projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8676c21
)
payment terms localiation, #71549
author
Mark Wells
<mark@freeside.biz>
Wed, 6 Jul 2016 20:57:20 +0000
(13:57 -0700)
committer
Mark Wells
<mark@freeside.biz>
Wed, 6 Jul 2016 20:57:26 +0000
(13:57 -0700)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/Upgrade.pm
patch
|
blob
|
history
conf/invoice_html
patch
|
blob
|
history
conf/invoice_latex
patch
|
blob
|
history
httemplate/elements/select-terms.html
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
dd0e032
..
e251cab
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-1,7
+1,8
@@
package FS::Conf;
use strict;
package FS::Conf;
use strict;
-use vars qw( $base_dir @config_items @base_items @card_types $DEBUG
+use vars qw( $base_dir @config_items @base_items @card_types @invoice_terms
+ $DEBUG
$conf_cache $conf_cache_enabled
);
use Carp;
$conf_cache $conf_cache_enabled
);
use Carp;
@@
-616,6
+617,14
@@
logo.png
logo.eps
);
logo.eps
);
+@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 {
my %msg_template_options = (
'type' => 'select-sub',
'options_sub' => sub {
@@
-1544,11
+1553,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,
'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',
{
'key' => 'invoice_show_prior_due_date',
diff --git
a/FS/FS/Upgrade.pm
b/FS/FS/Upgrade.pm
index
6a09711
..
3ff943f
100644
(file)
--- a/
FS/FS/Upgrade.pm
+++ b/
FS/FS/Upgrade.pm
@@
-180,6
+180,14
@@
If you need to continue using the old Form 477 report, turn on the
enable_banned_pay_pad() unless length($conf->config('banned_pay-pad'));
enable_banned_pay_pad() unless length($conf->config('banned_pay-pad'));
+ # 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 {
}
sub upgrade_overlimit_groups {
diff --git
a/conf/invoice_html
b/conf/invoice_html
index
9d6f528
..
d8a2d0a
100644
(file)
--- 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> !;
}
%>
$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>
<%= $po_line %>
</td>
</tr>
diff --git
a/conf/invoice_latex
b/conf/invoice_latex
index
2a0f882
..
fd0f952
100644
(file)
--- a/
conf/invoice_latex
+++ b/
conf/invoice_latex
@@
-272,7
+272,7
@@
}
\r
--@]
\r
\begin{flushright}
\r
}
\r
--@]
\r
\begin{flushright}
\r
-[@-- $terms ? emt('Terms') .
": $terms"
: '' --@]\\
\r
+[@-- $terms ? emt('Terms') .
': ' . emt($terms)
: '' --@]\\
\r
[@-- $po_line --@]\\
\r
\end{flushright}
\r
\end{minipage}}
\r
[@-- $po_line --@]\\
\r
\end{flushright}
\r
\end{minipage}}
\r
diff --git
a/httemplate/elements/select-terms.html
b/httemplate/elements/select-terms.html
index
a330df1
..
eda439a
100644
(file)
--- 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 $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} } : ();
my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : ();