Bug 22569 - Add a 'Transfers to send' report
Summary: Add a 'Transfers to send' report
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL: https://gitlab.com/mrenvoize/Koha/-/t...
Keywords:
Depends on: 26618
Blocks: 22160 25753
  Show dependency treegraph
 
Reported: 2019-03-22 17:49 UTC by Nick Clemens
Modified: 2021-01-21 10:37 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Large patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22569: Proof of concept (10.19 KB, patch)
2019-06-10 14:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Proof of concept (10.19 KB, patch)
2019-06-11 10:56 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Proof of concept (12.88 KB, patch)
2019-06-11 13:31 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Proof of concept (12.88 KB, patch)
2019-06-11 13:33 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (13.11 KB, patch)
2019-10-24 10:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (14.15 KB, patch)
2019-10-24 10:22 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (14.18 KB, patch)
2019-10-24 12:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (6.75 KB, patch)
2019-10-24 12:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (14.18 KB, patch)
2019-12-19 06:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (6.75 KB, patch)
2019-12-19 06:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Reverse transferstosend controller (1.49 KB, patch)
2019-12-19 06:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Add inbound_transfers to Koha::Library (1.03 KB, patch)
2019-12-19 06:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Use inbound_transfers in transferstosend template (1.15 KB, patch)
2019-12-19 06:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (14.50 KB, patch)
2019-12-19 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (6.75 KB, patch)
2019-12-19 07:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (14.55 KB, patch)
2019-12-20 11:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (6.75 KB, patch)
2019-12-20 11:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (14.43 KB, patch)
2020-01-15 13:34 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (6.65 KB, patch)
2020-01-15 13:34 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (15.21 KB, patch)
2020-07-23 14:38 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (5.34 KB, patch)
2020-07-23 14:38 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Refine GetTransfersFromTo to filter out unsent transfers (1.03 KB, patch)
2020-07-23 14:38 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (15.21 KB, patch)
2020-07-24 10:19 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (5.34 KB, patch)
2020-07-24 10:19 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Refine GetTransfersFromTo to filter out unsent transfers (1.03 KB, patch)
2020-07-24 10:19 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (15.24 KB, patch)
2020-09-17 16:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (5.44 KB, patch)
2020-09-17 16:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Refine GetTransfersFromTo to filter out unsent transfers (1.09 KB, patch)
2020-09-17 16:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add a 'Transfers to send' report (15.30 KB, patch)
2020-09-22 12:19 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Add Unit Tests (5.44 KB, patch)
2020-09-22 12:19 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22569: Refine GetTransfersFromTo to filter out unsent transfers (1.17 KB, patch)
2020-09-22 12:19 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2019-03-22 17:49:52 UTC
The cronjob provides a report email tot he branch, however, there is no way on the  staff client to view current items needing checked in/advanced at the current branch. Perhaps a 'transfers to send' report like 'transfers to receive'
Comment 1 Martin Renvoize 2019-06-10 09:31:55 UTC
Nice idea, I'll try to get to this some time soon.
Comment 2 Martin Renvoize 2019-06-10 14:18:51 UTC Comment hidden (obsolete)
Comment 3 Martin Renvoize 2019-06-11 10:56:05 UTC Comment hidden (obsolete)
Comment 4 Martin Renvoize 2019-06-11 11:02:11 UTC Comment hidden (obsolete)
Comment 5 Martin Renvoize 2019-06-11 13:31:35 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize 2019-06-11 13:33:05 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize 2019-06-11 13:34:40 UTC
Work still to be done.. Unit tests.
Comment 8 Martin Renvoize 2019-10-24 10:16:39 UTC Comment hidden (obsolete)
Comment 9 Martin Renvoize 2019-10-24 10:22:06 UTC Comment hidden (obsolete)
Comment 10 Martin Renvoize 2019-10-24 12:18:22 UTC Comment hidden (obsolete)
Comment 11 Martin Renvoize 2019-10-24 12:18:26 UTC Comment hidden (obsolete)
Comment 12 Katrin Fischer 2019-11-03 19:11:08 UTC
Hi Martin, I am not sure about how the report is supposed to be used - can you explain?

A bit worried that this will be the crucial bit:
2) There is no way to differentiate between a transfer that has been
   requested and a transfer than has been actually sent.

So you won't see what has been put into transfer already?
Comment 13 Martin Renvoize 2019-11-04 14:40:07 UTC
(In reply to Katrin Fischer from comment #12)
> Hi Martin, I am not sure about how the report is supposed to be used - can
> you explain?
> 
> A bit worried that this will be the crucial bit:
> 2) There is no way to differentiate between a transfer that has been
>    requested and a transfer than has been actually sent.
> 
> So you won't see what has been put into transfer already?

