From bfecc7bff27000416fd1c91e64e0edd8c67b1ab7 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 20 Oct 2021 18:47:01 +0000 Subject: [PATCH] Bug 29287: Add child funds to display of parent funds on acqui home Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Michael Sutherland Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- acqui/acqui-home.pl | 2 ++ .../prog/en/modules/acqui/acqui-home.tt | 32 +++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 3010c6a3a3..05eb16bf06 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -95,6 +95,8 @@ foreach my $budget ( @{$budget_arr} ) { } $budget->{'budget_avail'} = $budget->{'budget_amount'} - ( $budget->{'budget_spent'} + $budget->{'budget_ordered'} ); + $budget->{'total_avail'} = + $budget->{'budget_amount'} - ( $budget->{'total_spent'} + $budget->{'total_ordered'} ); $total += $budget->{'budget_amount'}; $totspent += $budget->{'budget_spent'}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt index 833c27a020..f2853fcfe4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt @@ -159,16 +159,36 @@ - [% loop_budge.budget_ordered | $Price %] - + [% IF !loop_budge.budget_parent_id %] + + ([% loop_budge.budget_ordered | $Price %]) + + [% loop_budge.total_ordered | $Price %] + [% ELSE %] + + [% loop_budge.budget_ordered | $Price %] + + [% END %] - - [% loop_budge.budget_spent | $Price %] - + [% IF !loop_budge.budget_parent_id %] + + ([% loop_budge.budget_spent | $Price %]) + + [% loop_budge.total_spent | $Price %] + [% ELSE %] + + [% loop_budge.budget_spent | $Price %] + + [% END %] - [% loop_budge.budget_avail | $Price %] + [% IF !loop_budge.budget_parent_id %] + ([% loop_budge.budget_avail | $Price %]) + [% loop_budge.total_avail | $Price %] + [% ELSE %] + [% loop_budge.budget_avail | $Price %] + [% END %] [% END %] -- 2.39.5