From 14d74bd92f780d5a2b4fb53f23b114efdc7292dd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 9 Apr 2014 15:21:50 +0200 Subject: [PATCH] Bug 11944: Fix fund names encoding on the parcel page On the parcel page, the subtotal values are stored in an hashref. The key was the fund name. The fund name being encoded in utf8, the hashref was broken. This patch replaces this logic creating a key based on an integer. The budget name is now stored in a new "budget_name" key. Note: It also fixes a small ergonomic issue (a td was missing in the tfoot). Signed-off-by: Paola Rossi Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Dobrica Pavlinusic --- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index f4f6e3e..e6f001e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -343,15 +343,18 @@ [% SET estimated_total = 0 %] [% FOREACH loop_receive IN loop_received %] - [% IF (funds.${ loop_receive.budget.budget_name }.estimated == '') %] - [% SET funds.${ loop_receive.budget.budget_name }.estimated = 0 %] + [% SET index = loop.count %] + [% SET funds.${ index }.budget_name = loop_receive.budget.budget_name %] + [% IF (funds.${ index }.estimated == '') %] + [% SET funds.${ index }.estimated = 0 %] [% END %] - [% IF (funds.${ loop_receive.budget.budget_name }.actual == '') %] - [% SET funds.${ loop_receive.budget.budget_name }.actual = 0 %] + [% IF (funds.${ index }.actual == '') %] + [% SET funds.${ index }.actual = 0 %] [% END %] [% SET estimated_total = estimated_total + ( loop_receive.ecost * loop_receive.quantityreceived ) %] - [% SET funds.${ loop_receive.budget.budget_name }.estimated = funds.${ loop_receive.budget.budget_name }.estimated + ( loop_receive.ecost * loop_receive.quantityreceived )%] - [% SET funds.${ loop_receive.budget.budget_name }.actual = funds.${ loop_receive.budget.budget_name }.actual + loop_receive.total %] + [% SET funds.${ index }.estimated = funds.${ index }.estimated + ( loop_receive.ecost * loop_receive.quantityreceived )%] + + [% SET funds.${ index }.actual = funds.${ loop_receive.budget.budget_name }.actual + loop_receive.total %] [% END %]
@@ -376,7 +379,7 @@ [% FOREACH key IN funds.keys.sort %] (Tax exc.) - Subtotal for [% key %] + Subtotal for [% funds.$key.budget_name %] [% currency( funds.$key.estimated ) %] [% currency( funds.$key.actual ) %]   -- 1.7.2.5