Last active
December 12, 2015 05:28
-
-
Save airspeed/4721747 to your computer and use it in GitHub Desktop.
Pdf erstellung vom Template über WickedPdf.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_invoice(invoice, out) | |
i = invoice | |
o = i.order_cart | |
l = i.customer.lang[0..1].downcase === 'de' ? 'de' : 'en' # unoptimal, reicht aber im Augenblick | |
params = {:@invoice_address => o.invoice_address, :@order_cart => o, :@shipments => o.shipments, :@invoice => i} | |
Clixxie::PdfGenerator.from_template "invoice_mailer/invoice_2_#{l}.pdf.erb", out, "#{i.invoice_number}_2r.pdf", params | |
end | |
# Usage | |
# print_invoice(Invoice.last, "mahnung/out") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment