Bugzilla – Attachment 119900 Details for
Bug 12362
Branch transfer records orphaned on cancelled holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12362: Reverse transfer upon cancellation
Bug-12362-Reverse-transfer-upon-cancellation.patch (text/plain), 1.77 KB, created by
Martin Renvoize (ashimema)
on 2021-04-20 09:59:17 UTC
(
hide
)
Description:
Bug 12362: Reverse transfer upon cancellation
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-04-20 09:59:17 UTC
Size:
1.77 KB
patch
obsolete
>From aa25df39bbf7fed85a53228b1921e4b337450884 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 22 Mar 2021 14:36:42 +0000 >Subject: [PATCH] Bug 12362: Reverse transfer upon cancellation > >This patch adds a reverse transfer if a transfer is cancelled whilst it >is in transit. This makes sure the item returns to it's original >location. > >Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Item/Transfer.pm | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/Koha/Item/Transfer.pm b/Koha/Item/Transfer.pm >index 96e652df28..aded4e23a5 100644 >--- a/Koha/Item/Transfer.pm >+++ b/Koha/Item/Transfer.pm >@@ -18,6 +18,7 @@ package Koha::Item::Transfer; > use Modern::Perl; > > use Carp; >+use Try::Tiny; > > use C4::Items; > >@@ -133,14 +134,24 @@ sub cancel { > error => "The 'reason' parameter is mandatory" ) > unless defined($params->{reason}); > >+ my $in_transit = $self->in_transit; >+ > # Throw exception if item is in transit already >- Koha::Exceptions::Item::Transfer::InTransit->throw() if ( !$params->{force} && $self->in_transit ); >+ Koha::Exceptions::Item::Transfer::InTransit->throw() if ( !$params->{force} && $in_transit ); > > # Update the cancelled date > $self->set( > { datecancelled => dt_from_string, cancellation_reason => $params->{reason} } ) > ->store; > >+ # Set up return transfer if transfer was force cancelled whilst in transit >+ # NOTE: We don't catch here, as we're happy to fail if there are already >+ # other transfers in the queue. >+ try { >+ $self->item->request_transfer( >+ { to => $self->frombranch, reason => 'TransferCancellation' } ); >+ }; >+ > return $self; > } > >-- >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 12362
:
118607
|
118608
|
118609
|
118611
|
118819
|
118820
|
118821
|
119762
|
119763
|
119764
|
119898
|
119899
| 119900 |
119901
|
119902