https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43790 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208007 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208007&action=edit Bug 43790: Dispatch EDIFACT message Import by message type The Import button on the EDIFACT messages page was shown for any message with status 'new' and always called process_invoice. Importing a QUOTE that way ran the invoice importer on it: every line was skipped with "missing ordernumber", an empty invoice header was created per click and the quote was marked received without a basket. Add Koha::EDI::process_message, which dispatches QUOTE, INVOICE and ORDRSP messages to process_quote, process_invoice and process_ordrsp and throws for anything else (outbound ORDERS). The Import button is now shown for unprocessed inbound messages of those types, is a cud-import POST with a CSRF token like Delete, and the script only imports messages still in status 'new'. Test plan: 1. prove t/db_dependent/Koha/EDI.t 2. Insert a 'new' QUOTE, an ORDERS and a processed QUOTE message in edifact_messages and open Acquisitions > EDIFACT messages 3. Import is shown only for the 'new' QUOTE 4. Click Import: a basket is created from the quote, no invoice or "missing ordernumber" errors are created 5. Repeat for INVOICE (EdifactInvoiceImport = manual) and ORDRSP Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.