Well, it's as an alternative to the stock rotation email reports which send this same data via email as a pick list for staff.

I can see where the confusion could come in.. perhaps bug 23092 needs to be done first if you think this will be more confusing as opposed to less?
Comment 14 Martin Renvoize 2019-12-19 06:53:09 UTC Comment hidden (obsolete)
Comment 15 Martin Renvoize 2019-12-19 06:53:12 UTC Comment hidden (obsolete)
Comment 16 Martin Renvoize 2019-12-19 06:53:15 UTC Comment hidden (obsolete)
Comment 17 Martin Renvoize 2019-12-19 06:53:18 UTC Comment hidden (obsolete)
Comment 18 Martin Renvoize 2019-12-19 06:53:21 UTC Comment hidden (obsolete)
Comment 19 Martin Renvoize 2019-12-19 07:09:02 UTC
Created attachment 96478 [details] [review]
Bug 22569: Add a 'Transfers to send' report

This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer by the stock
rotation subsystem.

Caveats:
1) It is currently limited to transfers prompted by stockrotation
2) There is no way to differentiate between a transfer that has been
   requested and a transfer than has been actually sent. (but we do
   filter out transfers that have been marked as received)
3) Both 'Advance' and 'Repatriate' actions will be listed and the
   'Advance' listings should have the option to set the item as 'In
   demand' at the current branch and thus cancel the transfer and
   make the item wait an additional stage period before being
   automatically set to transfer again.

   I believe we should enhance the transfers system as a whole to
   allow this report to be more meaningful and include transfer
   initiated via other means (along with appropriate actions to be
   taken upon them)

Test plan
1) Setup a rotation plan and add some items to it as per the
   manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appears in the new 'Transfers
   to send' page.

It does not yet catch items that are due for transfer by any other means
as at this time we do not store that sort of detail for other mechanisms.
See bug 23092 for one proposed resolution to that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 20 Martin Renvoize 2019-12-19 07:09:05 UTC
Created attachment 96479 [details] [review]
Bug 22569: Add Unit Tests
Comment 21 Martin Renvoize 2019-12-20 11:53:57 UTC
Created attachment 96516 [details] [review]
Bug 22569: Add a 'Transfers to send' report

This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer by the stock
rotation subsystem.

Caveats:
1) It is currently limited to transfers prompted by stockrotation
2) There is no way to differentiate between a transfer that has been
   requested and a transfer than has been actually sent. (but we do
   filter out transfers that have been marked as received)
3) Both 'Advance' and 'Repatriate' actions will be listed and the
   'Advance' listings should have the option to set the item as 'In
   demand' at the current branch and thus cancel the transfer and
   make the item wait an additional stage period before being
   automatically set to transfer again.

   I believe we should enhance the transfers system as a whole to
   allow this report to be more meaningful and include transfer
   initiated via other means (along with appropriate actions to be
   taken upon them)

Test plan
1) Setup a rotation plan and add some items to it as per the
   manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appears in the new 'Transfers
   to send' page.

It does not yet catch items that are due for transfer by any other means
as at this time we do not store that sort of detail for other mechanisms.
See bug 23092 for one proposed resolution to that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 22 Martin Renvoize 2019-12-20 11:54:00 UTC
Created attachment 96517 [details] [review]
Bug 22569: Add Unit Tests
Comment 23 Martin Renvoize 2020-01-15 13:34:51 UTC
Created attachment 97392 [details] [review]
Bug 22569: Add a 'Transfers to send' report

This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer by the stock
rotation subsystem.

Caveats:
1) It is currently limited to transfers prompted by stockrotation
2) There is no way to differentiate between a transfer that has been
   requested and a transfer than has been actually sent. (but we do
   filter out transfers that have been marked as received)
3) Both 'Advance' and 'Repatriate' actions will be listed and the
   'Advance' listings should have the option to set the item as 'In
   demand' at the current branch and thus cancel the transfer and
   make the item wait an additional stage period before being
   automatically set to transfer again.

   I believe we should enhance the transfers system as a whole to
   allow this report to be more meaningful and include transfer
   initiated via other means (along with appropriate actions to be
   taken upon them)

Test plan
1) Setup a rotation plan and add some items to it as per the
   manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appears in the new 'Transfers
   to send' page.

It does not yet catch items that are due for transfer by any other means
as at this time we do not store that sort of detail for other mechanisms.
See bug 23092 for one proposed resolution to that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 24 Martin Renvoize 2020-01-15 13:34:55 UTC
Created attachment 97393 [details] [review]
Bug 22569: Add Unit Tests
Comment 25 Katrin Fischer 2020-01-15 22:57:17 UTC
This has a dependency on bug 23092 that doesn't seem right. 

