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

(-)a/C4/SIP/ILS.pm (-9 / +8 lines)
Lines 147-154 sub checkout { Link Here
147
    elsif ( !$item ) {
147
    elsif ( !$item ) {
148
        $circ->screen_msg("Invalid Item");
148
        $circ->screen_msg("Invalid Item");
149
    }
149
    }
150
    elsif ( $item->{patron}
150
    elsif ( $item->{borrowernumber}
151
        && !_ci_cardnumber_cmp( $item->{patron}, $patron_id ) )
151
        && !_ci_cardnumber_cmp( $item->{borrowernumber}, $patron_id ) )
152
    {
152
    {
153
        $circ->screen_msg("Item checked out to another patron");
153
        $circ->screen_msg("Item checked out to another patron");
154
    }
154
    }
Lines 159-168 sub checkout { Link Here
159
159
160
            # If the item is already associated with this patron, then
160
            # If the item is already associated with this patron, then
161
            # we're renewing it.
161
            # we're renewing it.
162
            $circ->renew_ok( $item->{patron}
162
            $circ->renew_ok( $item->{borrowernumber}
163
                  && _ci_cardnumber_cmp( $item->{patron}, $patron_id ) );
163
                  && _ci_cardnumber_cmp( $item->{borrowernumber}, $patron_id ) );
164
164
165
            $item->{patron}   = $patron_id;
165
            $item->{borrowernumber}   = $patron_id;
166
            $item->{due_date} = $circ->{due};
166
            $item->{due_date} = $circ->{due};
167
            push( @{ $patron->{items} }, { barcode => $item_id } );
167
            push( @{ $patron->{items} }, { barcode => $item_id } );
168
            $circ->desensitize( !$item->magnetic_media );
168
            $circ->desensitize( !$item->magnetic_media );
Lines 226-232 sub checkin { Link Here
226
    } elsif ( $data->{messages}->{WasLost} && !$circ->ok && C4::Context->preference("BlockReturnOfLostItems") ) {
226
    } elsif ( $data->{messages}->{WasLost} && !$circ->ok && C4::Context->preference("BlockReturnOfLostItems") ) {
227
            $circ->screen_msg("Item lost, return not allowed");
227
            $circ->screen_msg("Item lost, return not allowed");
228
            syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item lost");
228
            syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item lost");
229
    } elsif ( !$item->{patron} ) {
229
    } elsif ( !$item->{borrowernumber} ) {
230
        if ( $checked_in_ok ) { # Mark checkin ok although book not checked out
230
        if ( $checked_in_ok ) { # Mark checkin ok although book not checked out
231
            $circ->ok( 1 );
231
            $circ->ok( 1 );
232
            syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - using checked_in_ok");
232
            syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - using checked_in_ok");
Lines 235-242 sub checkin { Link Here
235
            syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item not checked out");
235
            syslog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item not checked out");
236
        }
236
        }
237
    } elsif ( $circ->ok ) {
237
    } elsif ( $circ->ok ) {
238
        $circ->patron( $patron = C4::SIP::ILS::Patron->new( $item->{patron} ) );
238
        $circ->patron( $patron = C4::SIP::ILS::Patron->new( $item->{borrowernumber} ) );
239
        delete $item->{patron};
239
        delete $item->{borrowernumber};
240
        delete $item->{due_date};
240
        delete $item->{due_date};
241
        $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ];
241
        $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ];
242
    } else {
242
    } else {
243
- 

Return to bug 23403