Bug 18887: Port max_holds rules to new CirculationRules system
[koha.git] / admin / aqbudgets.pl
index 7e85254..44f0d7f 100755 (executable)
@@ -50,9 +50,11 @@ my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
 );
 
 my $active_currency = Koha::Acquisition::Currencies->get_active;
-$template->param( symbol => $active_currency->symbol,
-                  currency => $active_currency->currency
-               );
+if ( $active_currency ) {
+    $template->param( symbol => $active_currency->symbol,
+                      currency => $active_currency->currency
+                   );
+}
 
 my $op = $input->param('op') || 'list';
 
@@ -87,9 +89,6 @@ if ( $budget_period_id ) {
 
 # ------- get periods stuff ------------------
 
-# USED FOR PERMISSION COMPARISON LATER
-my $borrower_id         = $template->{VARS}->{'USER_INFO'}->{'borrowernumber'};
-
 $template->param(
     show_mine   => $show_mine,
     op  => $op,
@@ -115,8 +114,7 @@ if ($op eq 'add_form') {
             exit;
         }
         $dropbox_disabled = BudgetHasChildren($budget_id);
-        my $patron = Koha::Patrons->find( $budget->{budget_owner_id} );
-        $budget->{budget_owner_name} = ( $patron ? $patron->firstname . ' ' . $patron->surname : '' );
+        $budget->{budget_owner} = Koha::Patrons->find( $budget->{budget_owner_id} );
     }
 
     # build budget hierarchy
@@ -234,7 +232,7 @@ if ( $op eq 'list' ) {
     );
 
     my @budgets = @{
-        GetBudgetHierarchy( $$period{budget_period_id}, undef, ( $show_mine ? $borrower_id : 0 ))
+        GetBudgetHierarchy( $$period{budget_period_id}, undef, ( $show_mine ? $borrowernumber : 0 ))
     };
 
     my $period_total = 0;