https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41705 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197338 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197338&action=edit Bug 41705: Use PRG pattern for POS receipt printing to avoid popup blockers The previous approach triggered popup blockers because the receipt window was opened via JavaScript after a page reload — browsers treat this as a non-user-initiated action. This patch reverses the flow: when FinePaymentAutoPopup is enabled, the payment form submits directly to a new tab via target="_blank" (a user-initiated action that browsers allow), the server processes the payment and redirects (303) to the receipt page, which auto-prints and closes itself, returning focus to the POS tab. When FinePaymentAutoPopup is disabled, the server redirects back to the POS page with payment details in the URL (standard PRG), displaying the existing success banner with print/email receipt buttons. Changes: - pos/pay.pl: Implement PRG redirect for both popup and non-popup flows, URI-encode redirect parameters, remove session-based state management - pos/pay.tt: Add target="_blank" when FinePaymentAutoPopup is enabled, reset form state after submission via same-scope setTimeout - pos/printreceipt.pl: Add error handling for missing receipts, pass autoprint parameter to template - pos/printreceipt.tt: Add conditional auto-print, manual print/close buttons, error display, and IntranetSlipPrinterJS preference support - slip-print.inc: Modernize jQuery to vanilla JS, remove obsolete Chrome setTimeout hack Test plan: 1. Enable FinePaymentAutoPopup system preference 2. Go to Point of Sale, add items, and complete a sale 3. Verify receipt opens in a new tab without popup blocker warnings 4. Verify receipt auto-prints and tab closes after printing 5. Verify original POS tab form is reset for next transaction 6. Disable FinePaymentAutoPopup 7. Complete another sale 8. Verify POS page shows success with Print/Email receipt buttons 9. Test receipt printing from other pages (circulation, fees) to confirm slip-print.inc change causes no regressions -- You are receiving this mail because: You are on the CC list for the bug. You are watching all bug changes.