Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill

This patch makes the method use the new
Koha::Item::Transfers->filter_by_current one.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Michal Urban <michalurban177@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2022-07-18 18:39:51 -03:00
parent 96e0402573
commit 9d527ad8a4
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -120,12 +120,7 @@ sub get_items_that_can_fill {
push @bibs_or_items, 'me.itemnumber' => { in => \@itemnumbers } if @itemnumbers;
push @bibs_or_items, 'me.biblionumber' => { in => \@biblionumbers } if @biblionumbers;
my @branchtransfers = Koha::Item::Transfers->search(
{
datearrived => undef,
datecancelled => undef,
},
{
my @branchtransfers = Koha::Item::Transfers->filter_by_current->search({}, {
columns => ['itemnumber'],
collapse => 1,
}