LP#1550495 - Add EDI Cancel Code 85 - used by Baker & Taylor
authorJosh Stompro <stomproj@larl.org>
Fri, 4 Mar 2016 19:51:34 +0000 (13:51 -0600)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 14 Mar 2016 18:48:53 +0000 (14:48 -0400)
Baker & Taylor send back a quantity code 85 response when they cancel
a line item.  This code wasn't included as one of the built in EDI
codes so those line items were not being canceled automatically in
evergreen.

The system looks for the response code + 1200 to find the cancel reason,
so this code is entered as ID 1285 in the acq.cancel_reason table.

I received confirmation from another system that uses B&T as an EDI vendor
that they also receive code 85 responses when something gets canceled.

Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/xxxx.acq.cancel_reason-add-85.sql [new file with mode: 0644]
docs/RELEASE_NOTES_NEXT/Acquisitions/add_cancel_reason_85.adoc [new file with mode: 0644]

index b38207d..a9701f9 100644 (file)
@@ -9639,7 +9639,9 @@ INSERT INTO acq.cancel_reason (org_unit, keep_debits, id, label, description) VA
 (1, 't', 1246, oils_i18n_gettext(1246, 'Delayed: Pieces Delivered', 'acqcr', 'label'),
     oils_i18n_gettext(1246, 'Number of pieces actually received at the final destination.', 'acqcr', 'description')),
 (1, 't', 1283, oils_i18n_gettext(1283, 'Delayed: Backorder', 'acqcr', 'label'),
-    oils_i18n_gettext(1283, 'The quantity of goods that is on back-order.', 'acqcr', 'description'));
+    oils_i18n_gettext(1283, 'The quantity of goods that is on back-order.', 'acqcr', 'description')),
+(1, 'f',( 85+1200), oils_i18n_gettext(1285, 'Canceled: By Vendor', 'acqcr', 'label'),
+    oils_i18n_gettext(1285, 'Line item canceled by vendor', 'acqcr', 'description'));
 
 INSERT INTO config.global_flag (name, label, enabled)
     VALUES (
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.acq.cancel_reason-add-85.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.acq.cancel_reason-add-85.sql
new file mode 100644 (file)
index 0000000..d2e2273
--- /dev/null
@@ -0,0 +1,18 @@
+BEGIN;
+
+-- INSERT INTO config.upgrade_log (version) VALUES ('xxxx');
+
+-- LP#1550495 - Add Baker&Taylor EDI Quantity Cancel Code
+-- Insert EDI Cancel Reason 85 (1200 + 85 = 1285) if it doesn't already exist
+INSERT INTO acq.cancel_reason 
+   (org_unit, keep_debits, id, label, description)
+   SELECT 
+     1, 'f',( 85+1200),
+     oils_i18n_gettext(1285, 'Canceled: By Vendor', 'acqcr', 'label'),
+     oils_i18n_gettext(1285, 'Line item canceled by vendor', 'acqcr', 'description')
+   WHERE NOT EXISTS (
+    SELECT 1 FROM acq.cancel_reason where id=(85+1200)
+   );
+
+
+COMMIT;
diff --git a/docs/RELEASE_NOTES_NEXT/Acquisitions/add_cancel_reason_85.adoc b/docs/RELEASE_NOTES_NEXT/Acquisitions/add_cancel_reason_85.adoc
new file mode 100644 (file)
index 0000000..62ec0c1
--- /dev/null
@@ -0,0 +1,6 @@
+Add Acquisitions Cancel Reason 85 for Baker&Taylor EDI
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Baker & Taylor send back a quantity status code of 85
+when a line item is canceled when using EDI.  That code
+is now included in the system so those cancelations get 
+properly registered.