diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-08-31 21:49:04 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-08-31 21:49:04 -0500 |
commit | 2da1326a2ba34b1e322af040b174f24c618dc1a7 (patch) | |
tree | 7feaaee78b1e896184e001bd65fb69cc4b179e28 /FS/FS/ClientAPI | |
parent | c53b9ea5e995de0388c4e1973b1929626fdc29a6 (diff) |
71890: SelfService API: Return monthly recurring fee
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 685821b..07b1be9 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -672,6 +672,29 @@ sub customer_info_short { }; } +sub customer_recurring { + my $p = shift; + + my($context, $session, $custnum) = _custoragent_session_custnum($p); + return { 'error' => $session } if $context eq 'error'; + + my %return; + + my $conf = new FS::Conf; + + my $search = { 'custnum' => $custnum }; + $search->{'agentnum'} = $session->{'agentnum'} if $context eq 'agent'; + my $cust_main = qsearchs('cust_main', $search ) + or return { 'error' => "customer_info_short: unknown custnum $custnum" }; + + $return{'display_recurring'} = [ $cust_main->display_recurring ]; + + return { 'error' => '', + 'custnum' => $custnum, + %return, + }; +} + sub billing_history { my $p = shift; |