Bug 5084 - hide funds that are part of an inactive budget
authorRobin Sheat <robin@catalyst.net.nz>
Wed, 4 Aug 2010 03:48:10 +0000 (15:48 +1200)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 14 Dec 2010 02:07:51 +0000 (15:07 +1300)
Prevents inactive funds from showing in the aquisitions module, they
still show in the administration.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Budgets.pm

index 005bba8..0882756 100644 (file)
@@ -492,9 +492,13 @@ sub GetBudgetHierarchy {
        my $dbh   = C4::Context->dbh;
        my $query = qq|
                     SELECT aqbudgets.*
-                    FROM aqbudgets |;
-    # show only period X if requested
+                    FROM aqbudgets 
+                    LEFT JOIN aqbudgetperiods 
+                    ON aqbudgetperiods.budget_period_id=aqbudgets.budget_period_id |;
        my @where_strings;
+    # Pick out the active ones
+    push @where_strings, 'aqbudgetperiods.budget_period_active=1';
+    # show only period X if requested
     if ($budget_period_id) {
         push @where_strings," aqbudgets.budget_period_id = ?";
         push @bind_params, $budget_period_id;