Bugzilla – Attachment 108078 Details for
Bug 25347
Add support for circulation status 11 ( claimed returned )
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25347: Add support for circulation status 11 ( claimed returned )
Bug-25347-Add-support-for-circulation-status-11--c.patch (text/plain), 2.89 KB, created by
Kyle M Hall (khall)
on 2020-08-11 14:58:55 UTC
(
hide
)
Description:
Bug 25347: Add support for circulation status 11 ( claimed returned )
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-08-11 14:58:55 UTC
Size:
2.89 KB
patch
obsolete
>From eb4332b16bba69895a43f4ef4643b02e2d113aa5 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 1 May 2020 12:16:48 -0400 >Subject: [PATCH] Bug 25347: Add support for circulation status 11 ( claimed > returned ) > >Now that we have return claims in Koha, we should support the SIP2 >"circulation status" value 11, "claimed returned". > >Test Plan: >1) Apply this patch >2) prove t/db_dependent/SIP/Transaction.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/SIP/ILS/Item.pm | 16 ++++++++++------ > t/db_dependent/SIP/Transaction.t | 16 +++++++++++++++- > 2 files changed, 25 insertions(+), 7 deletions(-) > >diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm >index d5e61362bd..0950864aa2 100644 >--- a/C4/SIP/ILS/Item.pm >+++ b/C4/SIP/ILS/Item.pm >@@ -16,20 +16,21 @@ use Template; > use C4::SIP::ILS::Transaction; > use C4::SIP::Sip qw(add_field); > >-use C4::Debug; >-use C4::Context; > use C4::Biblio; >-use C4::Items; > use C4::Circulation; >+use C4::Context; >+use C4::Debug; >+use C4::Items; > use C4::Members; > use C4::Reserves; >-use Koha::Database; > use Koha::Biblios; >+use Koha::Checkouts::ReturnClaims; > use Koha::Checkouts; >+use Koha::Database; > use Koha::DateUtils; >-use Koha::Patrons; >-use Koha::Items; > use Koha::Holds; >+use Koha::Items; >+use Koha::Patrons; > > =encoding UTF-8 > >@@ -261,6 +262,9 @@ sub sip_circulation_status { > if ( $self->{_object}->get_transfer ) { > return '10'; # in transit between libraries > } >+ elsif ( Koha::Checkouts::ReturnClaims->search({ itemnumber => $self->{_object}->id, resolution => undef })->count ) { >+ return '11'; # claimed returned >+ } > elsif ( $self->{borrowernumber} ) { > return '04'; # charged > } >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index a09cd347a5..770bcc1a14 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 => 2; >+ plan tests => 3; > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $library2 = $builder->build_object( { class => 'Koha::Libraries' } ); >@@ -436,5 +436,19 @@ subtest item_circulation_status => sub { > $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); > $status = $sip_item->sip_circulation_status; > is( $status, '10', "Item circulation status is in transit" ); >+ >+ $transfer->delete; >+ >+ my $claim = Koha::Checkouts::ReturnClaim->new({ >+ itemnumber => $item->id, >+ borrowernumber => $patron->id, >+ created_by => $patron->id, >+ })->store(); >+ >+ $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); >+ $status = $sip_item->sip_circulation_status; >+ is( $status, '11', "Item circulation status is claimed returned" ); >+ >+ $claim->delete; > }; > $schema->storage->txn_rollback; >-- >2.24.1 (Apple Git-126)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25347
:
104126
|
104173
|
108078
|
108080