Bugzilla – Attachment 94847 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 Koha::Patron->return_claims
Bug-14697-Add-KohaPatron-returnclaims.patch (text/plain), 3.13 KB, created by
Kyle M Hall
on 2019-10-29 19:20:46 UTC
(
hide
)
Description:
Bug 14697: Add Koha::Patron->return_claims
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2019-10-29 19:20:46 UTC
Size:
3.13 KB
patch
obsolete
>From 54dff2532d399cdaecf5b16f5eee997d4c269797 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 29 Oct 2019 12:28:53 -0300 >Subject: [PATCH] Bug 14697: Add Koha::Patron->return_claims > >Adds the ability to get a list of a patron's return claims directly >from the Patron object. > >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> >--- > Koha/Patron.pm | 12 +++++++ > t/db_dependent/Circulation/ReturnClaims.t | 42 ++++++++++++++++++++++- > 2 files changed, 53 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 92580725db..b25d30ab73 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1131,6 +1131,18 @@ sub old_holds { > return Koha::Old::Holds->_new_from_dbic($old_holds_rs); > } > >+=head3 return_claims >+ >+my $return_claims = $patron->return_claims >+ >+=cut >+ >+sub return_claims { >+ my ($self) = @_; >+ my $return_claims = $self->_result->return_claims_borrowernumbers; >+ return Koha::Checkouts::ReturnClaims->_new_from_dbic( $return_claims ); >+} >+ > =head3 notice_email_address > > my $email = $patron->notice_email_address; >diff --git a/t/db_dependent/Circulation/ReturnClaims.t b/t/db_dependent/Circulation/ReturnClaims.t >index 5b094ef626..3681650464 100644 >--- a/t/db_dependent/Circulation/ReturnClaims.t >+++ b/t/db_dependent/Circulation/ReturnClaims.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 1; >+use Test::More tests => 2; > use Test::MockModule; > use Test::Warn; > >@@ -93,4 +93,44 @@ subtest 'Test Koha::Checkout::claim_returned' => sub { > ok( $claim->created_on, "Claim created_on is set" ); > }; > >+subtest 'Test Koha::Patronn::return_claims' => sub { >+ plan tests => 7; >+ >+ 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, >+ notes => "Test note", >+ } >+ ); >+ >+ my $claims = $patron->return_claims; >+ >+ is( $claims->count, 1, "Got back correct number of claims" ); >+ >+ my $claim = $claims->next; >+ >+ is( $claim->issue_id, $checkout->id, "Claim issue id matches" ); >+ is( $claim->itemnumber, $item->id, "Claim itemnumber matches" ); >+ is( $claim->borrowernumber, $patron->id, "Claim borrowernumber matches" ); >+ is( $claim->notes, "Test note", "Claim notes match" ); >+ is( $claim->created_by, $patron->id, "Claim created_by matches" ); >+ ok( $claim->created_on, "Claim created_on is set" ); >+}; >+ > $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