View | Details | Raw Unified | Return to bug 12063
Collapse All | Expand All

(-)a/Koha/Hold.pm (-2 / +9 lines)
Lines 127-132 sub set_waiting { Link Here
127
        waitingdate => $today->ymd,
127
        waitingdate => $today->ymd,
128
    };
128
    };
129
129
130
    my $requested_expiration;
131
    if ($self->expirationdate) {
132
        $requested_expiration = dt_from_string($self->expirationdate);
133
    }
134
130
    if ( C4::Context->preference("ExpireReservesMaxPickUpDelay") ) {
135
    if ( C4::Context->preference("ExpireReservesMaxPickUpDelay") ) {
131
        my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay");
136
        my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay");
132
        my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');
137
        my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');
Lines 139-145 sub set_waiting { Link Here
139
            $expirationdate = $calendar->days_forward( dt_from_string($self->waitingdate), $max_pickup_delay );
144
            $expirationdate = $calendar->days_forward( dt_from_string($self->waitingdate), $max_pickup_delay );
140
        }
145
        }
141
146
142
        $values->{expirationdate} = $expirationdate->ymd;
147
        # If patron's requested expiration date is prior to the
148
        # calculated one, we keep the patron's one.
149
        my $cmp = $requested_expiration ? DateTime->compare($requested_expiration, $expirationdate) : 0;
150
        $values->{expirationdate} = $cmp == -1 ? $requested_expiration->ymd : $expirationdate->ymd;
143
    }
151
    }
144
152
145
    $self->set($values)->store();
153
    $self->set($values)->store();
146
- 

Return to bug 12063