Lines 1461-1467
Return the relevant recall for this item
Link Here
|
1461 |
|
1461 |
|
1462 |
sub recall { |
1462 |
sub recall { |
1463 |
my ( $self ) = @_; |
1463 |
my ( $self ) = @_; |
1464 |
my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef }, { order_by => { -asc => 'recalldate' } }); |
1464 |
my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef }, { order_by => { -asc => 'recalldate' } })->as_list; |
1465 |
foreach my $recall (@recalls) { |
1465 |
foreach my $recall (@recalls) { |
1466 |
if ( $recall->item_level_recall and $recall->itemnumber == $self->itemnumber ){ |
1466 |
if ( $recall->item_level_recall and $recall->itemnumber == $self->itemnumber ){ |
1467 |
return $recall; |
1467 |
return $recall; |
Lines 1534-1540
sub can_be_recalled {
Link Here
|
1534 |
|
1534 |
|
1535 |
# check item availability |
1535 |
# check item availability |
1536 |
# items are unavailable for recall if they are lost, withdrawn or notforloan |
1536 |
# items are unavailable for recall if they are lost, withdrawn or notforloan |
1537 |
my @items = Koha::Items->search({ biblionumber => $self->biblionumber, itemlost => 0, withdrawn => 0, notforloan => 0 }); |
1537 |
my @items = Koha::Items->search({ biblionumber => $self->biblionumber, itemlost => 0, withdrawn => 0, notforloan => 0 })->as_list; |
1538 |
|
1538 |
|
1539 |
# if there are no available items at all, no recall can be placed |
1539 |
# if there are no available items at all, no recall can be placed |
1540 |
return 0 if ( scalar @items == 0 ); |
1540 |
return 0 if ( scalar @items == 0 ); |
Lines 1608-1614
Get the most relevant recall for this item.
Link Here
|
1608 |
sub check_recalls { |
1608 |
sub check_recalls { |
1609 |
my ( $self ) = @_; |
1609 |
my ( $self ) = @_; |
1610 |
|
1610 |
|
1611 |
my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, itemnumber => [ $self->itemnumber, undef ], status => [ 'R','O','W','T' ] }, { order_by => { -asc => 'recalldate' } }); |
1611 |
my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, itemnumber => [ $self->itemnumber, undef ], status => [ 'R','O','W','T' ] }, { order_by => { -asc => 'recalldate' } })->as_list; |
1612 |
|
1612 |
|
1613 |
my $recall; |
1613 |
my $recall; |
1614 |
# iterate through relevant recalls to find the best one. |
1614 |
# iterate through relevant recalls to find the best one. |