Bug 31367: Add subtotals if budget has children
authorNick Clemens <nick@bywatersolutions.com>
Fri, 26 Aug 2022 13:32:50 +0000 (13:32 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 31 Oct 2022 23:04:06 +0000 (23:04 +0000)
commit14dd1ab9e4f0bdcf12269afd3a72569482aedf97
treedb32fffede006e71ffc05a703d0bd7beab47cfeb
parentc7074be1c93ef8a1fc81895d448d377740414cd7
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 <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6523db73214c57d6a6b8ea2d4c3731445ccddf1f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt