summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-04-15 15:38:47 -0700
committerIvan Kohler <ivan@freeside.biz>2012-04-15 15:38:47 -0700
commit820fe0ac288d4f2bb975b7f58ee02baefd96ed24 (patch)
tree0661dd62e4c4c9e71dca45aedc473cbb7aeb35f4 /httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
parent2ce6ee8e5cd817a4018ad26eb1e364198c1dd931 (diff)
parent401ba3ab0637de1bc460370949b75dca092375d8 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_main-discount_terms.cgi')
-rw-r--r--httemplate/misc/xmlhttp-cust_main-discount_terms.cgi19
1 files changed, 11 insertions, 8 deletions
diff --git a/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi b/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
index 71e2da597..b524e69fc 100644
--- a/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
+++ b/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
@@ -2,15 +2,18 @@
%
% my $return = [];
% my $custnum = $cgi->param('arg');
-% my $cust_main = '';
-% $cust_main = qsearchs({
-% 'table' => 'cust_main',
-% 'hashref' => { 'custnum' => $custnum },
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-% });
+% if ( $custnum =~ /^\d+$/ ) {
+% my $cust_main = '';
+% $cust_main = qsearchs({
+% 'table' => 'cust_main',
+% 'hashref' => { 'custnum' => $custnum },
+% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+% });
%
-% if ($cust_main) {
-% $return = [ map [ $_, "$_ months" ], $cust_main->discount_terms ];
+% if ($cust_main) {
+% $return = [ map [ $_, sprintf("%d months", $_) ],
+% $cust_main->discount_terms ];
+% }
% }
%
<% objToJson($return) %>