[Bug 43345] New: The Pending orders table lists order lines with a cancellation date
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43345 Bug ID: 43345 Summary: The Pending orders table lists order lines with a cancellation date 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: nugged@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 36018 Target Milestone: --- The Pending orders table can list historical order lines whose cancellation date is set while their status is still new, ordered or partial and an outstanding quantity remains. Bug 36018 made the Pending orders table use Koha::Acquisition::Orders->filter_by_active. The filter checks order status and outstanding quantity, but it does not check datecancellationprinted. Bug 36068 classifies this exact combination (a cancellation date with a non-cancelled status) as obsolete acquisition data. As a result, an obsolete cancelled order line can be offered for receiving. Steps to reproduce: Prerequisite: use an upgraded test database containing an old order line with a cancellation date, status new, ordered or partial, and an outstanding quantity. Keep a normal outstanding order for the same vendor as a control. 1. Go to Acquisitions. 2. Open the vendor used by the two order lines. 3. Click "Receive shipments". 4. Create or open an invoice. 5. Look at the Pending orders table. Actual result: The obsolete order line with a cancellation date is listed together with the normal outstanding order. Expected result: The order line with a cancellation date is not listed. The normal outstanding order remains available for receiving. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36018 [Bug 36018] Improve consistency in Acquisition/Order(s) regarding active/current orders -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43345 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nugged@gmail.com |ity.org | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32928, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36068 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43345 --- Comment #1 from Andrii Nugged <nugged@gmail.com> --- Created attachment 203834 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203834&action=edit Bug 43345: Exclude cancelled orders from active order filter The original patch on Bug 32928 added cancellation and outstanding quantity filters. Bug 36018 later added the quantity check, but the cancellation-date condition did not land. Historical orders may have datecancellationprinted set while orderstatus remains new, ordered or partial. Koha treats these records as obsolete, but filter_by_active still returns them through only_active. They can therefore appear under Pending orders even though they were cancelled. Require active orders to have no cancellation date. Test plan: These steps require an upgraded database containing an order with a cancellation date and status new, ordered or partial. Current Koha does not normally create this inconsistent state. Keep a normal outstanding order for the same vendor as a control. Before applying the patch: 1. Go to Acquisitions and find the vendor for the inconsistent order. 2. Click Receive shipments and create or open an invoice. 3. Confirm that the inconsistent cancelled order is incorrectly listed under Pending orders. Apply the patch. After applying the patch: 1. Repeat the same receiving flow for the vendor. 2. Confirm that the inconsistent cancelled order is no longer listed under Pending orders. 3. Confirm that the normal outstanding order is still listed and can be opened for receiving. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43345 --- Comment #2 from Andrii Nugged <nugged@gmail.com> --- Created attachment 203835 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203835&action=edit Bug 43345: Add regression tests for active order filtering TestBuilder generates values for omitted date columns, so the existing active-order fixtures do not reliably model orders without a cancellation date. Set cancellation dates explicitly. Cover ordered, partial and standing new orders whose cancellation date is set, while retaining normal active orders as controls. Add REST API coverage for the only_active query used by the Pending orders table and keep the full parcel embed path covered. Update the method documentation to include the cancellation-date condition. Automated tests: prove t/db_dependent/Koha/Acquisition/Orders.t prove t/db_dependent/api/v1/acquisitions_orders.t Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43345 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org