diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-09-07 21:36:07 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-09-07 21:59:18 -0500 |
commit | 00a479701fd2dbb814698df1d103c1e286a528df (patch) | |
tree | 534f94d7e6b037442450cd24050f87d715e70223 /httemplate/misc/xmlhttp-cust_main-display_recurring.html | |
parent | 7dd38e05281e88826d724955a74e7ec2e38d4ee5 (diff) |
RT#72157: Monthly recurring field is missing [v3]
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_main-display_recurring.html')
-rw-r--r-- | httemplate/misc/xmlhttp-cust_main-display_recurring.html | 29 |
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> |