Bugzilla – Attachment 127806 Details for
Bug 29519
Add option to resolve a return claim at checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29519: (follow-up) Use 'item' relationship
Bug-29519-follow-up-Use-item-relationship.patch (text/plain), 2.09 KB, created by
Martin Renvoize (ashimema)
on 2021-11-18 15:48:49 UTC
(
hide
)
Description:
Bug 29519: (follow-up) Use 'item' relationship
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-18 15:48:49 UTC
Size:
2.09 KB
patch
obsolete
>From f0ff995cfac99d2090abdb0d5d838229062b37b1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 18 Nov 2021 15:47:02 +0000 >Subject: [PATCH] Bug 29519: (follow-up) Use 'item' relationship > >This patch adds the missing 'item' relationship in >Checkouts::ReturnClaim and then uses it from the resolve method. > >This improve the reliability of the resolution code so it works when the >item has already been checked in (without having to check >Old::Checkouts). >--- > Koha/Checkouts/ReturnClaim.pm | 16 +++++++++++++++- > Koha/Schema/Result/ReturnClaim.pm | 15 +++++++++++++++ > 2 files changed, 30 insertions(+), 1 deletion(-) > >diff --git a/Koha/Checkouts/ReturnClaim.pm b/Koha/Checkouts/ReturnClaim.pm >index ff10d638f9..dbbe89a3d9 100644 >--- a/Koha/Checkouts/ReturnClaim.pm >+++ b/Koha/Checkouts/ReturnClaim.pm >@@ -102,6 +102,20 @@ sub patron { > return Koha::Patron->_new_from_dbic( $borrower ) if $borrower; > } > >+=head3 item >+ >+ my $item = $claim->item; >+ >+Return the return claim item >+ >+=cut >+ >+sub item { >+ my ( $self ) = @_; >+ my $item_rs = $self->_result->item; >+ return Koha::Item->_new_from_dbic( $item_rs ); >+} >+ > =head3 resolve > > $claim->resolve( >@@ -138,7 +152,7 @@ sub resolve { > )->store; > > if ( defined $params->{new_lost_status} ) { >- $self->checkout->item->itemlost( $params->{new_lost_status} )->store; >+ $self->item->itemlost( $params->{new_lost_status} )->store; > } > } > ); >diff --git a/Koha/Schema/Result/ReturnClaim.pm b/Koha/Schema/Result/ReturnClaim.pm >index 4e2c56c40b..9e67c7f0e7 100644 >--- a/Koha/Schema/Result/ReturnClaim.pm >+++ b/Koha/Schema/Result/ReturnClaim.pm >@@ -316,6 +316,21 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 item >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Item> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "item", >+ "Koha::Schema::Result::Item", >+ { itemnumber => "itemnumber" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ > sub koha_objects_class { > 'Koha::Checkouts::ReturnClaims'; > } >-- >2.20.1
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 29519
:
127802
|
127805
|
127806
|
127807
|
127808
|
127814
|
127815
|
127945
|
129700
|
130338