X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg.pm;h=1d4a90c56b1f74cec1b59740b0d52b916ec2b6d3;hb=4cc0b69a94138d85b1ff8b67966127af3c72288d;hp=1cca10bc4d877380301d063ac849927562c52030;hpb=79ca46c249e58be3b7c70df57a8fc75a60ceb622;p=freeside.git diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 1cca10bc4..1d4a90c56 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -972,7 +972,16 @@ sub uncancel { my $svc_error = $svc_x->insert; if ( $svc_error && $options{svc_fatal} ) { $dbh->rollback if $oldAutoCommit; - return $error; + return $svc_error; + } else { + my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_x->svcnum }); + if ( $cust_svc ) { + my $cs_error = $cust_svc->delete; + if ( $cs_error ) { + $dbh->rollback if $oldAutoCommit; + return $cs_error; + } + } } push @svc_errors, $svc_error if $svc_error; } @@ -3682,7 +3691,7 @@ sub _location_sql_where { # ( $table.${prefix}city = ? $or_empty_city $ornull ) " - ( $table.${prefix}district = ? OR ? = '' OR CAST(? AS text) IS NULL ) + ( $table.district = ? OR ? = '' OR CAST(? AS text) IS NULL ) AND ( $table.${prefix}city = ? OR ? = '' OR CAST(? AS text) IS NULL ) AND ( $table.${prefix}county = ? $or_empty_county $ornull ) AND ( $table.${prefix}state = ? $or_empty_state $ornull )