We find the following behavior in sale_credit_limit module that we believe should be modified:
When a sale is set to 100 units and finally 110 units are invoiced, the credit limit amount is set to the amount of the sale (100), not the amount actually invoiced.
Example:
Sale line: 100 u. at 0,40€/u. → 40€
Invoice line: 110 u. at 0,40€/u. → 44€
The credit limit amount is set as 40€ instead of 44€.
The same behavior happens when fewer units are invoiced than those initially defined in the sale.
We think that the amount is has to be set in the field “Credit limit amount” should always be the invoiced amount, also taking into account the sale lines that are still pending to invoice.
I did post the invoice and with the case I exposed the credit limit amount is not the amount invoiced, maybe because the computed quantity is used when is negative, as Cédric has said.