Revision 2401956f
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
t/controllers/disposition_manager/disposition_manager.t | ||
---|---|---|
60 | 60 |
|
61 | 61 |
my $controller = SL::Controller::DispositionManager->new(); |
62 | 62 |
my $reorder_parts = $controller->_get_parts; |
63 |
is(scalar @{$reorder_parts}, 6, "found 6 parts where onhand <= rop");
|
|
63 |
is(scalar @{$reorder_parts}, 5, "found 5 parts where onhand < rop");
|
|
64 | 64 |
|
65 | 65 |
# die; # die here if you want to test making basket manually |
66 | 66 |
|
... | ... | |
76 | 76 |
select $oldFH; |
77 | 77 |
close $outputFH; |
78 | 78 |
|
79 |
is(SL::DB::Manager::PurchaseBasketItem->get_all_count(), 6, "6 items in purchase basket ok");
|
|
79 |
is(SL::DB::Manager::PurchaseBasketItem->get_all_count(), 5, "5 items in purchase basket ok");
|
|
80 | 80 |
|
81 | 81 |
# die; # die here if you want to test creating purchase orders manually |
82 | 82 |
|
... | ... | |
97 | 97 |
|
98 | 98 |
my $purchase_order = SL::DB::Manager::Order->get_first(); |
99 | 99 |
|
100 |
is( scalar @{$purchase_order->items}, 6, "Purchase order has 6 item ok");
|
|
101 |
print "PART\n"; |
|
102 |
print Dumper($part1); |
|
100 |
is( scalar @{$purchase_order->items}, 5, "Purchase order has 5 item ok");
|
|
101 |
# print "PART\n";
|
|
102 |
# print Dumper($part1);
|
|
103 | 103 |
my $first_item = $purchase_order->items_sorted->[0]; |
104 |
print "FIRST\n"; |
|
105 |
print Dumper($first_item); |
|
104 |
# print "FIRST\n";
|
|
105 |
# print Dumper($first_item);
|
|
106 | 106 |
is( $first_item->parts_id, $part1->id, "Purchase order: first item is part1"); |
107 |
is( $first_item->qty, '1.0000000', "Purchase order: first item has qty 1");
|
|
108 |
cmp_ok( $purchase_order->netamount, '==', 52, "Purchase order: netamount ok");
|
|
109 |
is( $first_item->active_price_source, 'makemodel/' . $part1->makemodels->[0]->id . "/" . $part1->makemodels->[0]->parts_id . "/" . $part1->makemodels->[0]->make, "Purchase order: first item has correct active_price_source" . $first_item->part->partnumber);
|
|
107 |
is( $first_item->qty, '20.00000', "Purchase order: first item has qty 20");
|
|
108 |
cmp_ok( $purchase_order->netamount, '==', 240, "Purchase order: netamount ok");
|
|
109 |
is( $first_item->active_price_source, 'makemodel/' . $part1->makemodels->[0]->id, "Purchase order: first item has correct active_price_source" . $first_item->part->partnumber); |
|
110 | 110 |
|
111 | 111 |
clear_up(); |
112 | 112 |
done_testing(); |
Auch abrufbar als: Unified diff
WIP DispositionManager