From 9d595e36a7844f99fa5d74aad418717d12eeae37 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 --- 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 cc3f04918d..75291d9f5c 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 8909eb03e0..69a25379f9 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 d95a36082b..5cc5ae7f6f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt @@ -2,6 +2,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 | html %] - [% order.ecost | html %] + [% 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 0797760990..5aeedabc3e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt @@ -2,6 +2,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 | html %] - [% order.unitprice | html %] + [% order.unitprice_tax_included | $Price %] [% order.entrydate | $KohaDates %] -- 2.39.5