Bug 37651: Add ConfirmFutureHolds to biblio->current_holds

Test plan:
Easy way is to run the unit tests in the next patch.
One call of biblio->current_holds is hidden in acqui/parcel.pl. The
table column "Item holds / Total holds" should now make a difference
for an order referring to an item having future holds.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2024-08-15 16:09:26 +02:00 committed by Lucas Gass
parent 503a81efe1
commit eedd4bcf2e
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 6 additions and 5 deletions

View File

@ -801,17 +801,18 @@ sub old_holds {
=head3 current_holds
my $holds = $biblio->current_holds
my $holds = $biblio->current_holds
Return the holds placed on this bibliographic record.
It does not include future holds.
Return the holds placed on this bibliographic record.
Respects the lookahead days in ConfirmFutureHolds pref.
=cut
sub current_holds {
my ($self) = @_;
my $dtf = Koha::Database->new->schema->storage->datetime_parser;
return $self->holds( { reservedate => { '<=' => $dtf->format_date(dt_from_string) } } );
my $dtf = Koha::Database->new->schema->storage->datetime_parser;
my $dt = dt_from_string()->add( days => C4::Context->preference('ConfirmFutureHolds') || 0 );
return $self->holds( { reservedate => { '<=' => $dtf->format_date($dt) } } );
}
=head3 biblioitem