projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
limit sales reports for employee, RT#25524
[freeside.git]
/
FS
/
FS
/
cust_tax_location.pm
diff --git
a/FS/FS/cust_tax_location.pm
b/FS/FS/cust_tax_location.pm
index
161a654
..
4293b2c
100644
(file)
--- 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});
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)
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);
}
delete($hash->{$_}) foreach (keys %$hash);
}
@@
-234,13
+236,15
@@
sub batch_import {
if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') {
delete($hash->{actionflag});
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)
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);
}
delete($hash->{$_}) foreach (keys %$hash);
}
@@
-298,7
+302,7
@@
sub batch_import {
}
if ( scalar( @columns ) ) {
$dbh->rollback if $oldAutoCommit;
}
if ( scalar( @columns ) ) {
$dbh->rollback if $oldAutoCommit;
- return "Unexpected trailing columns in line (wrong format?): $line";
+ return "Unexpected trailing columns in line (wrong format?)
importing cust_tax_location
: $line";
}
my $error = &{$hook}(\%cust_tax_location);
}
my $error = &{$hook}(\%cust_tax_location);