#written 20/02/2002 by paul.poulain@free.fr
# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
#written 20/02/2002 by paul.poulain@free.fr
# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
my $period = GetBudgetPeriod($budget_period_id);
my $count = GetPeriodsCount();
my $active_currency = Koha::Acquisition::Currencies->get_active;
my $period = GetBudgetPeriod($budget_period_id);
my $count = GetPeriodsCount();
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,
+ );
+}
$template->param( period_button_only => 1 ) if $count == 0;
# authcats_loop populates the YUI planning button
my $auth_cats_loop = GetBudgetAuthCats($budget_period_id);
$template->param( period_button_only => 1 ) if $count == 0;
# authcats_loop populates the YUI planning button
my $auth_cats_loop = GetBudgetAuthCats($budget_period_id);
my $budget_period_startdate = $period->{'budget_period_startdate'};
my $budget_period_enddate = $period->{'budget_period_enddate'};
my $budget_period_locked = $period->{'budget_period_locked'};
my $budget_period_startdate = $period->{'budget_period_startdate'};
my $budget_period_enddate = $period->{'budget_period_enddate'};
my $budget_period_locked = $period->{'budget_period_locked'};
-my $output = $input->param("output");
-my $basename = $input->param("basename");
-my $del = $input->param("sep");
+my $output = $input->param("output") // q{};
+our $basename = $input->param("basename");
+our $del = $input->param("sep");
$authcat = 'Asort1' if not defined $authcat; # defaults to Asort if no authcat given
my $budget_id = $input->param('budget_id');
$authcat = 'Asort1' if not defined $authcat; # defaults to Asort if no authcat given
my $budget_id = $input->param('budget_id');
-my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}->{'borrowernumber'}:'' );
+my $budgets_ref = GetBudgetHierarchy(
+ $budget_period_id,
+ $show_mine ? $borrower_branchcode : '',
+ $show_mine ? $borrowernumber : ''
+);
push( @category_list, 'MONTHS' );
push( @category_list, 'ITEMTYPES' );
push( @category_list, 'BRANCHES' );
push( @category_list, 'MONTHS' );
push( @category_list, 'ITEMTYPES' );
push( @category_list, 'BRANCHES' );
} elsif ( $budget->{budget_permission} == 2 ) {
$budget_lock = 1 if $borrower_branchcode ne $budget->{budget_branchcode};
}
} elsif ( $budget->{budget_permission} == 2 ) {
$budget_lock = 1 if $borrower_branchcode ne $budget->{budget_branchcode};
}
);
my ( $actual, $estimated, $display ) = GetBudgetsPlanCell( \%cell, $period, $budget );
);
my ( $actual, $estimated, $display ) = GetBudgetsPlanCell( \%cell, $period, $budget );
- $cell{actual_amount} = sprintf( "%.2f", $actual );
- $cell{estimated_amount} = sprintf( "%.2f", $estimated );
+ $cell{actual_amount} = sprintf( "%.2f", $actual // 0 );
+ $cell{estimated_amount} = sprintf( "%.2f", $estimated // 0 );
$template->param(
authvals_row => \@authvals_row,
budget_lines => \@budget_lines,
$template->param(
authvals_row => \@authvals_row,
budget_lines => \@budget_lines,
authvals => \@authvals_row,
hide_cols_loop => \@hide_cols,
authvals => \@authvals_row,
hide_cols_loop => \@hide_cols,