[freeside-commits] branch FREESIDE_3_BRANCH updated. 5e76080d6ca453fa4471d21e10da023f8bb03184
Mark Wells
mark at 420.am
Wed Jul 6 17:00:58 PDT 2016
The branch, FREESIDE_3_BRANCH has been updated
via 5e76080d6ca453fa4471d21e10da023f8bb03184 (commit)
from 6a38d3f3aa3e7953d3da2c6a48466bf600366732 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5e76080d6ca453fa4471d21e10da023f8bb03184
Author: Mark Wells <mark at freeside.biz>
Date: Wed Jul 6 13:57:20 2016 -0700
payment terms localization, #71549
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 8c131a1..cf505de 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2,6 +2,9 @@ package FS::Conf;
use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
use strict;
+use vars qw( $base_dir @config_items @base_items @card_types @invoice_terms
+ $DEBUG
+ );
use Carp;
use IO::File;
use File::Basename;
@@ -689,6 +692,14 @@ logo.png
logo.eps
);
+ at invoice_terms = (
+ '',
+ 'Payable upon receipt',
+ 'Net 0', 'Net 3', 'Net 5', 'Net 7', 'Net 9', 'Net 10', 'Net 14',
+ 'Net 15', 'Net 18', 'Net 20', 'Net 21', 'Net 25', 'Net 30', 'Net 45',
+ 'Net 60', 'Net 90'
+);
+
my %msg_template_options = (
'type' => 'select-sub',
'options_sub' => sub {
@@ -1656,11 +1667,8 @@ and customer address. Include units.',
'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
'type' => 'select',
'per_agent' => 1,
- 'select_enum' => [
- '', 'Payable upon receipt', 'Net 0', 'Net 3', 'Net 5', 'Net 7', 'Net 9', 'Net 10', 'Net 14',
- 'Net 15', 'Net 18', 'Net 20', 'Net 21', 'Net 25', 'Net 30', 'Net 45',
- 'Net 60', 'Net 90'
- ], },
+ 'select_enum' => \@invoice_terms,
+ },
{
'key' => 'invoice_show_prior_due_date',
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm
index b0a2713..377a0b1 100644
--- a/FS/FS/Upgrade.pm
+++ b/FS/FS/Upgrade.pm
@@ -161,6 +161,14 @@ If you need to continue using the old Form 477 report, turn on the
$conf->delete('unsuspendauto');
}
+ # if translate-auto-insert is enabled for a locale, ensure that invoice
+ # terms are in the msgcat (is there a better place for this?)
+ if (my $auto_locale = $conf->config('translate-auto-insert')) {
+ my $lh = FS::L10N->get_handle($auto_locale);
+ foreach (@FS::Conf::invoice_terms) {
+ $lh->maketext($_) if length($_);
+ }
+ }
}
sub upgrade_overlimit_groups {
diff --git a/conf/invoice_html b/conf/invoice_html
index 9d6f528..d8a2d0a 100644
--- a/conf/invoice_html
+++ b/conf/invoice_html
@@ -122,7 +122,7 @@
$OUT .= qq! <img src="cust_bill-barcode.cgi?invnum=$invnum;template=$template"><br> !;
}
%>
- <%= $terms ? emt('Terms') . ": $terms" : '' %><BR>
+ <%= $terms ? emt('Terms') . ': ' . emt($terms) : '' %><BR>
<%= $po_line %>
</td>
</tr>
diff --git a/conf/invoice_latex b/conf/invoice_latex
index 2a0f882..fd0f952 100644
--- a/conf/invoice_latex
+++ b/conf/invoice_latex
@@ -272,7 +272,7 @@
}
--@]
\begin{flushright}
-[@-- $terms ? emt('Terms') .": $terms" : '' --@]\\
+[@-- $terms ? emt('Terms') . ': ' . emt($terms) : '' --@]\\
[@-- $po_line --@]\\
\end{flushright}
\end{minipage}}
diff --git a/httemplate/elements/select-terms.html b/httemplate/elements/select-terms.html
index a330df1..eda439a 100644
--- a/httemplate/elements/select-terms.html
+++ b/httemplate/elements/select-terms.html
@@ -34,10 +34,7 @@ my $empty_label =
my $empty_value = $opt{'empty_value'} || '';
-my @terms = ( emt('Payable upon receipt'),
- ( map "Net $_",
- 0, 3, 5, 7, 9, 10, 14, 15, 18, 20, 21, 25, 30, 45, 60, 90 ),
- );
+my @terms = map emt($_), @FS::Conf::invoice_terms;
my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : ();
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Conf.pm | 18 +++++++++++++-----
FS/FS/Upgrade.pm | 8 ++++++++
conf/invoice_html | 2 +-
conf/invoice_latex | 2 +-
httemplate/elements/select-terms.html | 5 +----
5 files changed, 24 insertions(+), 11 deletions(-)
More information about the freeside-commits
mailing list