6 use_ok 'Support::TestSetup';
8 use_ok 'SL::DB::Warehouse';
11 Support::TestSetup::login();
13 my $part = SL::DB::Manager::Part->get_first;
14 is(ref $part, 'SL::DB::Part', 'loading a part to test with id ' . $part->id);
16 my $wh = SL::DB::Manager::Warehouse->get_first;
17 is(ref $wh, 'SL::DB::Warehouse', 'loading a warehouse to test with id ' . $wh->id);
19 my $bin1 = $wh->bins->[0];
20 is(ref $bin1, 'SL::DB::Bin', 'getting first bin to test with id ' . $bin1->id);
22 my $bin2 = $wh->bins->[1];
23 is(ref $bin2, 'SL::DB::Bin', 'getting another bin to test with id ' . $bin2->id);
26 $::form->{l_warehouseid} = 'Y';
27 $::form->{l_binid} = 'Y';
28 my ($result) = WH->get_warehouse_report(
29 warehouse_id => $wh->id,
41 transfer_type => 'transfer',
42 parts_id => $part->id,
43 src_warehouse_id => $wh->id,
44 dst_warehouse_id => $wh->id,
45 src_bin_id => $bin1->id,
46 dst_bin_id => $bin2->id,
53 is $r1->{qty}, $r2->{qty} + 4, 'transfer one way';
56 transfer_type => 'transfer',
57 parts_id => $part->id,
58 src_warehouse_id => $wh->id,
59 dst_warehouse_id => $wh->id,
60 src_bin_id => $bin2->id,
61 dst_bin_id => $bin1->id,
69 is $r2->{qty}, $r3->{qty} - 4, 'and back';