Bug 38174

Summary: Self checkout renders alert for each checkout in session instead of just most recent checkout
Product: Koha Reporter: Brendan Lawlor <blawlor>
Component: Self checkoutAssignee: Brendan Lawlor <blawlor>
Status: Pushed to stable --- QA Contact: Paul Derscheid <me>
Severity: minor    
Priority: P5 - low CC: blawlor, cbrannon
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.05.00,24.11.04
Circulation function:
Bug Depends on: 32256    
Bug Blocks:    
Attachments: Bug 38174: Fix self checkout alerts for non batch checkouts
Bug 38174: Fix self checkout alerts for non batch checkouts
Bug 38174: Fix self checkout alerts for non batch checkouts

Description Brendan Lawlor 2024-10-15 12:18:44 UTC
In self checkout, if a  patron scans a stack of books one at a time, an additional blue alert-info box is rendered for each new checkout. When this list becomes long it can push the barcode input down so far that it goes off screen which can be confusing for patrons.

When not using batch checkout, self checkout should only render an alert-info box for the most recent scan.
Comment 1 Brendan Lawlor 2024-10-15 13:02:20 UTC
Created attachment 172774 [details] [review]
Bug 38174: Fix self checkout alerts for non batch checkouts

This patch adds a check for batch_checkouts_allowed to SCO.

If not using batch checkout, only the most recent chekout should be
rendered as an alert, instead of all the new issues for the session.

This makes the input box consitently render in the same position.

To replicate:
1. Login as self_checkout to localhost:8080/cgi-bin/koha/sco/sco-main.pl
2. Login as a patron to make self checkouts
3. Check many items out and notice an additional alert is rendered
    for each checkout, eventually pushing the barcode input off screen.

To test:
1. Apply patch and restart_alll
2. Login as a patron to make self checkouts
3. Check many items out
4. Notice only the most recent checkout is rendered as an info alert
5. Confirm the Checkouts table below still loads all checkouts
6. In Admin set BatchCheckouts to 'Allow'
7. Set SCOBatchCheckoutsValidCategories to 'Select all'
8. Login to sco as a patron and enter a newline delimited list of barcodes
9. Confirm that an alert is rendered for each checkout in the batch
Comment 2 Lucas Gass (lukeg) 2024-12-20 21:04:48 UTC
Created attachment 175856 [details] [review]
Bug 38174: Fix self checkout alerts for non batch checkouts

This patch adds a check for batch_checkouts_allowed to SCO.

If not using batch checkout, only the most recent chekout should be
rendered as an alert, instead of all the new issues for the session.

This makes the input box consitently render in the same position.

To replicate:
1. Login as self_checkout to localhost:8080/cgi-bin/koha/sco/sco-main.pl
2. Login as a patron to make self checkouts
3. Check many items out and notice an additional alert is rendered
    for each checkout, eventually pushing the barcode input off screen.

To test:
1. Apply patch and restart_alll
2. Login as a patron to make self checkouts
3. Check many items out
4. Notice only the most recent checkout is rendered as an info alert
5. Confirm the Checkouts table below still loads all checkouts
6. In Admin set BatchCheckouts to 'Allow'
7. Set SCOBatchCheckoutsValidCategories to 'Select all'
8. Login to sco as a patron and enter a newline delimited list of barcodes
9. Confirm that an alert is rendered for each checkout in the batch

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 Paul Derscheid 2025-01-20 18:00:59 UTC
Created attachment 176838 [details] [review]
Bug 38174: Fix self checkout alerts for non batch checkouts

This patch adds a check for batch_checkouts_allowed to SCO.

If not using batch checkout, only the most recent chekout should be
rendered as an alert, instead of all the new issues for the session.

This makes the input box consitently render in the same position.

To replicate:
1. Login as self_checkout to localhost:8080/cgi-bin/koha/sco/sco-main.pl
2. Login as a patron to make self checkouts
3. Check many items out and notice an additional alert is rendered
    for each checkout, eventually pushing the barcode input off screen.

To test:
1. Apply patch and restart_alll
2. Login as a patron to make self checkouts
3. Check many items out
4. Notice only the most recent checkout is rendered as an info alert
5. Confirm the Checkouts table below still loads all checkouts
6. In Admin set BatchCheckouts to 'Allow'
7. Set SCOBatchCheckoutsValidCategories to 'Select all'
8. Login to sco as a patron and enter a newline delimited list of barcodes
9. Confirm that an alert is rendered for each checkout in the batch

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 4 Katrin Fischer 2025-01-24 15:15:14 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 5 Christopher Brannon 2025-04-16 22:10:34 UTC
Can this be backported to 24.11?
Comment 6 Paul Derscheid 2025-04-22 20:27:00 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.04