From 2b0fb9631d2363884cda481e67bd131548fec6b0 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 6 Dec 2011 14:34:31 +0100 Subject: [PATCH] Adapted the code for the invoice subdir changes --- stoptime.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index ffcf14b..bc48d2e 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -845,11 +845,11 @@ module StopTime::Controllers @input = @invoice.attributes render :invoice elsif @format == "tex" - tex_file = PUBLIC_DIR + "#{@number}.tex" + tex_file = PUBLIC_DIR + "invoices/#{@number}.tex" _generate_invoice_tex(@number) unless tex_file.exist? redirect(Static, tex_file.basename) elsif @format == "pdf" - pdf_file = PUBLIC_DIR + "#{@number}.pdf" + pdf_file = PUBLIC_DIR + "invoices/#{@number}.pdf" _generate_invoice_pdf(@number) unless pdf_file.exist? redirect(Static, pdf_file.basename) end @@ -870,7 +870,7 @@ module StopTime::Controllers # Generates a LaTex document for the invoice with the given _number_. def _generate_invoice_tex(number) template = TEMPLATE_DIR + "invoice.tex.erb" - tex_file = PUBLIC_DIR + "#{number}.tex" + tex_file = PUBLIC_DIR + "invoices/#{number}.tex" I18n.with_locale :nl do erb = ERB.new(File.read(template)) @@ -881,7 +881,7 @@ module StopTime::Controllers # Generates a PDF document for the invoice with the given _number_ # via _generate_invoice_tex. def _generate_invoice_pdf(number) - tex_file = PUBLIC_DIR + "#{@number}.tex" + tex_file = PUBLIC_DIR + "invoices/#{@number}.tex" _generate_invoice_tex(number) unless tex_file.exist? # FIXME: remove rubber depend, use pdflatex directly