Bug 29234 - Transfers generated by stock rotation alert but do not initiate at checkin
Summary: Transfers generated by stock rotation alert but do not initiate at checkin
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 35100
  Show dependency treegraph
 
Reported: 2021-10-13 17:18 UTC by Nick Clemens (kidclamp)
Modified: 2024-01-08 12:32 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05
Circulation function:


Attachments
Bug 29234: Transit on checking (1.13 KB, patch)
2021-10-14 11:05 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 29234: Transit on checking (1.12 KB, patch)
2021-10-14 11:07 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 29234: Transit on checking (1.18 KB, patch)
2021-10-14 16:34 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 29234: Transit on checking (1.24 KB, patch)
2021-10-19 11:09 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29234: Unit test (2.98 KB, patch)
2023-03-27 11:08 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29234: Transit on checking (1.24 KB, patch)
2023-03-27 11:08 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29234: (QA follow-up) Fix test that expects wrong defaults (2.16 KB, patch)
2023-03-31 16:34 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 29234: Set datesent for transfers in Z3950 Responder tests (1.96 KB, patch)
2023-04-03 13:16 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29234: Further clean Z3950 Tests (4.33 KB, patch)
2023-04-03 13:16 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 29234: Set datesent for transfers in Z3950 Responder tests (1.81 KB, patch)
2023-04-03 13:48 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 29234: Further clean Z3950 Tests (4.17 KB, patch)
2023-04-03 13:48 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2021-10-13 17:18:01 UTC
When a transfer is created by stock rotation, the transfer is left with a NULL datesent - this is so the item won't be in transit until checked in.

When checked in, however, the buttons do not have the 'dotransfer' name attribute, and so the transfer is not affected. This means the item tells you to print a slip, but does not get marked as sent.

To reecreate:
(Ideally you would do this via stock rotation, but we can recreate easily via DB)
1 - INSERT INTO branchtransfers (itemnumber,daterequested,frombranch,tobranch,reason) VALUES (676,NOW(),'CPL','MPL','StockrotationRepatriation');
2 - Check item in
3 - Print slip or hit OK
4 - Check the item, not in transit
5 - Check the DB, datesent is still null
Comment 1 Martin Renvoize (ashimema) 2021-10-14 11:05:45 UTC
Created attachment 126267 [details] [review]
Bug 29234: Transit on checking
Comment 2 Martin Renvoize (ashimema) 2021-10-14 11:07:49 UTC
Created attachment 126269 [details] [review]
Bug 29234: Transit on checking
Comment 3 Kyle M Hall (khall) 2021-10-14 16:34:31 UTC
Created attachment 126300 [details] [review]
Bug 29234: Transit on checking

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Comment 4 Lisette Scheer 2021-10-14 16:35:08 UTC
Signed off on the BWS sandbox. Worked as expected.
Comment 5 Nick Clemens (kidclamp) 2021-10-19 11:09:43 UTC
Created attachment 126481 [details] [review]
Bug 29234: Transit on checking

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens (kidclamp) 2021-10-19 11:10:08 UTC
Needs unit tests
Comment 7 Nick Clemens (kidclamp) 2023-03-27 11:08:32 UTC
Created attachment 148751 [details] [review]
Bug 29234: Unit test

This patch adds a test that a pending stock rotation transfer is initiated on
checkin, as well as updating the defaults for creating transfer objects

To test:
prove -v t/db_dependent/Circulation.t
Comment 8 Nick Clemens (kidclamp) 2023-03-27 11:08:35 UTC
Created attachment 148752 [details] [review]
Bug 29234: Transit on checking

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Tomás Cohen Arazi (tcohen) 2023-03-31 10:04:11 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Tomás Cohen Arazi (tcohen) 2023-03-31 16:34:25 UTC
Created attachment 149046 [details] [review]
Bug 29234: (QA follow-up) Fix test that expects wrong defaults

This patch changes the get_items_that_can_fill tests so they explicitly
set a 'datearrived' as the new defaults for fresh transfer objects from
TestBuilder is more sane and has this field undef. Tests *should always*
create their required scenarios explicitly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 11 Nick Clemens (kidclamp) 2023-04-03 13:16:34 UTC
Created attachment 149093 [details] [review]
Bug 29234: Set datesent for transfers in Z3950 Responder tests
Comment 12 Nick Clemens (kidclamp) 2023-04-03 13:16:36 UTC
Created attachment 149094 [details] [review]
Bug 29234: Further clean Z3950 Tests

We are deleting all authorised values in Session2.t and assuming they don't exist in Sesson.t

This patch ensures the tests will work regardless of data in DB
Comment 13 Tomás Cohen Arazi (tcohen) 2023-04-03 13:48:44 UTC
Created attachment 149095 [details] [review]
Bug 29234: Set datesent for transfers in Z3950 Responder tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 14 Tomás Cohen Arazi (tcohen) 2023-04-03 13:48:47 UTC
Created attachment 149096 [details] [review]
Bug 29234: Further clean Z3950 Tests

We are deleting all authorised values in Session2.t and assuming they don't exist in Sesson.t

This patch ensures the tests will work regardless of data in DB

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 15 Tomás Cohen Arazi (tcohen) 2023-04-03 13:56:14 UTC
Thanks for those follow-ups, Nick!
Comment 16 Matt Blenkinsop 2023-04-11 11:19:57 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 17 Lucas Gass (lukeg) 2023-04-24 17:19:54 UTC
Doesn't apply cleanly to 22.05.x, no backport. If needed please rebase.