projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
07a313a
)
proper match arguments help
author
jeff
<jeff>
Thu, 12 Feb 2009 19:48:24 +0000
(19:48 +0000)
committer
jeff
<jeff>
Thu, 12 Feb 2009 19:48:24 +0000
(19:48 +0000)
FS/FS/cust_tax_location.pm
patch
|
blob
|
history
FS/FS/tax_rate.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_tax_location.pm
b/FS/FS/cust_tax_location.pm
index
bb61089
..
16a79db
100644
(file)
--- a/
FS/FS/cust_tax_location.pm
+++ b/
FS/FS/cust_tax_location.pm
@@
-211,7
+211,7
@@
sub batch_import {
} elsif ( $format eq 'cch-zip' || $format eq 'cch-update-zip' ) {
@fields = qw( zip city county state postalcity countyfips countydef default geocode cityflag unique );
} elsif ( $format eq 'cch-zip' || $format eq 'cch-update-zip' ) {
@fields = qw( zip city county state postalcity countyfips countydef default geocode cityflag unique );
- push @fields, 'actionflag' if $format eq 'cch-update';
+ push @fields, 'actionflag' if $format eq 'cch-update
-zip
';
$imported++ if $format eq 'cch-update'; #empty file ok
$imported++ if $format eq 'cch-update'; #empty file ok
diff --git
a/FS/FS/tax_rate.pm
b/FS/FS/tax_rate.pm
index
d468e60
..
291e2d5
100644
(file)
--- a/
FS/FS/tax_rate.pm
+++ b/
FS/FS/tax_rate.pm
@@
-913,10
+913,12
@@
sub process_batch_import {
UNLINK => 0, #meh
) or die "can't open temp file: $!\n";
UNLINK => 0, #meh
) or die "can't open temp file: $!\n";
+ my $insert_pattern = ($format eq 'cch-update') ? qr/"I"\s*$/ : qr/I\s*$/;
+ my $delete_pattern = ($format eq 'cch-update') ? qr/"D"\s*$/ : qr/D\s*$/;
while(<$fh>) {
my $handle = '';
while(<$fh>) {
my $handle = '';
- $handle = $ifh if $_ =~ /
"I"\s*$
/;
- $handle = $dfh if $_ =~ /
"D"\s*$
/;
+ $handle = $ifh if $_ =~ /
$insert_pattern
/;
+ $handle = $dfh if $_ =~ /
$delete_pattern
/;
unless ($handle) {
$error = "bad input line: $_" unless $handle;
last;
unless ($handle) {
$error = "bad input line: $_" unless $handle;
last;