From afd037b95e26bb063a6ac94cfcbcc49f59f239c7 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 13 Jul 2013 22:32:45 +0200 Subject: [PATCH] Add the time specification to the invoice_form view; update it Generation of a time specification appendix can be enabled for each invoice indepently on whether it is or is not enabled for the customer. However, whether it is enabled by default when an invoice is created, that does follow the setting for the customer. --- stoptime.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stoptime.rb b/stoptime.rb index 6f02fcb..ebe0c78 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1056,6 +1056,7 @@ module StopTime::Controllers invoice = Invoice.create(:number => number) invoice.customer = Customer.find(customer_id) invoice.company_info = CompanyInfo.last + invoice.include_specification = invoice.customer.time_specification # Handle the hourly rated tasks first by looking at the selected time # entries. @@ -1143,6 +1144,7 @@ module StopTime::Controllers def post(customer_id, invoice_number) invoice = Invoice.find_by_number(invoice_number) invoice.paid = @input.has_key? "paid" + invoice.include_specification = @input.has_key? "include_specification" invoice.save redirect R(CustomersNInvoicesX, customer_id, invoice_number) @@ -2040,6 +2042,12 @@ module StopTime::Views _form_input_checkbox("paid") end end + div.control_group do + label.control_label "Include specification?" + div.controls do + _form_input_checkbox("include_specification") + end + end div.form_actions do button.btn.btn_primary "Update", :type => :submit, :name => "update", :value => "Update"