X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_tax_location.pm;h=aec94104509f13aac4cc9302c22cf4d7f9912d5c;hp=1a9bf5a41b9f088669d69ede5e8319c8c4b2c8e0;hb=66720bf1f5bae4b1d4022eabff456c247447fbc1;hpb=fe5b1c30b591e50abc6f5496853f24f79a84e1c1 diff --git a/FS/FS/cust_tax_location.pm b/FS/FS/cust_tax_location.pm index 1a9bf5a41..aec941045 100644 --- a/FS/FS/cust_tax_location.pm +++ b/FS/FS/cust_tax_location.pm @@ -234,13 +234,15 @@ sub batch_import { if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') { delete($hash->{actionflag}); - my $cust_tax_location = qsearchs('cust_tax_location', $hash); + my @cust_tax_location = qsearch('cust_tax_location', $hash); return "Can't find cust_tax_location to delete: ". join(" ", map { "$_ => ". $hash->{$_} } @fields) - unless $cust_tax_location; + unless scalar(@cust_tax_location) || $param->{'delete_only'} ; - my $error = $cust_tax_location->delete; - return $error if $error; + foreach my $cust_tax_location (@cust_tax_location) { + my $error = $cust_tax_location->delete; + return $error if $error; + } delete($hash->{$_}) foreach (keys %$hash); }