@@ -, +, @@ --- C4/Biblio.pm | 5 +++++ cataloguing/additem.pl | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -98,6 +98,7 @@ use C4::Debug; use Koha::Caches; use Koha::Authority::Types; +use Koha::Acquisition::Booksellers; use Koha::Acquisition::Currencies; use Koha::Biblio::Metadatas; use Koha::Holds; @@ -1363,6 +1364,10 @@ descriptions rather than normal ones when they exist. sub GetAuthorisedValueDesc { my ( $tag, $subfield, $value, $framework, $tagslib, $category, $opac ) = @_; + if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.booksellerid' ) { + my $vendor = Koha::Acquisition::Booksellers->find($value); + return $vendor ? $vendor->name : $value; + } if ( !$category ) { return $value unless defined $tagslib->{$tag}->{$subfield}->{'authorised_value'}; --- a/cataloguing/additem.pl +++ a/cataloguing/additem.pl @@ -333,7 +333,25 @@ sub generate_subfield_form { id => $subfield_data{id}, value => $value, }; - } else { + } + elsif ($value && $subfieldlib->{kohafield} eq 'items.booksellerid' ) { + # It's linked with items.booksellerid (expected for "Source of acquisition") + my $vendors = Koha::Acquisition::Booksellers->search; + my @authorised_values; + my %authorised_lib; + while ( my $vendor = $vendors->next ) { + push @authorised_values, $vendor->id; + $authorised_lib{$vendor->id} = $vendor->name; + } + $subfield_data{marc_value} = { + type => 'select', + id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, + values => \@authorised_values, + labels => \%authorised_lib, + default => $value, + }; + } + else { # it's a standard field $subfield_data{marc_value} = { type => 'text', --