Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[kivitendo-erp.git] / SL / Controller / Inventory.pm
index ca6190c..8e5a445 100644 (file)
@@ -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
@@ -242,7 +243,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.');