X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_tax_location.pm;h=4293b2c90d5177b3df3d2acd751fab7e836274f9;hb=63973c641c4be00765fa27e55c57cc5b9aa4da19;hp=1a9bf5a41b9f088669d69ede5e8319c8c4b2c8e0;hpb=0af38652da3b3be7da2d35b048285ef6f2194e1a;p=freeside.git diff --git a/FS/FS/cust_tax_location.pm b/FS/FS/cust_tax_location.pm index 1a9bf5a41..4293b2c90 100644 --- a/FS/FS/cust_tax_location.pm +++ b/FS/FS/cust_tax_location.pm @@ -199,13 +199,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); } @@ -234,13 +236,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); }