Do not attempt to createI EDI messages for order responses which
reference nonexistent purchase orders, since it results in
transaction commit errors on invalid foreign keys, preventing
subsequent EDI files from getting processed. Instead, log it
and skip it.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
if ($msg_hash->{purchase_order}) {
$logger->info("EDI: processing message for PO " . $msg_hash->{purchase_order});
$incoming->purchase_order($msg_hash->{purchase_order});
+ unless ($e->retrieve_acq_purchase_order($incoming->purchase_order)) {
+ $logger->warn("EDI: received order response for nonexistent PO. Skipping...");
+ next;
+ }
}
$e->xact_begin;