2 use Test::More tests => 4;
 
   6 use SL::Dev::Part qw(new_part);
 
   7 use SL::Dev::Inventory qw(create_warehouse_and_bins);
 
   9 use Support::TestSetup;
 
  11 Support::TestSetup::login();
 
  15 my ($wh, $bin, $part);
 
  18   ($wh, $bin) = create_warehouse_and_bins(
 
  19     warehouse_description => 'Test warehouse',
 
  20     bin_description       => 'Test bin',
 
  24   $part = new_part()->save->load;
 
  26   my $tt_used = SL::DB::Manager::TransferType->find_by(direction => 'out', description => 'used') or die;
 
  27   my $tt_assembled = SL::DB::Manager::TransferType->find_by(direction => 'in', description => 'assembled') or die;
 
  35     employee     => SL::DB::Manager::Employee->current,
 
  36     shippingdate => DateTime->now,
 
  39   SL::DB::Inventory->new(%args, trans_type => $tt_used, qty => -1)->save;
 
  40   SL::DB::Inventory->new(%args, trans_type => $tt_used, qty => -1)->save;
 
  41   SL::DB::Inventory->new(%args, trans_type => $tt_assembled, qty => 1)->save;
 
  43   qty                           => { type => 'numeric', precision => 25, scale => 5 },
 
  44   shippingdate                  => { type => 'date', not_null => 1 },
 
  48   SL::DB::Manager::Inventory->delete_all(all => 1);
 
  55 # l_warehouse_from = Y
 
  60 # l_partdescription = Y
 
  69 my @contents = WH->get_warehouse_journal(sort => 'date');
 
  71 is $contents[0]{qty}, '1.00000', "produce assembly does not multiply qty (1)";
 
  72 is $contents[1]{qty}, '1.00000', "produce assembly does not multiply qty (2)";
 
  73 is $contents[2]{qty}, '1.00000', "produce assembly does not multiply qty (3)";