Before, invoice_number and invoice_date were both independent
columns that would be set whenever the invoice would be printed.
However, there should be an invoice for every order, so this commit
changes that behaviour to set the invoice number when the order changes
to complete.
With this change, invoice_date becomes obsolete. I added a delegator
method to use completed_at instead (which is set more or less at the
same time).
Before,
invoice_number
andinvoice_date
were both independent columns that would be set whenever the invoice would be printed.However, there should be an invoice for every order, so this commit changes that behaviour to set the invoice number when the order changes to complete.
With this change, invoice_date becomes obsolete. I added a delegator method to use completed_at instead (which is set more or less at the same time).