Bug in invoice deletion

I’ve just spent a happy couple of hours trying to reconcile some anomalous payments (e.g. shown as “unapplied” on one screen but “applied” on another and so on. I’ve hit several bugs I couldn’t reproduce but here’s at least one that I can.

(See attached image). In this case the reason for a discrepancy in the amount owed was revealed when I changed the invoice filter from “Active” to “All”. There’s a deleted payment that is still being counted.

I’ve tried restoring and deleting the payment but that doesn’t work either (second bug?). If I click the “kebab” menu at the left then Restore it says “Successfully restored invoice” but nothing actually changes. If I try to edit it it says “Record is deleted and cannot be edited”. I’m stuck. I guess I’m going to have to hack the database to fix this.

Update: I found the ledger. There’s something strange here as well.

I deleted the bad invoice from the “invoices” table in the database (after making a backup!) and it has vanished from the customer’s invoice list but the amount owing hasn’t changed.

Update: Success! After a few minutes the totals matched up again, it let me recreate the payment and match the transaction to it and everything for that client looks consistent now. I guess it was waiting for a cron job to run or something.

It’s taken me most of the day just to fix the problems with two clients (the other one I eventually deleted and recreated from scratch).

My confidence in the reliability of the numbers has taken a severe hit though today.

1 Like

Hi,

Please don’t make manual changes to the database. It will break the app and we wont be able to [provide support.

The unmodified DB is available if it helps. Very interested in any fix that works without manual changes!

If you think there’s a reproducible bug I suggest creating an issue on GitHub with the details.