Bug 32335

Summary: Allow stock rotation items to be moved several stages ahead
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CatalogingAssignee: Nick Clemens (kidclamp) <nick>
Status: Needs documenting --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, gmcharlt, kyle.m.hall, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:
Attachments: Bug 32335: Allow stock rotation items to be advanced when in transit
Bug 32335: Allow stock rotation items to be advanced when in transit
Bug 32335: Allow stock rotation items to be advanced when in transit
Bug 32335: Allow stock rotation items to be advanced when in transit
Bug 32335: Allow stock rotation items to be advanced when in transit
Bug 32335: Allow stock rotation items to be advanced when in transit
Bug 32335: (QA follow-up) Add 'Actions' label to 'Actions' column
Bug 32335: (QA follow-up) Add 'btn-primary' instead of 'btn-default' class to dialog Save buttons

Description Nick Clemens (kidclamp) 2022-11-23 13:22:39 UTC
Currently when an item is added to stock rotation it can only be moved ahaead one stage, then the transfer must be filled to allow moving to the next stage.

Some libraries will want to add an item to a rotation, and move it ahead to 'catch-up' with other items.
Comment 1 Nick Clemens (kidclamp) 2022-11-23 13:28:10 UTC
Created attachment 144204 [details] [review]
Bug 32335: Allow stock rotation items to be advanced when in transit

This patch simply removes the disabling of the 'Move to next stage' button
and adds a title to let the librarian know the item is in transit

To test:
1 - Setup a rota with multiple stages
2 - Add an item
3 - Advance to next stage
4 - Observe 'Move to next stage' button is disabled
5 - Check item in at destination
6 - Reload rota - observe 'Move to next stage' is enabled
7 - Apply patch
8 - Click 'Move to next stage'
9 - Note button is not disabled
10 - Hover and confirm note about transit
11 - Click 'Move to next stage'
12 - Checkin item at wrong branch, confirm it is correctly directed to correct stage
Comment 2 Martin Renvoize (ashimema) 2022-11-23 13:37:34 UTC
Created attachment 144206 [details] [review]
Bug 32335: Allow stock rotation items to be advanced when in transit

This patch simply removes the disabling of the 'Move to next stage' button
and adds a title to let the librarian know the item is in transit

To test:
1 - Setup a rota with multiple stages
2 - Add an item
3 - Advance to next stage
4 - Observe 'Move to next stage' button is disabled
5 - Check item in at destination
6 - Reload rota - observe 'Move to next stage' is enabled
7 - Apply patch
8 - Click 'Move to next stage'
9 - Note button is not disabled
10 - Hover and confirm note about transit
11 - Click 'Move to next stage'
12 - Checkin item at wrong branch, confirm it is correctly directed to correct stage

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2022-11-23 13:38:48 UTC
Nice, discussed with Nick, and I am happy this change doesn't affect the logic in any detrimental way :)

