LP#1373690 display +::: only when values present
authorBill Erickson <berickxx@gmail.com>
Mon, 18 May 2015 17:47:41 +0000 (13:47 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 5 Nov 2015 15:02:08 +0000 (10:02 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq-order-edi.sql

index 486ee59..886c6c6 100644 (file)
@@ -220,14 +220,14 @@ CUX+2:[% target.provider.currency_type %]:9'
 [%- FOR li_hash IN LINEITEMS -%]
 LIN+[% li_hash.id %]++[% li_hash.idval %]:[% li_hash.idqual %]'
 PIA+5+[% li_hash.idval %]:[% li_hash.idqual %]'
-IMD+F+BTI+:::[% li_hash.title %]'
-IMD+F+BPD+:::[% li_hash.pubdate %]'
-IMD+F+BPU+:::[% li_hash.publisher %]'
+IMD+F+BTI[% IF li_hash.title %]+:::[% li_hash.title %][% END %]'
+IMD+F+BPD[% IF li_hash.pubdate %]+:::[% li_hash.pubdate %][% END %]'
+IMD+F+BPU[% IF li_hash.publisher %]+:::[% li_hash.publisher %][% END %]'
 [%- IF VENDOR_ULS -%]
-IMD+F+BPU+:::[% li_hash.author %]'
-IMD+F+BEN+:::[% li_hash.edition %]'
+IMD+F+BPU[% IF li_hash.author %]+:::[% li_hash.author %][% END %]'
+IMD+F+BEN[% IF li_hash.edition %]+:::[% li_hash.edition %][% END %]'
 [%- ELSE -%]
-IMD+F+BPH+:::[% li_hash.pagination %]'
+IMD+F+BPH[% IF li_hash.pagination %]+:::[% li_hash.pagination %][% END %]'
 [%- END -%]
 QTY+21:[% li_hash.quantity %]'
 [%- GIR_INDEX = 0; -%]
@@ -276,7 +276,7 @@ when we exceed 5, add a new GIR segement.
 '[%# finalize the GIR segment with a "'" -%]
 [%- END -%][%# FOR copies %]
 [%- FOR note IN li_hash.notes -%]
-FTX+LIN+1+[% note %]'
+FTX+LIN+1[% IF note %]+[% note %][% END %]'
 [%- END -%]
 PRI+AAB:[% li_hash.estimated_unit_price || "0.00" %]'
 [%- IF INC_PO_NAME -%]