Browse Source

Bug 24175: Take advantage of Koha::Item->holds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Jonathan Druart 3 years ago
committed by Martin Renvoize
parent
commit
d2bdccdb64
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 10
      C4/SIP/ILS/Transaction/Hold.pm

10
C4/SIP/ILS/Transaction/Hold.pm

@ -86,14 +86,10 @@ sub drop_hold {
$self->ok(0);
return $self;
}
my $item = Koha::Items->find({ barcode => $self->{item}->id });
my $holds = Koha::Holds->search(
{
biblionumber => $item->biblionumber,
itemnumber => $item->itemnumber,
borrowernumber => $patron->borrowernumber
}
);
my $holds = $item->holds->search({ borrowernumber => $patron->borrowernumber });
return $self unless $holds->count;
$holds->next->cancel;

Loading…
Cancel
Save