Koha/acqui
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
..
pdfformat Bug 12110: (follow-up) improve whitespace 2014-05-25 15:24:33 +00:00
acqui-home.pl Bug 11714 - GetBudgetHierarchy needs optimization 2014-10-31 16:41:46 -03:00
addorder.pl Bug 7162: Factorize code for order cancellation (QA fixes) 2014-10-30 00:44:16 -03:00
addorderiso2709.pl Bug 12830: Move the order-related code into Koha::Acquisition::Order 2014-10-28 11:10:36 -03:00
ajax-getauthvaluedropbox.pl Bug 766: (follow-up) point acqui/ajax-getauthvaluedropbox.pl at the new location of GetAuthvalueDropbox 2014-05-04 23:11:31 +00:00
aqbasketuser_search.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
basket.pl Bug 12493: moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm 2014-07-30 10:40:06 -03:00
basketgroup.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
basketheader.pl Bug 12493: moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm 2014-07-30 10:40:06 -03:00
booksellers.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
cancelorder.pl Bug 7162: Factorize code for order cancellation (QA fixes) 2014-10-30 00:44:16 -03:00
check_budget_total.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
check_duplicate_barcode_ajax.pl Bug 6963: Corrects a problem when a new order is created with a duplicate barcode. 2011-11-04 10:22:28 +01:00
check_uniqueness.pl Bug 10483: fix item uniqueness check on order form 2013-08-14 21:17:11 +00:00
currency.pl Fix FSF address in directory acqui/ 2010-03-16 20:17:51 -04:00
finishreceive.pl Bug 12830: Move the order-related code into Koha::Acquisition::Order 2014-10-28 11:10:36 -03:00
histsearch.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
invoice-files.pl Bug 3050 - Add an option to upload scanned invoices #1/3 2014-05-25 21:14:00 +00:00
invoice.pl Bug 12619 - Shipment date gets lost on finishing and/or editing the invoice 2014-08-05 20:40:51 -03:00
invoices.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
lateorders-export.pl Bug 7298: (follow-up) various QA fixes 2013-10-31 15:51:25 +00:00
lateorders.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
modordernotes.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
neworderbiblio.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
neworderempty.pl Bug 12493: moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm 2014-07-30 10:40:06 -03:00
newordersubscription.pl Bug 9508: Standardize the dateformat value from C4::Auth 2013-05-20 09:05:01 -07:00
newordersuggestion.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
ordered.pl Bug 7735: removal of C4::Dates when unused 2012-03-20 18:11:04 +01:00
orderreceive.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
parcel.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
parcels.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
spent.pl Bug 9987: Remove DB field aqorders.biblioitemnunmber 2013-07-02 15:18:50 -07:00
supplier.pl Bug 10402 follow-up: choose contacts for claims 2014-08-26 11:45:59 -03:00
transferorder.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
uncertainprice.pl Bug 10402: Use an object for contacts 2014-08-26 11:45:42 -03:00
updatesupplier.pl Bug 10402 follow-up: choose contacts for claims 2014-08-26 11:45:59 -03:00
z3950_search.pl Bug 6536: Include SRU searching in Breeding.pm 2014-09-01 10:09:07 -03:00