Bug 17872: Fix small error in GetBudgetHierarchy and one of its calls
In aqbudgetperiods.pl a commented line is removed that contains a
wrong userenv hash key. Should be branch instead of branchcode.
In aqbudgets GetBudgetHierarchy is called with the same wrong userenv
hash key. Should be userenv->{branch}.
This made another bug visible: if you call GetBudgetHierarchy with a
branch and without owner, the where clause should take into account
that the branchcode can be empty (not null).
Test plan:
[1] Run Budgets.t
[2] Run aqbudgets.pl from Administration
[3] Add the show_mine=1 parameter in the URL
[4] Change owner of one of the funds and repeat step 2 and 3.
t/Budgets.t returns green. Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
17f4b05d23
commit
476179a123
|
|
@ -511,7 +511,7 @@ sub GetBudgetHierarchy {
|
|||
}
|
||||
} else {
|
||||
if ($branchcode) {
|
||||
push @where_strings," (budget_branchcode =? or budget_branchcode is NULL)";
|
||||
push @where_strings," (budget_branchcode =? or budget_branchcode is NULL OR budget_branchcode='')";
|
||||
push @bind_params, $branchcode;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,8 +198,6 @@ elsif ( $op eq 'close_form' ) {
|
|||
|
||||
my $budgets_to_move = GetBudgetHierarchy($budget_period_id);
|
||||
|
||||
# C4::Context->userenv->{branchcode}, $show_mine ? $borrower_id : '')
|
||||
|
||||
my $number_of_unreceived_orders = 0;
|
||||
for my $budget (@$budgets_to_move) {
|
||||
|
||||
|
|
|
|||
|
|
@ -237,8 +237,7 @@ if ( $op eq 'list' ) {
|
|||
);
|
||||
|
||||
my @budgets = @{
|
||||
GetBudgetHierarchy($$period{budget_period_id},
|
||||
C4::Context->userenv->{branchcode}, $show_mine ? $borrower_id : '')
|
||||
GetBudgetHierarchy( $$period{budget_period_id}, C4::Context->userenv->{branch}, ( $show_mine ? $borrower_id : 0 ))
|
||||
};
|
||||
|
||||
my $period_total = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue