Merged template tweaks needed for ULS
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 15 Nov 2012 19:22:33 +0000 (14:22 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 10 Dec 2012 19:52:46 +0000 (14:52 -0500)
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 <lebbeous@esilibrary.com>
edi_order.tt2

index 5135f4d..2cca34d 100644 (file)
     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 -%]
                 {"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;
                     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":[