X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount.pm;h=e5016d51e946f37e3c8ce7d9b1c2efd16642cb8c;hb=1551c7d41cea8bfa58ea1d3fb489cfb54823e5d8;hp=a32ef33056c1ac7ad5342f43510810de1e0b2dd7;hpb=f38a8a7b537c33676dbba48cbd64a735fc0101eb;p=freeside.git diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index a32ef3305..e5016d51e 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -1310,12 +1310,18 @@ sub list_svcs { 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 @@ sub list_svcs { %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,20 @@ sub list_svcs { # more... ); - } elsif ( $svcdb eq 'svc_phone' || $svcdb eq 'svc_port' ) { - %hash = ( - %hash, - ); + } elsif ( $svcdb eq 'svc_dsl' ) { + if ( $svc_x->first || $svc_x->get('last') || $svc_x->company ) { + $hash{'name'} = $svc_x->first. ' '. $svc_x->get('last'); + $hash{'name'} = $svc_x->company. ' ('. $hash{'name'}. ')' + if $svc_x->company; + } else { + $hash{'name'} = $cust_main->name; + } } + # elsif ( $svcdb eq 'svc_phone' || $svcdb eq 'svc_port' ) { + # %hash = ( + # %hash, + # ); + #} \%hash; }