EDI order template includes empty GIR for B&T
authorBill Erickson <berick@esilibrary.com>
Fri, 28 Dec 2012 16:40:39 +0000 (11:40 -0500)
committerBill Erickson <berick@esilibrary.com>
Fri, 28 Dec 2012 16:40:39 +0000 (11:40 -0500)
When the vendor is 'baker and taylor', include all agreed-upon GIR
fields, regardless of whether the field has a value.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/sql/Pg/950.data.seed-values.sql

index 665d5fb..ffcaf9a 100644 (file)
@@ -8194,12 +8194,17 @@ $$
                     # If we assume owning_lib is required and set, 
                     # it is safe to prepend each following copy field w/ a ","
 
+                    # B&T EDI requires expected GIR fields to be 
+                    # present regardless of whether a value exists.  
+                    # some fields are required to have a value in ACQ, 
+                    # though, so they are not forced into place below.
+
                  %]{[%- IF INC_OWNING_LIB AND copy.owning_lib %] "owning_lib":"[% copy.owning_lib %]"[% END -%]
                     [%- IF INC_FUND AND copy.fund %],"fund":"[% copy.fund %]"[% END -%]
-                    [%- IF INC_CALLNUMBER AND copy.callnumber %],"call_number":"[% copy.callnumber %]"[% END -%]
-                    [%- IF INC_ITEM_TYPE AND copy.item_type %],"item_type":"[% copy.item_type %]"[% END -%]
+                    [%- IF INC_CALLNUMBER AND (VENDOR_BT OR copy.callnumber) %],"call_number":"[% copy.callnumber %]"[% END -%]
+                    [%- IF INC_ITEM_TYPE AND (VENDOR_BT OR copy.item_type) %],"item_type":"[% copy.item_type %]"[% END -%]
                     [%- IF INC_LOCATION AND copy.location %],"copy_location":"[% copy.location %]"[% END -%]
-                    [%- IF INC_COLLECTION_CODE AND copy.collection_code %],"collection_code":"[% copy.collection_code %]"[% END -%]
+                    [%- IF INC_COLLECTION_CODE AND (VENDOR_BT OR copy.collection_code) %],"collection_code":"[% copy.collection_code %]"[% END -%]
                     [%- IF INC_QUANTITY %],"quantity":"[% copy.quantity %]"[% END -%]
                     [%- IF INC_COPY_ID %],"copy_id":"[% copy.copy_id %]" [% END %]}[% ',' UNLESS loop.last -%]
                 [%- END -%] [%# FOR compressed_copies -%]