|
Lines 163-169
sub set_waiting {
Link Here
|
| 163 |
$requested_expiration = dt_from_string($self->expirationdate); |
163 |
$requested_expiration = dt_from_string($self->expirationdate); |
| 164 |
} |
164 |
} |
| 165 |
|
165 |
|
| 166 |
my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); |
|
|
| 167 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
166 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
| 168 |
my $calendar = Koha::Calendar->new( branchcode => $self->branchcode ); |
167 |
my $calendar = Koha::Calendar->new( branchcode => $self->branchcode ); |
| 169 |
|
168 |
|
|
Lines 172-178
sub set_waiting {
Link Here
|
| 172 |
my $patron = Koha::Patrons->find( {borrowernumber => $self->borrowernumber} ); |
171 |
my $patron = Koha::Patrons->find( {borrowernumber => $self->borrowernumber} ); |
| 173 |
my $item = Koha::Items->find( $self->itemnumber() ); |
172 |
my $item = Koha::Items->find( $self->itemnumber() ); |
| 174 |
my $hold = Koha::Holds->find( $self->reserve_id ); |
173 |
my $hold = Koha::Holds->find( $self->reserve_id ); |
| 175 |
# my $lastpickupdate = C4::Reserves->GetLastPickupDate( $hold, $item, $patron); |
|
|
| 176 |
|
174 |
|
| 177 |
# Get the controlbranch |
175 |
# Get the controlbranch |
| 178 |
my $controlbranch = C4::Reserves->GetReservesControlBranch( $item, $patron ); |
176 |
my $controlbranch = C4::Reserves->GetReservesControlBranch( $item, $patron ); |
|
Lines 184-200
sub set_waiting {
Link Here
|
| 184 |
$branchcode = $patron->branchcode; |
182 |
$branchcode = $patron->branchcode; |
| 185 |
} |
183 |
} |
| 186 |
|
184 |
|
| 187 |
warn $branchcode; |
185 |
my $issuingrule = Koha::IssuingRules->get_effective_issuing_rule({ |
| 188 |
warn $patron->categorycode; |
|
|
| 189 |
warn $item->itype; |
| 190 |
my $issuingrule = Koha::IssuingRules->get_effective_issuing_rule({ |
| 191 |
branchcode => $branchcode, |
186 |
branchcode => $branchcode, |
| 192 |
categorycode => $patron->categorycode, |
187 |
categorycode => $patron->categorycode, |
| 193 |
itemtype => $item->itype, |
188 |
itemtype => $item->itype, |
| 194 |
}); |
189 |
}); |
| 195 |
|
190 |
|
| 196 |
if ( defined $issuingrule->holdspickupwait && $issuingrule->holdspickupwait > 0) { |
191 |
if ( defined $issuingrule->holdspickupwait && $issuingrule->holdspickupwait > 0) { |
| 197 |
$expirationdate->add(days => $issuingrule->holdspickupwait); |
192 |
if ( defined($issuingrule) && defined $issuingrule->holdspickupwait && $issuingrule->holdspickupwait > 0 ) { #If holdspickupwait is <= 0, it means this feature is disabled for this type of material. |
|
|
193 |
if ($cancel_on_holidays) { |
| 194 |
$expirationdate->add(days => $issuingrule->holdspickupwait); |
| 195 |
} else { |
| 196 |
$expirationdate->add(days => $issuingrule->holdspickupwait); |
| 197 |
my $is_holiday = $calendar->is_holiday( $expirationdate ); |
| 198 |
while ( $is_holiday ) { |
| 199 |
$expirationdate->add( days => 1 ); |
| 200 |
$is_holiday = $calendar->is_holiday( $expirationdate ); |
| 201 |
} |
| 202 |
} |
| 203 |
} |
| 198 |
} |
204 |
} |
| 199 |
|
205 |
|
| 200 |
if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { |
206 |
if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { |
| 201 |
- |
|
|