Lines 1444-1450
Return the relevant recall for this item
Link Here
|
1444 |
|
1444 |
|
1445 |
sub recall { |
1445 |
sub recall { |
1446 |
my ( $self ) = @_; |
1446 |
my ( $self ) = @_; |
1447 |
my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef }, { order_by => { -asc => 'recalldate' } }); |
1447 |
my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef }, { order_by => { -asc => 'recalldate' } })->as_list; |
1448 |
foreach my $recall (@recalls) { |
1448 |
foreach my $recall (@recalls) { |
1449 |
if ( $recall->item_level_recall and $recall->itemnumber == $self->itemnumber ){ |
1449 |
if ( $recall->item_level_recall and $recall->itemnumber == $self->itemnumber ){ |
1450 |
return $recall; |
1450 |
return $recall; |
Lines 1517-1523
sub can_be_recalled {
Link Here
|
1517 |
|
1517 |
|
1518 |
# check item availability |
1518 |
# check item availability |
1519 |
# items are unavailable for recall if they are lost, withdrawn or notforloan |
1519 |
# items are unavailable for recall if they are lost, withdrawn or notforloan |
1520 |
my @items = Koha::Items->search({ biblionumber => $self->biblionumber, itemlost => 0, withdrawn => 0, notforloan => 0 }); |
1520 |
my @items = Koha::Items->search({ biblionumber => $self->biblionumber, itemlost => 0, withdrawn => 0, notforloan => 0 })->as_list; |
1521 |
|
1521 |
|
1522 |
# if there are no available items at all, no recall can be placed |
1522 |
# if there are no available items at all, no recall can be placed |
1523 |
return 0 if ( scalar @items == 0 ); |
1523 |
return 0 if ( scalar @items == 0 ); |
Lines 1591-1597
Get the most relevant recall for this item.
Link Here
|
1591 |
sub check_recalls { |
1591 |
sub check_recalls { |
1592 |
my ( $self ) = @_; |
1592 |
my ( $self ) = @_; |
1593 |
|
1593 |
|
1594 |
my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, itemnumber => [ $self->itemnumber, undef ], status => [ 'R','O','W','T' ] }, { order_by => { -asc => 'recalldate' } }); |
1594 |
my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, itemnumber => [ $self->itemnumber, undef ], status => [ 'R','O','W','T' ] }, { order_by => { -asc => 'recalldate' } })->as_list; |
1595 |
|
1595 |
|
1596 |
my $recall; |
1596 |
my $recall; |
1597 |
# iterate through relevant recalls to find the best one. |
1597 |
# iterate through relevant recalls to find the best one. |