Comment 0 for bug 901378

Revision history for this message
James Fournie (jfournie) wrote :

Sometimes invoices will hang when you attempt to save them.

To recreate this problem, you can do something like the following:

1. Add a prorateable charge to an invoice
2. Save invoice and reopen
3. Add another prorateable charge and delete the first one, then click Save again

This or similar actions can cause the system to hang.

This appears to be caused when there are invoice charges that are deleted but aren't attached to any fund_debit. This is expected for a prorateable charge as the charge will be prorated to multiple funds.

When deleting a charge, the system expects a fund_debit to be assigned so that it can delete the debit, however in this case there is no debit, and the system returns an (unhandled in Javascript) error. Instead, we should check for a fund_debit value -- if none is found then we can generally assume that we don't need to remove any debits.