Bugzilla – Attachment 71235 Details for
Bug 19530
Prevent multiple transfers from existing for one item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19530: Prevent multiple transfers from existing for one item
Bug-19530-Prevent-multiple-transfers-from-existing.patch (text/plain), 2.49 KB, created by
Josef Moravec
on 2018-02-05 16:14:54 UTC
(
hide
)
Description:
Bug 19530: Prevent multiple transfers from existing for one item
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-02-05 16:14:54 UTC
Size:
2.49 KB
patch
obsolete
>From 2140e49df58615574c8c2f0ee295dd71547ca487 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 25 Oct 2017 14:24:18 -0400 >Subject: [PATCH] Bug 19530: Prevent multiple transfers from existing for one > item > >We have found multiple open branch transfers for a given item. While I'm not sure how it is happening at this point, it seems that it would make sense to cancel any existing branch transfers when initiating a new one. > >Test Plan: >1) prove t/db_dependent/Circulation/transfers.t > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Items.pm | 2 ++ > t/db_dependent/Circulation/transfers.t | 19 ++++++++++++++++++- > 2 files changed, 20 insertions(+), 1 deletion(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index a7154be..241aae0 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -622,6 +622,8 @@ sub ModItemTransfer { > # Remove the 'shelving cart' location status if it is being used. > CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") ); > >+ $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ?", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber); >+ > #new entry in branchtransfers.... > my $sth = $dbh->prepare( > "INSERT INTO branchtransfers (itemnumber, frombranch, datesent, tobranch) >diff --git a/t/db_dependent/Circulation/transfers.t b/t/db_dependent/Circulation/transfers.t >index df63437..dc3a9e8 100644 >--- a/t/db_dependent/Circulation/transfers.t >+++ b/t/db_dependent/Circulation/transfers.t >@@ -23,10 +23,11 @@ use C4::Circulation; > use Koha::Database; > use Koha::DateUtils; > use DateTime::Duration; >+use Koha::Item::Transfers; > > use t::lib::TestBuilder; > >-use Test::More tests => 22; >+use Test::More tests => 24; > use Test::Deep; > > BEGIN { >@@ -192,5 +193,21 @@ cmp_deeply( > "Barcode and itemnumber for same item both generate same TransferSlip" > ); > >+$dbh->do("DELETE FROM branchtransfers"); >+ModItemTransfer( >+ $item_id1, >+ $branchcode_1, >+ $branchcode_2 >+); >+my $transfer = Koha::Item::Transfers->search()->next(); >+ModItemTransfer( >+ $item_id1, >+ $branchcode_1, >+ $branchcode_2 >+); >+$transfer->{_result}->discard_changes; >+ok( $transfer->datearrived, 'Date arrived is set when new transfer is initiated' ); >+is( $transfer->comments, "Canceled, new transfer from $branchcode_1 to $branchcode_2 created" ); >+ > $schema->storage->txn_rollback; > >-- >2.1.4
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 19530
:
68541
|
68573
|
68574
|
71065
|
71066
| 71235 |
71236
|
71237