@@ -, +, @@ --- C4/Budgets.pm | 55 ++++++++++++++++++ .../prog/en/modules/suggestion/suggestion.tt | 59 ++++++++++++++++++++ suggestion/suggestion.pl | 11 ++++ 3 files changed, 125 insertions(+), 0 deletions(-) --- a/C4/Budgets.pm +++ a/C4/Budgets.pm @@ -46,6 +46,10 @@ BEGIN { &GetBudgetPeriod &GetBudgetPeriods + &GetBudgetFirstChild + &GetBudgetParent + &GetBudgetSecondChild + &ModBudgetPeriod &AddBudgetPeriod &DelBudgetPeriod @@ -464,6 +468,57 @@ sub GetBudgetPeriod { } # ------------------------------------------------------------------- +sub GetBudgetFirstChild { + my $dbh = C4::Context->dbh; + my $query = "SELECT * + FROM `aqbudgets` + WHERE budget_parent_id + IN ( + SELECT budget_id FROM `aqbudgets` + JOIN `aqbudgetperiods` ON aqbudgets.budget_period_id = aqbudgetperiods.budget_period_id + WHERE ((`budget_parent_id` IS NULL)AND (`budget_period_active` LIKE 1))) + ORDER BY `aqbudgets`.`budget_parent_id`, budget_name ASC"; + my $sth= $dbh->prepare($query); + $sth->execute(); + my $data = $sth->fetchall_arrayref({}); + return $data; +} +# ------------------------------------------------------------------- +sub GetBudgetParent { + my $dbh = C4::Context->dbh; + my $query = "SELECT * + FROM `aqbudgets` + JOIN `aqbudgetperiods` ON aqbudgets.budget_period_id = aqbudgetperiods.budget_period_id + WHERE ((`budget_parent_id` IS NULL)AND (`budget_period_active` LIKE 1)) + ORDER BY `aqbudgets`.`budget_id`, budget_name ASC"; + my $sth= $dbh->prepare($query); + $sth->execute(); + my $data = $sth->fetchall_arrayref({}); + return $data; +} +# ------------------------------------------------------------------- +sub GetBudgetSecondChild { + my $dbh = C4::Context->dbh; + my $query = "SELECT * + FROM `aqbudgets` + WHERE budget_parent_id + IN ( + SELECT budget_id + FROM `aqbudgets` + WHERE budget_parent_id + IN ( + SELECT budget_id + FROM `aqbudgets` + JOIN `aqbudgetperiods` ON aqbudgets.budget_period_id = aqbudgetperiods.budget_period_id + WHERE ((`budget_parent_id` IS NULL)AND (`budget_period_active` LIKE 1)))) + ORDER BY `aqbudgets`.`budget_parent_id` , budget_name ASC"; + my $sth= $dbh->prepare($query); + $sth->execute(); + my $data = $sth->fetchall_arrayref({}); + return $data; +} +# ------------------------------------------------------------------- + sub DelBudgetPeriod{ my ($budget_period_id) = @_; my $dbh = C4::Context->dbh; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -87,6 +87,57 @@ $(document).ready(function() { calcNewsuggTotal(); }); [% END %] + + +
[% INCLUDE 'header.inc' %] @@ -169,6 +220,14 @@ $(document).ready(function() { calcNewsuggTotal(); }); [% FOREACH budgetsloo IN budgetsloop %] [% IF ( budgetsloo.selected ) %][% ELSE %][% END %][% END %] + +