From 6fb3aaba241eee24be54751b63e923436c38d047 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 7 Aug 2018 16:26:27 -0400 Subject: [PATCH] LP#1785887 edi_order_pusher.pl sets message account Apply the edi_message.account value when sending EDI order messages via edi_order_pusher.pl. This solves a problem where EDI ORDERS message were not visible in the interface, because there was no way to complete the permission check. Signed-off-by: Bill Erickson Signed-off-by: Chris Sharp --- Open-ILS/src/support-scripts/edi_order_pusher.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Open-ILS/src/support-scripts/edi_order_pusher.pl b/Open-ILS/src/support-scripts/edi_order_pusher.pl index 3d383f288d..c6c8c11dfe 100755 --- a/Open-ILS/src/support-scripts/edi_order_pusher.pl +++ b/Open-ILS/src/support-scripts/edi_order_pusher.pl @@ -183,6 +183,22 @@ for $po_id (@$po_ids) { $message->purchase_order($po_id); $message->message_type('ORDERS'); $message->isnew(1); + + my $po = $e->retrieve_acq_purchase_order([$po_id, { + flesh => 2, + flesh_fields => { + acqpo => ['provider'], + acqpro => ['edi_default'], + } + }]); + + if (!$po->provider->edi_default) { + announce('error', "Provider for PO $po_id has no default EDI ". + "account, EDI message will not be sent."); + next; + } + + $message->account($po->provider->edi_default->id); } $message->edi($edi); -- 2.43.2