Lines 72-78
my $op = $input->param('op')||"else";
Link Here
|
72 |
|
72 |
|
73 |
# get only the columns of aqbudgetperiods in budget_period_hashref |
73 |
# get only the columns of aqbudgetperiods in budget_period_hashref |
74 |
my @columns = Koha::Database->new()->schema->source('Aqbudgetperiod')->columns; |
74 |
my @columns = Koha::Database->new()->schema->source('Aqbudgetperiod')->columns; |
75 |
my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $input->param($_) ) : () } keys($input->Vars) } ; |
75 |
my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $input->param($_) ) : () } keys( %{$input->Vars()} ) } ; |
76 |
$budget_period_hashref->{budget_period_startdate} = dt_from_string( $input->param('budget_period_startdate') ); |
76 |
$budget_period_hashref->{budget_period_startdate} = dt_from_string( $input->param('budget_period_startdate') ); |
77 |
$budget_period_hashref->{budget_period_enddate} = dt_from_string( $input->param('budget_period_enddate') ); |
77 |
$budget_period_hashref->{budget_period_enddate} = dt_from_string( $input->param('budget_period_enddate') ); |
78 |
|
78 |
|
Lines 222-228
elsif ( $op eq 'duplicate_budget' ){
Link Here
|
222 |
|
222 |
|
223 |
# get only the columns of aqbudgets |
223 |
# get only the columns of aqbudgets |
224 |
my @columns = Koha::Database->new()->schema->source('Aqbudget')->columns; |
224 |
my @columns = Koha::Database->new()->schema->source('Aqbudget')->columns; |
225 |
my $new_entry = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $$entry{$_} ) : () } keys($entry) }; |
225 |
my $new_entry = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $$entry{$_} ) : () } keys(%$entry) }; |
226 |
# write it to db |
226 |
# write it to db |
227 |
my $new_id = AddBudget($new_entry); |
227 |
my $new_id = AddBudget($new_entry); |
228 |
$old_new{$old_id} = $new_id; |
228 |
$old_new{$old_id} = $new_id; |