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

(-)a/C4/SIP/ILS/Item.pm (-21 / +13 lines)
Lines 261-300 sub title_id { Link Here
261
}
261
}
262
262
263
sub sip_circulation_status {
263
sub sip_circulation_status {
264
    my $self = shift;
264
    my $self   = shift;
265
    my $server = shift;
265
    my $server = shift;
266
266
267
    # Defines what lost status means "missing" for this SIP account
267
    # Defines what lost status means "missing" for this SIP account
268
    my $missing_status = $server->{account}->{lost_status_for_missing};
268
    my $missing_status = $server->{account}->{lost_status_for_missing};
269
269
270
    if ( $self->{_object}->get_transfer ) {
270
    if ( $self->{_object}->get_transfer ) {
271
        return '10'; # in transit between libraries
271
        return '10';    # in transit between libraries
272
    }
272
    } elsif (
273
    elsif ( Koha::Checkouts::ReturnClaims->search({ itemnumber => $self->{_object}->id, resolution => undef })->count ) {
273
        Koha::Checkouts::ReturnClaims->search( { itemnumber => $self->{_object}->id, resolution => undef } )->count )
274
    {
274
        return '11';    # claimed returned
275
        return '11';    # claimed returned
275
    }
276
    } elsif ( $missing_status && $self->{itemlost} && $missing_status eq $self->{itemlost} ) {
276
    elsif ( $missing_status && $self->{itemlost} && $missing_status eq $self->{itemlost} ) {
277
        return '13';    # missing
277
        return '13';    # missing
278
    }
278
    } elsif ( $self->{itemlost} ) {
279
    elsif ( $self->{itemlost} ) {
280
        return '12';    # lost
279
        return '12';    # lost
281
    }
280
    } elsif ( $self->{borrowernumber} ) {
282
    elsif ( $self->{borrowernumber} ) {
283
        return '04';    # charged
281
        return '04';    # charged
284
    }
282
    } elsif ( grep { $_->{itemnumber} == $self->{itemnumber} } @{ $self->{hold_attached} } ) {
285
    elsif ( grep { $_->{itemnumber} == $self->{itemnumber}  } @{ $self->{hold_attached} } ) {
286
        return '08';    # waiting on hold shelf
283
        return '08';    # waiting on hold shelf
287
    }
284
    } elsif ( $self->{location} and $self->{location} eq 'CART' ) {
288
    elsif ( $self->{location} and $self->{location} eq 'CART' ) {
289
        return '09';    # waiting to be re-shelved
285
        return '09';    # waiting to be re-shelved
290
    }
286
    } elsif ( $self->{damaged} ) {
291
    elsif ( $self->{damaged} ) {
292
        return '01';    # damaged
287
        return '01';    # damaged
293
    }
288
    } elsif ( $self->{notforloan} < 0 ) {
294
    elsif ( $self->{notforloan} < 0 ) {
295
        return '02';    # on order
289
        return '02';    # on order
296
    }
290
    } else {
297
    else {
298
        return '03';    # available
291
        return '03';    # available
299
    }    # FIXME: 01-13 enumerated in spec.
292
    }    # FIXME: 01-13 enumerated in spec.
300
}
293
}
301
- 

Return to bug 34868