Bug 25757

Summary: Add a Koha::Item::Transfer->transit method
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Architecture, internals, and plumbingAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, testopia
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This patch adds the `Koha::Item->transit` method which can be used to progress a transfer from 'requested' to 'in_transit'. The method will throw an exception if the item is not checked in and will handle `CartToShelf` and update `DateLastSeen` as well as updating the 'frombranch' if required. We also add some sugar methods to allow easy navigation between the 'Transfer' and it's respective 'Item'.
Version(s) released in:
21.05.00
Circulation function:
Bug Depends on: 25755    
Bug Blocks: 25767    
Attachments: Bug 25757: Add item relation to Koha::Item::Transfer
Bug 25757: Add Koha::Item::Transfer->transit method
Bug 25757: Add unit tests for item relation
Bug 25757: Add item relation to Koha::Item::Transfer
Bug 25757: Add Koha::Item::Transfer->transit method
Bug 25757: Add unit tests for item relation
Bug 25757: Add item relation to Koha::Item::Transfer
Bug 25757: Add Koha::Item::Transfer->transit method
Bug 25757: Add unit tests for item relation
Bug 25757: Add item relation to Koha::Item::Transfer
Bug 25757: Add Koha::Item::Transfer->transit method
Bug 25757: Add unit tests for item relation
Bug 25757: Add item relation to Koha::Item::Transfer
Bug 25757: Add Koha::Item::Transfer->transit method
Bug 25757: Add unit tests for item relation
Bug 25757: Add item relation to Koha::Item::Transfer
Bug 25757: Add Koha::Item::Transfer->transit method
Bug 25757: Add unit tests for item relation
Bug 25757: Add item relation to Koha::Item::Transfer
Bug 25757: Add Koha::Item::Transfer->transit method
Bug 25757: Add unit tests for item relation
Bug 25757: Add item relation to Koha::Item::Transfer
Bug 25757: Add Koha::Item::Transfer->transit method
Bug 25757: Add unit tests for item relation

Description Martin Renvoize (ashimema) 2020-06-15 15:02:19 UTC
We should have a `transit` method available within the Koha::Item::Transfer object to set a Transfer from 'Requested' to 'In transit' but setting the 'sent' date.
Comment 1 Martin Renvoize (ashimema) 2020-06-16 11:02:34 UTC
Created attachment 105900 [details] [review]
Bug 25757: Add item relation to Koha::Item::Transfer
Comment 2 Martin Renvoize (ashimema) 2020-06-16 11:02:36 UTC
Created attachment 105901 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method
Comment 3 Martin Renvoize (ashimema) 2020-06-16 11:02:39 UTC
Created attachment 105902 [details] [review]
Bug 25757: Add unit tests for item relation
Comment 4 Martin Renvoize (ashimema) 2020-07-23 13:51:32 UTC
Created attachment 107241 [details] [review]
Bug 25757: Add item relation to Koha::Item::Transfer
Comment 5 Martin Renvoize (ashimema) 2020-07-23 13:51:35 UTC
Created attachment 107242 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method
Comment 6 Martin Renvoize (ashimema) 2020-07-23 13:51:37 UTC
Created attachment 107243 [details] [review]
Bug 25757: Add unit tests for item relation
Comment 7 Martin Renvoize (ashimema) 2020-07-23 13:52:06 UTC
Test plan
1/ Run the included unit tests and verify they pass
Comment 8 Martin Renvoize (ashimema) 2020-07-24 10:08:06 UTC
Created attachment 107296 [details] [review]
Bug 25757: Add item relation to Koha::Item::Transfer
Comment 9 Martin Renvoize (ashimema) 2020-07-24 10:08:09 UTC
Created attachment 107297 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method
Comment 10 Martin Renvoize (ashimema) 2020-07-24 10:08:12 UTC
Created attachment 107298 [details] [review]
Bug 25757: Add unit tests for item relation
Comment 11 Martin Renvoize (ashimema) 2020-09-17 16:21:35 UTC
Created attachment 110274 [details] [review]
Bug 25757: Add item relation to Koha::Item::Transfer

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 12 Martin Renvoize (ashimema) 2020-09-17 16:21:39 UTC
Created attachment 110275 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method

Test plan
1/ Run the included unit tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 13 Martin Renvoize (ashimema) 2020-09-17 16:21:42 UTC
Created attachment 110276 [details] [review]
Bug 25757: Add unit tests for item relation

Test plan
1/ Run the unit test

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 14 Martin Renvoize (ashimema) 2020-09-17 16:22:09 UTC
Tested in use by Kathleen as part of relying on bug 22569
Comment 15 Katrin Fischer 2020-09-17 20:53:22 UTC
Created attachment 110296 [details] [review]
Bug 25757: Add item relation to Koha::Item::Transfer

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Katrin Fischer 2020-09-17 20:53:29 UTC
Created attachment 110297 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method

Test plan
1/ Run the included unit tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2020-09-17 20:53:35 UTC
Created attachment 110298 [details] [review]
Bug 25757: Add unit tests for item relation

Test plan
1/ Run the unit test

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2020-09-17 20:54:10 UTC
Giving these patches my QA stamp, but setting to BLOCKED as we need to resolve the questions on the dependent bug first.
Comment 19 Katrin Fischer 2020-09-21 20:55:34 UTC
Created attachment 110507 [details] [review]
Bug 25757: Add item relation to Koha::Item::Transfer

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 Katrin Fischer 2020-09-21 20:55:40 UTC
Created attachment 110508 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method

Test plan
1/ Run the included unit tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 21 Katrin Fischer 2020-09-21 20:55:44 UTC
Created attachment 110509 [details] [review]
Bug 25757: Add unit tests for item relation

Test plan
1/ Run the unit test

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 22 Martin Renvoize (ashimema) 2021-02-09 10:54:19 UTC
Created attachment 116547 [details] [review]
Bug 25757: Add item relation to Koha::Item::Transfer

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 23 Martin Renvoize (ashimema) 2021-02-09 10:54:22 UTC
Created attachment 116548 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method

Test plan
1/ Run the included unit tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 24 Martin Renvoize (ashimema) 2021-02-09 10:54:25 UTC
Created attachment 116549 [details] [review]
Bug 25757: Add unit tests for item relation

Test plan
1/ Run the unit test

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 25 Jonathan Druart 2021-03-03 11:36:22 UTC
+    # Remove the 'shelving cart' location status if it is being used (Bug 3701)
+    CartToShelf( $self->item->itemnumber )
+      if $self->item->location
+      && $self->item->location eq 'CART'
+      && (!$self->item->permanent_location
+        || $self->item->permanent_location ne 'CART' );

We have this code on several places.
Willing to move them to a dedicated Koha::Item method?
(on its own bug report ofc)
Comment 26 Jonathan Druart 2021-03-03 14:29:19 UTC
Created attachment 117580 [details] [review]
Bug 25757: Add item relation to Koha::Item::Transfer

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 27 Jonathan Druart 2021-03-03 14:29:22 UTC
Created attachment 117581 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method

Test plan
1/ Run the included unit tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 28 Jonathan Druart 2021-03-03 14:29:26 UTC
Created attachment 117582 [details] [review]
Bug 25757: Add unit tests for item relation

Test plan
1/ Run the unit test

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 29 Jonathan Druart 2021-03-03 14:36:46 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 30 Fridolin Somers 2021-03-04 12:23:16 UTC
Enhancement not pushed to 20.11.x