From 61739318f9b07b892e8b01a65fd560914a095084 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 1 May 2020 12:24:44 -0400 Subject: [PATCH] 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 --- C4/SIP/ILS/Item.pm | 3 +++ t/db_dependent/SIP/Transaction.t | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 7dd774413a..b0aa89c0b8 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -262,6 +262,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->{patron} ) { return '04'; # charged } diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index 7dcc8499c6..8da9197835 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/t/db_dependent/SIP/Transaction.t @@ -397,7 +397,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' } ); @@ -448,5 +448,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; -- 2.24.2 (Apple Git-127)