summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-cust_main-display_recurring.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-09-08 11:05:38 -0700
committerMark Wells <mark@freeside.biz>2016-09-08 11:05:38 -0700
commit0929e7aec153632691a64ae8755c082090fd1de5 (patch)
treeab72a786d31797d681572100edd58e2fe5b03d3d /httemplate/misc/xmlhttp-cust_main-display_recurring.html
parent1768c2039b6ff3d68bd3b711621d82dcbf5eab75 (diff)
parent6df492990ea195513430f3a56d537e57e50b6913 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_main-display_recurring.html')
-rw-r--r--httemplate/misc/xmlhttp-cust_main-display_recurring.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/httemplate/misc/xmlhttp-cust_main-display_recurring.html b/httemplate/misc/xmlhttp-cust_main-display_recurring.html
new file mode 100644
index 000000000..dd9ed3bb5
--- /dev/null
+++ b/httemplate/misc/xmlhttp-cust_main-display_recurring.html
@@ -0,0 +1,29 @@
+<% encode_json($return) %>\
+<%init>
+
+my %arg = $cgi->param('arg');
+my $custnum = delete($arg{'custnum'});
+
+my $error;
+my $return;
+
+$error = "No customer specified" unless $custnum =~ /^\d+$/;
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+$error = "access denied"
+ unless $error or $curuser->access_right('View customer');
+
+my $cust_main;
+$cust_main = qsearchs( {
+ 'table' => 'cust_main',
+ 'hashref' => { 'custnum' => $custnum },
+ 'extra_sql' => ' AND '. $curuser->agentnums_sql,
+}) unless $error;
+$error = "Customer not found!" unless $error or $cust_main;
+
+$return = $error
+ ? { 'error' => $error }
+ : { 'display_recurring' => [ $cust_main->display_recurring ] };
+
+</%init>