From ed6a65c1ddacaa80fe825056cc77c3a3170af683 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 Signed-off-by: David Nind Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- 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 0950864aa2..056c214be4 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -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 } diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index 770bcc1a14..a11b6b48db 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/t/db_dependent/SIP/Transaction.t @@ -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; -- 2.39.5