Lines 419-442
$quantity //= 0;
Link Here
|
419 |
# Get additional fields |
419 |
# Get additional fields |
420 |
my $record; |
420 |
my $record; |
421 |
my @additional_fields = Koha::AdditionalFields->search({ tablename => 'aqorders' })->as_list; |
421 |
my @additional_fields = Koha::AdditionalFields->search({ tablename => 'aqorders' })->as_list; |
422 |
my %additional_field_values; |
422 |
my $additional_field_values; |
423 |
if ($ordernumber) { |
423 |
if ($ordernumber) { |
424 |
my $order = Koha::Acquisition::Orders->find($ordernumber); |
424 |
my $order = Koha::Acquisition::Orders->find($ordernumber); |
425 |
foreach my $value ($order->additional_field_values->as_list) { |
425 |
$additional_field_values = $order->get_additional_field_values_for_template; |
426 |
$additional_field_values{$value->field_id} = $value->value; |
|
|
427 |
} |
428 |
} elsif ( $biblionumber ) { |
426 |
} elsif ( $biblionumber ) { |
|
|
427 |
my %additional_field_values; |
429 |
foreach my $af (@additional_fields) { |
428 |
foreach my $af (@additional_fields) { |
|
|
429 |
my @marc_field_values; |
430 |
if ($af->marcfield) { |
430 |
if ($af->marcfield) { |
431 |
$record //= Koha::Biblios->find($biblionumber)->metadata->record; |
431 |
$record //= Koha::Biblios->find($biblionumber)->metadata->record; |
432 |
my ($field, $subfield) = split /\$/, $af->marcfield; |
432 |
my ($field, $subfield) = split /\$/, $af->marcfield; |
433 |
$additional_field_values{$af->id} = $record->subfield($field, $subfield); |
433 |
push @marc_field_values, $record->subfield( $field, $subfield ) if $record->subfield( $field, $subfield ); |
|
|
434 |
$additional_field_values{ $af->id } = \@marc_field_values; |
434 |
} |
435 |
} |
435 |
} |
436 |
} |
|
|
437 |
$additional_field_values = \%additional_field_values |
436 |
} |
438 |
} |
|
|
439 |
|
437 |
$template->param( |
440 |
$template->param( |
438 |
additional_fields => \@additional_fields, |
441 |
additional_fields => \@additional_fields, |
439 |
additional_field_values => \%additional_field_values, |
442 |
additional_field_values => $additional_field_values, |
440 |
); |
443 |
); |
441 |
|
444 |
|
442 |
# fill template |
445 |
# fill template |