|
|
|
@ -13,7 +13,7 @@ |
|
|
|
|
<p><%= f.select :cost_type_id, cost_types_collection_for_select_options, :required => true %></p> |
|
|
|
|
<p> |
|
|
|
|
<%= f.text_field :units, :size => 6, :required => true %> |
|
|
|
|
<span id="cost_entry_unit_name"><%= @cost_entry.units == 1 ? @cost_entry.cost_type.unit : @cost_entry.cost_type.unit_plural %></span> |
|
|
|
|
<span id="cost_entry_unit_name"><%= (@cost_entry.units == 1 ? @cost_entry.cost_type.unit : @cost_entry.cost_type.unit_plural) if @cost_entry.cost_type %></span> |
|
|
|
|
<%= observe_field( "cost_entry_cost_type_id", :url => {:controller => :deliverables, :action => :update_deliverable_cost, :project_id => @cost_entry.project}, :with => "'cost_type_id=' + encodeURIComponent(value) + '&units=' + encodeURIComponent(document.getElementById('cost_entry_units').value) + '&fixed_date=' + encodeURIComponent(document.getElementById('cost_entry_spent_on').value) + '&element_id=cost_entry'") %> |
|
|
|
|
<%= observe_field( "cost_entry_units", :frequency => 1, :url => {:controller => :deliverables, :action => :update_deliverable_cost, :project_id => @cost_entry.project}, :with => "'cost_type_id=' + encodeURIComponent(document.getElementById('cost_entry_cost_type_id').value) + '&units=' + encodeURIComponent(value) + '&fixed_date=' + encodeURIComponent(document.getElementById('cost_entry_spent_on').value) + '&element_id=cost_entry'") %> |
|
|
|
|
<%= observe_field( "cost_entry_spent_on", :frequency => 1, :url => {:controller => :deliverables, :action => :update_deliverable_cost, :project_id => @cost_entry.project}, :with => "'cost_type_id=' + encodeURIComponent(document.getElementById('cost_entry_cost_type_id').value) + '&units=' + encodeURIComponent(document.getElementById('cost_entry_units').value) + '&fixed_date=' + encodeURIComponent(value) + '&element_id=cost_entry'") %> |
|
|
|
|