# get only the columns of aqbudgetperiods in budget_period_hashref
my @columns = Koha::Database->new()->schema->source('Aqbudgetperiod')->columns;
my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => scalar $input->param($_) ) : () } keys( %{$input->Vars()} ) } ;
-$budget_period_hashref->{budget_period_startdate} = dt_from_string( $input->param('budget_period_startdate') );
-$budget_period_hashref->{budget_period_enddate} = dt_from_string( $input->param('budget_period_enddate') );
+$budget_period_hashref->{budget_period_startdate} = dt_from_string( scalar $input->param('budget_period_startdate') );
+$budget_period_hashref->{budget_period_enddate} = dt_from_string( scalar $input->param('budget_period_enddate') );
$searchfield =~ s/\,//g;
elsif ( $op eq 'duplicate_budget' ){
die "please specify a budget period id\n" if( !defined $budget_period_id || $budget_period_id eq '' );
- my $budget_period_startdate = dt_from_string $input->param('budget_period_startdate');
- my $budget_period_enddate = dt_from_string $input->param('budget_period_enddate');
+ my $budget_period_startdate = dt_from_string scalar $input->param('budget_period_startdate');
+ my $budget_period_enddate = dt_from_string scalar $input->param('budget_period_enddate');
my $budget_period_description = $input->param('budget_period_description');
my $amount_change_percentage = $input->param('amount_change_percentage');
my $amount_change_round_increment = $input->param('amount_change_round_increment');