diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-12-05 10:45:26 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-12-05 10:45:26 -0800 |
commit | c7c96355331687b6fd44bfe541b402bd0664481d (patch) | |
tree | e39453120b474fc911b8bcc356a0e6059f924e6f /httemplate | |
parent | be2a6e7068337aa57b04bd7fa88090002d79a64b (diff) |
agent-ize invoice_default_terms, RT#32513
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/cust_main/billing.html | 3 | ||||
-rw-r--r-- | httemplate/edit/quick-charge.html | 14 | ||||
-rw-r--r-- | httemplate/elements/select-terms.html | 8 | ||||
-rwxr-xr-x | httemplate/search/report_cust_main.html | 7 | ||||
-rw-r--r-- | httemplate/view/cust_main/billing.html | 7 |
5 files changed, 27 insertions, 12 deletions
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 1f44905f8..fcd8f017c 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -547,7 +547,8 @@ <TD ALIGN="right" WIDTH="200"><% mt('Invoice terms') |h %> </TD> <TD WIDTH="408"> <& /elements/select-terms.html, - 'curr_value' => $cust_main->invoice_terms, + 'curr_value' => $cust_main->invoice_terms, + 'agentnum' => $cust_main->agentnum, &> </TD> </TR> diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 0db154337..da9ac6e66 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -200,8 +200,9 @@ function bill_now_changed (what) { > <% mt('with terms') |h %> <& /elements/select-terms.html, - 'curr_value' => scalar($cgi->param('invoice_terms')), - 'disabled' => ( $cgi->param('bill_now') ? 0 : 1 ), + 'curr_value' => scalar($cgi->param('invoice_terms')), + 'disabled' => ( $cgi->param('bill_now') ? 0 : 1 ), + 'agentnum' => $cust_main->agentnum, &> </TD> </TR> @@ -429,9 +430,12 @@ my $default_terms; if ( $cust_main->invoice_terms ) { $default_terms = emt("Customer default ([_1])", $cust_main->invoice_terms); } else { - $default_terms = emt("Default ([_1])", - ($conf->config('invoice_default_terms') || emt('Payable upon receipt')) - ); + $default_terms = + emt( "Default ([_1])", + ( $conf->config('invoice_default_terms', $cust_main->agentnum) + || emt('Payable upon receipt') + ) + ); } my @description; diff --git a/httemplate/elements/select-terms.html b/httemplate/elements/select-terms.html index 88396920f..716832f52 100644 --- a/httemplate/elements/select-terms.html +++ b/httemplate/elements/select-terms.html @@ -26,9 +26,11 @@ my $conf = new FS::Conf; my $empty_label = $opt{'empty_label'} - || emt('Default').' ('. - ($conf->config('invoice_default_terms') || emt('Payable upon receipt')). - ')'; + || emt('Default').' ('. + ( $conf->config('invoice_default_terms', $opt{'agentnum'}) + || emt('Payable upon receipt') + ). + ')'; my $empty_value = $opt{'empty_value'} || ''; diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html index 994f9503b..2b406729a 100755 --- a/httemplate/search/report_cust_main.html +++ b/httemplate/search/report_cust_main.html @@ -236,9 +236,12 @@ <TR> <TD ALIGN="right"><% mt('Invoice terms') |h %></TD> <TD> +% my @agentnums = $FS::CurrentUser::CurrentUser->agentnums; +% my $agentnum = scalar(@agentnums) == 1 ? $agentnums[0] : ''; <& /elements/select-terms.html, - 'pre_options' => [ '' => emt('all') ], - 'empty_value' => 'NULL', + 'pre_options' => [ '' => emt('all') ], + 'empty_value' => 'NULL', + 'agentnum' => $agentnum, &> </TD> </TR> diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 2c4b3fb2d..64ec591a2 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -260,7 +260,12 @@ <TR> <TD ALIGN="right"><% mt('Invoice terms') |h %></TD> <TD BGCOLOR="#ffffff"> - <% $cust_main->invoice_terms || emt('Default').' ('. ( $conf->config('invoice_default_terms') || emt('Payable upon receipt') ). ')' %> + <% $cust_main->invoice_terms + || emt('Default').' ('. ( $conf->config('invoice_default_terms', $cust_main->agentnum) + || emt('Payable upon receipt') + ). + ')' + %> </TD> </TR> <TR> |