Lines 3054-3061
sub CanBookBeRenewed {
Link Here
|
3054 |
if ( $item->current_holds->search( { non_priority => 0 } )->count ); |
3054 |
if ( $item->current_holds->search( { non_priority => 0 } )->count ); |
3055 |
|
3055 |
|
3056 |
|
3056 |
|
3057 |
my ($status, $matched_reserve, $fillable_holds) = CheckReserves($item); |
3057 |
my ($status, $matched_reserve, $possible_holds) = CheckReserves($item); |
3058 |
if ( $fillable_holds ) { |
3058 |
my @fillable_holds = (); |
|
|
3059 |
foreach my $possible_hold ( @{$possible_holds} ) { |
3060 |
push @fillable_holds, $possible_hold unless $possible_hold->{non_priority}; |
3061 |
} |
3062 |
if ( @fillable_holds ) { |
3059 |
if ( C4::Context->preference('AllowRenewalIfOtherItemsAvailable') ) { |
3063 |
if ( C4::Context->preference('AllowRenewalIfOtherItemsAvailable') ) { |
3060 |
|
3064 |
|
3061 |
# Get all other items that could possibly fill reserves |
3065 |
# Get all other items that could possibly fill reserves |
Lines 3066-3075
sub CanBookBeRenewed {
Link Here
|
3066 |
notforloan => 0, |
3070 |
notforloan => 0, |
3067 |
-not => { itemnumber => $item->itemnumber } })->as_list; |
3071 |
-not => { itemnumber => $item->itemnumber } })->as_list; |
3068 |
|
3072 |
|
3069 |
return ( 0, "on_reserve" ) if @{$fillable_holds} && (scalar @other_items < scalar @{$fillable_holds} ); |
3073 |
return ( 0, "on_reserve" ) if @fillable_holds && (scalar @other_items < scalar @fillable_holds ); |
3070 |
|
3074 |
|
3071 |
my %matched_items; |
3075 |
my %matched_items; |
3072 |
foreach my $possible_hold ( @{$fillable_holds} ) { |
3076 |
foreach my $possible_hold ( @fillable_holds ) { |
3073 |
my $fillable = 0; |
3077 |
my $fillable = 0; |
3074 |
my $patron_with_reserve = Koha::Patrons->find($possible_hold->{borrowernumber}); |
3078 |
my $patron_with_reserve = Koha::Patrons->find($possible_hold->{borrowernumber}); |
3075 |
|
3079 |
|
3076 |
- |
|
|