https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Bug ID: 43876 Summary: CancelReceipt deletes items with raw SQL: no deleteditems copy, no reindex, no logging 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: adolfo.rodriguez@xercode.es QA Contact: testopia@bugs.koha-community.org Target Milestone: --- When a basket creates items on receiving (effective_create_items eq 'receiving'), cancelling a receipt (C4::Acquisition::CancelReceipt) deletes those items with a raw SQL DELETE in _cancel_items_receipt: DELETE FROM items, aqorders_items USING items, aqorders_items WHERE items.itemnumber = ? AND aqorders_items.itemnumber = ? Because Koha::Item->delete is bypassed: - no copy of the item is kept in deleteditems - the bibliographic record is not reindexed, so the deleted items are still shown in the search results (Elasticsearch and Zebra) - nothing is written to the cataloguing log - the after_item_action plugin hook (action 'delete') is not called - the real-time holds queue is not updated - an item group left empty is not deleted To reproduce: 1. Create a basket with "Create items when: receiving an order". 2. Add an order with quantity 2, close the basket and receive it. Two items are created and shown in the catalog search results. 3. Cancel the receipt. 4. The items are gone from the items table, but they are not in deleteditems, there is no DELETE entry in the cataloguing log, and the record still shows the items in the search results. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.