X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_svc.pm;h=bbf4eedf8782d3aed6d37599f9e5c238f903c8b4;hb=b70a4b7f41c84aefd7f273974db59e5c37fc368b;hp=acd2fcdb7818a76e54e6006e81991eca721947c6;hpb=cd6bb5eafb6c7df7ea3eb7b78226a0d9c4b572ed;p=freeside.git diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index acd2fcdb7..bbf4eedf8 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -13,6 +13,7 @@ use FS::pkg_svc; use FS::domain_record; use FS::part_export; use FS::cdr; +use FS::UI::Web; #most FS::svc_ classes are autoloaded in svc_x emthod use FS::svc_acct; #this one is used in the cache stuff @@ -338,7 +339,7 @@ sub check { unless $part_svc || $ignore_quantity; return "Already ". $part_svc->get('num_cust_svc'). " ". $part_svc->svc. " services for pkgnum ". $self->pkgnum - if $part_svc->get('num_avail') <= 0 and !$ignore_quantity; + if !$ignore_quantity && $part_svc->get('num_avail') <= 0 ; } $self->SUPER::check; @@ -479,7 +480,7 @@ Returns a listref of html elements associated with this service's exports. sub export_links { my $self = shift; my $svc_x = $self->svc_x - or return "can't find ". $self->part_svc->svcdb. '.svcnum '. $self->svcnum; + or return [ "can't find ". $self->part_svc->svcdb. '.svcnum '. $self->svcnum ]; $svc_x->export_links; } @@ -883,7 +884,7 @@ sub smart_search_param { my $extra_sql = ' WHERE '.join(' AND ', @extra_sql); #for agentnum my $addl_from = ' LEFT JOIN cust_pkg USING ( pkgnum )'. - ' LEFT JOIN cust_main USING ( custnum )'. + FS::UI::Web::join_cust_main('cust_pkg', 'cust_pkg'). ' LEFT JOIN part_svc USING ( svcpart )'; (