From b87adeb5aa46b5e6797fa340037713f1c235209c 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 (cherry picked from commit a9aec1853871765f1a5d3ca82a0ff24c4bf0263e) Signed-off-by: Fridolin Somers --- 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 28786b16e3..a5f2e46777 100755 --- a/acqui/ordered.pl +++ b/acqui/ordered.pl @@ -54,7 +54,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 76ed805d71..e778146f4b 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -56,14 +56,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 c730e8472d..6d17ac427d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt @@ -1,5 +1,6 @@ [% USE KohaDates %] [% USE ItemTypes %] +[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › Ordered @@ -72,7 +73,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 686f35beb1..55ca63cf1b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt @@ -1,5 +1,6 @@ [% USE KohaDates %] [% USE ItemTypes %] +[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › Spent @@ -73,7 +74,7 @@ [% order.quantityreceived %] - [% order.unitprice %] + [% order.unitprice_tax_included | $Price %] [% order.entrydate | $KohaDates %] -- 2.39.5