Signing off.
Comment 4 Katrin Fischer 2022-11-27 21:44:34 UTC
Sounds more like an enh than a bug?
Comment 5 Marcel de Rooy 2023-01-27 09:20:18 UTC
                                                 [% IF !in_transit && stages.size > 1 %]
                                                     <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;rota_id=[% rota.id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;stage_id=[% sritem.stage.stage_id | uri %]">
                                                 [% ELSE %]
-                                                    <a class="btn btn-default btn-xs" disabled>
+                                                    <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;rota_id=[% rota.id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;stage_id=[% sritem.stage.stage_id | uri %]" title="Item is in transit, it will be directed to new stage when checked in">
                                                 [% END %]

Just looking at this code. I am wondering how you could say that the item is in transit? Since we also have the stages.size condition !
Needs feedback.
Comment 6 Martin Renvoize (ashimema) 2023-01-27 11:23:12 UTC
Sorry Marcel, I'm not sure I understand your question here.. could you clarify what you mean?
Comment 7 Marcel de Rooy 2023-01-30 10:46:29 UTC
(In reply to Martin Renvoize from comment #6)
> Sorry Marcel, I'm not sure I understand your question here.. could you
> clarify what you mean?

Compare if-condition with comment in else branch.
If A and B does not mean that A is false in the else. B could be false?
Comment 8 Nick Clemens (kidclamp) 2023-03-27 10:05:33 UTC
Created attachment 148747 [details] [review]
Bug 32335: Allow stock rotation items to be advanced when in transit

This patch simply removes the disabling of the 'Move to next stage' button
and adds a title to let the librarian know the item is in transit

To test:
1 - Setup a rota with multiple stages
2 - Add an item
3 - Advance to next stage
4 - Observe 'Move to next stage' button is disabled
5 - Check item in at destination
6 - Reload rota - observe 'Move to next stage' is enabled
7 - Apply patch
8 - Click 'Move to next stage'
9 - Note button is not disabled
10 - Hover and confirm note about transit
11 - Click 'Move to next stage'
12 - Checkin item at wrong branch, confirm it is correctly directed to correct stage

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Nick Clemens (kidclamp) 2023-03-27 10:28:46 UTC
Created attachment 148748 [details] [review]
Bug 32335: Allow stock rotation items to be advanced when in transit

This patch adjusts the logic so that we check:
1 - If there are less than 2 stages we disable the 'Move to next stage' button
2 - If the item is not in transit, we show move to next normally
3 - If the item is in transit (and there is more than 1 stage) the button is enabled with a note about transfer

To test:
1 - Setup a rota with multiple stages
2 - Add an item
3 - Advance to next stage
4 - Observe 'Move to next stage' button is disabled
5 - Check item in at destination
6 - Reload rota - observe 'Move to next stage' is enabled
7 - Apply patch
8 - Click 'Move to next stage'
9 - Note button is not disabled
10 - Hover and confirm note about transit
11 - Click 'Move to next stage'
12 - Checkin item at wrong branch, confirm it is correctly directed to correct stage
Comment 10 Sam Lau 2023-05-19 18:06:00 UTC
Created attachment 151491 [details] [review]
Bug 32335: Allow stock rotation items to be advanced when in transit

This patch adjusts the logic so that we check:
1 - If there are less than 2 stages we disable the 'Move to next stage' button
2 - If the item is not in transit, we show move to next normally
3 - If the item is in transit (and there is more than 1 stage) the button is enabled with a note about transfer

To test:
1 - Setup a rota with multiple stages
2 - Add an item
3 - Advance to next stage
4 - Observe 'Move to next stage' button is disabled
5 - Check item in at destination
6 - Reload rota - observe 'Move to next stage' is enabled
7 - Apply patch
8 - Click 'Move to next stage'
9 - Note button is not disabled
10 - Hover and confirm note about transit
11 - Click 'Move to next stage'
12 - Checkin item at wrong branch, confirm it is correctly directed to correct stage

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 11 Pedro Amorim 2023-09-07 15:47:47 UTC
Created attachment 155322 [details] [review]
Bug 32335: Allow stock rotation items to be advanced when in transit

This patch adjusts the logic so that we check:
1 - If there are less than 2 stages we disable the 'Move to next stage' button
2 - If the item is not in transit, we show move to next normally
3 - If the item is in transit (and there is more than 1 stage) the button is enabled with a note about transfer

To test:
1 - Setup a rota with multiple stages
2 - Add an item
3 - Advance to next stage
4 - Observe 'Move to next stage' button is disabled
5 - Check item in at destination
6 - Reload rota - observe 'Move to next stage' is enabled
7 - Apply patch
8 - Click 'Move to next stage'
9 - Note button is not disabled
10 - Hover and confirm note about transit
11 - Click 'Move to next stage'
12 - Checkin item at wrong branch, confirm it is correctly directed to correct stage

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 12 Pedro Amorim 2023-09-07 15:47:50 UTC
Created attachment 155323 [details] [review]
Bug 32335: (QA follow-up) Add 'Actions' label to 'Actions' column

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 13 Pedro Amorim 2023-09-07 15:47:53 UTC
Created attachment 155324 [details] [review]
Bug 32335: (QA follow-up) Add 'btn-primary' instead of 'btn-default' class to dialog Save buttons

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 14 Tomás Cohen Arazi (tcohen) 2023-10-11 13:34:06 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 15 Fridolin Somers 2023-10-12 21:06:45 UTC
Enhancement not pushed to 23.05.x