Merge branch 'master' of git.luon.net:users/paul/stoptime
This commit is contained in:
commit
a32cb00846
2 changed files with 6 additions and 6 deletions
0
public/invoices/.placeholder
Normal file
0
public/invoices/.placeholder
Normal file
12
stoptime.rb
12
stoptime.rb
|
@ -848,11 +848,11 @@ module StopTime::Controllers
|
||||||
@input = @invoice.attributes
|
@input = @invoice.attributes
|
||||||
render :invoice
|
render :invoice
|
||||||
elsif @format == "tex"
|
elsif @format == "tex"
|
||||||
tex_file = PUBLIC_DIR + "#{@number}.tex"
|
tex_file = PUBLIC_DIR + "invoices/#{@number}.tex"
|
||||||
_generate_invoice_tex(@number) unless tex_file.exist?
|
_generate_invoice_tex(@number) unless tex_file.exist?
|
||||||
redirect(Static, tex_file.basename)
|
redirect(Static, tex_file.basename)
|
||||||
elsif @format == "pdf"
|
elsif @format == "pdf"
|
||||||
pdf_file = PUBLIC_DIR + "#{@number}.pdf"
|
pdf_file = PUBLIC_DIR + "invoices/#{@number}.pdf"
|
||||||
_generate_invoice_pdf(@number) unless pdf_file.exist?
|
_generate_invoice_pdf(@number) unless pdf_file.exist?
|
||||||
redirect(Static, pdf_file.basename)
|
redirect(Static, pdf_file.basename)
|
||||||
end
|
end
|
||||||
|
@ -873,7 +873,7 @@ module StopTime::Controllers
|
||||||
# Generates a LaTex document for the invoice with the given _number_.
|
# Generates a LaTex document for the invoice with the given _number_.
|
||||||
def _generate_invoice_tex(number)
|
def _generate_invoice_tex(number)
|
||||||
template = TEMPLATE_DIR + "invoice.tex.erb"
|
template = TEMPLATE_DIR + "invoice.tex.erb"
|
||||||
tex_file = PUBLIC_DIR + "#{number}.tex"
|
tex_file = PUBLIC_DIR + "invoices/#{number}.tex"
|
||||||
|
|
||||||
I18n.with_locale :nl do
|
I18n.with_locale :nl do
|
||||||
erb = ERB.new(File.read(template))
|
erb = ERB.new(File.read(template))
|
||||||
|
@ -884,7 +884,7 @@ module StopTime::Controllers
|
||||||
# Generates a PDF document for the invoice with the given _number_
|
# Generates a PDF document for the invoice with the given _number_
|
||||||
# via _generate_invoice_tex.
|
# via _generate_invoice_tex.
|
||||||
def _generate_invoice_pdf(number)
|
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?
|
_generate_invoice_tex(number) unless tex_file.exist?
|
||||||
|
|
||||||
# FIXME: remove rubber depend, use pdflatex directly
|
# FIXME: remove rubber depend, use pdflatex directly
|
||||||
|
@ -1723,8 +1723,8 @@ module StopTime::Views
|
||||||
li { _form_input_with_label("Web address", "website", :text) }
|
li { _form_input_with_label("Web address", "website", :text) }
|
||||||
li { _form_input_with_label("Chamber number", "chamber", :text) }
|
li { _form_input_with_label("Chamber number", "chamber", :text) }
|
||||||
li { _form_input_with_label("VAT number", "vatno", :text) }
|
li { _form_input_with_label("VAT number", "vatno", :text) }
|
||||||
li { _form_input_with_label("Account name", "accountname", :text) }
|
li { _form_input_with_label("Bank account name", "accountname", :text) }
|
||||||
li { _form_input_with_label("Account number", "accountno", :text) }
|
li { _form_input_with_label("Bank account number", "accountno", :text) }
|
||||||
end
|
end
|
||||||
input :type => "submit", :name => "update", :value => "Update"
|
input :type => "submit", :name => "update", :value => "Update"
|
||||||
input :type => :reset, :name => "reset", :value => "Reset"
|
input :type => :reset, :name => "reset", :value => "Reset"
|
||||||
|
|
Loading…
Reference in a new issue