improper invoice payments work-around

Johan van Oostrum jo.vanoost at
Thu Dec 8 16:18:50 EST 2005

Sometimes I found payments do not result in the right invoices marked 
as paid. Looks like the same problem has been reported more than once 
in the mailing list but no real soluting other than explanation of the 
FIFO payment processing.
Checking the code I found that this glitch seems to be caused by 
invoices for the same customer having the same date due.

You can track in dialog_payment.c[gnc_payment_ok_cb], 
gncInvoice.c[gncOwnerAplyPayment], [gnc_lot_sort_func] 
[gncInvoiceGetDateDue] and Transaction.c[xaccTransRetDateDueTS].

As the order of invoices having same date due might not be really the 
FIFO order, as time is not taken into account, the wrong, i.e. a 
younger,  invoice might get marked as paid over the right, i.e. older, 

So, if you have multiple invoices with the same customer, make sure 
that you have them one day differing in date due and, just to be sure, 
maybe date posted too. Hopefully some users can use this to get the 
payments attributed to the right invoice(s).

To conclude with my compliments to the GnuCash developers.

Johan van Oostrum

More information about the gnucash-user mailing list