From 087802a435a2e0cbf1ebf1ffd5b77bc6991879a6 Mon Sep 17 00:00:00 2001 From: atz Date: Tue, 5 Oct 2010 16:16:59 +0000 Subject: [PATCH] EDI job POD git-svn-id: svn://svn.open-ils.org/ILS/trunk@18172 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/support-scripts/edi_fetcher.pl | 6 ++-- Open-ILS/src/support-scripts/edi_pusher.pl | 45 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/support-scripts/edi_fetcher.pl b/Open-ILS/src/support-scripts/edi_fetcher.pl index 3339f4e272..9d5f1682bc 100755 --- a/Open-ILS/src/support-scripts/edi_fetcher.pl +++ b/Open-ILS/src/support-scripts/edi_fetcher.pl @@ -140,8 +140,6 @@ print "\ndone\n"; __END__ -=pod - =head1 NAME edi_fetcher.pl - A script for retrieving and processing EDI files from remote accounts. @@ -159,8 +157,8 @@ the environmental variable FTP_PASSIVE like: =head1 OPTIONS - --account=[id] Target one account, whether or not it is inactive. - --inactive Includes inactive provider accounts (default OFF, forced ON if --account specified) + --account=[id] Target one account, whether or not it is inactive. + --inactive Includes inactive provider accounts (default OFF, forced ON if --account specified) =head1 ARGUMENTS diff --git a/Open-ILS/src/support-scripts/edi_pusher.pl b/Open-ILS/src/support-scripts/edi_pusher.pl index bb214da52b..a5eff79c6a 100755 --- a/Open-ILS/src/support-scripts/edi_pusher.pl +++ b/Open-ILS/src/support-scripts/edi_pusher.pl @@ -32,6 +32,7 @@ INIT { my %defaults = ( 'quiet' => 0, + 'test' => 0, # TODO 'max-batch-size=i' => -1 ); @@ -48,6 +49,8 @@ my $defs = $e->search_action_trigger_event_definition({ $opts->{verbose} = 0 if $opts->{quiet}; +print "FTP_PASSIVE is ", ($ENV{FTP_PASSIVE} ? "ON" : "OFF"), "\n"; + print "\nHook '$hook' is used in ", scalar(@$defs), " event definition(s):\n"; $Data::Dumper::Indent = 1; @@ -154,6 +157,10 @@ foreach my $def (@$defs) { print "\ntarget->provider->edi_default->id: ", $target->provider->edi_default->id, "\n"; my $logstr2 = sprintf "event %s, PO %s, template_output %s", $_->{id}, $message->purchase_order, $event->template_output->id; + if ($opts->{test}) { + print "Test mode, skipping translation/send\n"; + } + printf "\nNow calling attempt_translation for $logstr2\n\n"; unless (OpenILS::Application::Acq::EDI->attempt_translation($message, 1)) { @@ -191,3 +198,41 @@ foreach my $def (@$defs) { } print "\ndone\n"; + +__END__ + +=head1 NAME + +edi_pusher.pl - A script for generating and sending EDI files to remote accounts. + +=head1 DESCRIPTION + +This script is expected to be run via crontab, for the purpose of retrieving vendor EDI files. + +=head1 OPTIONS + + --max-batch-size=i Limit the processing to a set number of events. + +=head1 TODO + +More docs here. + +=head1 USAGE + +B is recommended. Depending on your vendors' and your own network environments, you may want to set/export +the environmental variable FTP_PASSIVE like: + + export FTP_PASSIVE=1 + # or + FTP_PASSIVE=1 Open-ILS/src/support-scripts/edi_pusher.pl + +=head1 SEE ALSO + + OpenILS::Utils::Cronscript + edi_fetcher.pl + +=head1 AUTHOR + +Joe Atzberger + +=cut -- 2.11.0