Bug 27064: (QA follow-up) Do not create transfer prior to accepting it

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ä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2021-05-17 15:51:46 +01:00 committed by Kyle M Hall
parent 8239e43793
commit 8b095aaf37
3 changed files with 4 additions and 6 deletions

View file

@ -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....

View file

@ -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'};

View file

@ -67,8 +67,8 @@
<input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
<input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" />
<input type="hidden" name="barcode" value="[% barcode | html %]" />
[% IF ( waiting or transferred or processing ) %]
<input type="hidden" name="barcode" value="[% barcode | html %]" />
<input type="hidden" name="request" value="KillWaiting" />
<input type="submit" value="Cancel" />
[% END %]
@ -93,7 +93,6 @@
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
<input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" />
<input type="hidden" name="barcode" value="[% barcode | html %]" />
<input type="hidden" name="request" value="KillReserved" />
<input type="submit" value="Cancel" />
</form>