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:36:07 -0500 |
commit | 24c164b829dce551badd130dba51b011342676f2 (patch) | |
tree | 9d12f7f225d04e5d9a5dfd72fd64db01eabfc593 /httemplate/misc/xmlhttp-cust_main-display_recurring.html | |
parent | 4fd97fe8a23cbe875600b838f01a9ed10641f61e (diff) |
RT#72157: Monthly recurring field is missing
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> |