https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44297 Bug ID: 44297 Summary: Deleting a basket does not warn about, or cancel, patrons' holds on the on-order items of its lines Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Depends on: 14797 Target Milestone: --- Deleting a basket in acquisitions cancels every order line that is still open and then deletes the basket (acqui/basket.pl, op cud-delete). Patrons who have placed holds on the on-order items of those lines are not mentioned anywhere. The holds can no longer be filled, and while they exist the items of those lines cannot be deleted either, so the lines are cancelled and the items stay behind. Bug 14797 adds a warning to the cancel confirmation page for a single order line: it lists the patrons whose holds could no longer be filled once the order is cancelled, and a librarian with the permission to cancel holds can choose to cancel them with a HOLD_CANCELLATION reason, which also tells the patrons (Koha::Acquisition::Order->holds_orphaned_by_cancellation and the cancel_holds / hold_cancellation_reason options of Order->cancel, added by bug 44187). Deleting a whole basket does not use that page, so it still has the problem, for every line in the basket at once. Proposal: * Before the basket is deleted, collect the holds that cancelling its open lines would orphan, using holds_orphaned_by_cancellation() on each line. * If there are any, show them in the confirmation (how many patrons and titles are affected) and, for a librarian who may cancel holds, offer to cancel them with a HOLD_CANCELLATION reason chosen once for the whole basket. Without the permission, or without ticking the option, behaviour stays as it is today. * Pass cancel_holds and the reason through to Order->cancel() for each line, as 14797 does, and report how many holds were cancelled and whether the patrons were notified on the page shown after the deletion. * Reuse the markup and wording of 14797 so the two screens behave the same way. Open questions: * The current page lists records that could not be deleted (cannotdelbiblios) whenever cancel() reports anything. With holds cancelled, the holds_cancelled message from cancel() must not be counted as a problem, as in 14797. * Whether the basket confirmation should be a page or stay a browser confirm with the holds shown on the basket page itself. Test plan: 1. Set AcqCreateItem to "placing an order", add reasons to the HOLD_CANCELLATION authorized value category and define the HOLD_CANCELLATION notice. 2. Create a basket with two orders whose items each have a hold from a patron with an email address. 3. Delete the basket. Before the patch: the basket is deleted, the holds and items remain and nobody is told. 4. After the patch: the confirmation lists the affected patrons and titles; choosing to cancel the holds with a reason cancels them, deletes the items and notifies the patrons; leaving it unticked behaves as before. 5. A basket with no holds shows nothing extra, and a librarian without the permission to cancel holds is told they will be left in place. Related: 14797 (single order line), 44187 (helper and automated EDI cancellations). Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14797 [Bug 14797] Cancelling orders with no alert to existing holds -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.