Payment applies twice


The payment of a recurring invoice was applied twice to the same invoice.

Once the bill was paid, the system did archive the invoice before apply it credit. So when I tried to apply manually it didn’t accept until I restore(remove from the archive) the invoice.

Now it is applied twice and consequently the client’s account show he has a negative balance (credit).

How do I fix it? I am happy to do SQL commands, I just don’t want to break anything.

Can I just delete the relative line from the database?
I found in the table paymentables;

I did delete the line in paymentables, but the balance of the client have not changed. I am guessing I have to change it manually. Right?

I did change the balance in the table clients.

So far, looks like nothing else is broken because of it. Please let me know if you can see anything I have missed.

Thank you.


In general we don’t recommend manually updating the database.

cc @david

Hi Hillel,

I avoid doing it as much as I can. But I had no choice since somehow the payment wasn’t automatically applied to the invoice. Then when I tried, it didn’t mark the invoice as paid and somehow at the end I had it applied twice.

How else could I have corrected the error?

Thank you.


You may also want to update the company_ledgers table… the payment would have adjusted the client balance there also.

Thank you. I found it and updated accordingly.