lib/polish_invoicer/writer.rb in polish_invoicer-0.0.7 vs lib/polish_invoicer/writer.rb in polish_invoicer-0.0.8
- old
+ new
@@ -19,12 +19,14 @@
create_writer
@writer.save_to_pdf(path)
end
def template_path
- tpl = 'invoice.slim'
- tpl = 'invoice-en.slim' if invoice.foreign_buyer
- tpl = 'proforma.slim' if invoice.proforma
+ tpl = if invoice.proforma
+ invoice.foreign_buyer ? 'proforma-en.slim' : 'proforma.slim'
+ else
+ invoice.foreign_buyer ? 'invoice-en.slim' : 'invoice.slim'
+ end
invoice.template_path || File.expand_path("../../../tpl/#{tpl}", __FILE__)
end
private