https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43790

--- Comment #1 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 207816
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207816&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 <[email protected]>

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to