From: Bill Erickson Date: Mon, 12 Sep 2022 15:31:04 +0000 (-0400) Subject: LP1952931 ASN support Ingram message format (PCI field) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3aeef78dfa135b4e128c69b2dd29cfa90b7e4f4f;p=working%2FEvergreen.git LP1952931 ASN support Ingram message format (PCI field) Includes change to allow skipping line items that have no container code, which happens with Ingram messages sometimes. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm index c0af836471..c024fc5d86 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm @@ -1160,6 +1160,9 @@ sub create_shipment_notification_from_edi { my %containers = map {$_->{container_code} => 1} @{$msg_data->{lineitems}}; for my $container_code (keys %containers) { + + next unless $container_code; + $logger->info("ACQ processing container: $container_code"); my $eg_asn = Fieldmapper::acq::shipment_notification->new; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/EDIReader.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/EDIReader.pm index 5433f9f643..91938066bd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/EDIReader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/EDIReader.pm @@ -34,6 +34,7 @@ my %edi_fields = ( invoice_date => qr/^DTM\+137:([^:]+)/, # This is really "messge date" # We don't retain a top-level container code -- they can repeat. _container_code => qr/^GIN\+BJ\+([^:]+)/, + _container_code_alt => qr/^PCI\+33E\+([^:]+)/, lading_number => qr/^RFF\+BM:([^:]+)/ ); @@ -131,8 +132,8 @@ sub read { # each container. Instead of restructuring the messages to # be containers of lineitems, just tag each lineitem with # its container if one is specified. - $msg->{_current_li}->{container_code} = - $msg->{_container_code} if $msg->{_container_code}; + my $ccode = $msg->{_container_code} || $msg->{_container_code_alt}; + $msg->{_current_li}->{container_code} = $ccode if $ccode; push(@{$msg->{lineitems}}, $msg->{_current_li}); }