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.