We are also failing the QA script:

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstosend.tt
   FAIL	  filters
		wrong_html_filter at line 59 (                        <a href="/cgi-bin/koha/catalogue/stockrotation.pl?op=toggle_in_demand&stage_id=4&item_id=[% transfer.itemnumber %]&biblionumber=[% transfer.item.biblionumber %]" class="btn btn-default btn-xs"><i class="fa fa-fire"></i> Mark "In demand"</a>)
		wrong_html_filter at line 59 (                        <a href="/cgi-bin/koha/catalogue/stockrotation.pl?op=toggle_in_demand&stage_id=4&item_id=[% transfer.itemnumber %]&biblionumber=[% transfer.item.biblionumber %]" class="btn btn-default btn-xs"><i class="fa fa-fire"></i> Mark "In demand"</a>)
		missing_filter at line 59 (                        <a href="/cgi-bin/koha/catalogue/stockrotation.pl?op=toggle_in_demand&stage_id=4&item_id=[% transfer.itemnumber %]&biblionumber=[% transfer.item.biblionumber %]" class="btn btn-default btn-xs"><i class="fa fa-fire"></i> Mark "In demand"</a>)
		missing_filter at line 59 (                        <a href="/cgi-bin/koha/catalogue/stockrotation.pl?op=toggle_in_demand&stage_id=4&item_id=[% transfer.itemnumber %]&biblionumber=[% transfer.item.biblionumber %]" class="btn btn-default btn-xs"><i class="fa fa-fire"></i> Mark "In demand"</a>)
   FAIL	  forbidden patterns
		forbidden pattern: tab char (line 31)


And the tests are not passing for me?

Please fix!
Comment 26 Martin Renvoize 2020-07-23 14:38:10 UTC
Created attachment 107258 [details] [review]
Bug 22569: Add a 'Transfers to send' report

This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer by the stock
rotation subsystem.

Caveats:
1) It is currently limited to transfers prompted by stockrotation
2) There is no way to differentiate between a transfer that has been
   requested and a transfer than has been actually sent. (but we do
   filter out transfers that have been marked as received)
3) Both 'Advance' and 'Repatriate' actions will be listed and the
   'Advance' listings should have the option to set the item as 'In
   demand' at the current branch and thus cancel the transfer and
   make the item wait an additional stage period before being
   automatically set to transfer again.

   I believe we should enhance the transfers system as a whole to
   allow this report to be more meaningful and include transfer
   initiated via other means (along with appropriate actions to be
   taken upon them)

Test plan
1) Setup a rotation plan and add some items to it as per the
   manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appears in the new 'Transfers
   to send' page.

It does not yet catch items that are due for transfer by any other means
as at this time we do not store that sort of detail for other mechanisms.
See bug 23092 for one proposed resolution to that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 27 Martin Renvoize 2020-07-23 14:38:15 UTC
Created attachment 107259 [details] [review]
Bug 22569: Add Unit Tests
Comment 28 Martin Renvoize 2020-07-23 14:38:19 UTC
Created attachment 107260 [details] [review]
Bug 22569: Refine GetTransfersFromTo to filter out unsent transfers

GetTransfersFromTo is used solely by the transferstorecieve page which
assumes items have already been sent. With the introduction of
daterequested we allow for a state where a transfer has been scheduled
but not yet sent (See stockrotation for such a case) and so we need to
filter these transfers out from the transferstorecieve report.
Comment 29 Martin Renvoize 2020-07-24 10:19:41 UTC
Created attachment 107306 [details] [review]
Bug 22569: Add a 'Transfers to send' report

This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer by the stock
rotation subsystem.

Caveats:
1) It is currently limited to transfers prompted by stockrotation
2) There is no way to differentiate between a transfer that has been
   requested and a transfer than has been actually sent. (but we do
   filter out transfers that have been marked as received)
3) Both 'Advance' and 'Repatriate' actions will be listed and the
   'Advance' listings should have the option to set the item as 'In
   demand' at the current branch and thus cancel the transfer and
   make the item wait an additional stage period before being
   automatically set to transfer again.

   I believe we should enhance the transfers system as a whole to
   allow this report to be more meaningful and include transfer
   initiated via other means (along with appropriate actions to be
   taken upon them)

Test plan
1) Setup a rotation plan and add some items to it as per the
   manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appears in the new 'Transfers
   to send' page.

It does not yet catch items that are due for transfer by any other means
as at this time we do not store that sort of detail for other mechanisms.
See bug 23092 for one proposed resolution to that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 30 Martin Renvoize 2020-07-24 10:19:44 UTC
Created attachment 107307 [details] [review]
Bug 22569: Add Unit Tests
Comment 31 Martin Renvoize 2020-07-24 10:19:48 UTC
Created attachment 107308 [details] [review]
Bug 22569: Refine GetTransfersFromTo to filter out unsent transfers

