Bug 24159: Set days_mode according to circ rules in 3 other places
There are 3 other occurrences where the new circ rule can be used: * C4::Circulation::checkHighHolds * Koha::Hold->set_waiting * misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl Test plan: * checkHighHolds Enable decreaseLoanHighHolds and fill decreaseLoanHighHoldsDuration Setup things to hit a "high demand" alert with a shortened due date Check an item out => The due date must be recalculated depending on the circ rule useDaysMode. * set_waiting Set ExcludeHolidaysFromMaxPickUpDelay to "1" (note that there is currently a bug in the description of the syspref, see bug 22381 comment 19) Mark a hold waiting The expiration date should have been set depending on the value of the circ rule. * TalkingTech cronjob Cannot test this Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
aea24e6e9e
commit
71e235751f
|
|
@ -1240,9 +1240,16 @@ sub checkHighHolds {
|
|||
|
||||
my $issuedate = dt_from_string();
|
||||
|
||||
my $calendar = Koha::Calendar->new( branchcode => $branchcode );
|
||||
|
||||
my $itype = $item_object->effective_itemtype;
|
||||
my $useDaysMode_value = Koha::CirculationRules->get_useDaysMode_effective_value(
|
||||
{
|
||||
categorycode => $borrower->{categorycode},
|
||||
itemtype => $itype,
|
||||
branchcode => $branchcode,
|
||||
}
|
||||
);
|
||||
my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => $useDaysMode_value );
|
||||
|
||||
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
|
||||
|
||||
my $decreaseLoanHighHoldsDuration = C4::Context->preference('decreaseLoanHighHoldsDuration');
|
||||
|
|
|
|||
11
Koha/Hold.pm
11
Koha/Hold.pm
|
|
@ -178,12 +178,21 @@ sub set_waiting {
|
|||
|
||||
my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay");
|
||||
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');
|
||||
my $calendar = Koha::Calendar->new( branchcode => $self->branchcode );
|
||||
|
||||
my $expirationdate = $today->clone;
|
||||
$expirationdate->add(days => $max_pickup_delay);
|
||||
|
||||
if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) {
|
||||
my $itemtype = $self->item ? $self->item->effective_itemtype : $self->biblio->itemtype;
|
||||
my $useDaysMode_value = Koha::CirculationRules->get_useDaysMode_effective_value(
|
||||
{
|
||||
categorycode => $self->borrower->categorycode,
|
||||
itemtype => $itemtype,
|
||||
branchcode => $self->branchcode,
|
||||
}
|
||||
);
|
||||
my $calendar = Koha::Calendar->new( branchcode => $self->branchcode, days_mode => $useDaysMode_value );
|
||||
|
||||
$expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ sub GetWaitingHolds {
|
|||
|
||||
my $patron_branchcode_filter = $patron_branchcode ? "AND borrowers.branchcode = '$patron_branchcode'" : q{};
|
||||
|
||||
my $query = "SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname,
|
||||
my $query = "SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, borrowers.categorycode,
|
||||
borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, reserves.waitingdate,
|
||||
reserves.branchcode AS site, branches.branchname AS site_name,
|
||||
TO_DAYS(NOW())-TO_DAYS(reserves.waitingdate) AS days_since_waiting
|
||||
|
|
@ -332,7 +332,16 @@ sub GetWaitingHolds {
|
|||
$sth->execute();
|
||||
my @results;
|
||||
while ( my $issue = $sth->fetchrow_hashref() ) {
|
||||
my $calendar = Koha::Calendar->new( branchcode => $issue->{'site'} );
|
||||
my $item = Koha::Items->find({ barcode => $issue->{barcode} });
|
||||
my $useDaysMode_value = Koha::CirculationRules->get_useDaysMode_effective_value(
|
||||
{
|
||||
categorycode => $issue->{categorycode},
|
||||
itemtype => $item->effective_itemtype,
|
||||
branchcode => $issue->{site},
|
||||
}
|
||||
);
|
||||
|
||||
my $calendar = Koha::Calendar->new( branchcode => $issue->{'site'}, days_mode => $useDaysMode_value );
|
||||
|
||||
my $waiting_date = dt_from_string( $issue->{waitingdate}, 'sql' );
|
||||
my $pickup_date = $waiting_date->clone->add( days => $pickupdelay );
|
||||
|
|
|
|||
Loading…
Reference in New Issue