X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/e502a43953cea946526bdb4bfcdc7f5ad4d2e3c8..4bed72f:/t/wh/transfer.t diff --git a/t/wh/transfer.t b/t/wh/transfer.t index 94767529c..8d88fb178 100644 --- a/t/wh/transfer.t +++ b/t/wh/transfer.t @@ -8,10 +8,16 @@ use_ok 'SL::DB::Part'; use_ok 'SL::DB::Warehouse'; use_ok 'SL::WH'; +use_ok('SL::DB::Inventory'); + + Support::TestSetup::login(); -my $part = SL::DB::Manager::Part->get_first; -is(ref $part, 'SL::DB::Part', 'loading a part to test with id ' . $part->id); +my $part = SL::DB::Part->new(unit => 'mg', description => 'TestObject'); +$part->save(); + +is(ref($part), 'SL::DB::Part', 'loading a part to test with id ' . $part->id); + my $wh = SL::DB::Manager::Warehouse->get_first; is(ref $wh, 'SL::DB::Warehouse', 'loading a warehouse to test with id ' . $wh->id); @@ -71,6 +77,20 @@ test { shift->{qty}, shift->{qty} - 4, 'and back' } { chargenumber => '', }; +################################################# + +test {shift->{qty}, shift->{qty} + 4000000000, 'transfer one way with unit'} { + transfer_type => 'transfer', + parts_id => $part->id, + src_warehouse_id => $wh->id, + dst_warehouse_id => $wh->id, + src_bin_id => $bin1->id, + dst_bin_id => $bin2->id, + qty => 4, + unit => 't', + chargenumber => '', +}; + ############################################## use_ok 'SL::DB::TransferType'; @@ -138,6 +158,10 @@ test { shift->{qty}, shift->{qty}, 'warehouse reduced interface' } { }; +SL::DB::Manager::Inventory->delete_objects(where => [parts_id => $part->id]); + +$part->delete(); + done_testing; 1;