Better handling of purchase_order being non-numeric
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 5 Sep 2013 17:24:54 +0000 (13:24 -0400)
committerBen Shum <bshum@biblio.org>
Thu, 26 Sep 2013 00:38:02 +0000 (20:38 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm

index 70642bd..a7b05a4 100644 (file)
@@ -224,8 +224,8 @@ sub process_retrieval {
             # up PO number later from the lineitems themselves if necessary.
 
             if ($msg_hash->{purchase_order} !~ /^\d+$/) {
-                $logger->warn("EDI: PO identifier is non-numeric. Continuing.");
-                # No "next" here; we'll process this and just not link to acqpo.
+                $logger->warn("EDI: PO identifier is non-numeric. Blanking and continuing.");
+                undef $msg_hash->{purchase_order};
             } else {
                 $logger->info("EDI: processing message for PO " .
                     $msg_hash->{purchase_order});
@@ -898,6 +898,7 @@ sub invoice_lineitem_to_invoice_entry {
 # references from the electronic invoice.
 # @param    $message            An acqedim object
 # @param    $invoice_lineitems  An arrayref from part of EDIReader output
+# NOTE: This sub can have side-effects on $message.
 sub process_invoice_lineitems {
     my ($e, $msg_kludges, $log_prefix, $message, $invoice_lineitems) = @_;