Invoicing and crediting.

It's possible to invoice any order with the status Order. To create the invoice, simply change the status to Invoice, The Invoice record will be created automatically from the order record, and the order record will be locked from further editing.

If there was a problem with the order and the customer needs to have something altered before paying it, it's possible to change the status from Invoice to Credit Invoice and make changes. After fixing the problem switch the status back to Invoice to generate another invoice with the new information.

In the above case, looking at the invoicing history of the order will show three invoices. A normal inital debit invoice, a credit invoice matching the initial debit and finally a new debit invoice that has the updated values. The order itself will match the newest invoice.

After the invoice is paid, change the status to Paid.