made it proper numerics

This commit is contained in:
Finn 2019-07-09 18:06:31 +01:00
parent 0a097afdfe
commit 975c348299

View file

@ -44,7 +44,12 @@ sub _row_to_result {
my $paid_date = ( $row->{paid_date} ? $date_formatter->parse_datetime($row->{paid_date}) : DateTime->today ); 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 # TODO negative values are sometimes present
$self->external_result->find_or_create_related('transactions', { $self->external_result->find_or_create_related('transactions', {
@ -55,11 +60,10 @@ sub _row_to_result {
purchase_time => $paid_date, purchase_time => $paid_date,
value => $row->{net_amount}, value => $row->{net_amount},
meta => { meta => {
gross_value => $row->{gross_amount} * 100000, gross_value => $gross_value * 100000,
sales_tax_value => $row->{"vat amount"} * 100000, sales_tax_value => $sales_tax_value * 100000,
net_value => $row->{net_amount} * 100000, net_value => $net_value * 100000,
}, },
# distance => $distance,
} }
}); });
} }