Decrease amount to pay on invoice if there are payment
The fields amount to pay on invoice do not take into account pending payment made.
I think it will be better to decrease the amount when payments have been done on the lines to pay of the invoice.