Koha/t/db_dependent/Circulation
Joonas Kylmälä bd3852bc72 Bug 28520: Allow creating a transfer back automatically if a hold is canceled during transit
This fixes regression caused by "Bug 12362: Cancel transfer with hold
cancelation" where cancelled hold's transfer didn't show up in
intranet and opac because it create a new transfer that was not yet
put in in-transit state. The original idea of bug 12362 was to be able
to trigger transfer back home if a hold was cancelled (a regression
caused by bug 26078). However, we can do it more simply by setting the
$validTransfer variable true in the item check-in code when we are
dealing with Reserve transfers. More down in the AddReturn() code
there is also a check "and !$resfound" to make sure we only try to
trigger the transfer back home automatically if there is no hold
waiting at the current location the item arrived in.

It should be noted however that now we only display generic message
for the automatic transfer reason. Bug 12362 made the return display
as the reason "Transfer was cancelled whilst in transit". However,
since this fixes the original regressions caused by bug 26078 and
restores similar behaviour to that I think giving a more descriptive
message for example regarding a hold being cancelled can be considered
a further enhancement.

To test:
 1) Apply patch
 1) Have biblio with item in branch A
 2) Create a new hold with a pickup library to branch B
 3) Check-in the item at branch A and confirm the hold and transfer
 4) Cancel the hold
 5) Check-in the hold at branch B and notice it prompt to return it to
 branch A

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2021-06-18 10:46:41 -04:00
..
IssuingRules Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Branch.t Bug 28520: Allow creating a transfer back automatically if a hold is canceled during transit 2021-06-18 10:46:41 -04:00
CalcDateDue.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
CalcFine.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
CheckIfIssuedToPatron.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
CheckValidBarcode.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
dateexpiry.t Bug 7806: Fix remaining occurrences of 0000-00-00 2021-03-01 11:16:42 +01:00
GetHardDueDate.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
GetPendingOnSiteCheckouts.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
GetTopIssues.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
IsItemIssued.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
issue.t Bug 21301: (QA follow-up) Fix number of tests 2021-01-12 11:17:33 +01:00
MarkIssueReturned.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
NoIssuesChargeGuarantees.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
OfflineOperation.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
ReturnClaims.t Bug 25552: Simplify tests using build_sample_item 2021-02-01 17:25:22 +01:00
Returns.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
StoreLastBorrower.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
SwitchOnSiteCheckouts.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
TooMany.t Bug 26132: (follow-up) Add test to show errors in max issues amount calculation 2020-11-04 17:32:35 +01:00
transferbook.t Bug 27064: Correct transferbook.t tests to reflect new behaviour of transferbook() 2021-06-18 07:12:02 -04:00
transfers.t Bug 27896: Remove DeleteTransfer 2021-04-23 11:58:49 +02:00