summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_main-discount_terms.cgi')
-rw-r--r--httemplate/misc/xmlhttp-cust_main-discount_terms.cgi24
1 files changed, 24 insertions, 0 deletions
diff --git a/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi b/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
new file mode 100644
index 000000000..71e2da597
--- /dev/null
+++ b/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
@@ -0,0 +1,24 @@
+% if ( $sub eq 'discount_terms' ) {
+%
+% 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 ($cust_main) {
+% $return = [ map [ $_, "$_ months" ], $cust_main->discount_terms ];
+% }
+%
+<% objToJson($return) %>
+% }
+<%init>
+
+my $conf = new FS::Conf;
+
+my $sub = $cgi->param('sub');
+
+</%init>