when you are using the api Command UpdateInvoice and you delete with it a line item, the total will be correct adjust, but the applied Credit is equal to the old total.
Thus it can happen that the invoice amount is only 10$, but the invoice has 15$ of credit assigned.
It would be useful if the function corrects the assigned credit if the invoice amount is less than the credit.
4 Comments
Login to post a comment.
Thanks for your suggestion. At present the API behaviour is consistent with the behaviour of the admin UI. So any changes would likely need to be made to both places.
How would everyone feel about that more broader change?
04/19/2023 Invoice #240224 Overpayment $150.89
It would make sense to me if that specific overpayment credit was automatically adjusted based on the current overpaid invoice balance. If the invoice amount changes or the transaction is deleted, the overpaid invoice balance is different so this credit line item should be automatically adjusted (or a new counterbalancing credit line item is added to adjust the total credit balance to reflect the invoice balance). Here are scenarios that would warrant/trigger a credit adjustment:
- Overpaid invoice is deleted
- Overpaid invoice transaction is deleted
- Overpaid invoice line item is deleted
- Overpaid invoice line item amount is changed
- Overpaid invoice has credits removed
- Overpaid invoice is deleted
- Overpaid invoice transaction is deleted
- Overpaid invoice line item is added
- Overpaid invoice line item is deleted
- Overpaid invoice line item amount is changed
- Overpaid invoice has credits removed