Lines 131-141
elsif ( $op && $op eq 'cud-mod' ) {
Link Here
|
131 |
my @additional_fields; |
131 |
my @additional_fields; |
132 |
my $invoice_fields = Koha::AdditionalFields->search({ tablename => 'aqinvoices' }); |
132 |
my $invoice_fields = Koha::AdditionalFields->search({ tablename => 'aqinvoices' }); |
133 |
while ( my $field = $invoice_fields->next ) { |
133 |
while ( my $field = $invoice_fields->next ) { |
134 |
my $value = $input->param('additional_field_' . $field->id); |
134 |
my @field_values = $input->param( 'additional_field_' . $field->id ); |
135 |
push @additional_fields, { |
135 |
foreach my $value (@field_values) { |
136 |
id => $field->id, |
136 |
push @additional_fields, { |
137 |
value => $value, |
137 |
id => $field->id, |
138 |
}; |
138 |
value => $value, |
|
|
139 |
} if $value; |
140 |
} |
139 |
} |
141 |
} |
140 |
Koha::Acquisition::Invoices->find($invoiceid)->set_additional_fields(\@additional_fields); |
142 |
Koha::Acquisition::Invoices->find($invoiceid)->set_additional_fields(\@additional_fields); |
141 |
|
143 |
|
Lines 320-328
if ( $adjustments ) { $template->param( adjustments => $adjustments ); }
Link Here
|
320 |
my $invoice = Koha::Acquisition::Invoices->find($invoiceid); |
322 |
my $invoice = Koha::Acquisition::Invoices->find($invoiceid); |
321 |
$template->param( |
323 |
$template->param( |
322 |
available_additional_fields => Koha::AdditionalFields->search( { tablename => 'aqinvoices' } ), |
324 |
available_additional_fields => Koha::AdditionalFields->search( { tablename => 'aqinvoices' } ), |
323 |
additional_field_values => { map { |
325 |
additional_field_values => $invoice->get_additional_field_values_for_template, |
324 |
$_->field->id => $_->value |
|
|
325 |
} $invoice->additional_field_values->as_list }, |
326 |
); |
326 |
); |
327 |
|
327 |
|
328 |
$template->param( |
328 |
$template->param( |