Bug 5962 : Budgets showing when they shouldn't (MT #4717) Bug in Koha 3.2 on acqui...
authorChristophe Croullebois <christophe.croullebois@biblibre.com>
Mon, 4 Apr 2011 12:28:19 +0000 (14:28 +0200)
committerChris Nighswonger <chris.nighswonger@gmail.com>
Mon, 11 Apr 2011 19:45:07 +0000 (15:45 -0400)
In the screen all the budgets with budget_branchcode=NULL were displayed even if the budget_owner_id was not NULL. This patch fixes the bug

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
To test:
1) Add a new fund, leave library empty, owned by yourself
2) Go into the database and change aqbudgets.budget_branchcode to be NULL
3) Check acq home. Before patch the fund will not show up, although it's owned by you.
After patch it will.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 5910b59d1d4bdbe6fb6152453536bfe64d490c01)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
C4/Budgets.pm

index 0882756..9d3e94b 100644 (file)
@@ -506,8 +506,9 @@ sub GetBudgetHierarchy {
        # show only budgets owned by me, my branch or everyone
     if ($owner) {
         if ($branchcode) {
-            push @where_strings,qq{ (budget_owner_id = ? OR budget_branchcode = ? OR (budget_branchcode IS NULL or budget_branchcode="" AND (budget_owner_id IS NULL OR budget_owner_id="")))};
-            push @bind_params, ($owner, $branchcode);
+            push @where_strings,
+            qq{ (budget_owner_id = ? OR budget_branchcode = ? OR ((budget_branchcode IS NULL or budget_branchcode="") AND (budget_owner_id IS NULL OR budget_owner_id="")))};
+            push @bind_params, ( $owner, $branchcode );
         } else {
             push @where_strings, ' (budget_owner_id = ? OR budget_owner_id IS NULL or budget_owner_id ="") ';
             push @bind_params, $owner;