2021-12-23 01:50:06 +01:00
|
|
|
module Concerns::SendGroupOrderInvoicePdf
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
2021-12-24 13:31:10 +01:00
|
|
|
def send_group_order_invoice_pdf(group_order_invoice)
|
2021-12-23 01:50:06 +01:00
|
|
|
invoice_data = group_order_invoice.load_data_for_invoice
|
2021-12-24 13:31:10 +01:00
|
|
|
invoice_data[:title] = t('documents.group_order_invoice_pdf.title', supplier: invoice_data[:supplier])
|
2021-12-23 01:50:06 +01:00
|
|
|
pdf = GroupOrderInvoicePdf.new group_order_invoice.load_data_for_invoice
|
|
|
|
send_data pdf.to_pdf, filename: pdf.filename, type: 'application/pdf'
|
|
|
|
end
|
|
|
|
end
|