Fridolin Somers
32bd54a7ca
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> |
||
---|---|---|
.. | ||
admin-home.pl | ||
aqbudget_user_search.pl | ||
aqbudgetperiods.pl | ||
aqbudgets.pl | ||
aqcontract.pl | ||
aqplan.pl | ||
auth_subfields_structure.pl | ||
auth_tag_structure.pl | ||
authorised_values.pl | ||
authtypes.pl | ||
biblio_framework.pl | ||
branch_transfer_limits.pl | ||
branches.pl | ||
categorie.pl | ||
check_budget_parent.pl | ||
check_parent_total.pl | ||
checkmarc.pl | ||
cities.pl | ||
classsources.pl | ||
clone-rules.pl | ||
columns_settings.pl | ||
columns_settings.yml | ||
currency.pl | ||
didyoumean.pl | ||
env_tz_test.pl | ||
fieldmapping.pl | ||
import_export_framework.pl | ||
item_circulation_alerts.pl | ||
itemtypes.pl | ||
koha2marclinks.pl | ||
marc_subfields_structure.pl | ||
marctagstructure.pl | ||
matching-rules.pl | ||
oai_set_mappings.pl | ||
oai_sets.pl | ||
patron-attr-types.pl | ||
preferences.pl | ||
printers.pl | ||
smart-rules.pl | ||
sru_modmapping.pl | ||
stopwords.pl | ||
systempreferences.pl | ||
transport-cost-matrix.pl | ||
z3950servers.pl |