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: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Laura_Escamilla 2026-03-12 16:04:34 +00:00 committed by Pedro Amorim
parent c420f23125
commit 51bdab13ee
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
2 changed files with 8 additions and 3 deletions

View File

@ -18,7 +18,7 @@
<fieldset class="rows"> <fieldset class="rows">
<ol> <ol>
<li> <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" /> <input id="text" type="text" size="25" name="supplier" autofocus="autofocus" />
</li> </li>
</ol> </ol>

View File

@ -59,8 +59,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $supplier = $query->param('supplier'); my $supplier = $query->param('supplier');
my @suppliers = Koha::Acquisition::Booksellers->search( 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; )->as_list;
#build result page #build result page