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>
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
}
};
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' } );
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;