View | Details | Raw Unified | Return to bug 22415
Collapse All | Expand All

(-)a/Koha/EDI.pm (-7 / +7 lines)
Lines 39-46 use C4::Biblio qw( Link Here
39
use Koha::Edifact::Order;
39
use Koha::Edifact::Order;
40
use Koha::Edifact;
40
use Koha::Edifact;
41
use C4::Log qw( logaction );
41
use C4::Log qw( logaction );
42
use Log::Log4perl;
43
use Text::Unidecode qw( unidecode );
42
use Text::Unidecode qw( unidecode );
43
use Koha::Logger;
44
use Koha::Plugins; # Adds plugin dirs to @INC
44
use Koha::Plugins; # Adds plugin dirs to @INC
45
use Koha::Plugins::Handler;
45
use Koha::Plugins::Handler;
46
use Koha::Acquisition::Baskets;
46
use Koha::Acquisition::Baskets;
Lines 173-179 sub process_ordrsp { Link Here
173
    $response_message->status('processing');
173
    $response_message->status('processing');
174
    $response_message->update;
174
    $response_message->update;
175
    my $schema = Koha::Database->new()->schema();
175
    my $schema = Koha::Database->new()->schema();
176
    my $logger = Log::Log4perl->get_logger();
176
    my $logger = Koha::Logger->get({ interface => 'edi' });
177
    my $vendor_acct;
177
    my $vendor_acct;
178
    my $edi =
178
    my $edi =
179
      Koha::Edifact->new( { transmission => $response_message->raw_msg, } );
179
      Koha::Edifact->new( { transmission => $response_message->raw_msg, } );
Lines 227-233 sub process_invoice { Link Here
227
    $invoice_message->status('processing');
227
    $invoice_message->status('processing');
228
    $invoice_message->update;
228
    $invoice_message->update;
229
    my $schema = Koha::Database->new()->schema();
229
    my $schema = Koha::Database->new()->schema();
230
    my $logger = Log::Log4perl->get_logger();
230
    my $logger = Koha::Logger->get({ interface => 'edi' });
231
    my $vendor_acct;
231
    my $vendor_acct;
232
232
233
    my $plugin_class = $invoice_message->edi_acct()->plugin();
233
    my $plugin_class = $invoice_message->edi_acct()->plugin();
Lines 442-448 sub _get_invoiced_price { Link Here
442
442
443
sub receipt_items {
443
sub receipt_items {
444
    my ( $schema, $inv_line, $ordernumber, $quantity ) = @_;
444
    my ( $schema, $inv_line, $ordernumber, $quantity ) = @_;
445
    my $logger   = Log::Log4perl->get_logger();
445
    my $logger   = Koha::Logger->get({ interface => 'edi' });
446
446
447
    # itemnumber is not a foreign key ??? makes this a bit cumbersome
447
    # itemnumber is not a foreign key ??? makes this a bit cumbersome
448
    my @item_links = $schema->resultset('AqordersItem')->search(
448
    my @item_links = $schema->resultset('AqordersItem')->search(
Lines 542-548 sub transfer_items { Link Here
542
        }
542
        }
543
        ++$gocc;
543
        ++$gocc;
544
    }
544
    }
545
    my $logger = Log::Log4perl->get_logger();
545
    my $logger = Koha::Logger->get({ interface => 'edi' });
546
    my $o1     = $order_from->ordernumber;
546
    my $o1     = $order_from->ordernumber;
547
    my $o2     = $order_to->ordernumber;
547
    my $o2     = $order_to->ordernumber;
548
    $logger->warn("transferring $quantity copies from order $o1 to order $o2");
548
    $logger->warn("transferring $quantity copies from order $o1 to order $o2");
Lines 586-592 sub process_quote { Link Here
586
586
587
    my $messages       = $edi->message_array();
587
    my $messages       = $edi->message_array();
588
    my $process_errors = 0;
588
    my $process_errors = 0;
589
    my $logger         = Log::Log4perl->get_logger();
589
    my $logger         = Koha::Logger->get({ interface => 'edi' });
590
    my $schema         = Koha::Database->new()->schema();
590
    my $schema         = Koha::Database->new()->schema();
591
    my $message_count  = 0;
591
    my $message_count  = 0;
592
    my @added_baskets;    # if auto & multiple baskets need to order all
592
    my @added_baskets;    # if auto & multiple baskets need to order all
Lines 671-677 sub quote_item { Link Here
671
    my ( $item, $quote, $basketno ) = @_;
671
    my ( $item, $quote, $basketno ) = @_;
672
672
673
    my $schema = Koha::Database->new()->schema();
673
    my $schema = Koha::Database->new()->schema();
674
    my $logger = Log::Log4perl->get_logger();
674
    my $logger = Koha::Logger->get({ interface => 'edi' });
675
675
676
    # $basketno is the return from AddBasket in the calling routine
676
    # $basketno is the return from AddBasket in the calling routine
677
    # So this call should not fail unless that has
677
    # So this call should not fail unless that has
(-)a/misc/cronjobs/edi_cron.pl (-14 / +2 lines)
Lines 31-56 use utf8; Link Here
31
31
32
use Koha::Script -cron;
32
use Koha::Script -cron;
33
use C4::Context;
33
use C4::Context;
34
use Log::Log4perl qw(:easy);
35
use Koha::Database;
34
use Koha::Database;
36
use Koha::EDI qw( process_quote process_invoice process_ordrsp );
35
use Koha::EDI qw( process_quote process_invoice process_ordrsp );
37
use Koha::Edifact::Transport;
36
use Koha::Edifact::Transport;
37
use Koha::Logger;
38
use Koha::Plugins::Handler;
38
use Koha::Plugins::Handler;
39
use Fcntl qw( LOCK_EX O_CREAT O_RDWR SEEK_SET );
39
use Fcntl qw( LOCK_EX O_CREAT O_RDWR SEEK_SET );
40
40
41
die "Syspref 'EDIFACT' is disabled" unless C4::Context->preference('EDIFACT');
41
die "Syspref 'EDIFACT' is disabled" unless C4::Context->preference('EDIFACT');
42
42
43
my $logdir = C4::Context->config('logdir');
44
45
# logging set to trace as this may be what you
46
# want on implementation
47
Log::Log4perl->easy_init(
48
    {
49
        level => $TRACE,
50
        file  => ">>$logdir/editrace.log",
51
    }
52
);
53
54
# we dont have a lock dir in context so use the logdir
43
# we dont have a lock dir in context so use the logdir
55
my $pidfile = "$logdir/edicron.pid";
44
my $pidfile = "$logdir/edicron.pid";
56
45
Lines 60-66 my $schema = Koha::Database->new()->schema(); Link Here
60
49
61
my @edi_accts = $schema->resultset('VendorEdiAccount')->all();
50
my @edi_accts = $schema->resultset('VendorEdiAccount')->all();
62
51
63
my $logger = Log::Log4perl->get_logger();
52
my $logger = Koha::Logger->get({ interface => 'edi', prefix => 0 });
64
53
65
for my $acct (@edi_accts) {
54
for my $acct (@edi_accts) {
66
    if ( $acct->quotes_enabled ) {
55
    if ( $acct->quotes_enabled ) {
67
- 

Return to bug 22415