From cbe7ef4d7744dff8ce259419da63026c495ff779 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 18 May 2015 11:38:00 -0400 Subject: [PATCH] LP#1373690 template GIR fixes, repeating prices/ids Signed-off-by: Bill Erickson --- .../src/sql/Pg/upgrade/XXXX.data.acq-order-edi.sql | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-order-edi.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-order-edi.sql index 478379e1a1..352e92a1e5 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-order-edi.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-order-edi.sql @@ -106,13 +106,14 @@ FOR li IN target.lineitems; li_hash.idval = idval; li_hash.idqual = idqual; - li_hash.title = helpers.get_li_attr_edi('title', '', li.attributes); - li_hash.author = helpers.get_li_attr_edi('author', '', li.attributes); - li_hash.edition = helpers.get_li_attr_edi('edition', '', li.attributes); - li_hash.pubdate = helpers.get_li_attr_edi('pubdate', '', li.attributes); - li_hash.publisher = helpers.get_li_attr_edi('publisher', '', li.attributes); - li_hash.pagination = helpers.get_li_attr_edi('pagination','', li.attributes); + li_hash.title = helpers.get_li_attr_edi('title', '', li.attributes); + li_hash.author = helpers.get_li_attr_edi('author', '', li.attributes); + li_hash.edition = helpers.get_li_attr_edi('edition', '', li.attributes); + li_hash.pubdate = helpers.get_li_attr_edi('pubdate', '', li.attributes); + li_hash.publisher = helpers.get_li_attr_edi('publisher', '', li.attributes); + li_hash.pagination = helpers.get_li_attr_edi('pagination', '', li.attributes); li_hash.quantity = li.lineitem_details.size; + li_hash.estimated_unit_price = li.estimated_unit_price; li_hash.copies = []; ftx_vals = []; @@ -251,34 +252,34 @@ when we exceed 5, add a new GIR segement. [%- IF FIELD_COUNT == 5; FIELD_COUNT = 0; SEGMENT_COUNT = SEGMENT_COUNT + 1 -%] '[%# finalize the GIR segment with a "'" %] -GIR+[% GIR_INDEX | format('%03d') -%][% END -%] [%- IF INC_LOCATION AND (VENDOR_BT OR copy.location); FIELD_COUNT = FIELD_COUNT + 1 ; SEGMENT_COUNT = SEGMENT_COUNT + 1-%] +[%- IF FIELD_COUNT == 1 -%]GIR+[% GIR_INDEX | format('%03d') -%][% END -%][% END -%] +[% copy.location %]:LFH[%- END -%] [%- IF FIELD_COUNT == 5; FIELD_COUNT = 0; SEGMENT_COUNT = SEGMENT_COUNT + 1 -%] '[%# finalize the GIR segment with a "'" %] -GIR+[% GIR_INDEX | format('%03d') -%][% END -%] [%- IF INC_QUANTITY AND (VENDOR_BT OR copy.quantity); FIELD_COUNT = FIELD_COUNT + 1; SEGMENT_COUNT = SEGMENT_COUNT + 1 -%] +[%- IF FIELD_COUNT == 1 -%]GIR+[% GIR_INDEX | format('%03d') -%][% END -%][% END -%] +[% copy.quantity %]:LQT[%- END -%] [%- IF FIELD_COUNT == 5; FIELD_COUNT = 0; SEGMENT_COUNT = SEGMENT_COUNT + 1 -%] '[%# finalize the GIR segment with a "'" %] -GIR+[% GIR_INDEX | format('%03d') -%][% END -%] [%- IF INC_COPY_ID AND (VENDOR_BT OR copy.copy_id); FIELD_COUNT = FIELD_COUNT + 1 -%] +[%- IF FIELD_COUNT == 1 -%]GIR+[% GIR_INDEX | format('%03d') -%][% END -%][% END -%] +[% copy.copy_id %]:LCO[%- END -%] '[%# finalize the GIR segment with a "'" -%] [%- END -%][%# FOR copies %] [%- FOR note IN li_hash.notes -%] FTX+LIN+1+[% note %]' [%- END -%] -PRI+AAB:[% li.estimated_unit_price || "0.00" %]' +PRI+AAB:[% li_hash.estimated_unit_price || "0.00" %]' [%- IF INC_PO_NAME -%] -RFF+LI:[% helpers.escape_edi(target.name) %]/[% li.id %]' +RFF+LI:[% helpers.escape_edi(target.name) %]/[% li_hash.id %]' [%- ELSE -%] -RFF+LI:[% target.id %]/[% li.id %]' +RFF+LI:[% target.id %]/[% li_hash.id %]' [%- END -%] [%- END -%][%# for lineitems %] UNS+S' -- 2.11.0