Bug 24446 - Stockrotation: Update to use daterequested in branchtransfers
Summary: Stockrotation: Update to use daterequested in branchtransfers
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Joonas Kylmälä
URL:
Keywords:
Depends on: 22566 26057
Blocks: 26618 28208 28210 31437
  Show dependency treegraph
 
Reported: 2020-01-17 12:12 UTC by Martin Renvoize (ashimema)
Modified: 2022-08-22 14:26 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patchset updates the Stock Rotation system to use the recently introduced Koha::Item[::Transfer] methods. It fixes a bug whereby such transfers could be accidentally cancelled by other processes and sets these transfer to be the lowest priority. We also introduce handling for the new 'requested' transfer state into the circulation system.
Version(s) released in:
21.05.00
Circulation function:


Attachments
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.40 KB, patch)
2020-06-17 11:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (3.42 KB, patch)
2020-06-17 11:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.63 KB, patch)
2020-06-17 11:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.40 KB, patch)
2020-07-23 13:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (3.42 KB, patch)
2020-07-23 13:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.62 KB, patch)
2020-07-23 13:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Add Koha::Item::Transfer->in_transit method (2.70 KB, patch)
2020-07-23 13:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Catch daterequested in circ returns (9.59 KB, patch)
2020-07-23 13:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.40 KB, patch)
2020-07-23 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (7.98 KB, patch)
2020-07-23 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.62 KB, patch)
2020-07-23 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Add Koha::Item::Transfer->in_transit method (2.74 KB, patch)
2020-07-23 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Catch daterequested in circ returns (9.60 KB, patch)
2020-07-23 14:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.40 KB, patch)
2020-07-24 10:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (7.98 KB, patch)
2020-07-24 10:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.61 KB, patch)
2020-07-24 10:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Add Koha::Item::Transfer->in_transit method (2.74 KB, patch)
2020-07-24 10:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Catch daterequested in circ returns (9.60 KB, patch)
2020-07-24 10:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.46 KB, patch)
2020-09-17 16:26 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (8.05 KB, patch)
2020-09-17 16:26 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.67 KB, patch)
2020-09-17 16:26 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Catch daterequested in circ returns (9.37 KB, patch)
2020-09-17 16:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.46 KB, patch)
2020-09-22 11:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (8.08 KB, patch)
2020-09-22 11:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.72 KB, patch)
2020-09-22 11:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Catch daterequested in circ returns (9.37 KB, patch)
2020-09-22 11:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: (follow-up) Handle cases of pre-existing transfers (20.06 KB, patch)
2020-09-22 11:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.46 KB, patch)
2020-09-22 12:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (8.08 KB, patch)
2020-09-22 12:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.72 KB, patch)
2020-09-22 12:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Catch daterequested in circ returns (9.37 KB, patch)
2020-09-22 12:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: (follow-up) Handle cases of pre-existing transfers (23.27 KB, patch)
2020-09-22 12:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance (1.08 KB, patch)
2020-10-06 20:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.63 KB, patch)
2021-02-09 11:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (8.26 KB, patch)
2021-02-09 11:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.87 KB, patch)
2021-02-09 11:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Catch daterequested in circ returns (9.58 KB, patch)
2021-02-09 11:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update transferbook Unit Test (1.29 KB, patch)
2021-02-09 11:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update GetTransfers Unit Test (1.43 KB, patch)
2021-02-09 11:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: (follow-up) Handle cases of pre-existing transfers (23.85 KB, patch)
2021-02-09 11:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance (1.29 KB, patch)
2021-02-09 11:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Add datecancelled handling to GetTransfers (913 bytes, patch)
2021-02-09 11:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Add datesent/datecancelled handling to GetTransfersFromTo (3.08 KB, patch)
2021-02-09 11:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update ModItemTransfer for daterequested/datecancelled (3.04 KB, patch)
2021-02-09 11:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Update transferbook Test (5.40 KB, patch)
2021-02-09 11:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Fix ModItemTransfer tests (2.68 KB, patch)
2021-02-09 11:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Correction to datecancelled for ModItemTransfer (5.40 KB, patch)
2021-02-09 11:12 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24446: Update branchtransfers.daterequested for stockrotation (1.63 KB, patch)
2021-03-03 14:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Improve StockRotationItem->advance tests (8.26 KB, patch)
2021-03-03 14:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Update StockRotationItem to use daterequested (5.87 KB, patch)
2021-03-03 14:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Catch daterequested in circ returns (9.58 KB, patch)
2021-03-03 14:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Update transferbook Unit Test (1.29 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Update GetTransfers Unit Test (1.43 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (follow-up) Handle cases of pre-existing transfers (23.85 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance (1.29 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Add datecancelled handling to GetTransfers (913 bytes, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Add datesent/datecancelled handling to GetTransfersFromTo (3.08 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: Update ModItemTransfer for daterequested/datecancelled (3.04 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Update unit test for ModItemTransfer (2.17 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Update transferbook Test (5.40 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Fix ModItemTransfer tests (4.23 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Correction to datecancelled for ModItemTransfer (5.40 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Set TransferTrigger to 'Reserve' for bug 24298 (1.09 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) SIP test fix for bug 27166 (1.54 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Remove superflous store calls (1.73 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (QA follow-up) Use 'receive' method in ModReserveAffect (1.40 KB, patch)
2021-03-03 14:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24446: (follow-up) Fix tests (1.59 KB, patch)
2021-04-23 15:23 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2020-01-17 12:12:09 UTC
Bug 23092 adds a daterequested field to the branchtransfers table which better reflects how stockrotation utilises the existing datesent field.

This patchset will update stockrotation to take advantage of the new field and in doing so rectify some of the rotation logic.
Comment 1 Martin Renvoize (ashimema) 2020-06-17 11:09:42 UTC
Created attachment 105943 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockration triggered
branchtransfers and moves the datesent value into daterequested
Comment 2 Martin Renvoize (ashimema) 2020-06-17 11:09:45 UTC
Created attachment 105944 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.
Comment 3 Martin Renvoize (ashimema) 2020-06-17 11:09:48 UTC
Created attachment 105945 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff
Comment 4 Martin Renvoize (ashimema) 2020-07-23 13:54:07 UTC
Created attachment 107246 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested
Comment 5 Martin Renvoize (ashimema) 2020-07-23 13:54:10 UTC
Created attachment 107247 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.
Comment 6 Martin Renvoize (ashimema) 2020-07-23 13:54:13 UTC
Created attachment 107248 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff
Comment 7 Martin Renvoize (ashimema) 2020-07-23 13:54:16 UTC
Created attachment 107249 [details] [review]
Bug 24446: Add Koha::Item::Transfer->in_transit method

This method returns a boolean representing the in_transit state of the
transfer.
Comment 8 Martin Renvoize (ashimema) 2020-07-23 13:54:19 UTC
Created attachment 107250 [details] [review]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.
Comment 9 Martin Renvoize (ashimema) 2020-07-23 14:11:19 UTC
Created attachment 107252 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested
Comment 10 Martin Renvoize (ashimema) 2020-07-23 14:11:22 UTC
Created attachment 107253 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.
Comment 11 Martin Renvoize (ashimema) 2020-07-23 14:11:25 UTC
Created attachment 107254 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff
Comment 12 Martin Renvoize (ashimema) 2020-07-23 14:11:28 UTC
Created attachment 107255 [details] [review]
Bug 24446: Add Koha::Item::Transfer->in_transit method

This method returns a boolean representing the in_transit state of the
transfer.
Comment 13 Martin Renvoize (ashimema) 2020-07-23 14:11:31 UTC
Created attachment 107256 [details] [review]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.
Comment 14 Martin Renvoize (ashimema) 2020-07-24 10:13:48 UTC
Created attachment 107301 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested
Comment 15 Martin Renvoize (ashimema) 2020-07-24 10:13:51 UTC
Created attachment 107302 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.
Comment 16 Martin Renvoize (ashimema) 2020-07-24 10:13:54 UTC
Created attachment 107303 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff
Comment 17 Martin Renvoize (ashimema) 2020-07-24 10:13:57 UTC
Created attachment 107304 [details] [review]
Bug 24446: Add Koha::Item::Transfer->in_transit method

This method returns a boolean representing the in_transit state of the
transfer.
Comment 18 Martin Renvoize (ashimema) 2020-07-24 10:14:00 UTC
Created attachment 107305 [details] [review]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.
Comment 19 Martin Renvoize (ashimema) 2020-09-17 16:26:47 UTC
Created attachment 110280 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 20 Martin Renvoize (ashimema) 2020-09-17 16:26:53 UTC
Created attachment 110281 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 21 Martin Renvoize (ashimema) 2020-09-17 16:26:57 UTC
Created attachment 110282 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 22 Martin Renvoize (ashimema) 2020-09-17 16:27:02 UTC
Created attachment 110283 [details] [review]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 23 Martin Renvoize (ashimema) 2020-09-17 16:27:51 UTC
Tested in use by Kathleen as part of relying on bug 22569
Comment 24 Katrin Fischer 2020-09-21 21:07:36 UTC
kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/StockRotationItems.t
t/db_dependent/StockRotationItems.t .. 5/8     # Looks like you planned 6 tests but ran 5.

#   Failed test 'Tests for needs_advancing.'
#   at t/db_dependent/StockRotationItems.t line 229.
Can't locate object method "clone" via package "0" (perhaps you forgot to load "0"?) at /usr/lib/x86_64-linux-gnu/perl5/5.24/DateTime/Duration.pm line 326.
# Looks like your test exited with 255 just after 6.
t/db_dependent/StockRotationItems.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 3/8 subtests 

Test Summary Report
-------------------
t/db_dependent/StockRotationItems.t (Wstat: 65280 Tests: 6 Failed: 1)
  Failed test:  6
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 8 tests but ran 6.
Files=1, Tests=6,  3 wallclock secs ( 0.02 usr  0.01 sys +  2.64 cusr  0.25 csys =  2.92 CPU)
Result: FAIL
Comment 25 Martin Renvoize (ashimema) 2020-09-22 07:51:12 UTC
Oops, I forgot to mark this as assigned.. I found a couple fo bugs whilst sorting out some of the tree last week.. working on them at the moment.. thanks for testing Katrin.
Comment 26 Martin Renvoize (ashimema) 2020-09-22 11:13:51 UTC
Created attachment 110533 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 27 Martin Renvoize (ashimema) 2020-09-22 11:13:56 UTC
Created attachment 110534 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 28 Martin Renvoize (ashimema) 2020-09-22 11:14:01 UTC
Created attachment 110535 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 29 Martin Renvoize (ashimema) 2020-09-22 11:14:06 UTC
Created attachment 110536 [details] [review]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 30 Martin Renvoize (ashimema) 2020-09-22 11:14:12 UTC
Created attachment 110537 [details] [review]
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.
Comment 31 Martin Renvoize (ashimema) 2020-09-22 11:18:08 UTC
Leaving as FQA.. just thought of some more tests I aught to add with that final followup :|
Comment 32 Martin Renvoize (ashimema) 2020-09-22 12:11:25 UTC
Created attachment 110538 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 33 Martin Renvoize (ashimema) 2020-09-22 12:11:29 UTC
Created attachment 110539 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 34 Martin Renvoize (ashimema) 2020-09-22 12:11:33 UTC
Created attachment 110540 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 35 Martin Renvoize (ashimema) 2020-09-22 12:11:39 UTC
Created attachment 110541 [details] [review]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 36 Martin Renvoize (ashimema) 2020-09-22 12:11:44 UTC
Created attachment 110542 [details] [review]
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.
Comment 37 Katrin Fischer 2020-09-27 12:17:05 UTC
The dependent bug 26057 still requires sign-off - moving to BLOCKED for the moment.
Comment 38 Martin Renvoize (ashimema) 2020-10-06 20:17:18 UTC
Created attachment 111322 [details] [review]
Bug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance

This patch prioritizes the RotatingCollection transfer type over the
StockRotationAdvance transfers allowing us to queue up a our transfer
behind it.
Comment 39 Martin Renvoize (ashimema) 2021-02-09 11:11:38 UTC
Created attachment 116557 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 40 Martin Renvoize (ashimema) 2021-02-09 11:11:41 UTC
Created attachment 116558 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 41 Martin Renvoize (ashimema) 2021-02-09 11:11:44 UTC
Created attachment 116559 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 42 Martin Renvoize (ashimema) 2021-02-09 11:11:48 UTC
Created attachment 116560 [details] [review]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 43 Martin Renvoize (ashimema) 2021-02-09 11:11:51 UTC
Created attachment 116561 [details] [review]
Bug 24446: Update transferbook Unit Test

We updated C4::Circulation::transferbook to return the to_branch branchcode as
the data entity for 'WasTransfered'. This patch updates the corresponding unit
test.

To test:
1/ Run t/db_dependent/Circulation/transferbook.t
2/ Signoff if it passes

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 44 Martin Renvoize (ashimema) 2021-02-09 11:11:54 UTC
Created attachment 116562 [details] [review]
Bug 24446: Update GetTransfers Unit Test

We updated the return signature for GetTransfers and as such need to
update the corresponding unit test

Test plan
1/ Run t/db_dependent/Circulation/transfers.t
2/ Confirm it passes
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 45 Martin Renvoize (ashimema) 2021-02-09 11:11:57 UTC
Created attachment 116563 [details] [review]
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>
Comment 46 Martin Renvoize (ashimema) 2021-02-09 11:12:01 UTC
Created attachment 116564 [details] [review]
Bug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance

This patch prioritizes the RotatingCollection transfer type over the
StockRotationAdvance transfers allowing us to queue up a our transfer
behind it.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 47 Martin Renvoize (ashimema) 2021-02-09 11:12:04 UTC
Created attachment 116565 [details] [review]
Bug 24446: Add datecancelled handling to GetTransfers

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 48 Martin Renvoize (ashimema) 2021-02-09 11:12:07 UTC
Created attachment 116566 [details] [review]
Bug 24446: Add datesent/datecancelled handling to GetTransfersFromTo

With the first uses of Koha::Item->request_transfer and
Koha::Item::Transfer->cancel having been added, we need to update
GetTransferFromTo to respect transfers that have been requested but
not yet sent and not cancelled.

Test plan
1/ Run the included unit test
2/ Confirm the "Transfers to recieve" page loads
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 49 Martin Renvoize (ashimema) 2021-02-09 11:12:11 UTC
Created attachment 116567 [details] [review]
Bug 24446: Update ModItemTransfer for daterequested/datecancelled

C4::Items::ModItemTransfer is used throughout the codebase and currently
it will never set the daterequested or datecancelled fields.  With the
modifications to how circulation deals with transfers we need to update
this function to set those fields appropriately. Functionality has been
retained, ModItemTransfer will continue to add a transfer regardless of
limits or current transits existing.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 50 Martin Renvoize (ashimema) 2021-02-09 11:12:14 UTC
Created attachment 116568 [details] [review]
Bug 24446: (QA follow-up) Update transferbook Test

Needed for a rebase, a new test was introduced so we need to add the
trigger option into that test now too.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 51 Martin Renvoize (ashimema) 2021-02-09 11:12:17 UTC
Created attachment 116569 [details] [review]
Bug 24446: (QA follow-up) Fix ModItemTransfer tests

Seems I missed passing trigger in the tests for ModItemTransfer. This
patch corrects that oversight.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 52 Martin Renvoize (ashimema) 2021-02-09 11:12:20 UTC
Created attachment 116570 [details] [review]
Bug 24446: (QA follow-up) Correction to datecancelled for ModItemTransfer

ModItemTransfer always replaces any existing transfers, including those
in transit.. so we needed to add a 'force' option to
Koha::Item::Transfer->cancel();

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 53 Jonathan Druart 2021-03-03 14:31:47 UTC
Created attachment 117589 [details] [review]
Bug 24446: Update branchtransfers.daterequested for stockrotation

This database update catches existing stockrotation triggered
branchtransfers and moves the datesent value into daterequested

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 54 Jonathan Druart 2021-03-03 14:31:50 UTC
Created attachment 117590 [details] [review]
Bug 24446: Improve StockRotationItem->advance tests

This patch adds additional checks in the tests for item homebranch
updates and cyclical transfers caused by the StockRotationItem->advance
method.

It highlights a bug in the original logic whereby a cyclical rotation
would always result in a completed transfer but the physical item would
not have actually been moved between branches.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 55 Jonathan Druart 2021-03-03 14:31:54 UTC
Created attachment 117591 [details] [review]
Bug 24446: Update StockRotationItem to use daterequested

This patch updates the stockrotation functionality to utilise the new
branchtransfers.daterequested field to more accurately track the state
of stockrotation transfers.

We also opt to start using the new Koha::Item and Koha::Item::Transfer
methods to achieve this goal.

Test plan
0/ Setup stockrotation and configure some rotas and assign items to
them.
1/ Run the stockrotation cronscript
2/ Check the database for branchtransfers initiated by stockrotation and
confirm that that now populate the daterequested field and not the
datesent.
3/ Run the stockrotation tests and verify they pass
4/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 56 Jonathan Druart 2021-03-03 14:31:57 UTC
Created attachment 117592 [details] [review]
Bug 24446: Catch daterequested in circ returns

Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 57 Jonathan Druart 2021-03-03 14:32:00 UTC
Created attachment 117593 [details] [review]
Bug 24446: Update transferbook Unit Test

We updated C4::Circulation::transferbook to return the to_branch branchcode as
the data entity for 'WasTransfered'. This patch updates the corresponding unit
test.

To test:
1/ Run t/db_dependent/Circulation/transferbook.t
2/ Signoff if it passes

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 58 Jonathan Druart 2021-03-03 14:32:04 UTC
Created attachment 117594 [details] [review]
Bug 24446: Update GetTransfers Unit Test

We updated the return signature for GetTransfers and as such need to
update the corresponding unit test

Test plan
1/ Run t/db_dependent/Circulation/transfers.t
2/ Confirm it passes
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 59 Jonathan Druart 2021-03-03 14:32:07 UTC
Created attachment 117595 [details] [review]
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>
Comment 60 Jonathan Druart 2021-03-03 14:32:11 UTC
Created attachment 117596 [details] [review]
Bug 24446: Prioritize RotatingCollection transfer over StockRotationAdvance

This patch prioritizes the RotatingCollection transfer type over the
StockRotationAdvance transfers allowing us to queue up a our transfer
behind it.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 61 Jonathan Druart 2021-03-03 14:32:14 UTC
Created attachment 117597 [details] [review]
Bug 24446: Add datecancelled handling to GetTransfers

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 62 Jonathan Druart 2021-03-03 14:32:18 UTC
Created attachment 117598 [details] [review]
Bug 24446: Add datesent/datecancelled handling to GetTransfersFromTo

With the first uses of Koha::Item->request_transfer and
Koha::Item::Transfer->cancel having been added, we need to update
GetTransferFromTo to respect transfers that have been requested but
not yet sent and not cancelled.

Test plan
1/ Run the included unit test
2/ Confirm the "Transfers to recieve" page loads
3/ Signoff

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 63 Jonathan Druart 2021-03-03 14:32:21 UTC
Created attachment 117599 [details] [review]
Bug 24446: Update ModItemTransfer for daterequested/datecancelled

C4::Items::ModItemTransfer is used throughout the codebase and currently
it will never set the daterequested or datecancelled fields.  With the
modifications to how circulation deals with transfers we need to update
this function to set those fields appropriately. Functionality has been
retained, ModItemTransfer will continue to add a transfer regardless of
limits or current transits existing.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 64 Jonathan Druart 2021-03-03 14:32:25 UTC
Created attachment 117600 [details] [review]
Bug 24446: (QA follow-up) Update unit test for ModItemTransfer

Update unit test to reflect we now use cancellationdate and
cancellation_reason in ModItemTransfer
Comment 65 Jonathan Druart 2021-03-03 14:32:28 UTC
Created attachment 117601 [details] [review]
Bug 24446: (QA follow-up) Update transferbook Test

Needed for a rebase, a new test was introduced so we need to add the
trigger option into that test now too.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 66 Jonathan Druart 2021-03-03 14:32:32 UTC
Created attachment 117602 [details] [review]
Bug 24446: (QA follow-up) Fix ModItemTransfer tests

Seems I missed passing trigger in the tests for ModItemTransfer. This
patch corrects that oversight.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 67 Jonathan Druart 2021-03-03 14:32:35 UTC
Created attachment 117603 [details] [review]
Bug 24446: (QA follow-up) Correction to datecancelled for ModItemTransfer

ModItemTransfer always replaces any existing transfers, including those
in transit.. so we needed to add a 'force' option to
Koha::Item::Transfer->cancel();

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 68 Jonathan Druart 2021-03-03 14:32:38 UTC
Created attachment 117604 [details] [review]
Bug 24446: (QA follow-up) Set TransferTrigger to 'Reserve' for bug 24298

The SIP initiated transfer was set to use the 'TransferTrigger' passed
back from AddReturn; However, TransferTrigger is not set for reserves in
AddReturn (It's is set controller side by circ/returns.pl). We thus need
to also hard code the trigger type in the SIP transaction for reserves.
Comment 69 Jonathan Druart 2021-03-03 14:32:42 UTC
Created attachment 117605 [details] [review]
Bug 24446: (QA follow-up) SIP test fix for bug 27166

A new test was introduced in bug 27166 since this code was written, this
patch simply updates the test for the additional 'TransferTrigger'
message that is returned by this patchset.
Comment 70 Jonathan Druart 2021-03-03 14:32:46 UTC
Created attachment 117606 [details] [review]
Bug 24446: (QA follow-up) Remove superflous store calls

The original code here called store after setting each field. Instead,
we set all the fields and call store at the end and save ourselves a few
database hits.
Comment 71 Jonathan Druart 2021-03-03 14:32:49 UTC
Created attachment 117607 [details] [review]
Bug 24446: (QA follow-up) Use 'receive' method in ModReserveAffect

ModeReserveAffect was setting all transfers in the queue to received by
looping through a resultset. This patch updates the logic to try and
catch the in_transit transfer and receive just that one instead.
Comment 72 Jonathan Druart 2021-03-03 14:36:39 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 73 Fridolin Somers 2021-03-04 12:25:11 UTC
Enhancement not pushed to 20.11.x
Comment 74 Nick Clemens (kidclamp) 2021-04-23 15:23:49 UTC
Created attachment 120116 [details] [review]
Bug 24446: (follow-up) Fix tests

The tests were failing because we weren't actually changing the item, so store was doing nothing.

We need to transfer 'from' a new branch so that the holdingbranch is changed
Comment 75 Jonathan Druart 2021-04-27 09:41:46 UTC
Follow-up pushed to master.