X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FMaestro.pm;h=e395c5a220f2eb6b9e85d1bb47f4f066bb12ce73;hb=f8f4c51eaa6f5aa3d49672fe7a17f19fa22494c0;hp=20dbad60757cfe60a332b20d9a61d92f68aefe17;hpb=40d935c8cd952be7b461405406d9d03f46775baf;p=freeside.git diff --git a/FS/FS/Maestro.pm b/FS/FS/Maestro.pm index 20dbad607..e395c5a22 100644 --- a/FS/FS/Maestro.pm +++ b/FS/FS/Maestro.pm @@ -21,7 +21,7 @@ sub customer_status { ## my @cust_svc_pbx = - grep { my($n,$l,$t) = $_->label; $_->t eq 'svc_pbx' } + grep { my($n,$l,$t) = $_->label; $t eq 'svc_pbx' } @cust_svc; #i tried sofa king hard to explain to them why passing a custnum instead @@ -37,7 +37,7 @@ sub customer_status { my $cust_svc_pbx = $cust_svc_pbx[0]; - my $svc_pbx = $cust_svc_pbx->svc_X; + my $svc_pbx = $cust_svc_pbx->svc_x; ### # find "outbound service" y/n @@ -46,7 +46,11 @@ sub customer_status { my $conf = new FS::Conf; my %outbound_pkgs = map { $_=>1 } $conf->config('mc-outbound_packages'); my $outbound_service = - scalar( grep $outbound_pkgs{ $_->pkgpart }, @cust_pkg ) + scalar( grep { $outbound_pkgs{ $_->pkgpart } + && !$_->get('cancel') + } + @cust_pkg + ) ? 1 : 0; ### @@ -67,8 +71,8 @@ sub customer_status { 'status' => substr($cust_main->ucfirst_status,0,1), #what they asked for.. 'name' => $cust_main->name, 'email' => $cust_main->invoicing_list_emailonly_scalar, - 'max_lines' => $svc_pbx->max_extensions, - 'max_simultaneous' => $svc_pbx->max_simultaneous, + 'max_lines' => $svc_pbx ? $svc_pbx->max_extensions : '', + 'max_simultaneous' => $svc_pbx ? $svc_pbx->max_simultaneous : '', 'outbound_service' => $outbound_service, 'good_till' => $good_till, 'products' => [ map $_->pkgpart, grep !$_->get('cancel'), @cust_pkg ],