@@ -, +, @@ one hold priority priority --- C4/Circulation.pm | 9 +++- installer/data/mysql/atomicupdate/bug_22789.perl | 3 ++ .../intranet-tmpl/prog/en/includes/holds_table.inc | 57 ++++++++++++++-------- .../prog/en/modules/reserve/request.tt | 3 +- reserve/request.pl | 1 + t/db_dependent/Holds.t | 26 +++++++++- 6 files changed, 75 insertions(+), 24 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2761,7 +2761,14 @@ sub CanBookBeRenewed { my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber); - $resfound = 0 if $resrec->{non_priority}; + # If next hold is non priority, then check if any hold with priority (non_priority = 0) exists for the same biblionumber. + if ( $resfound && $resrec->{non_priority} ) { + $resfound = Koha::Holds->search( + { biblionumber => $resrec->{biblionumber}, non_priority => 0 } ) + ->count > 0; + } + + # This item can fill one or more unfilled reserve, can those unfilled reserves # all be filled by other available items? --- a/installer/data/mysql/atomicupdate/bug_22789.perl +++ a/installer/data/mysql/atomicupdate/bug_22789.perl @@ -6,6 +6,9 @@ if( CheckVersion( $DBversion ) ) { # or perform some test and warn if( !column_exists( 'reserves', 'non_priority' ) ) { $dbh->do("ALTER TABLE reserves ADD COLUMN `non_priority` tinyint(1) NOT NULL DEFAULT 0 AFTER `item_level_hold` -- Is this a non priority hold"); + } + + if( !column_exists( 'old_reserves', 'non_priority' ) ) { $dbh->do("ALTER TABLE old_reserves ADD COLUMN `non_priority` tinyint(1) NOT NULL DEFAULT 0 AFTER `item_level_hold` -- Is this a non priority hold"); } --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -140,38 +140,53 @@