Bug 25348: Add support for circulation status 12 ( lost )

We should support the SIP2 "circulation status" value 12, "lost".

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Transaction.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Kyle M Hall 2020-05-01 12:24:44 -04:00 committed by Jonathan Druart
parent ca44a3f2ca
commit ed6a65c1dd
2 changed files with 9 additions and 1 deletions

View File

@ -265,6 +265,9 @@ sub sip_circulation_status {
elsif ( Koha::Checkouts::ReturnClaims->search({ itemnumber => $self->{_object}->id, resolution => undef })->count ) {
return '11'; # claimed returned
}
elsif ( $self->{itemlost} ) {
return '12'; # lost
}
elsif ( $self->{borrowernumber} ) {
return '04'; # charged
}

View File

@ -399,7 +399,7 @@ subtest checkin_withdrawn => sub {
};
subtest item_circulation_status => sub {
plan tests => 3;
plan tests => 4;
my $library = $builder->build_object( { class => 'Koha::Libraries' } );
my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
@ -450,5 +450,10 @@ subtest item_circulation_status => sub {
is( $status, '11', "Item circulation status is claimed returned" );
$claim->delete;
$item->itemlost(1)->store();
$sip_item = C4::SIP::ILS::Item->new( $item->barcode );
$status = $sip_item->sip_circulation_status;
is( $status, '12', "Item circulation status is lost" );
};
$schema->storage->txn_rollback;