Don't mark drafts with invoice_total == 0 as paid

When saving a new draft invoice with items that don’t have a price (amount 0,00) the status changes from draft to paid, automatically.
I think it is not uncommon to add cost-free items in a first step, save the draft, and set the prices later.
I would suggest not to change the status of 0,00 invoices, automatically, especially when those are drafts.

There are only two places in v.1.4.6 where the status is set to paid (invoice_status_id 4):
/application/modules/invoices/models/mdl_invoice_amounts.php Line 98 + 161.

Maybe those could get a condition like “invoice_total != 0”, before the status is changed?

Last Update: 14.06.2016

1 Like