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

--- Comment #2 from Lisette Scheer <[email protected]> ---
Created attachment 199058
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199058&action=edit
Bug 42513: Stock rotation upgrades to handle cancelled advancements

This patch updates the Koha/StockRotationItem.pm to change needs_advancing to
be checked before needs_repatriating.
It also updates needs_advancing to handle when the last StockrotationAdvance
was cancelled so items don't get stuck never moving.

To recreate:

1. Turn on StockRotation in the system preferences
2. Navigate to 'Cataloging'->'Stock Rotation'
3. Click the 'New rota` button give it any name and leave it cyclical
4. On the stock rotations table, click the "Manage" button for your new rota
and manage stages
5. Create at least 2 stages at different libraries set the days for each stage
to 1
6. In the left hand bar, there should be a 'Manage items' option, click on
that.
7. Add 39999000011418 (or a barcode of your choice) to the rota
8. Click 'Stock rotation' in the breadcrumbs
9. on the stock rotation table, activate your rota with the "Activate" button
10. on the stock rotation table, click the manage button, then manage items
11. click 'Move to next stage'
12. Run the following report:
select * from branchtransfers

You should have 1 transfer with  the reason StockrotationAdvance
13. Search the catalog for 39999000011418, edit the item
14. Mark the item as lost
15. Repeat step 12, there should now be a cancellation
16. Remove the lost status
17. Repeat steps 10-12
There should now be one with a cancellation and one without a cancellation

18. Change your library to the library that matches the 'To branch' for your
active transfer.
19. Check the item in.
20. Repeat steps 10-12
There should now be a 'date_arrived' on the most recent transfer.

21. Directly edit your database
ktd --shell
koha-mysql kohadev
UPDATE branchtransfers SET date_arrived="date" where
branchtransfer_id="yourbranchtransfer_id";
*date arrived should be your date but change the day back in time a day or 2
*branchtransfer_id is the id of the most recent transfer, which should be 2

22. Run your report
Observe that the date is updated

23. in your ktd, run this script:
perl misc/cronjobs/stockrotation.pl -x
(if you're still in the database, first type 'exit' and hit enter)
This should show you the results of your item. It should have "status:
advancement"

This will execute the change.
23. Repeat steps 13-16
24. Repeat steps 21-22
25. in your ktd, run this script (leave the -x off the end)
 perl misc/cronjobs/stockrotation.pl

26. The status will come up and say 'repatriation' instead of 'advancement'

To test the patch:
27. Apply the patch
28. restart_all
29. Repeat steps  10-25
It should now say 'advancement'

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to