From f0bfd6727fb7d22583abf0dd6551b36d5abf31fe Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 18 May 2015 11:57:02 -0400 Subject: [PATCH] LP#1373690 template repair empty notes Signed-off-by: Bill Erickson --- .../src/sql/Pg/upgrade/XXXX.data.acq-order-edi.sql | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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; -- 2.11.0