Bug 25757 - Add a Koha::Item::Transfer->transit method
Summary: Add a Koha::Item::Transfer->transit method
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Joonas Kylmälä
URL:
Keywords:
Depends on: 25755
Blocks: 25767
  Show dependency treegraph
 
Reported: 2020-06-15 15:02 UTC by Martin Renvoize
Modified: 2021-06-14 21:35 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
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


Attachments
Bug 25757: Add item relation to Koha::Item::Transfer (826 bytes, patch)
2020-06-16 11:02 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add Koha::Item::Transfer->transit method (5.45 KB, patch)
2020-06-16 11:02 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add unit tests for item relation (1.50 KB, patch)
2020-06-16 11:02 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add item relation to Koha::Item::Transfer (826 bytes, patch)
2020-07-23 13:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add Koha::Item::Transfer->transit method (5.45 KB, patch)
2020-07-23 13:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add unit tests for item relation (1.50 KB, patch)
2020-07-23 13:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add item relation to Koha::Item::Transfer (826 bytes, patch)
2020-07-24 10:08 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add Koha::Item::Transfer->transit method (5.44 KB, patch)
2020-07-24 10:08 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add unit tests for item relation (1.50 KB, patch)
2020-07-24 10:08 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add item relation to Koha::Item::Transfer (889 bytes, patch)
2020-09-17 16:21 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add Koha::Item::Transfer->transit method (5.54 KB, patch)
2020-09-17 16:21 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add unit tests for item relation (1.59 KB, patch)
2020-09-17 16:21 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add item relation to Koha::Item::Transfer (947 bytes, patch)
2020-09-17 20:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25757: Add Koha::Item::Transfer->transit method (5.61 KB, patch)
2020-09-17 20:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25757: Add unit tests for item relation (1.65 KB, patch)
2020-09-17 20:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25757: Add item relation to Koha::Item::Transfer (947 bytes, patch)
2020-09-21 20:55 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25757: Add Koha::Item::Transfer->transit method (5.61 KB, patch)
2020-09-21 20:55 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25757: Add unit tests for item relation (1.65 KB, patch)
2020-09-21 20:55 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25757: Add item relation to Koha::Item::Transfer (1.07 KB, patch)
2021-02-09 10:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add Koha::Item::Transfer->transit method (5.74 KB, patch)
2021-02-09 10:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add unit tests for item relation (1.79 KB, patch)
2021-02-09 10:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25757: Add item relation to Koha::Item::Transfer (1.07 KB, patch)
2021-03-03 14:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25757: Add Koha::Item::Transfer->transit method (5.74 KB, patch)
2021-03-03 14:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25757: Add unit tests for item relation (1.79 KB, patch)
2021-03-03 14:29 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 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 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 2020-06-16 11:02:36 UTC
Created attachment 105901 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method
Comment 3 Martin Renvoize 2020-06-16 11:02:39 UTC
Created attachment 105902 [details] [review]
Bug 25757: Add unit tests for item relation
Comment 4 Martin Renvoize 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 2020-07-23 13:51:35 UTC
Created attachment 107242 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method
Comment 6 Martin Renvoize 2020-07-23 13:51:37 UTC
Created attachment 107243 [details] [review]
Bug 25757: Add unit tests for item relation
Comment 7 Martin Renvoize 2020-07-23 13:52:06 UTC
Test plan
1/ Run the included unit tests and verify they pass
Comment 8 Martin Renvoize 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 2020-07-24 10:08:09 UTC
Created attachment 107297 [details] [review]
Bug 25757: Add Koha::Item::Transfer->transit method
Comment 10 Martin Renvoize 2020-07-24 10:08:12 UTC
Created attachment 107298 [details] [review]
Bug 25757: Add unit tests for item relation
Comment 11 Martin Renvoize 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 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 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 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 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 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 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