summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-04-14 12:02:14 -0700
committerMark Wells <mark@freeside.biz>2012-04-14 12:02:14 -0700
commit5f2f706faad794d87d930c64db8eb641fe61990d (patch)
tree90f08fdbed3305636a3ccb9475e847f43489ca5a /httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
parent7150fcff4de104614319b5c57104d55e250dc8c3 (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) %>