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;
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:([^:]+)/
);
# 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});
}