Revision f8eaaf84
Von Sven Schöling vor etwa 4 Jahren hinzugefügt
t/wh/inventory.t | ||
---|---|---|
6 | 6 |
use SL::Dev::Part qw(new_part new_assembly); |
7 | 7 |
use SL::Dev::Inventory qw(create_warehouse_and_bins set_stock); |
8 | 8 |
use SL::Dev::Record qw(create_sales_order); |
9 |
use SL::DB::Helper::Reservation qw(make_reservation); |
|
10 | 9 |
|
11 | 10 |
use_ok 'Support::TestSetup'; |
12 | 11 |
use_ok 'SL::DB::Bin'; |
... | ... | |
58 | 57 |
is(SL::Helper::Inventory::get_stock(part => $assembly1), "60.00000", 'normal get_stock works'); |
59 | 58 |
is(SL::Helper::Inventory::get_onhand(part => $assembly1), "60.00000", 'normal get_onhand works'); |
60 | 59 |
|
61 |
# reserve some of it, get_stock, get_onhand |
|
62 |
|
|
63 |
my $order = create_sales_order(save => 1); |
|
64 |
|
|
65 |
make_reservation( |
|
66 |
part => $assembly1, |
|
67 |
bin => $bin1, |
|
68 |
reserve_for => $order, |
|
69 |
qty => 25, |
|
70 |
); |
|
71 |
|
|
72 |
is(WH->get_stock_(part => $assembly1), "60.00000", 'normal get_stock works'); |
|
73 |
is(WH->get_onhand_(part => $assembly1), "35.00000", 'normal get_onhand works'); |
|
74 |
|
|
75 | 60 |
# allocate some stuff |
76 | 61 |
|
77 | 62 |
my @allocations = SL::Helper::Inventory::allocate( |
... | ... | |
85 | 70 |
chargenumber => '', |
86 | 71 |
parts_id => $assembly1->id, |
87 | 72 |
qty => 12, |
88 |
reserve_for_id => undef, |
|
89 |
reserve_for_table => undef, |
|
90 | 73 |
warehouse_id => $wh->id, |
91 | 74 |
comment => undef, |
92 | 75 |
for_object_id => undef, |
... | ... | |
94 | 77 |
|
95 | 78 |
# simple |
96 | 79 |
|
97 |
# with reservation |
|
98 |
|
|
99 | 80 |
# more than exists |
100 | 81 |
|
101 | 82 |
# produce something |
Auch abrufbar als: Unified diff
t/wh/inventory.t: Reservierungen entfernt