1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

(bug) unable to rebuild the PDF for invoices without subscriptions

This commit is contained in:
Sylvain 2022-01-12 14:58:57 +01:00
parent d8568f47ad
commit 9f7c77144a
2 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@
- Fix a bug: some links redirect to the home page instead of triggering the requested action
- Fix a bug: exports to Excel are corrupted (#49)
- Fix a bug: if a specialized VAT rate was defined when the VAT was disabled, the resulting VAT rate is wrong
- Fix a bug: unable to rebuild the PDF for invoices without subscriptions
- [TODO DEPLOY] `rails db:seed`
# v5.3.0 2021 December 29

View File

@ -54,7 +54,7 @@ class Invoice < PaymentDocument
# for debug & used by rake task "fablab:maintenance:regenerate_invoices"
def regenerate_invoice_pdf
pdf = ::PDF::Invoice.new(self, invoice_items.find_by(object_type: Subscription.name)&.expiration_date).render
pdf = ::PDF::Invoice.new(self, invoice_items.find_by(object_type: Subscription.name)&.object&.expiration_date).render
File.binwrite(file, pdf)
end