Revision 9d4b66a8
t/wh/journal.t | ||
---|---|---|
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 |
} |
Auch abrufbar als: Unified diff
Testfall um Fehlerfall und Mandanteneinstellung erweitert