Bugzilla – Attachment 94845 Details for
Bug 14697
Extend and enhance "Claims returned" lost status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14697: Add return claim handling to AddReturn
Bug-14697-Add-return-claim-handling-to-AddReturn.patch (text/plain), 3.03 KB, created by
Kyle M Hall (khall)
on 2019-10-29 19:20:38 UTC
(
hide
)
Description:
Bug 14697: Add return claim handling to AddReturn
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-10-29 19:20:38 UTC
Size:
3.03 KB
patch
obsolete
>From 5a22847a99cc28d409b2819ed2aaac8c52a14630 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 29 Oct 2019 12:28:24 -0300 >Subject: [PATCH] Bug 14697: Add return claim handling to AddReturn > >This adds the ability to alert a librarian of an item claimed as returned is actually returned. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> >--- > C4/Circulation.pm | 14 ++++++++++++++ > t/db_dependent/Circulation/Returns.t | 27 ++++++++++++++++++++++++++- > 2 files changed, 40 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 5880abe691..44adcee711 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -60,6 +60,7 @@ use Koha::Account::Offsets; > use Koha::Config::SysPrefs; > use Koha::Charges::Fees; > use Koha::Util::SystemPreferences; >+use Koha::Checkouts::ReturnClaims; > use Carp; > use List::MoreUtils qw( uniq any ); > use Scalar::Util qw( looks_like_number ); >@@ -2127,6 +2128,19 @@ sub AddReturn { > } > } > >+ if ( C4::Context->preference('ClaimReturnedLostValue') ) { >+ my $claims = Koha::Checkouts::ReturnClaims->search( >+ { >+ itemnumber => $item->id, >+ resolution => undef, >+ } >+ ); >+ >+ if ( $claims->count ) { >+ $messages->{ReturnClaims} = $claims; >+ } >+ } >+ > return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} )); > } > >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index 41f7736bec..69ab1abc81 100644 >--- a/t/db_dependent/Circulation/Returns.t >+++ b/t/db_dependent/Circulation/Returns.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > use Test::MockModule; > use Test::Warn; > >@@ -339,4 +339,29 @@ subtest 'BlockReturnOfLostItems' => sub { > is( $doreturn, 1, "Without BlockReturnOfLostItems, a checkin of a lost item should not be blocked"); > }; > >+subtest 'Checkin of an item claimed as returned should generate a message' => sub { >+ plan tests => 1; >+ >+ t::lib::Mocks::mock_preference('ClaimReturnedLostValue', 1); >+ my $biblio = $builder->build_object( { class => 'Koha::Biblios' } ); >+ my $item = $builder->build_object( >+ { >+ class => 'Koha::Items', >+ value => { >+ biblionumber => $biblio->biblionumber, >+ notforloan => 0, >+ itemlost => 0, >+ withdrawn => 0, >+ } >+ } >+ ); >+ my $patron = $builder->build_object({class => 'Koha::Patrons'}); >+ my $checkout = AddIssue( $patron->unblessed, $item->barcode ); >+ >+ $checkout->claim_returned({ created_by => $patron->id }); >+ >+ my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode); >+ ok( $messages->{ReturnClaims}, "ReturnClaims is in messages for return of a claimed as returned itm" ); >+}; >+ > $schema->storage->txn_rollback; >-- >2.21.0 (Apple Git-122)
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 14697
:
92407
|
92408
|
92409
|
92410
|
92962
|
92963
|
92964
|
92965
|
93005
|
93006
|
93007
|
93008
|
93012
|
93013
|
93014
|
93015
|
93017
|
93038
|
93039
|
93040
|
93041
|
93042
|
93061
|
93062
|
93063
|
93064
|
93065
|
93952
|
93953
|
93954
|
93955
|
93956
|
93957
|
93959
|
94842
|
94843
|
94844
| 94845 |
94846
|
94847
|
94848
|
94849
|
94850
|
94851
|
94852
|
94853
|
94854
|
94857
|
94877
|
94878