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

(-)a/C4/SIP/ILS.pm (-17 / +20 lines)
Lines 211-239 sub checkin { Link Here
211
    else {
211
    else {
212
        $circ->alert(1);
212
        $circ->alert(1);
213
        $circ->alert_type(99);
213
        $circ->alert_type(99);
214
        $circ->ok( 0 );
214
        $circ->screen_msg('Invalid Item');
215
        $circ->screen_msg('Invalid Item');
216
        return $circ;
215
    }
217
    }
216
218
217
    # It's ok to check it in if it exists, and if it was checked out
219
    if( $circ->ok == 0 && $circ->alert_type == 98 ) { # data corruption
218
    # or it was not checked out but the checked_in_ok flag was set
220
        $circ->screen_msg("Checkin failed: data problem");
219
    $circ->ok( ( $checked_in_ok && $item ) || ( $item && $item->{patron} ) );
221
        syslog( "LOG_WARNING", "Problem with issue_id in issues and old_issues; check the about page" );
220
    syslog("LOG_DEBUG", "C4::SIP::ILS::checkin - using checked_in_ok") if $checked_in_ok;
222
    } elsif( !$item->{patron} ) {
221
223
        if( $checked_in_ok ) { # Mark checkin ok although book not checked out
222
    if ( !defined( $item->{patron} ) ) {
224
            $circ->ok( 1 );
223
        $circ->screen_msg("Item not checked out") unless $checked_in_ok;
225
            syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - using checked_in_ok");
224
	syslog("LOG_DEBUG", "C4::SIP::ILS::checkin - item not checked out");
226
        } else {
225
    }
227
            $circ->screen_msg("Item not checked out");
226
    else {
228
            syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item not checked out");
227
        if ( $circ->ok ) {
228
            $circ->patron( $patron = C4::SIP::ILS::Patron->new( $item->{patron} ) );
229
            delete $item->{patron};
230
            delete $item->{due_date};
231
            $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ];
232
        }
229
        }
230
    } elsif( $circ->ok ) {
231
        $circ->patron( $patron = C4::SIP::ILS::Patron->new( $item->{patron} ) );
232
        delete $item->{patron};
233
        delete $item->{due_date};
234
        $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ];
235
    } else {
236
        $circ->screen_msg("Checkin failed");
237
        syslog( "LOG_WARNING", "AddReturn false, but we have a patron" );
233
    }
238
    }
234
239
235
    # END TRANSACTION
236
237
    return $circ;
240
    return $circ;
238
}
241
}
239
242
(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-2 / +3 lines)
Lines 72-78 sub do_checkin { Link Here
72
    # biblionumber, biblioitemnumber, itemnumber
72
    # biblionumber, biblioitemnumber, itemnumber
73
    # borrowernumber, reservedate, branchcode
73
    # borrowernumber, reservedate, branchcode
74
    # cancellationdate, found, reservenotes, priority, timestamp
74
    # cancellationdate, found, reservenotes, priority, timestamp
75
75
    if( $messages->{DataCorrupted} ) {
76
        $self->alert_type('98');
77
    }
76
    if ($messages->{BadBarcode}) {
78
    if ($messages->{BadBarcode}) {
77
        $self->alert_type('99');
79
        $self->alert_type('99');
78
    }
80
    }
79
- 

Return to bug 18996