[#4177] Changed payment terms to a select.
This commit is contained in:
@@ -29,6 +29,19 @@ class Contract < ActiveRecord::Base
|
||||
attr_accessible :po_number
|
||||
attr_accessible :details
|
||||
|
||||
PaymentTerms = {
|
||||
:net_0 => :text_payment_terms_net_0,
|
||||
:net_15 => :text_payment_terms_net_15,
|
||||
:net_30 => :text_payment_terms_net_30,
|
||||
:net_45 => :text_payment_terms_net_45
|
||||
}
|
||||
|
||||
def payment_terms_for_select
|
||||
PaymentTerms.collect {|value, label|
|
||||
[l(label), value]
|
||||
}
|
||||
end
|
||||
|
||||
def after_initialize
|
||||
self.executed = false unless self.executed.present?
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<%= form.input :billable_rate, :input_html => {:size => 20}, :hint => l(:field_billable_rate_hint) %>
|
||||
<%= form.input :discount, :input_html => {:size => 20}, :hint => l(:field_discount_hint) %>
|
||||
<%= form.input :discount_note, :input_html => {:class => 'wiki-edit', :rows => '5'} %>
|
||||
<%= form.input :payment_terms %> <%# TODO: select %>
|
||||
<%= form.input :payment_terms, :as => :select, :collection => resource.payment_terms_for_select %>
|
||||
<%= form.input :client_ap_contact_information, :input_html => {:class => 'wiki-edit', :rows => '5'} %>
|
||||
<%= form.input :po_number %>
|
||||
<%= form.input :details, :input_html => {:class => 'wiki-edit'} %>
|
||||
|
||||
@@ -16,3 +16,7 @@ en:
|
||||
field_client_ap_contact_information: "AP Contact Info"
|
||||
field_po_number: "PO Number"
|
||||
field_details: "Details"
|
||||
text_payment_terms_net_0: "Net 0"
|
||||
text_payment_terms_net_15: "Net 15"
|
||||
text_payment_terms_net_30: "Net 30"
|
||||
text_payment_terms_net_45: "Net 45"
|
||||
|
||||
Reference in New Issue
Block a user