LP1952931 Parsing DESADV EDI Messages
authorBill Erickson <berickxx@gmail.com>
Wed, 1 Dec 2021 16:49:23 +0000 (11:49 -0500)
committerBill Erickson <berickxx@gmail.com>
Tue, 4 Jan 2022 16:00:35 +0000 (11:00 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/EDIReader.pm

index 7b91722..cd2ecbe 100644 (file)
@@ -29,7 +29,9 @@ my %edi_fields = (
     purchase_order  => qr/^RFF\+ON:(\S+)/,
     invoice_ident   => qr/^BGM\+380\+([^\+]+)/,
     total_billed    => qr/^MOA\+86:([^:]+)/,
-    invoice_date    => qr/^DTM\+137:([^:]+)/
+    invoice_date    => qr/^DTM\+137:([^:]+)/, # This is really "messge date"
+    package_code    => qr/^GIN\+BJ\+([^:]+)/,
+    lading_number   => qr/^RFF\+BM:([^:]+)/
 );
 
 my %edi_li_fields = (
@@ -42,7 +44,9 @@ my %edi_li_fields = (
     avail_status    => qr/^FTX\+LIN\++([^:]+):8B:28/,
     # "1B" codes are deprecated, but still in use.  
     # Pretend it's "12B" and it should just work
-    order_status    => qr/^FTX\+LIN\++([^:]+):12?B:28/
+    order_status    => qr/^FTX\+LIN\++([^:]+):12?B:28/,
+    # DESADV messages have multiple PO ID's, one RFF+ON per LIN.
+    purchase_order  => qr/^RFF\+ON:(\S+)/
 );
 
 my %edi_li_ident_fields = (