summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-04-14 11:43:08 -0700
committerMark Wells <mark@freeside.biz>2012-04-14 12:01:44 -0700
commit401ba3ab0637de1bc460370949b75dca092375d8 (patch)
treefc6009965442beed53b5c4a59614e11a54cf0027 /httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
parent33013bb1ef0b5f07105fe13f5bfc06350fc4d868 (diff)
fix various quick payment entry problems, #17356
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) %>