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

(-)a/C4/Reserves.pm (-2 / +4 lines)
Lines 1153-1161 sub ModReserveAffect { Link Here
1153
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1153
    my $already_on_shelf = $hold->found && $hold->found eq 'W';
1154
1154
1155
    $hold->itemnumber($itemnumber);
1155
    $hold->itemnumber($itemnumber);
1156
    $hold->set_waiting($transferToDo);
1157
1156
1158
    if( !$transferToDo ){
1157
    if( !$transferToDo ){
1158
        $hold->set_waiting();
1159
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1159
        _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf;
1160
        my $transfers = Koha::Item::Transfers->search({
1160
        my $transfers = Koha::Item::Transfers->search({
1161
            itemnumber => $itemnumber,
1161
            itemnumber => $itemnumber,
Lines 1164-1170 sub ModReserveAffect { Link Here
1164
        while( my $transfer = $transfers->next ){
1164
        while( my $transfer = $transfers->next ){
1165
            $transfer->datearrived( dt_from_string() )->store;
1165
            $transfer->datearrived( dt_from_string() )->store;
1166
        };
1166
        };
1167
    }
1167
     } else {
1168
        $hold->set_transfer();
1169
     }
1168
1170
1169
1171
1170
    _FixPriority( { biblionumber => $biblionumber } );
1172
    _FixPriority( { biblionumber => $biblionumber } );
(-)a/Koha/Hold.pm (-6 / +15 lines)
Lines 151-170 sub delete { Link Here
151
    return $deleted;
151
    return $deleted;
152
}
152
}
153
153
154
=head3 set_transfer
155
156
=cut
157
158
sub set_transfer {
159
    my ( $self ) = @_;
160
161
    $self->priority(0);
162
    $self->found('T');
163
    $self->store();
164
165
    return $self;
166
}
167
154
=head3 set_waiting
168
=head3 set_waiting
155
169
156
=cut
170
=cut
157
171
158
sub set_waiting {
172
sub set_waiting {
159
    my ( $self, $transferToDo ) = @_;
173
    my ( $self ) = @_;
160
174
161
    $self->priority(0);
175
    $self->priority(0);
162
176
163
    if ($transferToDo) {
164
        $self->found('T')->store();
165
        return $self;
166
    }
167
168
    my $today = dt_from_string();
177
    my $today = dt_from_string();
169
    my $values = {
178
    my $values = {
170
        found => 'W',
179
        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