fixes auto generate credits when creating an invoice