[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.133.2.17, 1.133.2.18

Ivan,,, ivan at wavetail.420.am
Mon Oct 3 17:58:17 PDT 2011


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

Modified Files:
      Tag: FREESIDE_2_3_BRANCH
	MyAccount.pm 
Log Message:
add svc_acct.finger to list_svcs output, add ability to specify a svcnum to limit to just the current package, RT#13656

Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.133.2.17
retrieving revision 1.133.2.18
diff -u -w -d -r1.133.2.17 -r1.133.2.18
--- MyAccount.pm	30 Sep 2011 05:30:08 -0000	1.133.2.17
+++ MyAccount.pm	4 Oct 2011 00:58:15 -0000	1.133.2.18
@@ -1310,12 +1310,18 @@
   my $cust_main = qsearchs('cust_main', $search )
     or return { 'error' => "unknown custnum $custnum" };
 
+  my $pkgnum = $session->{'pkgnum'} || $p->{'pkgnum'} || '';
+  if ( ! $pkgnum && $p->{'svcnum'} ) {
+    my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $p->{'svcnum'} } );
+    $pkgnum = $cust_svc->pkgnum if $cust_svc;
+  }
+
   my @cust_svc = ();
   #foreach my $cust_pkg ( $cust_main->ncancelled_pkgs ) {
   foreach my $cust_pkg ( $p->{'ncancelled'} 
                          ? $cust_main->ncancelled_pkgs
                          : $cust_main->unsuspended_pkgs ) {
-    next if $session->{'pkgnum'} && $cust_pkg->pkgnum != $session->{'pkgnum'};
+    next if $pkgnum && $cust_pkg->pkgnum != $pkgnum;
     push @cust_svc, @{[ $cust_pkg->cust_svc ]}; #@{[ ]} to force array context
   }
   if ( $p->{'svcdb'} ) {
@@ -1356,6 +1362,7 @@
                 %hash,
                 'username'   => $svc_x->username,
                 'email'      => $svc_x->email,
+                'finger'     => $svc_x->finger,
                 'seconds'    => $svc_x->seconds,
                 'upbytes'    => display_bytecount($svc_x->upbytes),
                 'downbytes'  => display_bytecount($svc_x->downbytes),
@@ -1372,11 +1379,12 @@
                 # more...
               );
 
-            } elsif ( $svcdb eq 'svc_phone' || $svcdb eq 'svc_port' ) {
-              %hash = (
-                %hash,
-              );
             }
+            # elsif ( $svcdb eq 'svc_phone' || $svcdb eq 'svc_port' ) {
+            #  %hash = (
+            #    %hash,
+            #  );
+            #}
 
             \%hash;
           }



More information about the freeside-commits mailing list