Bug 34868: (QA follow-up) Tidy sip_circulation_status

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kyle M Hall 2023-11-07 14:30:04 -05:00 committed by Tomas Cohen Arazi
parent e172b279c3
commit 2120e3d4c8
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 13 additions and 20 deletions

View File

@ -261,40 +261,33 @@ sub title_id {
}
sub sip_circulation_status {
my $self = shift;
my $self = shift;
my $server = shift;
# Defines what lost status means "missing" for this SIP account
my $missing_status = $server->{account}->{lost_status_for_missing};
if ( $self->{_object}->get_transfer ) {
return '10'; # in transit between libraries
}
elsif ( Koha::Checkouts::ReturnClaims->search({ itemnumber => $self->{_object}->id, resolution => undef })->count ) {
return '10'; # in transit between libraries
} elsif (
Koha::Checkouts::ReturnClaims->search( { itemnumber => $self->{_object}->id, resolution => undef } )->count )
{
return '11'; # claimed returned
}
elsif ( $missing_status && $self->{itemlost} && $missing_status eq $self->{itemlost} ) {
} elsif ( $missing_status && $self->{itemlost} && $missing_status eq $self->{itemlost} ) {
return '13'; # missing
}
elsif ( $self->{itemlost} ) {
} elsif ( $self->{itemlost} ) {
return '12'; # lost
}
elsif ( $self->{borrowernumber} ) {
} elsif ( $self->{borrowernumber} ) {
return '04'; # charged
}
elsif ( grep { $_->{itemnumber} == $self->{itemnumber} } @{ $self->{hold_attached} } ) {
} elsif ( grep { $_->{itemnumber} == $self->{itemnumber} } @{ $self->{hold_attached} } ) {
return '08'; # waiting on hold shelf
}
elsif ( $self->{location} and $self->{location} eq 'CART' ) {
} elsif ( $self->{location} and $self->{location} eq 'CART' ) {
return '09'; # waiting to be re-shelved
}
elsif ( $self->{damaged} ) {
} elsif ( $self->{damaged} ) {
return '01'; # damaged
}
elsif ( $self->{notforloan} < 0 ) {
} elsif ( $self->{notforloan} < 0 ) {
return '02'; # on order
}
else {
} else {
return '03'; # available
} # FIXME: 01-13 enumerated in spec.
}