From 0dd428bae743ea98e2bde821c12ff78b8f1c1c66 Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Wed, 18 Dec 2024 12:30:20 -0500 Subject: [PATCH] Bug 38588: Don't generate a second transfer when printing transfer slip When an item is checked in that should automatically return to its home branch, AddReturn generates the appropriate transfer. In some cases, the Print Slip button generates a second transfer, which now causes an exception to be thrown. In returns.pl, the op cud-dotransfer is used when a transfer was not initiated previously and the librarian has confirmed they want to initiate and send a transfer. The op cud-transfer is used when a transfer has already been generated and the page needs to send or cancel the transfer. This patch updates the op from the modal to ensure that the correct of the two options is generated according to whether a transfer was already initiated or not. To test: 1. Find or create an item that belongs to a branch other than the logged-in branch 2. In a new tab, check in the item - this should trigger a Return to Home transfer (keep the bib record tab open for later) 3. Click "Print Slip" --> Internal server error - 'Active item transfer already exists' 4. Apply patch and restart_all 5. Check in item again and cancel the transfer 6. Check in item again to generate new transfer 7. Click "Print Slip" --> Checkin page loads correctly --> Refresh bib record and confirm item shows as in-transit 8. Enable syspref ShowAllCheckins 9. Repeat steps 5-7 --> Ensure item displays correctly in checkins table --> Refresh bib record and confirm item still shows as in-transit 10. Repeat steps 5-7, except this time click "Yes" instead of "Print Slip" --> Ensure item displays correctly in the checkins table --> Refresh bib record and confirm item shows as in-transit 10. Set syspref TransfersBlockCirc to Don't Block, and set AutomaticConfirmTransfer to Enable 11. Check in the item again and cancel the transfer 12. Check in the item to generate new transfer 13. Click away from the modal without selecting a response --> Ensure item displays correctly in the checkins table --> Refresh bib record and confirm item shows as in-transit 14. Check out the item to a customer 15. Check the item in and click "Yes" --> Ensure item displays correctly in the checkins table --> Refresh bib record and confirm item shows as in-transit 16. Repeat steps 14-15, clicking "Print Slip" instead of "Yes" --> Ensure item displays correctly in the checkins table --> Refresh bib record and confirm item shows as in-transit 17. Repeat steps 14-15, clicking away from the modal without selecting a response --> Ensure item displays correctly in the checkins table --> Refresh bib record and confirm item shows as in-transit --- koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 98a1ea119b..d445341b95 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -770,16 +770,17 @@ - [% INCLUDE all_checkin_messages %]