Koha/koha-tmpl/intranet-tmpl/prog/en
Fridolin Somers 32bd54a7ca Bug 11714 - GetBudgetHierarchy needs optimization
The method C4::Budgets::GetBudgetHierarchy() retreives from database budgets in an array containing a tree of budgets (parent -> children -> children, ...).
The code generating this tree with the SQL results needs optimization because when a lot of budgets exists, it can run during several minutes.

This patch rewites the code using a recurive method.

Test plan :
- Create a active budget "MyBudget" with 1000
- Click "Add found" on this budget
- Create a found "Parent" with 1000, set you has owner
- Click "Add child found" on found "Parent"
- Create a found "Child" with 100, set you has owner
- Click "Add child found" on found "Child"
- Create a found "Grand-child" with 10, set you has owner
|
- Create a new acquisition basket
- Add a new order with "Child budget"
- Select "Child" found and set all costs to 2
- Save order
- Add a new order with "Grand-Child budget"
- Select "Child" found and set all costs to 2
- Save order
- Close basket
- Perform the receive of the two orders
|
- Go to founds of "MyBudget"
=> You see a table with 3 founds
- in "Fund filters", select no library and uncheck "Show my funds only" and click on "Go"
=> You see a table with "Parent" found
- Click on small arrow left of the fund code of "Parent"
=> You see a new line with "Child" found
- Click on small arrow left of the fund code of "Child"
=> You see a new line with "Grand-Child" found
|
=> You see in "Grand-Child" row "Base-level spent" = 2 and "Total sublevels spent" = 2
=> You see in "Child" row "Base-level spent" = 2 and "Total sublevels spent" = 4
This confirms the founds are used in a hierarchie.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-31 16:41:46 -03:00
..
css Bug 11926 [Follow-up] HEA - Render community koha statistic usages 2014-10-22 15:17:23 -03:00
data Bug 11695 - Fixed typo in marc21_field_008.xml 2014-03-11 14:21:23 +00:00
includes Bug 12494 - Remove yuipath system preference 2014-10-29 22:06:57 -03:00
js Bug 13080 - Addition of noEnterSubmit class should not apply to textarea, only to input 2014-10-27 12:56:15 -03:00
lib/yui Bug 13139 - Move treeview jQuery plugin outside of language-specific directory 2014-10-27 12:36:53 -03:00
modules Bug 11714 - GetBudgetHierarchy needs optimization 2014-10-31 16:41:46 -03:00
xslt Bug 11517: Braille and combination swapped in XSLT result lists 2014-10-31 14:18:10 -03:00
columns.def Bug 11673: columns.def has swapped last and first name of alt contact 2014-08-07 16:17:21 -03:00