|
Lines 59-74
subtest 'process_quote' => sub {
Link Here
|
| 59 |
|
59 |
|
| 60 |
$schema->storage->txn_begin; |
60 |
$schema->storage->txn_begin; |
| 61 |
|
61 |
|
|
|
62 |
# Create file transport for local testing |
| 63 |
my $file_transport = $builder->build( |
| 64 |
{ |
| 65 |
source => 'FileTransport', |
| 66 |
value => { |
| 67 |
name => 'Test Local Transport', |
| 68 |
transport => 'local', |
| 69 |
download_directory => $dirname, |
| 70 |
upload_directory => $dirname, |
| 71 |
} |
| 72 |
} |
| 73 |
); |
| 74 |
|
| 62 |
my $account = $builder->build( |
75 |
my $account = $builder->build( |
| 63 |
{ |
76 |
{ |
| 64 |
source => 'VendorEdiAccount', |
77 |
source => 'VendorEdiAccount', |
| 65 |
value => { |
78 |
value => { |
| 66 |
description => 'test vendor', |
79 |
description => 'test vendor', |
| 67 |
transport => 'FILE', |
80 |
file_transport_id => $file_transport->{file_transport_id}, |
| 68 |
plugin => '', |
81 |
plugin => '', |
| 69 |
san => $test_san, |
82 |
san => $test_san, |
| 70 |
orders_enabled => 1, |
83 |
orders_enabled => 1, |
| 71 |
auto_orders => 0, |
84 |
auto_orders => 0, |
| 72 |
} |
85 |
} |
| 73 |
} |
86 |
} |
| 74 |
); |
87 |
); |
|
Lines 228-243
subtest 'process_quote' => sub {
Link Here
|
| 228 |
plan tests => 7; |
241 |
plan tests => 7; |
| 229 |
|
242 |
|
| 230 |
$schema->storage->txn_begin; |
243 |
$schema->storage->txn_begin; |
|
|
244 |
|
| 245 |
# Create file transport for local testing |
| 246 |
my $file_transport = $builder->build( |
| 247 |
{ |
| 248 |
source => 'FileTransport', |
| 249 |
value => { |
| 250 |
name => 'Test Auto Order Transport', |
| 251 |
transport => 'local', |
| 252 |
download_directory => $dirname, |
| 253 |
upload_directory => $dirname, |
| 254 |
} |
| 255 |
} |
| 256 |
); |
| 257 |
|
| 231 |
my $account = $builder->build( |
258 |
my $account = $builder->build( |
| 232 |
{ |
259 |
{ |
| 233 |
source => 'VendorEdiAccount', |
260 |
source => 'VendorEdiAccount', |
| 234 |
value => { |
261 |
value => { |
| 235 |
description => 'auto order vendor', |
262 |
description => 'auto order vendor', |
| 236 |
transport => 'FILE', |
263 |
file_transport_id => $file_transport->{file_transport_id}, |
| 237 |
plugin => '', |
264 |
plugin => '', |
| 238 |
san => $test_san, |
265 |
san => $test_san, |
| 239 |
orders_enabled => 1, |
266 |
orders_enabled => 1, |
| 240 |
auto_orders => 1, |
267 |
auto_orders => 1, |
| 241 |
} |
268 |
} |
| 242 |
} |
269 |
} |
| 243 |
); |
270 |
); |
|
Lines 315-328
subtest 'process_quote' => sub {
Link Here
|
| 315 |
|
342 |
|
| 316 |
$schema->storage->txn_begin; |
343 |
$schema->storage->txn_begin; |
| 317 |
|
344 |
|
|
|
345 |
# Create file transport for local testing |
| 346 |
my $file_transport = $builder->build( |
| 347 |
{ |
| 348 |
source => 'FileTransport', |
| 349 |
value => { |
| 350 |
name => 'Test Multi-item Transport', |
| 351 |
transport => 'local', |
| 352 |
download_directory => $dirname, |
| 353 |
upload_directory => $dirname, |
| 354 |
} |
| 355 |
} |
| 356 |
); |
| 357 |
|
| 318 |
# Create vendor EDI account |
358 |
# Create vendor EDI account |
| 319 |
my $account = $builder->build( |
359 |
my $account = $builder->build( |
| 320 |
{ |
360 |
{ |
| 321 |
source => 'VendorEdiAccount', |
361 |
source => 'VendorEdiAccount', |
| 322 |
value => { |
362 |
value => { |
| 323 |
description => 'multi-item vendor', |
363 |
description => 'multi-item vendor', |
| 324 |
transport => 'FILE', |
364 |
file_transport_id => $file_transport->{file_transport_id}, |
| 325 |
plugin => '', |
365 |
plugin => '', |
| 326 |
} |
366 |
} |
| 327 |
} |
367 |
} |
| 328 |
); |
368 |
); |
|
Lines 475-486
subtest 'process_quote' => sub {
Link Here
|
| 475 |
|
515 |
|
| 476 |
$schema->storage->txn_begin; |
516 |
$schema->storage->txn_begin; |
| 477 |
|
517 |
|
|
|
518 |
# Create file transport for local testing |
| 519 |
my $file_transport = $builder->build( |
| 520 |
{ |
| 521 |
source => 'FileTransport', |
| 522 |
value => { |
| 523 |
name => 'Test Error Transport', |
| 524 |
transport => 'local', |
| 525 |
download_directory => $dirname, |
| 526 |
upload_directory => $dirname, |
| 527 |
} |
| 528 |
} |
| 529 |
); |
| 530 |
|
| 478 |
my $account = $builder->build( |
531 |
my $account = $builder->build( |
| 479 |
{ |
532 |
{ |
| 480 |
source => 'VendorEdiAccount', |
533 |
source => 'VendorEdiAccount', |
| 481 |
value => { |
534 |
value => { |
| 482 |
description => 'error test vendor', |
535 |
description => 'error test vendor', |
| 483 |
transport => 'FILE', |
536 |
file_transport_id => $file_transport->{file_transport_id}, |
| 484 |
} |
537 |
} |
| 485 |
} |
538 |
} |
| 486 |
); |
539 |
); |
|
Lines 582-593
subtest 'process_quote' => sub {
Link Here
|
| 582 |
|
635 |
|
| 583 |
$schema->storage->txn_begin; |
636 |
$schema->storage->txn_begin; |
| 584 |
|
637 |
|
|
|
638 |
# Create file transport for local testing |
| 639 |
my $file_transport = $builder->build( |
| 640 |
{ |
| 641 |
source => 'FileTransport', |
| 642 |
value => { |
| 643 |
name => 'Test Multiple Message Transport', |
| 644 |
transport => 'local', |
| 645 |
download_directory => $dirname, |
| 646 |
upload_directory => $dirname, |
| 647 |
} |
| 648 |
} |
| 649 |
); |
| 650 |
|
| 585 |
my $account = $builder->build( |
651 |
my $account = $builder->build( |
| 586 |
{ |
652 |
{ |
| 587 |
source => 'VendorEdiAccount', |
653 |
source => 'VendorEdiAccount', |
| 588 |
value => { |
654 |
value => { |
| 589 |
description => 'error test vendor', |
655 |
description => 'error test vendor', |
| 590 |
transport => 'FILE', |
656 |
file_transport_id => $file_transport->{file_transport_id}, |
| 591 |
} |
657 |
} |
| 592 |
} |
658 |
} |
| 593 |
); |
659 |
); |
|
Lines 646-660
subtest 'process_invoice' => sub {
Link Here
|
| 646 |
|
712 |
|
| 647 |
$schema->storage->txn_begin; |
713 |
$schema->storage->txn_begin; |
| 648 |
|
714 |
|
|
|
715 |
# Get dirname for transport |
| 716 |
my $dirname = ( $Bin =~ /^(.*\/t\/)/ ? $1 . 'edi_testfiles/' : q{} ); |
| 717 |
|
| 718 |
# Create file transport for local testing |
| 719 |
my $file_transport = $builder->build( |
| 720 |
{ |
| 721 |
source => 'FileTransport', |
| 722 |
value => { |
| 723 |
name => 'Test Invoice Transport', |
| 724 |
transport => 'local', |
| 725 |
download_directory => $dirname, |
| 726 |
upload_directory => $dirname, |
| 727 |
} |
| 728 |
} |
| 729 |
); |
| 730 |
|
| 649 |
# Add test EDI matching ean of test invoice file and ensure no plugins so we trigger core functions |
731 |
# Add test EDI matching ean of test invoice file and ensure no plugins so we trigger core functions |
| 650 |
my $account = $builder->build( |
732 |
my $account = $builder->build( |
| 651 |
{ |
733 |
{ |
| 652 |
source => 'VendorEdiAccount', |
734 |
source => 'VendorEdiAccount', |
| 653 |
value => { |
735 |
value => { |
| 654 |
description => 'test vendor', |
736 |
description => 'test vendor', |
| 655 |
transport => 'FILE', |
737 |
file_transport_id => $file_transport->{file_transport_id}, |
| 656 |
plugin => '', |
738 |
plugin => '', |
| 657 |
san => '5013546027173' |
739 |
san => '5013546027173' |
| 658 |
} |
740 |
} |
| 659 |
} |
741 |
} |
| 660 |
); |
742 |
); |
|
Lines 694-700
subtest 'process_invoice' => sub {
Link Here
|
| 694 |
my $ordernumber2 = $order2->ordernumber; |
776 |
my $ordernumber2 = $order2->ordernumber; |
| 695 |
|
777 |
|
| 696 |
# Add test invoice file to the database for testing |
778 |
# Add test invoice file to the database for testing |
| 697 |
my $dirname = ( $Bin =~ /^(.*\/t\/)/ ? $1 . 'edi_testfiles/' : q{} ); |
|
|
| 698 |
my $filename = 'INVOICE.CEI'; |
779 |
my $filename = 'INVOICE.CEI'; |
| 699 |
ok( -e $dirname . $filename, 'File INVOICE.CEI found' ); |
780 |
ok( -e $dirname . $filename, 'File INVOICE.CEI found' ); |
| 700 |
|
781 |
|