From a9aec1853871765f1a5d3ca82a0ff24c4bf0263e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 29 Aug 2018 17:26:14 -0300 Subject: [PATCH] Bug 21282: Sync ordered and spent values with acqui home The order list for each fund calculates using the ecost tax excl., but it should be tax incl. At the moment this means that the sum on the start page table and the order list don't match up. Test plan: - Create and receive orders - Values on acqui home and ordered/spent should be the same Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens (cherry picked from commit 9d595e36a7844f99fa5d74aad418717d12eeae37) Signed-off-by: Martin Renvoize --- acqui/ordered.pl | 4 ++-- acqui/spent.pl | 8 ++++---- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt | 3 ++- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/acqui/ordered.pl b/acqui/ordered.pl index 73ecb35917..3d7870efc4 100755 --- a/acqui/ordered.pl +++ b/acqui/ordered.pl @@ -53,7 +53,7 @@ my $query = <fetchrow_hashref ) { $left = $data->{'quantity'}; } if ( $left && $left > 0 ) { - my $subtotal = $left * $data->{'ecost'}; + my $subtotal = $left * $data->{'ecost_tax_included'}; $data->{subtotal} = sprintf( "%.2f", $subtotal ); $data->{'left'} = $left; push @ordered, $data; diff --git a/acqui/spent.pl b/acqui/spent.pl index e17d07c35f..e3c9096297 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -55,14 +55,14 @@ my $query = <fetchrow_hashref ) { my $recv = $data->{'quantityreceived'}; if ( $recv > 0 ) { - my $rowtotal = $recv * $data->{'unitprice'}; + my $rowtotal = $recv * $data->{'unitprice_tax_included'}; $data->{'rowtotal'} = sprintf( "%.2f", $rowtotal ); - $data->{'unitprice'} = sprintf( "%.2f", $data->{'unitprice'} ); + $data->{'unitprice_tax_included'} = sprintf( "%.2f", $data->{'unitprice_tax_included'} ); $subtotal += $rowtotal; push @spent, $data; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt index fb37c529dd..7b9c8b6c30 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt @@ -1,6 +1,7 @@ [% USE Asset %] [% USE KohaDates %] [% USE ItemTypes %] +[% USE Price %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › Ordered @@ -61,7 +62,7 @@ [% order.left %] - [% order.ecost %] + [% order.ecost_tax_included | $Price %] [% order.entrydate | $KohaDates %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt index cd4c630ba3..97893b87bd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt @@ -1,6 +1,7 @@ [% USE Asset %] [% USE KohaDates %] [% USE ItemTypes %] +[% USE Price %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › Spent @@ -62,7 +63,7 @@ [% order.quantityreceived %] - [% order.unitprice %] + [% order.unitprice_tax_included | $Price %] [% order.entrydate | $KohaDates %] -- 2.39.5