From: Bill Erickson Date: Mon, 18 May 2015 15:57:02 +0000 (-0400) Subject: LP#1373690 template repair empty notes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f0bfd6727fb7d22583abf0dd6551b36d5abf31fe;p=working%2FEvergreen.git LP#1373690 template repair empty notes Signed-off-by: Bill Erickson --- 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 352e92a1e5..486ee59675 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 @@ -131,17 +131,20 @@ FOR li IN target.lineitems; END; IF xtra_ftx; ftx_vals.unshift(xtra_ftx); END; + notes = []; + # 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; + notes.push(''); - # EDI FTX fields have a max length of 512 - notes = []; - FOR note IN ftx_vals; - sub_notes = note.chunk(512); - FOR sub_note IN sub_notes; - notes.push(helpers.escape_edi(sub_note)); + ELSE; + + # EDI FTX fields have a max length of 512 + FOR note IN ftx_vals; + sub_notes = note.chunk(512); + FOR sub_note IN sub_notes; + notes.push(helpers.escape_edi(sub_note)); + END; END; END;