summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-05-23 00:01:33 +0000
committerivan <ivan>2011-05-23 00:01:33 +0000
commitb3381ad6612e613aebdad6a908926bd496440f35 (patch)
tree74b6d34695f7e35e846f1518dbde5851a26cc36f
parentc0f73e8675d875b53dc755523f3dce5e82b03749 (diff)
fix cch tax rate import for taxes coming from dbf file in scientific notation, RT#11003
-rw-r--r--FS/FS/tax_rate.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/FS/FS/tax_rate.pm b/FS/FS/tax_rate.pm
index 54b388ce3..48c01967d 100644
--- 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) {
- $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
);