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

(-)a/C4/SIP/ILS.pm (-1 / +1 lines)
Lines 243-249 sub checkin { Link Here
243
            siplog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item not checked out");
243
            siplog("LOG_DEBUG", "C4::SIP::ILS::Checkin - item not checked out");
244
        }
244
        }
245
    } elsif ( $circ->ok ) {
245
    } elsif ( $circ->ok ) {
246
        $circ->patron( $patron = C4::SIP::ILS::Patron->new( $item->{borrowernumber} ) );
246
        $circ->patron( $patron = C4::SIP::ILS::Patron->new( { borrowernumber => $item->{borrowernumber} } ) );
247
        delete $item->{borrowernumber};
247
        delete $item->{borrowernumber};
248
        delete $item->{due_date};
248
        delete $item->{due_date};
249
        $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ];
249
        $patron->{items} = [ grep { $_ ne $item_id } @{ $patron->{items} } ];
(-)a/C4/SIP/ILS/Patron.pm (-3 / +15 lines)
Lines 38-45 sub new { Link Here
38
    my ($class, $patron_id) = @_;
38
    my ($class, $patron_id) = @_;
39
    my $type = ref($class) || $class;
39
    my $type = ref($class) || $class;
40
    my $self;
40
    my $self;
41
    my $patron = Koha::Patrons->find( { cardnumber => $patron_id } )
41
42
      || Koha::Patrons->find( { userid => $patron_id } );
42
    my $patron;
43
    if ( ref $patron_id eq "HASH" ) {
44
        if ( $patron_id->{borrowernumber} ) {
45
            $patron = Koha::Patrons->find( $patron_id->{borrowernumber} );
46
        } elsif ( $patron_id->{cardnumber} ) {
47
            $patron = Koha::Patrons->find( { cardnumber => $patron_id->{cardnumber} } );
48
        } elsif ( $patron_id->{userid} ) {
49
            $patron = Koha::Patrons->find( { userid => $patron_id->{userid} } );
50
        }
51
    } else {
52
        $patron = Koha::Patrons->find( { cardnumber => $patron_id } )
53
            || Koha::Patrons->find( { userid => $patron_id } );
54
    }
55
43
    $debug and warn "new Patron: " . Dumper($patron->unblessed) if $patron;
56
    $debug and warn "new Patron: " . Dumper($patron->unblessed) if $patron;
44
    unless ($patron) {
57
    unless ($patron) {
45
        siplog("LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id);
58
        siplog("LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id);
46
- 

Return to bug 27014