[Bug 43756] New: EDI invoice processing receives lines for cancelled orders and re-opens them
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43756 Bug ID: 43756 Summary: EDI invoice processing receives lines for cancelled orders and re-opens them 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 Target Milestone: --- Koha::EDI::process_invoice receives an invoice line even when the order it refers to has been cancelled in Koha. The cancelled order is received like any other: its status is changed from cancelled to complete, quantityreceived and prices are set, and nothing is recorded in edifact_errors. Bug 38423 made process_invoice skip and report lines that cannot be receipted (no ordernumber, unknown order, deleted record) and its description names cancelled orders as one of the problem cases, but a cancelled order is not skipped. Process_invoice already records a warning for an order that is already complete; a cancelled order gets no such treatment. Reproduced on main (vendor EDI account without plugin): an order with orderstatus 'cancelled' and one linked item, and an invoice for it with QTY+47:1 and RFF+LI pointing to the order. - order status after processing: complete (quantityreceived 1) - edifact_errors: none - message status: received This silently undoes a cancellation (for example one made by staff or by an ORDRSP cancel), re-opens spent budget and gives staff no indication that the supplier invoiced a line the library believed was cancelled. Proposed behaviour: skip the line, leave the order cancelled, and add an edifact_errors row (with the invoice number) saying the invoice line refers to a cancelled order, so staff can reconcile it with the supplier. Test plan: 1. Create an order line and cancel it. 2. Process an EDIFACT invoice that refers to the order with RFF+LI. 3. Without the patch: the order becomes complete and no error is shown. 4. With the patch: the order stays cancelled, other lines on the invoice are still received, and the EDIFACT messages page shows an error for the invoice line referring to a cancelled order. -- 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=43756 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 QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | Status|NEW |CONFIRMED -- 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=43756 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41852 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41852 [Bug 41852] Modernize EDI support in Koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43756 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208626 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208626&action=edit Bug 43756: Skip EDI invoice lines that refer to a cancelled order Koha::EDI::process_invoice received an invoice line even when the order it refers to had been cancelled in Koha. The cancelled order was received like any other: its status was changed from cancelled to complete, quantityreceived and prices were set, and nothing was recorded in edifact_errors. Bug 38423 made process_invoice skip and report lines that cannot be receipted (no ordernumber, unknown order, deleted record), and names cancelled orders among the problem cases, but a cancelled order was not skipped. An order that is already complete gets a warning; a cancelled one got no such treatment. That silently undid a cancellation (one made by staff, or by an ORDRSP cancel), re-opened spent budget, and gave staff no indication that the supplier had invoiced a line the library believed was cancelled. The line is now skipped and the order is left cancelled. An edifact_errors row, with the invoice number, says that the invoice line refers to a cancelled order, so staff can reconcile it with the supplier. The other lines on the invoice are still received. Test plan: 1. Apply the patch 2. prove t/db_dependent/Koha/EDI.t => the subtest 'process_invoice skips lines for cancelled orders' passes 3. Create an order line and cancel it 4. Process an EDIFACT invoice that refers to the order with RFF+LI, and has a second line for an order that is still open => the cancelled order stays cancelled, the second order is received, and the EDIFACT messages page shows an error for the invoice line that refers to a cancelled order Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43756 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43756 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208628 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208628&action=edit Bug 43756: (follow-up) Say that a skipped cancelled order line is not in the invoice total The error recorded for an invoice line that refers to a cancelled order only said that the line was skipped. Koha builds the invoice from the lines it receives and does not keep the total in the supplier's message, so a skipped line is left out of the invoice and the total shows less than the supplier's invoice, without saying why. The error, which the invoice page shows under "Processing errors", now says that the line was not received and is not included in the invoice total, and asks staff to check the total with the supplier. Test plan: 1. prove t/db_dependent/Koha/EDI.t => it passes, including 'process_invoice skips lines for cancelled orders' 2. Process an EDIFACT invoice that has a line referring to a cancelled order, and open the invoice => under "Processing errors" the message says the line refers to the cancelled order, was not received, and is not included in the invoice total Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org