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:
parent
d8568f47ad
commit
9f7c77144a
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user