diff options
author | Christopher Burger <burgerc@freeside.biz> | 2017-07-02 11:58:57 -0400 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2017-07-21 10:47:16 -0400 |
commit | 4c33f032d1ef813120134000fb7e58cab9417faf (patch) | |
tree | c21afd03a123ff3f57d6d52fa6ba0ad9a978f2e0 /FS/FS/ClientAPI/MyAccount.pm | |
parent | 92e726844528495d729ceb24c1131dde648ebb6c (diff) |
RT# 73993 - cleaned up code as requested, and created new call to get package info
Diffstat (limited to 'FS/FS/ClientAPI/MyAccount.pm')
-rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 8c082ec..505111e 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -1760,6 +1760,30 @@ sub cancel { } +sub pkg_info { + my $p = shift; + + my($context, $session, $custnum) = _custoragent_session_custnum($p); + return { 'error' => $session } if $context eq 'error'; + + my $pkg = qsearchs({ + 'table' => 'cust_pkg', + 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )', + 'hashref' => { + 'custnum' => $custnum, + 'pkgnum' => $p->{'pkgnum'}, + }, + }) + or return {'error' => 'unknown pkg num $pkgnum'}; + + return { + pkg_label => $pkg->pkg, + pkgpart => $pkg->pkgpart, + classnum => $pkg->classnum, + }; + +} + sub list_pkgs { my $p = shift; |