|
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 321-336
subtest 'process_quote' => sub {
Link Here
|
| 321 |
plan tests => 7; |
334 |
plan tests => 7; |
| 322 |
|
335 |
|
| 323 |
$schema->storage->txn_begin; |
336 |
$schema->storage->txn_begin; |
|
|
337 |
|
| 338 |
# Create file transport for local testing |
| 339 |
my $file_transport = $builder->build( |
| 340 |
{ |
| 341 |
source => 'FileTransport', |
| 342 |
value => { |
| 343 |
name => 'Test Auto Order Transport', |
| 344 |
transport => 'local', |
| 345 |
download_directory => $dirname, |
| 346 |
upload_directory => $dirname, |
| 347 |
} |
| 348 |
} |
| 349 |
); |
| 350 |
|
| 324 |
my $account = $builder->build( |
351 |
my $account = $builder->build( |
| 325 |
{ |
352 |
{ |
| 326 |
source => 'VendorEdiAccount', |
353 |
source => 'VendorEdiAccount', |
| 327 |
value => { |
354 |
value => { |
| 328 |
description => 'auto order vendor', |
355 |
description => 'auto order vendor', |
| 329 |
transport => 'FILE', |
356 |
file_transport_id => $file_transport->{file_transport_id}, |
| 330 |
plugin => '', |
357 |
plugin => '', |
| 331 |
san => $test_san, |
358 |
san => $test_san, |
| 332 |
orders_enabled => 1, |
359 |
orders_enabled => 1, |
| 333 |
auto_orders => 1, |
360 |
auto_orders => 1, |
| 334 |
} |
361 |
} |
| 335 |
} |
362 |
} |
| 336 |
); |
363 |
); |
|
Lines 408-421
subtest 'process_quote' => sub {
Link Here
|
| 408 |
|
435 |
|
| 409 |
$schema->storage->txn_begin; |
436 |
$schema->storage->txn_begin; |
| 410 |
|
437 |
|
|
|
438 |
# Create file transport for local testing |
| 439 |
my $file_transport = $builder->build( |
| 440 |
{ |
| 441 |
source => 'FileTransport', |
| 442 |
value => { |
| 443 |
name => 'Test Multi-item Transport', |
| 444 |
transport => 'local', |
| 445 |
download_directory => $dirname, |
| 446 |
upload_directory => $dirname, |
| 447 |
} |
| 448 |
} |
| 449 |
); |
| 450 |
|
| 411 |
# Create vendor EDI account |
451 |
# Create vendor EDI account |
| 412 |
my $account = $builder->build( |
452 |
my $account = $builder->build( |
| 413 |
{ |
453 |
{ |
| 414 |
source => 'VendorEdiAccount', |
454 |
source => 'VendorEdiAccount', |
| 415 |
value => { |
455 |
value => { |
| 416 |
description => 'multi-item vendor', |
456 |
description => 'multi-item vendor', |
| 417 |
transport => 'FILE', |
457 |
file_transport_id => $file_transport->{file_transport_id}, |
| 418 |
plugin => '', |
458 |
plugin => '', |
| 419 |
} |
459 |
} |
| 420 |
} |
460 |
} |
| 421 |
); |
461 |
); |
|
Lines 568-579
subtest 'process_quote' => sub {
Link Here
|
| 568 |
|
608 |
|
| 569 |
$schema->storage->txn_begin; |
609 |
$schema->storage->txn_begin; |
| 570 |
|
610 |
|
|
|
611 |
# Create file transport for local testing |
| 612 |
my $file_transport = $builder->build( |
| 613 |
{ |
| 614 |
source => 'FileTransport', |
| 615 |
value => { |
| 616 |
name => 'Test Error Transport', |
| 617 |
transport => 'local', |
| 618 |
download_directory => $dirname, |
| 619 |
upload_directory => $dirname, |
| 620 |
} |
| 621 |
} |
| 622 |
); |
| 623 |
|
| 571 |
my $account = $builder->build( |
624 |
my $account = $builder->build( |
| 572 |
{ |
625 |
{ |
| 573 |
source => 'VendorEdiAccount', |
626 |
source => 'VendorEdiAccount', |
| 574 |
value => { |
627 |
value => { |
| 575 |
description => 'error test vendor', |
628 |
description => 'error test vendor', |
| 576 |
transport => 'FILE', |
629 |
file_transport_id => $file_transport->{file_transport_id}, |
| 577 |
} |
630 |
} |
| 578 |
} |
631 |
} |
| 579 |
); |
632 |
); |
|
Lines 675-686
subtest 'process_quote' => sub {
Link Here
|
| 675 |
|
728 |
|
| 676 |
$schema->storage->txn_begin; |
729 |
$schema->storage->txn_begin; |
| 677 |
|
730 |
|
|
|
731 |
# Create file transport for local testing |
| 732 |
my $file_transport = $builder->build( |
| 733 |
{ |
| 734 |
source => 'FileTransport', |
| 735 |
value => { |
| 736 |
name => 'Test Multiple Message Transport', |
| 737 |
transport => 'local', |
| 738 |
download_directory => $dirname, |
| 739 |
upload_directory => $dirname, |
| 740 |
} |
| 741 |
} |
| 742 |
); |
| 743 |
|
| 678 |
my $account = $builder->build( |
744 |
my $account = $builder->build( |
| 679 |
{ |
745 |
{ |
| 680 |
source => 'VendorEdiAccount', |
746 |
source => 'VendorEdiAccount', |
| 681 |
value => { |
747 |
value => { |
| 682 |
description => 'error test vendor', |
748 |
description => 'error test vendor', |
| 683 |
transport => 'FILE', |
749 |
file_transport_id => $file_transport->{file_transport_id}, |
| 684 |
} |
750 |
} |
| 685 |
} |
751 |
} |
| 686 |
); |
752 |
); |
|
Lines 739-753
subtest 'process_invoice' => sub {
Link Here
|
| 739 |
|
805 |
|
| 740 |
$schema->storage->txn_begin; |
806 |
$schema->storage->txn_begin; |
| 741 |
|
807 |
|
|
|
808 |
# Get dirname for transport |
| 809 |
my $dirname = ( $Bin =~ /^(.*\/t\/)/ ? $1 . 'edi_testfiles/' : q{} ); |
| 810 |
|
| 811 |
# Create file transport for local testing |
| 812 |
my $file_transport = $builder->build( |
| 813 |
{ |
| 814 |
source => 'FileTransport', |
| 815 |
value => { |
| 816 |
name => 'Test Invoice Transport', |
| 817 |
transport => 'local', |
| 818 |
download_directory => $dirname, |
| 819 |
upload_directory => $dirname, |
| 820 |
} |
| 821 |
} |
| 822 |
); |
| 823 |
|
| 742 |
# Add test EDI matching ean of test invoice file and ensure no plugins so we trigger core functions |
824 |
# Add test EDI matching ean of test invoice file and ensure no plugins so we trigger core functions |
| 743 |
my $account = $builder->build( |
825 |
my $account = $builder->build( |
| 744 |
{ |
826 |
{ |
| 745 |
source => 'VendorEdiAccount', |
827 |
source => 'VendorEdiAccount', |
| 746 |
value => { |
828 |
value => { |
| 747 |
description => 'test vendor', |
829 |
description => 'test vendor', |
| 748 |
transport => 'FILE', |
830 |
file_transport_id => $file_transport->{file_transport_id}, |
| 749 |
plugin => '', |
831 |
plugin => '', |
| 750 |
san => '5013546027173' |
832 |
san => '5013546027173' |
| 751 |
} |
833 |
} |
| 752 |
} |
834 |
} |
| 753 |
); |
835 |
); |
|
Lines 787-793
subtest 'process_invoice' => sub {
Link Here
|
| 787 |
my $ordernumber2 = $order2->ordernumber; |
869 |
my $ordernumber2 = $order2->ordernumber; |
| 788 |
|
870 |
|
| 789 |
# Add test invoice file to the database for testing |
871 |
# Add test invoice file to the database for testing |
| 790 |
my $dirname = ( $Bin =~ /^(.*\/t\/)/ ? $1 . 'edi_testfiles/' : q{} ); |
|
|
| 791 |
my $filename = 'INVOICE.CEI'; |
872 |
my $filename = 'INVOICE.CEI'; |
| 792 |
ok( -e $dirname . $filename, 'File INVOICE.CEI found' ); |
873 |
ok( -e $dirname . $filename, 'File INVOICE.CEI found' ); |
| 793 |
|
874 |
|