foodsoft/app/controllers/concerns/send_group_order_invoice_pdf.rb
Philipp Rothmann 85bdf28f91 merge automatic group order invoice generation
see https://github.com/foodcoops/foodsoft/pull/907 for reference
and original work by viehlieb

Co-authored-by: viehlieb <pf@pragma-shift.net>

fix PDF Pdf
2023-08-11 10:48:52 +02:00

13 lines
480 B
Ruby

module Concerns::SendGroupOrderInvoicePdf
extend ActiveSupport::Concern
protected
def send_group_order_invoice_pdf(group_order_invoice)
invoice_data = group_order_invoice.load_data_for_invoice
invoice_data[:title] = t('documents.group_order_invoice_pdf.title', supplier: invoice_data[:supplier])
invoice_data[:no_footer] = true
pdf = GroupOrderInvoicePdf.new invoice_data
send_data pdf.to_pdf, filename: pdf.filename, type: 'application/pdf'
end
end