From: Lebbeous Fogle-Weekley Date: Mon, 30 Jul 2012 18:20:26 +0000 (-0400) Subject: more flexibility for reading invoice identifiers, references X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fedi-invoice-scratch;p=evergreen%2Fequinox.git more flexibility for reading invoice identifiers, references Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/edi_translator/data/brodart/1130B766274.jedi b/Open-ILS/src/edi_translator/data/brodart/1130B766274.jedi index d1ed502423..c2443fc874 100644 --- a/Open-ILS/src/edi_translator/data/brodart/1130B766274.jedi +++ b/Open-ILS/src/edi_translator/data/brodart/1130B766274.jedi @@ -263,7 +263,7 @@ } ] ] - }, + } ], "sender": "1697684", "header": [ 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 c1f1326d7a..ca6692667f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm @@ -678,16 +678,18 @@ sub create_acq_invoice_from_edi { # from LIN... try { my $c212 = $sg25->{LIN}[0]{C212}; - push @identifiers, [$c212->{7143}, $c212->{7140}]; + push @identifiers, [$c212->{7143}, $c212->{7140}] if + $c212 and ref $c212 eq 'HASH'; } catch Error with { # move on }; # from PIA... try { - my $c212 = $sg25->{PIA}[0]{C212}; - foreach my $h (@$c212) { - push @identifiers, [$h->{7143}, $h->{7140}]; + foreach my $pia (@{ $sg25->{PIA} }) { + foreach my $h (@{$pia->{C212}}) { + push @identifiers, [$h->{7143}, $h->{7140}]; + } } } catch Error with { # move on @@ -734,9 +736,9 @@ sub create_acq_invoice_from_edi { $log_prefix . "RFFs within lineitem disagree on PO # ?" ) unless $acq_identifiers->{po} eq $po; - - $acq_identifiers->{li} = $li; } + $acq_identifiers->{li} = $li; + $acq_identifiers->{po} = $po; } else { $logger->warn( $log_prefix .