From ed3a37df3b6edae18bfd2082b62bbf1818d3ae52 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 26 Aug 2022 13:32:50 +0000 Subject: [PATCH] Bug 31367: Add subtotals if budget has children On bug 29287 we added child funds if a fund had no parent id It turns out funds can have a parent, and still have children (sub-sub-funds) This patch simply checks for children, rather than checking for lack of parent. Totals are already calculated correctly in GetBudgetHierarchy To test: 1 - Add a fund "Fund" to a budget - assign 1000 dollars 2 - Add a sub-fund "SubFund" - assign 100 dollars 3 - Add a sub-sub-fund "SubSubFund" - assign 10 dollars 4 - Add to a basket $5 order from SubSubFund 5 - Add to a basket $50 order from SubFund 6 - Add to a basket $500 order form Fun 7 - View acqui home - note 'SubFund' does not include total from 'SubSubFund' 8 - Apply patch 9 - Confirm all sub-sub-funds totaled in sub-funds and that fund total correctly adds sub and sub-sub funds Signed-off-by: Andrew Fuerste-Henry --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 94d28d5f17..a4e480e895 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 @@ -160,7 +160,7 @@ - [% IF !loop_budge.budget_parent_id %] + [% IF loop_budge.children.size %] ([% loop_budge.budget_ordered | $Price %]) @@ -172,7 +172,7 @@ [% END %] - [% IF !loop_budge.budget_parent_id %] + [% IF loop_budge.children.size %] ([% loop_budge.budget_spent | $Price %]) @@ -184,7 +184,7 @@ [% END %] - [% IF !loop_budge.budget_parent_id %] + [% IF loop_budge.children.size %] ([% loop_budge.budget_avail | $Price %]) [% loop_budge.total_avail | $Price %] [% ELSE %] -- 2.30.2