Bugzilla – Attachment 121686 Details for
Bug 28520
Cancelling a hold that is in transit hides item's transit status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28520: Update detail to display cancelled in transit transfers
Bug-28520-Update-detail-to-display-cancelled-in-tr.patch (text/plain), 2.43 KB, created by
Martin Renvoize (ashimema)
on 2021-06-07 15:12:06 UTC
(
hide
)
Description:
Bug 28520: Update detail to display cancelled in transit transfers
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-06-07 15:12:06 UTC
Size:
2.43 KB
patch
obsolete
>From 42d9ebdd627ee5c47e61ecb8d77656715a8ebb44 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 7 Jun 2021 14:05:24 +0100 >Subject: [PATCH] Bug 28520: Update detail to display cancelled in transit > transfers > >--- > Koha/Item.pm | 10 ++++++++-- > Koha/Item/Transfer.pm | 3 +-- > catalogue/detail.pl | 13 +++++++------ > 3 files changed, 16 insertions(+), 10 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 2bad020287..cd72020520 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -527,8 +527,14 @@ sub get_transfers { > my ($self) = @_; > my $transfer_rs = $self->_result->branchtransfers->search( > { >- datearrived => undef, >- datecancelled => undef >+ datearrived => undef, >+ [ >+ { datesent => undef, datecancelled => { '!=' => undef } }, >+ { >+ datesent => { '!=' => undef }, >+ datecancelled => { '!=' => undef } >+ } >+ ] > }, > { > order_by => >diff --git a/Koha/Item/Transfer.pm b/Koha/Item/Transfer.pm >index 4112b3fab9..45b4b9cc6f 100644 >--- a/Koha/Item/Transfer.pm >+++ b/Koha/Item/Transfer.pm >@@ -110,8 +110,7 @@ sub in_transit { > my ($self) = @_; > > return ( defined( $self->datesent ) >- && !defined( $self->datearrived ) >- && !defined( $self->datecancelled ) ); >+ && !defined( $self->datearrived ) ); > } > > =head3 receive >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 14b4f1794b..34ebd17a94 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -334,12 +334,13 @@ foreach my $item (@items) { > } > > # Check the transit status >- my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber}); >- if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) { >- $item->{transfertwhen} = $transfertwhen; >- $item->{transfertfrom} = $transfertfrom; >- $item->{transfertto} = $transfertto; >- $item->{nocancel} = 1; >+ my $transfers = $item_object->get_transfers; >+ my $transfer = $transfers->next; >+ if ( defined($transfer) && $transfer->in_transit ) { >+ $item->{transfertwhen} = $transfer->datesent; >+ $item->{transfertfrom} = $transfer->frombranch; >+ $item->{transfertto} = $transfer->tobranch; >+ $item->{nocancel} = 1; > } > > foreach my $f (qw( itemnotes )) { >-- >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 28520
:
121686
|
121689
|
121690
|
121691
|
121693
|
121708
|
121709
|
121710
|
121711
|
121712
|
121718
|
121719
|
121720
|
121721
|
121722
|
121843
|
121844
|
121845
|
121846
|
121847
|
121951
|
121952
|
121953
|
121954
|
121955
|
121985
|
122005
|
122006
|
122007