[Bug 43874] New: EDIFACT GIR part-order sets (Lnn with LQT) are not expanded into copies
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43874 Bug ID: 43874 Summary: EDIFACT GIR part-order sets (Lnn with LQT) are not expanded into copies 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 Target Milestone: --- Koha treats every GIR segment as one copy. The EDItEUR Library EDI Implementation Guidelines (v1.2: quotes, orders, order responses and invoices) also define a part-order set, which is one GIR standing for several copies of an order line that share the same branch, fund, shelfmark and servicing. In a GIR segment the first element (DE 7297, set identification qualifier) is either a copy sequence number 001 to 999, or a part-order sequence number L01 to L99. For a part-order set the number of copies is given by the LQT code (part-order quantity, an integer in DE 7402), which the guidelines require with an Lnn set and do not use with a copy number. For example: GIR+L01+3:LQT+BR1:LLO+FIC:LSQ' means 3 copies to branch BR1 in the FIC sequence, in place of GIR+001, GIR+002 and GIR+003. LAC may repeat to list the barcodes of the set, or LAF and LAL may give a sequential range. It is a compact form for a large order spread over a few branches. Current behaviour: - Koha::Edifact::Line::extract_gir reads LQT into part_order_quantity, but nothing uses it. Each GIR is one entry, and segments with the same set number are merged. - Quotes: when there is more than one GIR the count must equal the quantity, otherwise an error "Order for N items, M segments present" is recorded. Koha::EDI has a comment, in the quote processing, that 1:1 GIR and 1:n GIR (with LQT values) should both be handled there. - Invoices: receipt_items and transfer_items take the branch from the GIR of each copy. With one GIR for N copies, only the first copy is matched by its branch, and the others have no branch. After bug 43755 they are taken from the remaining items on the order without any branch matching, so nothing fails but they may be taken from the wrong branch. Some suppliers do not follow the guidelines exactly. For example the Civica Spydus requirements for vendors put LQT on a numbered set (GIR+001+2:LQT+ABB:LLO...). Support should accept LQT whatever the set number is. Proposed change: expand part-order sets in the parser, Koha::Edifact::Line, into one entry per copy, so that quotes and invoices both see one GIR per copy and need no changes of their own: a. A GIR with LQT = n becomes n entries with the same field values. b. A list of LAC values is spread over the copies in order, and an LAF to LAL range is expanded into one barcode per copy. c. The mismatch error for quotes is kept for a count that still does not match after expansion, and the comment about LQT in the quote processing is removed. Optionally, as a follow-up, Koha::Edifact::Order could send part-order sets for a line whose copies share all their GIR data. Related to bug 43755 (invoice lines with no GIR), which also changes how items are matched on an invoice line. Test plan: 1. Process a QUOTE whose line has QTY+21:3 and a single GIR+L01+3:LQT+BR1:LLO+FIC:LSQ. 2. Without the patch: the line is not treated as 3 copies at BR1. 3. With the patch: the order line is for 3 copies, with 3 items at BR1 in the FIC sequence. 4. Process an INVOIC for an order of 4 copies, 3 of them at BR1, with QTY+47:3 and GIR+L01+3:LQT+BR1:LLO. 5. Without the patch: only the first copy is matched by branch. 6. With the patch: the 3 items at BR1 are the ones received. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43874 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43874 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=43874 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208630 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208630&action=edit Bug 43874: Expand EDIFACT GIR part-order sets into one entry per copy The EDItEUR Library EDI Implementation Guidelines let a GIR segment stand for a part-order set: several copies of an order line with the same branch, fund, shelfmark and servicing, instead of one GIR for each copy. The set number in the first element is L01 to L99 rather than a copy number 001 to 999, and the number of copies is given by the LQT code. For example GIR+L01+3:LQT+BR1:LLO+FIC:LSQ' is 3 copies to branch BR1 in the FIC sequence. Koha::Edifact::Line read LQT but never used it, and treated every GIR as one copy. On a quote, more than one GIR had to match the quantity or an error was recorded, and the processing noted that LQT should be handled. On an invoice only the first copy of a set was matched by its branch. Koha::Edifact::Line now expands a part-order set into one entry per copy, so that quotes and invoices both see one GIR for each copy and need no changes of their own. A GIR with an LQT above 1 becomes that many copies with the same fields, whatever its set number is, as some suppliers put LQT on numbered sets. The accession numbers of the copies are given by a list of LAC, or by an LAF and LAL range, and are spread over the copies in order. They are only used when they account for every copy, so a barcode is never given to two copies. A repeated LAC used to overwrite the one before it in a GIR segment, and now the barcodes of all the segments of a set are kept. The private subs in Koha::Edifact::Line that had no POD are documented, as the QA script requires it of a file that is changed. Test plan: 1. Apply the patch 2. prove t/Edifact.t t/db_dependent/Koha/EDI.t => they pass, including 'GIR part-order sets are expanded into copies' and 'process_invoice with a GIR part-order set' 3. Process a QUOTE whose line has QTY+21:3 and a single GIR+L01+3:LQT+BR1:LLO+FIC:LSQ => the order line is for 3 copies, with 3 items at BR1 in the FIC sequence, and there is no error about the number of segments 4. Process an INVOIC for an order of 4 copies, 3 of them at BR1, with QTY+47:3 and GIR+L01+3:LQT+BR1:LLO => the 3 items at BR1 are moved to the received order and received 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=43874 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=43874 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208630|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43874 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208632 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208632&action=edit Bug 43874: Expand EDIFACT GIR part-order sets into one entry per copy The EDItEUR Library EDI Implementation Guidelines let a GIR segment stand for a part-order set: several copies of an order line with the same branch, fund, shelfmark and servicing, instead of one GIR for each copy. The set number in the first element is L01 to L99 rather than a copy number 001 to 999, and the number of copies is given by the LQT code. For example GIR+L01+3:LQT+BR1:LLO+FIC:LSQ' is 3 copies to branch BR1 in the FIC sequence. Koha::Edifact::Line read LQT but never used it, and treated every GIR as one copy. On a quote, more than one GIR had to match the quantity, so two part-order sets for 5 copies recorded "Order for 5 items, 2 segments present" and an "Invalid budget" error for each copy the sets did not cover, and made two order lines of one copy instead of one for 5. On an invoice only the first copy of a set was matched by its branch. Koha::Edifact::Line now expands a part-order set into one entry per copy, so that quotes and invoices both see one GIR for each copy and need no changes of their own. A GIR with an LQT above 1 becomes that many copies with the same fields, whatever its set number is, as some suppliers put LQT on numbered sets. The accession numbers of the copies are given by a list of LAC, or by an LAF and LAL range, and are spread over the copies in order. They are only used when they account for every copy, so a barcode is never given to two copies. A repeated LAC used to overwrite the one before it in a GIR segment, and now the barcodes of all the segments of a set are kept. The private subs in Koha::Edifact::Line that had no POD are documented, as the QA script requires it of a file that is changed. Test plan: 1. Apply the patch 2. prove t/Edifact.t t/db_dependent/Koha/EDI.t => they pass, including 'GIR part-order sets are expanded into copies', 'process_quote with a GIR part-order set' and 'process_invoice with a GIR part-order set' 3. Process a QUOTE whose line has QTY+21:5 and two part-order sets, GIR+L01+2:LQT+BR1:LLO+REF:LFN and GIR+L02+3:LQT+BR2:LLO+REF:LFN => one order line for 5 copies, with 2 items at BR1 and 3 at BR2, and no error about the number of segments or the budget 4. Process an INVOIC for an order of 4 copies, 3 of them at BR1, with QTY+47:3 and GIR+L01+3:LQT+BR1:LLO => the 3 items at BR1 are moved to the received order and received 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