Bug 28382: Set trigger to 'Reserve' when actioning a reserve transfer

This patch sets the transfer trigger to 'Reserve' when the staff user
confirms they are transfering to fulfil a reserve.

Test plan
1 - Place a hold for delivery at Library B
2 - Sign in at Library A
3 - Browse to Circulation->Transfers
4 - Attempt to transfer an item on the title with the hold to Library B
5 - You get a notice that hold was found
6 - You have the option transfer the for the hold - click it
7 - Confirm hold is set to transit and transfer generated
8 - Check the branchtransfers table and confirm the 'reason' is
  'Reserve' not 'Manual'.

Signed-off-by: David Nind <david@davidnind.com>
JK: fix typo resver -> reserve
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

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-19 09:37:35 +01:00 committed by Kyle M Hall
parent dba0cc7cc2
commit 5079a9cb66

View file

@ -82,6 +82,7 @@ my $settransit;
my $request = $query->param('request') || ''; my $request = $query->param('request') || '';
my $borrowernumber = $query->param('borrowernumber') || 0; my $borrowernumber = $query->param('borrowernumber') || 0;
my $tobranchcd = $query->param('tobranchcd') || ''; my $tobranchcd = $query->param('tobranchcd') || '';
my $trigger = 'Manual';
my $ignoreRs = 0; my $ignoreRs = 0;
############ ############
@ -105,6 +106,7 @@ elsif ( $request eq "SetTransit" ) {
$ignoreRs = 1; $ignoreRs = 1;
$settransit = 1; $settransit = 1;
$reqmessage = 1; $reqmessage = 1;
$trigger = 'Reserve';
} }
elsif ( $request eq 'KillReserved' ) { elsif ( $request eq 'KillReserved' ) {
my $biblionumber = $query->param('biblionumber'); my $biblionumber = $query->param('biblionumber');
@ -132,7 +134,7 @@ if ($barcode) {
to_branch => $tobranchcd, to_branch => $tobranchcd,
barcode => $barcode, barcode => $barcode,
ignore_reserves => $ignoreRs, ignore_reserves => $ignoreRs,
trigger => 'Manual' trigger => $trigger
}); });
my $item = Koha::Items->find({ barcode => $barcode }); my $item = Koha::Items->find({ barcode => $barcode });
$found = $messages->{'ResFound'} unless $settransit; $found = $messages->{'ResFound'} unless $settransit;