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.
This commit is contained in:
parent
7a58ae9331
commit
afd037b95e
|
@ -1056,6 +1056,7 @@ module StopTime::Controllers
|
||||||
invoice = Invoice.create(:number => number)
|
invoice = Invoice.create(:number => number)
|
||||||
invoice.customer = Customer.find(customer_id)
|
invoice.customer = Customer.find(customer_id)
|
||||||
invoice.company_info = CompanyInfo.last
|
invoice.company_info = CompanyInfo.last
|
||||||
|
invoice.include_specification = invoice.customer.time_specification
|
||||||
|
|
||||||
# Handle the hourly rated tasks first by looking at the selected time
|
# Handle the hourly rated tasks first by looking at the selected time
|
||||||
# entries.
|
# entries.
|
||||||
|
@ -1143,6 +1144,7 @@ module StopTime::Controllers
|
||||||
def post(customer_id, invoice_number)
|
def post(customer_id, invoice_number)
|
||||||
invoice = Invoice.find_by_number(invoice_number)
|
invoice = Invoice.find_by_number(invoice_number)
|
||||||
invoice.paid = @input.has_key? "paid"
|
invoice.paid = @input.has_key? "paid"
|
||||||
|
invoice.include_specification = @input.has_key? "include_specification"
|
||||||
invoice.save
|
invoice.save
|
||||||
|
|
||||||
redirect R(CustomersNInvoicesX, customer_id, invoice_number)
|
redirect R(CustomersNInvoicesX, customer_id, invoice_number)
|
||||||
|
@ -2040,6 +2042,12 @@ module StopTime::Views
|
||||||
_form_input_checkbox("paid")
|
_form_input_checkbox("paid")
|
||||||
end
|
end
|
||||||
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
|
div.form_actions do
|
||||||
button.btn.btn_primary "Update", :type => :submit,
|
button.btn.btn_primary "Update", :type => :submit,
|
||||||
:name => "update", :value => "Update"
|
:name => "update", :value => "Update"
|
||||||
|
|
Loading…
Reference in New Issue