From b746d5a68b81101c4b23fe2e5ff9e219476f3f9f Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 26 Feb 2026 10:14:43 +0000 Subject: [PATCH] Bug 41900: Convert source of acquisition to a pre-populated vendor dropdown Test plan: 1) Choose a vendor and select to add to a basket from either a new or staged file 2) Stage and import the file 3) On the screen to add the orders, click on the 'Item information' tab 4) In subfield e - Source of acquisition there should be a dropdown of vendors with your chosen vendor pre-populated Signed-off-by: John Vinke --- acqui/addorderiso2709.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 12d0d25ed8..496e4fb25c 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -163,6 +163,24 @@ if ( $op eq "" ) { $cell = PrepareItemrecordDisplay( '', '', undef, '' ); $template->param( 'NoACQframework' => 1 ); } + + my @bookseller_field = grep( $_->{kohafield} eq "items.booksellerid", @{ $cell->{iteminformation} } ); + if ( scalar(@bookseller_field) ) { + 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; + } + $bookseller_field[0]->{marc_value} = { + type => 'select', + values => \@authorised_values, + labels => \%authorised_lib, + default => $booksellerid, + }; + } + my @itemloop; push @itemloop, $cell; -- 2.39.5