From 6ac4542948c451595a154a5467e548a43e9817e8 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 17 May 2021 15:51:46 +0100 Subject: [PATCH] Bug 27064: (QA follow-up) Do not create transfer prior to accepting it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch prevents the cancellations we were seeing. Transfers were being created pre-emtively for reserves in branchtransfers before the librarian had selected their prefered action. As such, we were getting double lines in the branchtransfers table. Signed-off-by: Joonas Kylmälä Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- C4/Circulation.pm | 4 ++-- circ/branchtransfers.pl | 3 +-- .../intranet-tmpl/prog/en/modules/circ/branchtransfers.tt | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 10db0d226a..f0e39b7583 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -375,10 +375,10 @@ sub transferbook { # That'll save a database query. my ( $resfound, $resrec, undef ) = CheckReserves( $itemnumber ); - if ( $resfound and not $ignoreRs ) { + if ( $resfound ) { $resrec->{'ResFound'} = $resfound; $messages->{'ResFound'} = $resrec; - $dotransfer = 1; + $dotransfer = 0 unless $ignoreRs; } #actually do the transfer.... diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index 59b4f24fec..bb508f77a0 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -127,7 +127,6 @@ defined $barcode and $barcode =~ s/^\s*|\s*$//g; # FIXME: barcodeInputFilter if ($barcode) { ( $transferred, $messages ) = - transferbook({ from_branch => C4::Context->userenv->{'branch'}, to_branch => $tobranchcd, @@ -136,7 +135,7 @@ if ($barcode) { trigger => 'Manual' }); my $item = Koha::Items->find({ barcode => $barcode }); - $found = $messages->{'ResFound'}; + $found = $messages->{'ResFound'} unless $settransit; if ($transferred) { my %trsfitem; my $frbranchcd = C4::Context->userenv->{'branch'}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt index 4aedfc4c97..2ee5e9e3bc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt @@ -67,8 +67,8 @@ + [% IF ( waiting or transferred or processing ) %] - [% END %] @@ -93,7 +93,6 @@ - -- 2.39.5