From aa2d42940396dcd67a52b845ff0627ee9979ed49 Mon Sep 17 00:00:00 2001 From: Finn Date: Tue, 9 Jul 2019 18:06:31 +0100 Subject: [PATCH] made it proper numerics --- lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm index eb906f7..e8bdd37 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm @@ -44,7 +44,12 @@ sub _row_to_result { my $paid_date = ( $row->{paid_date} ? $date_formatter->parse_datetime($row->{paid_date}) : DateTime->today ); - #my $distance = $self->get_distance_from_coords( $organisation, $lcc_org ); + my $gross_value = $row->{gross_amount}; + $gross_value =~ s/,//g; + my $sales_tax_value = $row->{"vat amount"}; + $sales_tax_value =~ s/,//g; + my $net_value = $row->{net_amount}; + $net_value =~ s/,//g; # TODO negative values are sometimes present $self->external_result->find_or_create_related('transactions', { @@ -55,11 +60,10 @@ sub _row_to_result { purchase_time => $paid_date, value => $row->{net_amount}, meta => { - gross_value => $row->{gross_amount} * 100000, - sales_tax_value => $row->{"vat amount"} * 100000, - net_value => $row->{net_amount} * 100000, + gross_value => $gross_value * 100000, + sales_tax_value => $sales_tax_value * 100000, + net_value => $net_value * 100000, }, - # distance => $distance, } }); }