Add the time specification to the customer_form view; update it

If time specifications are enabled for a customer this is considered to be
a global setting for invoices related to this customer.

Note that it will note change any of the existing voices, it will only
affect newly created ones!
This commit is contained in:
Paul van Tilburg 2013-07-13 22:32:27 +02:00
parent 17278fac98
commit 7a58ae9331
1 changed files with 7 additions and 0 deletions

View File

@ -851,6 +851,7 @@ module StopTime::Controllers
attrs.each do |attr|
@customer[attr] = @input[attr]
end
@customer.time_specification = @input.has_key? "time_specification"
@customer.save
if @customer.invalid?
@errors = @customer.errors
@ -1819,6 +1820,12 @@ module StopTime::Views
_form_input_with_label("Phone number", "phone", :tel)
_form_input_with_label("Financial contact", "financial_contact", :text)
_form_input_with_label("Default hourly rate", "hourly_rate", :text)
div.control_group do
label.control_label "Time specifications?"
div.controls do
_form_input_checkbox("time_specification")
end
end
div.form_actions do
button.btn.btn_primary @button.capitalize, :type => "submit",
:name => @button, :value => @button.capitalize