https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44352 Bug ID: 44352 Summary: Order preview leaves the receipt page for closed invoices Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: nugged@gmail.com Reporter: nugged@gmail.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Closed invoices have no pending-orders table. Calling api() on the missing table aborts the document-ready callback before the shared preview handlers are registered. Order previews then navigate away instead of opening the modal. Initialize the pending table and its selection handlers only while the invoice is open. Keep the preview handlers available for both states. Add a browser regression using a real received order, checking open and closed invoices without stubbing the table or preview responses. Test plan: Before applying the patch: 1. In Acquisitions, open an invoice containing a received order. 2. Click Go to receipt page. 3. In the received-orders table, click the Order link. Details open in a modal without leaving the receipt page. 4. Return to the invoice, select Close, and click Save. 5. Click Go to receipt page. 6. Click the same Order link. Koha leaves the receipt page and displays the order details as a separate page. Apply the patch. After applying the patch: 1. Return to the closed invoice and click Go to receipt page. 2. Click the same Order link. Details open in a modal and Koha stays on the receipt page. 3. Close the modal and confirm the received order is still listed. 4. Repeat with an open invoice; its preview must still open in a modal. Automated tests: Run the Acquisitions/ClosedInvoicePreview_spec.ts Cypress spec against the staff interface and test database, using the normal Koha setup. Related changes: Bug 8179 introduced the unchecked pending-table caller. Bug 38255 made kohaTable return early when the table node is absent. The pending table is intentionally absent for a closed invoice. -- You are receiving this mail because: You are watching all bug changes.