File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,23 @@ sub init {
36
36
shippingdate => DateTime-> now,
37
37
);
38
38
39
+ local $: :instance_conf-> data-> {transfer_default_ignore_onhand } = 1;
40
+
39
41
SL::DB::Inventory-> new(%args , trans_type => $tt_used , qty => -1)-> save;
40
42
SL::DB::Inventory-> new(%args , trans_type => $tt_used , qty => -1)-> save;
41
43
SL::DB::Inventory-> new(%args , trans_type => $tt_assembled , qty => 1)-> save;
42
44
45
+ local $: :instance_conf-> data-> {transfer_default_ignore_onhand } = 0;
46
+ my $die_message ;
47
+ eval {
48
+ SL::DB::Inventory-> new(%args , trans_type => $tt_used , qty => -1)-> save;
49
+
50
+ 1;
51
+ } or do {
52
+ $die_message = $@ ;
53
+ };
54
+ ok($die_message =~ m / Menge von -1 .* Artikel 50 .* Test warehouse am Lagerplatz Test bin 1/ , ' catch negative stock' );
55
+
43
56
qty => { type => ' numeric' , precision => 25, scale => 5 },
44
57
shippingdate => { type => ' date' , not_null => 1 },
45
58
}
You can’t perform that action at this time.
0 commit comments