Skip to content

Instantly share code, notes, and snippets.

@airspeed
Last active December 16, 2015 06:49
Show Gist options
  • Save airspeed/5394683 to your computer and use it in GitHub Desktop.
Save airspeed/5394683 to your computer and use it in GitHub Desktop.
Gibt die HTML-Darstellung eines Mahndokumentes zurück.
def render_invoice(invoice)
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, :@filedate => Date.today}
Clixxie::PdfGenerator.render_erb "invoice_mailer/invoice_#{l}.pdf.erb", params
end
# usage render_invoice(Invoice.last)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment