Skip to content

Commit 9d4b66a

Browse files
committed
Testfall um Fehlerfall und Mandanteneinstellung erweitert
1 parent e8b0097 commit 9d4b66a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/wh/journal.t

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,23 @@ sub init {
3636
shippingdate => DateTime->now,
3737
);
3838

39+
local $::instance_conf->data->{transfer_default_ignore_onhand} = 1;
40+
3941
SL::DB::Inventory->new(%args, trans_type => $tt_used, qty => -1)->save;
4042
SL::DB::Inventory->new(%args, trans_type => $tt_used, qty => -1)->save;
4143
SL::DB::Inventory->new(%args, trans_type => $tt_assembled, qty => 1)->save;
4244

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+
4356
qty => { type => 'numeric', precision => 25, scale => 5 },
4457
shippingdate => { type => 'date', not_null => 1 },
4558
}

0 commit comments

Comments
 (0)