From af99dc4042423a70b0caa5ebbf2a994293b4fa7d Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Tue, 13 Jul 2010 11:18:26 -0700 Subject: [PATCH] [#4183] Format the payment terms using the translated string. --- app/helpers/contracts_helper.rb | 5 +++++ app/views/contracts/show.html.erb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/helpers/contracts_helper.rb b/app/helpers/contracts_helper.rb index 13a52d0..198db7b 100644 --- a/app/helpers/contracts_helper.rb +++ b/app/helpers/contracts_helper.rb @@ -58,4 +58,9 @@ module ContractsHelper def format_hourly_rate(decimal) number_to_currency(decimal) + "/hr" if decimal end + + def format_payment_terms(value) + return '' if value.blank? + return l(Contract::PaymentTerms[value.to_sym]) + end end diff --git a/app/views/contracts/show.html.erb b/app/views/contracts/show.html.erb index 81bfdba..2993780 100644 --- a/app/views/contracts/show.html.erb +++ b/app/views/contracts/show.html.erb @@ -16,7 +16,7 @@ <%= show_field(resource, :client_point_of_contact, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-client-point-of-contact'}) %> <%= show_field(resource, :executed, :html_options => {:class => 'contract-executed'}) %> <%= show_field(resource, :discount_note, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-discount-note'}) %> - <%= show_field(resource, :payment_terms, :html_options => {:class => 'contract-payment-terms'}) %> + <%= show_field(resource, :payment_terms, :format => :format_payment_terms, :html_options => {:class => 'contract-payment-terms'}) %> <%= show_field(resource, :client_ap_contact_information, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-client-ap-contact-information'}) %> <%= show_field(resource, :po_number, :html_options => {:class => 'contract-po-number'}) %> <%= show_field(resource, :details, :format => :textilizable, :raw => true, :html_options => {:class => 'contract-details'}) %>