projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df4c3a5
)
fix cch tax rate import for taxes coming from dbf file in scientific notation, RT...
author
ivan
<ivan>
Mon, 23 May 2011 00:01:31 +0000
(
00:01
+0000)
committer
ivan
<ivan>
Mon, 23 May 2011 00:01:31 +0000
(
00:01
+0000)
FS/FS/tax_rate.pm
patch
|
blob
|
history
diff --git
a/FS/FS/tax_rate.pm
b/FS/FS/tax_rate.pm
index
54b388c
..
48c0196
100644
(file)
--- a/
FS/FS/tax_rate.pm
+++ b/
FS/FS/tax_rate.pm
@@
-1196,9
+1196,14
@@
sub _cch_extract_csv_from_dbf {
$date;
};
while (my $row = $cursor->fetch_hashref) {
$date;
};
while (my $row = $cursor->fetch_hashref) {
- $csv->combine( map { ($table->field_type($_) eq 'D')
- ? &{$format_date}($row->{$_})
- : $row->{$_}
+ $csv->combine( map { my $type = $table->field_type($_);
+ if ($type eq 'D') {
+ &{$format_date}($row->{$_}) ;
+ } elsif ($type eq 'N' && $row->{$_} =~ /e-/i ) {
+ sprintf('%.8f', $row->{$_}); #db row is numeric(14,8)
+ } else {
+ $row->{$_};
+ }
}
@fields
);
}
@fields
);