From 9927cd0198171e1685a5950aa7b3f2782c084b74 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Thu, 15 Nov 2012 14:22:33 -0500 Subject: [PATCH] Merged template tweaks needed for ULS These were learned when setting up basic ordering only, not taking into account anything that may turn out to be needed for enriched/GIR stuff yet. Signed-off-by: Lebbeous Fogle-Weekley --- edi_order.tt2 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/edi_order.tt2 b/edi_order.tt2 index 5135f4d03b..2cca34d707 100644 --- a/edi_order.tt2 +++ b/edi_order.tt2 @@ -14,12 +14,14 @@ VENDOR_BRODART = 0; VENDOR_MW_TAPE = 0; # Midwest Tape VENDOR_RB = 0; # Recorded Books + VENDOR_ULS = 0; # ULS IF VENDOR_SAN == '1556150'; VENDOR_BT = 1; ELSIF VENDOR_SAN == '1697684'; VENDOR_BRODART = 1; ELSIF VENDOR_SAN == '1697978'; VENDOR_INGRAM = 1; ELSIF VENDOR_SAN == '2549913'; VENDOR_MW_TAPE = 1; ELSIF VENDOR_SAN == '1113984'; VENDOR_RB = 1; + ELSIF VENDOR_SAN == '1699342'; VENDOR_ULS = 1; END; # GIR configuration -------------------------------------- @@ -75,7 +77,7 @@ "items":[ [%- FOR li IN target.lineitems %] { - "line_index":"[% li.id %]", + "line_index":"[% VENDOR_ULS ? loop.count : li.id %]", "identifiers":[ [%-# li.isbns = helpers.get_li_isbns(li.attributes) %] [% FOR isbn IN helpers.get_li_isbns(li.attributes) -%] [% IF isbn.length == 13 -%] @@ -91,7 +93,12 @@ {"BTI":"[% helpers.get_li_attr_jedi('title', '', li.attributes) %]"}, {"BPU":"[% helpers.get_li_attr_jedi('publisher', '', li.attributes) %]"}, {"BPD":"[% helpers.get_li_attr_jedi('pubdate', '', li.attributes) %]"}, + [% IF VENDOR_ULS -%] + {"BEN":"[% helpers.get_li_attr_jedi('edition', '', li.attributes) %]"}, + {"BAU":"[% helpers.get_li_attr_jedi('author', '', li.attributes) %]"} + [%- ELSE -%] {"BPH":"[% helpers.get_li_attr_jedi('pagination','', li.attributes) %]"} + [%- END %] ], [%- ftx_vals = []; FOR note IN li.lineitem_notes; @@ -107,8 +114,11 @@ END; END; IF xtra_ftx; ftx_vals.unshift(xtra_ftx); END; - #IF ftx_vals.size == 0; ftx_vals.unshift(''); END; - # ^-- BT needs FTX+LIN for every LI, even if it is an empty one + + # BT & ULS want FTX+LIN for every LI, even if empty + IF ((VENDOR_BT OR VENDOR_ULS) AND ftx_vals.size == 0); + ftx_vals.unshift(''); + END; -%] "free-text":[ -- 2.11.0