Bug 24296

Summary: Move stock rotation transfer triggers from `comments` to `reason`
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: CirculationAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, gmcharlt, jonathan.druart, kyle.m.hall, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Circulation function:
Bug Depends on: 24287    
Bug Blocks: 23432, 24298    
Attachments: Bug 24296: Update stockrotation process to use branchtransfers.trigger
Bug 24296: Update existing data in the database
Bug 24296: Update existing data in the database
Bug 24296: Update stockrotation process to use branchtransfers.trigger
Bug 24296: Update existing data in the database
Bug 24296: Update stockrotation process to use branchtransfers.trigger
Bug 24296: Update existing data in the database
Bug 24296: Update stockrotation process to use branchtransfers.reason
Bug 24296: Update existing data in the database
Bug 24296: Update stockrotation process to use branchtransfers.reason

Description Martin Renvoize (ashimema) 2019-12-23 09:36:09 UTC
Stock rotation misused the 'comments' field in branchtransfers to track that a transfer was triggered by the stock rotation subsystem.  We should use a the new 'trigger' field for this instead.
Comment 1 Martin Renvoize (ashimema) 2020-01-16 09:03:14 UTC
Created attachment 97433 [details] [review]
Bug 24296: Update stockrotation process to use branchtransfers.trigger

This patch updates all occurences of stockrotation related lookups of
branchtransfers status from using the 'comments' field to using the new
'trigger' field.

Test plan:
1) Work through the process of creating a stock rotation plan and adding
   items to the plan.. no errors should be encoutered during this process.
2) Run the stockrotation cronjob to move some items on.. no errors
   should be encountered.
3) Navigate to the transferstosend page in the circulation area of the
   staff client.. no errors should be encountered.
Comment 2 Martin Renvoize (ashimema) 2020-01-16 09:03:17 UTC
Created attachment 97434 [details] [review]
Bug 24296: Update existing data in the database

This DB udpate adds the stockration states to the trigger enum in the
branchtransfers table and then populates it with any such data currently
contained within the comments field.
Comment 3 Martin Renvoize (ashimema) 2020-01-17 11:42:22 UTC
Created attachment 97504 [details] [review]
Bug 24296: Update existing data in the database

This DB udpate adds the stockration states to the trigger enum in the
branchtransfers table and then populates it with any such data currently
contained within the comments field.

https://bugs.koha-community.org/show_bug.cgi?id=24292
Comment 4 Martin Renvoize (ashimema) 2020-01-17 11:42:25 UTC
Created attachment 97505 [details] [review]
Bug 24296: Update stockrotation process to use branchtransfers.trigger

This patch updates all occurences of stockrotation related lookups of
branchtransfers status from using the 'comments' field to using the new
'trigger' field.

Test plan:
1) Work through the process of creating a stock rotation plan and adding
   items to the plan.. no errors should be encoutered during this process.
2) Run the stockrotation cronjob to move some items on.. no errors
   should be encountered.

https://bugs.koha-community.org/show_bug.cgi?id=24292
Comment 5 Kyle M Hall (khall) 2020-01-17 14:02:17 UTC
Created attachment 97517 [details] [review]
Bug 24296: Update existing data in the database

This DB udpate adds the stockration states to the trigger enum in the
branchtransfers table and then populates it with any such data currently
contained within the comments field.

https://bugs.koha-community.org/show_bug.cgi?id=24292

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Kyle M Hall (khall) 2020-01-17 14:02:31 UTC
Created attachment 97518 [details] [review]
Bug 24296: Update stockrotation process to use branchtransfers.trigger

This patch updates all occurences of stockrotation related lookups of
branchtransfers status from using the 'comments' field to using the new
'trigger' field.

Test plan:
1) Work through the process of creating a stock rotation plan and adding
   items to the plan.. no errors should be encoutered during this process.
2) Run the stockrotation cronjob to move some items on.. no errors
   should be encountered.

https://bugs.koha-community.org/show_bug.cgi?id=24292

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Martin Renvoize (ashimema) 2020-01-17 16:00:14 UTC
Created attachment 97533 [details] [review]
Bug 24296: Update existing data in the database

This DB udpate adds the stockration states to the trigger enum in the
branchtransfers table and then populates it with any such data currently
contained within the comments field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Martin Renvoize (ashimema) 2020-01-17 16:00:17 UTC
Created attachment 97534 [details] [review]
Bug 24296: Update stockrotation process to use branchtransfers.reason

This patch updates all occurences of stockrotation related lookups of
branchtransfers status from using the 'comments' field to using the new
'reason' field.

Test plan:
1) Work through the process of creating a stock rotation plan and adding
   items to the plan.. no errors should be encoutered during this process.
2) Run the stockrotation cronjob to move some items on.. no errors
   should be encountered.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Jonathan Druart 2020-01-28 12:33:28 UTC
CONFLICT (content): Merge conflict in t/db_dependent/StockRotationItems.t
CONFLICT (content): Merge conflict in Koha/StockRotationItem.pm
Comment 10 Jonathan Druart 2020-01-28 12:35:26 UTC
(In reply to Jonathan Druart from comment #9)
> CONFLICT (content): Merge conflict in t/db_dependent/StockRotationItems.t
> CONFLICT (content): Merge conflict in Koha/StockRotationItem.pm

Forget that, a previous patch was not obsoleted.
Comment 11 Jonathan Druart 2020-01-28 12:56:18 UTC
Created attachment 98024 [details] [review]
Bug 24296: Update existing data in the database

This DB udpate adds the stockration states to the trigger enum in the
branchtransfers table and then populates it with any such data currently
contained within the comments field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2020-01-28 12:56:21 UTC
Created attachment 98025 [details] [review]
Bug 24296: Update stockrotation process to use branchtransfers.reason

This patch updates all occurences of stockrotation related lookups of
branchtransfers status from using the 'comments' field to using the new
'reason' field.

Test plan:
1) Work through the process of creating a stock rotation plan and adding
   items to the plan.. no errors should be encoutered during this process.
2) Run the stockrotation cronjob to move some items on.. no errors
   should be encountered.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Martin Renvoize (ashimema) 2020-01-28 15:06:37 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 14 Joy Nelson 2020-02-10 22:40:10 UTC
enhancement not backported to 19.11.x