Bugzilla – Attachment 121740 Details for
Bug 28527
Transfers that are cancelled whilst in transit should still appear as 'in transit' until they are received
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28527: Update detail to display cancelled in transit transfers
Bug-28527-Update-detail-to-display-cancelled-in-tr.patch (text/plain), 2.43 KB, created by
Martin Renvoize (ashimema)
on 2021-06-09 13:33:39 UTC
(
hide
)
Description:
Bug 28527: Update detail to display cancelled in transit transfers
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-06-09 13:33:39 UTC
Size:
2.43 KB
patch
obsolete
>From 130c4578153f2694ee4c263ef2fc482d44c072af 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 28527: 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 47a86eb0bb..bd0ddd5f9a 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 fdda1bb2ab..32cbec7bfa 100644 >--- a/Koha/Item/Transfer.pm >+++ b/Koha/Item/Transfer.pm >@@ -123,8 +123,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 28527
:
121739
| 121740 |
121741
|
121742