X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4fdbfa7df4c1f89cdb0d3d3266b5908ac67c3f15..96f2dabc7d64e28c74358fb5745a6c68b18527f3:/SL/Controller/Inventory.pm diff --git a/SL/Controller/Inventory.pm b/SL/Controller/Inventory.pm index ca6190c90..5bc780bf9 100644 --- a/SL/Controller/Inventory.pm +++ b/SL/Controller/Inventory.pm @@ -45,8 +45,9 @@ sub action_stock { my ($self) = @_; my $qty = $::form->parse_amount(\%::myconfig, $::form->{qty}); - - if ($qty < 0) { + if (!$qty) { + flash_later('error', t8('Cannot stock without amount')); + } elsif ($qty < 0) { flash_later('error', t8('Cannot stock negative amounts')); } else { # do stock @@ -58,6 +59,7 @@ sub action_stock { unit => $self->unit, transfer_type => 'stock', chargenumber => $::form->{chargenumber}, + bestbefore => $::form->{bestbefore}, ean => $::form->{ean}, comment => $::form->{comment}, }); @@ -242,7 +244,7 @@ sub show_no_warehouses_error { my $msg = t8('No warehouse has been created yet or the quantity of the bins is not configured yet.') . ' '; - if ($::auth->check_right($::form->{login}, 'config')) { # TODO wut? + if ($::auth->check_right($::myconfig{login}, 'config')) { # TODO wut? $msg .= t8('You can create warehouses and bins via the menu "System -> Warehouses".'); } else { $msg .= t8('Please ask your administrator to create warehouses and bins.');