Bug 24446: (follow-up) Handle cases of pre-existing transfers
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 18 Dec 2020 16:36:51 +0000 (16:36 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 3 Mar 2021 14:36:13 +0000 (15:36 +0100)
commit2ac337b4e74182d8d4b0ddbaefcd98e041911ae7
treedecbd328f79108b25e9e50a65a8d44ee2f9007c2
parentcfe6ebc66784ad6bdfc1645009ca05ab7f2a2ad2
Bug 24446: (follow-up) Handle cases of pre-existing transfers

This is a long standing bug in stockrotation (and transfers in general)
where by if a transfer is in progress and another transfer is requested
then the original transfer is inexplicitly cancelled. This patch updates
the stockrotation code to handle queued transfers, either adding a
StockrotationAdvance transfer to the queue when an in progress transfer
was triggered to fulfil a Reserve, or otherwise cancelling the transfer
as stockrotation should take precidence.

To test
1/ Run t/db_dependent/StockRotationsItems.t.
2/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Item.pm
Koha/StockRotationItem.pm
t/db_dependent/StockRotationItems.t