[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.158, 1.159

Ivan,,, ivan at wavetail.420.am
Mon Nov 7 20:17:04 PST 2011


Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv18784/FS/FS/ClientAPI

Modified Files:
	MyAccount.pm 
Log Message:
selfservice-hide_invoices-pkgclass and add pkg_status to ClientAPI list_svcs, RT#13656

Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -w -d -r1.158 -r1.159
--- MyAccount.pm	30 Oct 2011 23:28:16 -0000	1.158
+++ MyAccount.pm	8 Nov 2011 04:17:02 -0000	1.159
@@ -1236,9 +1236,21 @@
   my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
     or return { 'error' => "unknown custnum $custnum" };
 
-  my @cust_bill = $cust_main->cust_bill;
+  my $conf = new FS::Conf;
+
   my @legacy_cust_bill = $cust_main->legacy_cust_bill;
 
+  my @cust_bill = $cust_main->cust_bill;
+
+  my $hide_taxclass = $conf->config('selfservice-hide_invoices-taxclass');
+  if ( $hide_taxclass ) {
+    @cust_bill = grep { my @cust_bill_pkg = $_->cust_bill_pkg;
+                        my @part_pkg= grep $_, map $_->part_pkg, @cust_bill_pkg;
+                        grep { $_->taxclass ne $hide_taxclass } @part_pkg;
+                      }
+                   @cust_bill;
+  }
+
   my $balance = 0;
 
   return  { 'error'       => '',
@@ -1434,13 +1446,15 @@
             my $svc_x = $_->svc_x;
             my($label, $value) = $_->label;
             my $svcdb = $_->part_svc->svcdb;
-            my $part_pkg = $_->cust_pkg->part_pkg;
+            my $cust_pkg = $_->cust_pkg;
+            my $part_pkg = $cust_pkg->part_pkg;
 
             my %hash = (
               'svcnum' => $_->svcnum,
               'svcdb'  => $svcdb,
               'label'  => $label,
               'value'  => $value,
+              'pkg_status' => $cust_pkg->status,
             );
 
             if ( $svcdb eq 'svc_acct' ) {



More information about the freeside-commits mailing list