Bug 42078: Allow vendor ID searches on serial subscription vendor search page

The serials vendor search currently only searches vendors by name.
This patch allows the search field to also match vendor IDs so
staff can locate vendors using either name or ID.

Test plan:
1. Go to Serials → New subscription.
2. Click to search for a vendor.
3. Search using part of a vendor name and confirm results appear.
4. Search using an exact vendor ID and confirm the correct vendor is returned.
5. Sign off and have a wonderful day! :D

Signed-off-by: Angela Berrett <angela.berrett@familysearch.org>
Signed-off-by: Angela <angela.berrett@familysearch.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Laura_Escamilla 2026-03-12 16:04:34 +00:00 committed by Lucas Gass
parent 430bfcd76b
commit 406a79026a
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 8 additions and 3 deletions

View File

@ -18,7 +18,7 @@
<fieldset class="rows">
<ol>
<li>
<label for="text">Vendor name: </label>
<label for="text">Vendor name or ID: </label>
<input id="text" type="text" size="25" name="supplier" autofocus="autofocus" />
</li>
</ol>

View File

@ -59,8 +59,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $supplier = $query->param('supplier');
my @suppliers = Koha::Acquisition::Booksellers->search(
{ name => { -like => "%$supplier%" } },
{ order_by => { -asc => 'name' } }
{
-or => [
name => { -like => "%$supplier%" },
id => $supplier,
]
},
{ order_by => { -asc => 'name' } }
)->as_list;
#build result page