GetTransfersFromTo is used solely by the transferstorecieve page which
assumes items have already been sent. With the introduction of
daterequested we allow for a state where a transfer has been scheduled
but not yet sent (See stockrotation for such a case) and so we need to
filter these transfers out from the transferstorecieve report.
Comment 32 Martin Renvoize 2020-09-17 16:28:35 UTC
Created attachment 110284 [details] [review]
Bug 22569: Add a 'Transfers to send' report

This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer by the stock
rotation subsystem.

Caveats:
1) It is currently limited to transfers prompted by stockrotation
2) There is no way to differentiate between a transfer that has been
   requested and a transfer than has been actually sent. (but we do
   filter out transfers that have been marked as received)
3) Both 'Advance' and 'Repatriate' actions will be listed and the
   'Advance' listings should have the option to set the item as 'In
   demand' at the current branch and thus cancel the transfer and
   make the item wait an additional stage period before being
   automatically set to transfer again.

   I believe we should enhance the transfers system as a whole to
   allow this report to be more meaningful and include transfer
   initiated via other means (along with appropriate actions to be
   taken upon them)

Test plan
1) Setup a rotation plan and add some items to it as per the
   manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appears in the new 'Transfers
   to send' page.

It does not yet catch items that are due for transfer by any other means
as at this time we do not store that sort of detail for other mechanisms.
See bug 23092 for one proposed resolution to that.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 33 Martin Renvoize 2020-09-17 16:28:40 UTC
Created attachment 110285 [details] [review]
Bug 22569: Add Unit Tests

Test plan:
1/ Run the updated unit tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 34 Martin Renvoize 2020-09-17 16:28:47 UTC
Created attachment 110286 [details] [review]
Bug 22569: Refine GetTransfersFromTo to filter out unsent transfers

GetTransfersFromTo is used solely by the transferstorecieve page which
assumes items have already been sent. With the introduction of
daterequested we allow for a state where a transfer has been scheduled
but not yet sent (See stockrotation for such a case) and so we need to
filter these transfers out from the transferstorecieve report.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 35 Martin Renvoize 2020-09-17 16:30:28 UTC
This development has been in use for considerable time on site and I have been given approval by he users there to add their signoff.
Comment 36 Martin Renvoize 2020-09-22 12:19:24 UTC
Created attachment 110543 [details] [review]
Bug 22569: Add a 'Transfers to send' report

This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer by the stock
rotation subsystem.

Caveats:
1) It is currently limited to transfers prompted by stockrotation
2) There is no way to differentiate between a transfer that has been
   requested and a transfer than has been actually sent. (but we do
   filter out transfers that have been marked as received)
3) Both 'Advance' and 'Repatriate' actions will be listed and the
   'Advance' listings should have the option to set the item as 'In
   demand' at the current branch and thus cancel the transfer and
   make the item wait an additional stage period before being
   automatically set to transfer again.

   I believe we should enhance the transfers system as a whole to
   allow this report to be more meaningful and include transfer
   initiated via other means (along with appropriate actions to be
   taken upon them)

Test plan
1) Setup a rotation plan and add some items to it as per the
   manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appears in the new 'Transfers
   to send' page.

It does not yet catch items that are due for transfer by any other means
as at this time we do not store that sort of detail for other mechanisms.
See bug 23092 for one proposed resolution to that.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 37 Martin Renvoize 2020-09-22 12:19:31 UTC
Created attachment 110544 [details] [review]
Bug 22569: Add Unit Tests

Test plan:
1/ Run the updated unit tests

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 38 Martin Renvoize 2020-09-22 12:19:36 UTC
Created attachment 110545 [details] [review]
Bug 22569: Refine GetTransfersFromTo to filter out unsent transfers

GetTransfersFromTo is used solely by the transferstorecieve page which
assumes items have already been sent. With the introduction of
daterequested we allow for a state where a transfer has been scheduled
but not yet sent (See stockrotation for such a case) and so we need to
filter these transfers out from the transferstorecieve report.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Comment 39 Martin Renvoize 2020-10-20 13:25:26 UTC
OK.. pretty much the entire tree beneath this has now been tested and either already QA'd or SO'd in isolation, but it's time to QA the whole patchset.

I've set all preceeding bugs to BLOCKED to prevent duplication of work and obsoleted all patches so we can instead checkout the 'definitive' branch which contains all the patches.

I'm currently working through the creation of a complete test plan to take account of all area's modified.
Comment 40 Martin Renvoize 2021-01-12 11:29:08 UTC
I'm looking for feedback for this tree on https://gitlab.com/mrenvoize/Koha/-/merge_requests/1