[Bug 43535] New: Support matching EDIFACT invoice lines to orders via RFF+SLI
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43535 Bug ID: 43535 Summary: Support matching EDIFACT invoice lines to orders via RFF+SLI 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 Depends on: 43534 Target Milestone: --- Koha::Edifact::Line already parses the RFF+SLI segment (supplier's unique order line reference number) into orderline_reference_number for both QUOTES and INVOIC messages. However, Koha::EDI's process_invoice only ever matches an incoming invoice line to an aqorders row via RFF+LI (Koha's own internal ordernumber, which the supplier is expected to echo back because Koha sent it in the original EDIFACT ORDERS message). If RFF+LI is missing, or was never set in the first place, the invoice line is skipped and logged as an error - even in cases where RFF+SLI carries a vendor reference that could be matched against aqorders.suppliers_reference_number. Use case: Vendors such as GOBI/YBP support ordering via MARC file import (Koha's MarcFieldsToOrder workflow, see bug 43534) rather than via EDIFACT ORDERS, yet still return EDIFACT INVOIC invoices referencing their own order/line ID via RFF+SLI (e.g. the GOBI order ID). Because Koha never sent an ORDERS message for those lines, there is no RFF+LI value the vendor can echo back, so the invoice lines currently cannot be auto-matched at all. Bug 43534 proposes capturing that vendor reference into aqorders.suppliers_reference_number / suppliers_reference_qualifier at MARC-order time. This bug is to add a fallback in Koha::EDI's invoice processing: when RFF+LI does not resolve to an aqorders row, attempt to match the invoice line to an order via RFF+SLI (orderline_reference_number) against aqorders.suppliers_reference_number. Depends on bug 43534. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43534 [Bug 43534] Allow MarcFieldsToOrder to map a MARC field to supplier's reference number/qualifier -- 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=43535 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 watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43535 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 205794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205794&action=edit Bug 43535: Support matching EDIFACT invoice lines to orders via RFF+SLI/QLI Koha::EDI's process_invoice previously matched every incoming EDIFACT INVOIC line to an aqorders row only via RFF+LI - Koha's own internal ordernumber, echoed back by the vendor because Koha sent it in the original EDIFACT ORDERS message. If RFF+LI was missing or did not resolve, the line was skipped and logged as an error. This adds a fallback: when RFF+LI is absent or does not match an order, try the supplier's own line reference (RFF+SLI), or failing that their quotation reference (RFF+QLI), against aqorders.suppliers_reference_number - scoped to the invoice's vendor to avoid cross-vendor collisions. Both qualifiers were already parsed by Koha::Edifact::Line but never consulted during invoice matching. This matters for vendors such as GOBI/YBP, which support ordering via MARC file import (see bug 43534, which this depends on) rather than EDIFACT ORDERS, but still return EDIFACT invoices referencing their own order/line ID via RFF+SLI. Previously those invoice lines could never be matched at all, since Koha never sent an ORDERS message containing a Koha ordernumber for the vendor to echo back. Test plan: 1. Apply this patch and bug 43534's patch. 2. Set MarcFieldsToOrder to map suppliers_reference_number and a literal suppliers_reference_qualifier (e.g. SLI), then create an order line via a MARC order file as per bug 43534's test plan, noting the resulting suppliers_reference_number. 3. Construct or receive an EDIFACT INVOIC message for that vendor whose line has no RFF+LI (or an unresolvable one) but has an RFF+SLI (or RFF+QLI) matching that suppliers_reference_number. 4. Process the invoice (Koha::EDI::process_invoice) and confirm the order line is receipted correctly, with no "cannot find order" error logged. 5. Confirm existing EDI invoice processing (RFF+LI matching, and the "missing ordernumber" / "cannot find order with ordernumber X" error paths) is unaffected when no supplier reference is present or applicable. 6. prove t/db_dependent/Koha/EDI.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43535 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=43535 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43535 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Support matching EDIFACT |Support matching EDIFACT |invoice lines to orders via |invoice lines to orders via |RFF+SLI |RFF+SLI|QLI -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org