]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator/Acq/PurchaseOrderEDIRequired.pm
Bugfix fatal error: $self->editor is not defined
[working/Evergreen.git] / Open-ILS / src / perlmods / OpenILS / Application / Trigger / Validator / Acq / PurchaseOrderEDIRequired.pm
1 package OpenILS::Application::Trigger::Validator::Acq::PurchaseOrderEDIRequired;
2 use strict; use warnings;
3 # use OpenSRF::Utils::Logger qw/:logger/;
4 use OpenILS::Utils::CStoreEditor qw/ new_editor /;
5 use OpenILS::Application::AppUtils;
6 my $U = 'OpenILS::Application::AppUtils';
7
8 sub handler {
9     my $self = shift;
10     my $env  = shift;
11     my $po   = $env->{target};
12
13     my $provider = 
14         ref($po->provider) ? 
15             $po->provider : 
16             new_editor->retrieve_acq_provider($po->provider);
17
18     return 1 if 
19         $po->state eq 'on-order' and 
20         $provider->edi_default   and 
21         $U->is_true($provider->active);
22
23     return 0;
24 }
25
26 1;