[-] BO : BugFix : #PSCFV-2644 : Unable to remove stock to a product with advanced stock management
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15870 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
e54b4c54cb
commit
0dc3d1b996
1 file changed
+11
-1
@@ -356,7 +356,7 @@ class AdminStockManagementControllerCore extends AdminController
|
|||||||
'size' => 10,
|
'size' => 10,
|
||||||
'maxlength' => 6,
|
'maxlength' => 6,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'desc' => $this->l('Physical quantity to remove')
|
'desc' => $this->l('Physical quantity to remove'),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'type' => 'radio',
|
'type' => 'radio',
|
||||||
@@ -675,10 +675,20 @@ class AdminStockManagementControllerCore extends AdminController
|
|||||||
StockAvailable::synchronize($id_product);
|
StockAvailable::synchronize($id_product);
|
||||||
Tools::redirectAdmin($redirect.'&conf=2');
|
Tools::redirectAdmin($redirect.'&conf=2');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$physical_quantity_in_stock = (int)$stock_manager->getProductPhysicalQuantities($id_product, $id_product_attribute, array($warehouse->id), false);
|
||||||
|
$usable_quantity_in_stock = (int)$stock_manager->getProductPhysicalQuantities($id_product, $id_product_attribute, array($warehouse->id), true);
|
||||||
|
$not_usable_quantity = ($physical_quantity_in_stock - $usable_quantity_in_stock);
|
||||||
|
if ($usable_quantity_in_stock < $quantity)
|
||||||
|
$this->errors[] = sprintf(Tools::displayError('You don\'t have enough usable quantity (usable or not). Could not remove %d out of %d.'), (int)$quantity, (int)$usable_quantity_in_stock);
|
||||||
|
else if ($not_usable_quantity < $quantity)
|
||||||
|
$this->errors[] = sprintf(Tools::displayError('You don\'t have enough quantity (not usable). Could not remove %d out of %d.'), (int)$quantity, (int)$not_usable_quantity);
|
||||||
else
|
else
|
||||||
$this->errors[] = Tools::displayError('It is not possible to remove the specified quantity or an error occurred. No stock was removed.');
|
$this->errors[] = Tools::displayError('It is not possible to remove the specified quantity or an error occurred. No stock was removed.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Tools::isSubmit('transferstock') && Tools::isSubmit('is_post'))
|
if (Tools::isSubmit('transferstock') && Tools::isSubmit('is_post'))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user