spree-contrib / spree_print_invoice

Create a PDF invoice for Spree orders.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
91 stars 239 forks source link

Set invoice attributes on state change to "completed" #85

Closed mamhoff closed 9 years ago

mamhoff commented 9 years ago

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).

mamhoff commented 9 years ago

Closed in favour of https://github.com/spree-contrib/spree_print_invoice/pull/86