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

--- Comment #1 from Martin Renvoize (ashimema) 
<[email protected]> ---
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 <[email protected]>

-- 
You are receiving this mail because:
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