Bug 21754: Automatically clean up outstanding transfers on lost items
authorAlex Buckley <alexbuckley@catalyst.net.nz>
Wed, 31 Oct 2018 10:27:41 +0000 (10:27 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 26 Dec 2018 20:47:08 +0000 (20:47 +0000)
commit66f1605c59763613a4e955fd259a845e4fc06324
tree02b3c27aa8c6e9607e1842a25b09dac7fd85c149
parent3c14a0d3526351fde4d785b5f60117f62edea5a9
Bug 21754: Automatically clean up outstanding transfers on lost items

This is an alternative to bug 21732 as transfers are automatically cancelled on marking an item lost, and the items holding rbanch is set to the transfers source ('from') branch.

When an item is marked as lost, the routine should also clean up any
outstanding transfers.

Also added tests to t/db_dependent/Circulation.t which check:
* If transfer is automatically deleted when item is marked as lost
* If the items holdingbranch automatically changes when item with
transfers on it is marked as lost.

Test plan:
1. Find a item which is in transfer, i.e. find an item with the text in
the 'Status' field of the table in detail.pl that indicates it is in
transfer
2. Set the item to 'Lost' either by clicking on Edit->Edit items from
the detail.pl page
OR
clicking on the Items tab on the left side of the detail.pl page
3. Notice that the transfer is now cancelled for the item and the items
holdingbranch is the transfers source ('from') branch
4. Run t/db_dependent/Circulation.t

Sponsored-by: Brimbank Library, Australia
Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se>
(fixed the introduction of a whitespace line and removed a double
declare warning from the new tests as part of QA)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Circulation.pm
t/db_dependent/Circulation.t