Bug 28223 - Total for budgets is incorrect when child funds have negative values
Summary: Total for budgets is incorrect when child funds have negative values
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 23767
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-26 12:40 UTC by Nick Clemens
Modified: 2021-05-24 18:55 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.06,20.05.12


Attachments
Bug 28223 - Add data elements to negative budgets (1.51 KB, patch)
2021-04-26 12:42 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28223 - Add data elements to negative budgets (1.57 KB, patch)
2021-04-26 12:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28223: Add data elements to negative budgets (1.57 KB, patch)
2021-04-27 10:15 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-04-26 12:40:35 UTC
The math that we do on this page uses data elements parent_id and self_id to ensure we add only the parent budgets and don't add any more than once.

When a budget is negative, however, we don't add these elements and this then totals child funds an additional time

To recreate:
1 - Have a parent fund and a child fund
2 - Order an amount from the child fund that is greater than the amount available
3 - Browse to acquisitions
4 - Confirm the totals look right
5 - Click on the over spent fund to go to 'Funds for main budget'
6 - Note the totals are incorrect
Comment 1 Nick Clemens 2021-04-26 12:42:00 UTC
Created attachment 120172 [details] [review]
Bug 28223 - Add data elements to negative budgets

To test:
1 - Have a parent fund and a child fund
2 - Order an amount from the child fund that is greater than the amount available
3 - Browse to acquisitions
4 - Confirm the totals look right
5 - Click on the over spent fund to go to 'Funds for main budget'
6 - Note the totals are incorrect
7 - Apply patch
8 - Reload
9 - Totals are now correct
Comment 2 Martin Renvoize 2021-04-26 12:53:36 UTC
Created attachment 120173 [details] [review]
Bug 28223 - Add data elements to negative budgets

To test:
1 - Have a parent fund and a child fund
2 - Order an amount from the child fund that is greater than the amount available
3 - Browse to acquisitions
4 - Confirm the totals look right
5 - Click on the over spent fund to go to 'Funds for main budget'
6 - Note the totals are incorrect
7 - Apply patch
8 - Reload
9 - Totals are now correct

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2021-04-26 12:54:15 UTC
Works as expected.. can't believe I missed this during QA first time around!

Passing QA
Comment 4 Jonathan Druart 2021-04-27 10:15:15 UTC
Created attachment 120207 [details] [review]
Bug 28223: Add data elements to negative budgets

To test:
1 - Have a parent fund and a child fund
2 - Order an amount from the child fund that is greater than the amount available
3 - Browse to acquisitions
4 - Confirm the totals look right
5 - Click on the over spent fund to go to 'Funds for main budget'
6 - Note the totals are incorrect
7 - Apply patch
8 - Reload
9 - Totals are now correct

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Jonathan Druart 2021-04-27 14:26:22 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-04-30 08:53:47 UTC
Pushed to 20.11.x for 20.11.06
Comment 7 Andrew Fuerste-Henry 2021-05-24 18:47:00 UTC
Pushed to 20.05.x for 20.05.12
Comment 8 Victor Grousset/tuxayo 2021-05-24 18:55:16 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.