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

(-)a/C4/Reserves.pm (-2 / +4 lines)
Lines 1161-1169 sub ModReserveAffect { Link Here
1161
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1161
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1162
1162
1163
    $hold->itemnumber($itemnumber);
1163
    $hold->itemnumber($itemnumber);
1164
    $hold->set_waiting($transferToDo);
1165
1164
1166
    if( !$transferToDo ){
1165
    if( !$transferToDo ){
1166
        $hold->set_waiting();
1167
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1167
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1168
        my $transfers = Koha::Item::Transfers->search({
1168
        my $transfers = Koha::Item::Transfers->search({
1169
            itemnumber => $itemnumber,
1169
            itemnumber => $itemnumber,
Lines 1172-1178 sub ModReserveAffect { Link Here
1172
        while( my $transfer = $transfers->next ){
1172
        while( my $transfer = $transfers->next ){
1173
            $transfer->datearrived( dt_from_string() )->store;
1173
            $transfer->datearrived( dt_from_string() )->store;
1174
        };
1174
        };
1175
    }
1175
     } else {
1176
        $hold->set_transfer();
1177
     }
1176
1178
1177
1179
1178
    _FixPriority( { biblionumber => $biblionumber } );
1180
    _FixPriority( { biblionumber => $biblionumber } );
(-)a/Koha/Hold.pm (-6 / +15 lines)
Lines 153-172 sub delete { Link Here
153
    return $deleted;
153
    return $deleted;
154
}
154
}
155
155
156
=head3 set_transfer
157
158
=cut
159
160
sub set_transfer {
161
    my ( $self ) = @_;
162
163
    $self->priority(0);
164
    $self->found('T');
165
    $self->store();
166
167
    return $self;
168
}
169
156
=head3 set_waiting
170
=head3 set_waiting
157
171
158
=cut
172
=cut
159
173
160
sub set_waiting {
174
sub set_waiting {
161
    my ( $self, $transferToDo ) = @_;
175
    my ( $self ) = @_;
162
176
163
    $self->priority(0);
177
    $self->priority(0);
164
178
165
    if ($transferToDo) {
166
        $self->found('T')->store();
167
        return $self;
168
    }
169
170
    my $today = dt_from_string();
179
    my $today = dt_from_string();
171
    my $values = {
180
    my $values = {
172
        found => 'W',
181
        found => 'W',
(-)a/t/db_dependent/Hold.t (-2 / +1 lines)
Lines 224-230 subtest 'suspend() tests' => sub { Link Here
224
    is( $@->status, 'W', 'Exception gets the \'status\' parameter set correctly' );
224
    is( $@->status, 'W', 'Exception gets the \'status\' parameter set correctly' );
225
225
226
    # set hold found=T
226
    # set hold found=T
227
    $hold->set_waiting(1);
227
    $hold->set_transfer;
228
    throws_ok
228
    throws_ok
229
        { $hold->suspend_hold; }
229
        { $hold->suspend_hold; }
230
        'Koha::Exceptions::Hold::CannotSuspendFound',
230
        'Koha::Exceptions::Hold::CannotSuspendFound',
231
- 

Return to bug 12556