projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove useless line
[freeside.git]
/
FS
/
FS
/
tax_rate.pm
diff --git
a/FS/FS/tax_rate.pm
b/FS/FS/tax_rate.pm
index
021bce3
..
0d9156b
100644
(file)
--- a/
FS/FS/tax_rate.pm
+++ b/
FS/FS/tax_rate.pm
@@
-471,7
+471,7
@@
sub _fatal_or_null {
$name = 'Other surcharges'
if ($self->passtype == 2);
$name = 'Other surcharges'
if ($self->passtype == 2);
- if ($conf->exists('ignore_incalculable_tax')) {
+ if ($conf->exists('ignore_incalculable_tax
es
')) {
warn $error;
return { name => $name, amount => 0 };
} else {
warn $error;
return { name => $name, amount => 0 };
} else {
@@
-560,9
+560,11
@@
sub batch_import {
/^(\d{4})(\d{2})(\d{2})$/ && ($r="$1/$2/$3");
$r;
};
/^(\d{4})(\d{2})(\d{2})$/ && ($r="$1/$2/$3");
$r;
};
-
$column_callbacks[8] = $date_format
;
+
my $trim = sub { my $r = shift; $r =~ s/^\s*//; $r =~ s/\s*$//; $r }
;
push @column_lengths, qw( 10 1 1 8 8 5 8 8 8 1 2 2 30 8 8 10 2 8 2 1 2 2 );
push @column_lengths, 1 if $format eq 'cch-update';
push @column_lengths, qw( 10 1 1 8 8 5 8 8 8 1 2 2 30 8 8 10 2 8 2 1 2 2 );
push @column_lengths, 1 if $format eq 'cch-update';
+ push @column_callbacks, $trim foreach (@column_lengths); # 5, 6, 15, 17 esp
+ $column_callbacks[8] = $date_format;
}
my $line;
}
my $line;
@@
-913,10
+915,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;