[Bug 42789] New: EDI ORDRSP: Item and suggestion status not updated when order line cancelled by supplier
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Bug ID: 42789 Summary: EDI ORDRSP: Item and suggestion status not updated when order line cancelled by supplier Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement 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 When an EDI ORDRSP message cancels an order line, Koha marks the order status to 'cancelled' but does not update the status of associated items or purchase suggestions. Items created as part of the acquisition (on-order items) retain their existing status, which can prevent holds from being placed or fulfilled. Similarly, any purchase suggestion that drove the original order is not updated to reflect that the order has been cancelled, leaving suggestions in a misleading state. Customer reports confirm that in some configurations items are being deleted on cancellation, causing holds to fail. The correct behaviour â whether to delete, update status, or transfer holds â needs to be defined and implemented consistently for the EDI cancellation code path, matching the behaviour of manual cancellation via the acquisitions UI. The processing logic is in Koha/EDI.pm, process_ordrsp() (~line 199-248). Test plan: 1. Create an order with associated on-order items and/or a linked suggestion. 2. Place a hold on one of the on-order items. 3. Receive an EDI ORDRSP cancellation for that order line and run edi_cron.pl. 4. Confirm the order line is marked cancelled. 5. Confirm on-order items are handled appropriately (status updated / holds transferred). 6. Confirm any linked suggestion is returned to a pending/unfulfilled state. -- 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=42789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- 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=42789 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200098 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200098&action=edit Bug 42789: EDI ORDRSP cancellation should use Koha::Acquisition::Order->cancel() The process_ordrsp() function was calling C4::Acquisition::ModOrder() directly when processing a supplier cancellation, which only updated the order status fields and left associated items and purchase suggestions untouched. Replace with Koha::Acquisition::Order->cancel(), which mirrors the behaviour of manual cancellation via the acquisitions UI: - Deletes on-order items via safe_delete() with error capture - Reverts any linked purchase suggestion from ORDERED back to ACCEPTED - Updates orderstatus, cancellationreason and datecancellationprinted The delete_biblio option is intentionally omitted (defaults to false) as silent biblio deletion is not appropriate for an automated EDI flow. ModOrder is retained for the non-cancellation branch which only needs to update suppliers_report. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200099 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200099&action=edit Bug 42789: Add missing POD for _validate_location_code and _validate_collection_code These private subs were added without pod_coverage documentation, causing a QA failure. Add minimal =head3 blocks to resolve it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200100 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200100&action=edit Bug 42789: Add tests for process_ordrsp() cancellation handling Tests verify that EDI ORDRSP cancellations now use Koha::Acquisition::Order->cancel() rather than a raw ModOrder call: - Order status, cancellation reason and date are set correctly - On-order items linked via aqorders_items are deleted - Purchase suggestions linked to the biblio are reverted from ORDERED back to ACCEPTED - Non-cancellation actions update suppliers_report only - Missing ordernumbers are handled gracefully without dying -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernard.scaife@openfifth.co | |.uk, | |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Sponsorship status|--- |Sponsored Status|Needs Signoff |Signed Off Comma delimited| |OpenFifth list of Sponsors| |<https://openfifth.co.uk/> QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200098|0 |1 is obsolete| | Attachment #200099|0 |1 is obsolete| | Attachment #200100|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200354 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200354&action=edit Bug 42789: EDI ORDRSP cancellation should use Koha::Acquisition::Order->cancel() The process_ordrsp() function was calling C4::Acquisition::ModOrder() directly when processing a supplier cancellation, which only updated the order status fields and left associated items and purchase suggestions untouched. Replace with Koha::Acquisition::Order->cancel(), which mirrors the behaviour of manual cancellation via the acquisitions UI: - Deletes on-order items via safe_delete() with error capture - Reverts any linked purchase suggestion from ORDERED back to ACCEPTED - Updates orderstatus, cancellationreason and datecancellationprinted The delete_biblio option is intentionally omitted (defaults to false) as silent biblio deletion is not appropriate for an automated EDI flow. ModOrder is retained for the non-cancellation branch which only needs to update suppliers_report. Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200355 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200355&action=edit Bug 42789: Add missing POD for _validate_location_code and _validate_collection_code These private subs were added without pod_coverage documentation, causing a QA failure. Add minimal =head3 blocks to resolve it. Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200356 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200356&action=edit Bug 42789: Add tests for process_ordrsp() cancellation handling Tests verify that EDI ORDRSP cancellations now use Koha::Acquisition::Order->cancel() rather than a raw ModOrder call: - Order status, cancellation reason and date are set correctly - On-order items linked via aqorders_items are deleted - Purchase suggestions linked to the biblio are reverted from ORDERED back to ACCEPTED - Non-cancellation actions update suppliers_report only - Missing ordernumbers are handled gracefully without dying Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |20252 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20252 [Bug 20252] If an EDI orderline is cancelled send a cancellation message -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200354|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200355|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200356|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #7 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201088 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201088&action=edit Bug 42789: EDI ORDRSP cancellation should use Koha::Acquisition::Order->cancel() The process_ordrsp() function was calling C4::Acquisition::ModOrder() directly when processing a supplier cancellation, which only updated the order status fields and left associated items and purchase suggestions untouched. Replace with Koha::Acquisition::Order->cancel(), which mirrors the behaviour of manual cancellation via the acquisitions UI: - Deletes on-order items via safe_delete() with error capture - Reverts any linked purchase suggestion from ORDERED back to ACCEPTED - Updates orderstatus, cancellationreason and datecancellationprinted The delete_biblio option is intentionally omitted (defaults to false) as silent biblio deletion is not appropriate for an automated EDI flow. ModOrder is retained for the non-cancellation branch which only needs to update suppliers_report. Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #8 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201089 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201089&action=edit Bug 42789: Add missing POD for _validate_location_code and _validate_collection_code These private subs were added without pod_coverage documentation, causing a QA failure. Add minimal =head3 blocks to resolve it. Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #9 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201090 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201090&action=edit Bug 42789: Add tests for process_ordrsp() cancellation handling Tests verify that EDI ORDRSP cancellations now use Koha::Acquisition::Order->cancel() rather than a raw ModOrder call: - Order status, cancellation reason and date are set correctly - On-order items linked via aqorders_items are deleted - Purchase suggestions linked to the biblio are reverted from ORDERED back to ACCEPTED - Non-cancellation actions update suppliers_report only - Missing ordernumbers are handled gracefully without dying Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #10 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201091 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201091&action=edit Bug 42789: (QA follow-up) Log item deletion failures during EDI cancellation This patch logs any object messages returned by cancel() to the EDI log, including the itemnumber if available. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42789 --- Comment #11 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201092 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201092&action=edit Bug 42789: (QA follow-up) Add test for cancelling an order with a held item Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org