// StockManager : bugs fix + improvement of StockManager utilisation in fucntion of global configuration

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10861 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dSevere
2011-12-02 15:23:01 +00:00
parent d76998340a
commit 43654ffba1
6 changed files with 53 additions and 41 deletions
+10 -7
View File
@@ -654,13 +654,16 @@ class ProductCore extends ObjectModel
* - physical stock for this product
* - supply order(s) for this product
*/
$stock_manager = StockManagerFactory::getManager();
$physical_quantity = $stock_manager->getProductPhysicalQuantities($this->id, 0);
$real_quantity = $stock_manager->getProductRealQuantities($this->id, 0);
if ($physical_quantity > 0)
return false;
if ($real_quantity > $physical_quantity)
return false;
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
{
$stock_manager = StockManagerFactory::getManager();
$physical_quantity = $stock_manager->getProductPhysicalQuantities($this->id, 0);
$real_quantity = $stock_manager->getProductRealQuantities($this->id, 0);
if ($physical_quantity > 0)
return false;
if ($real_quantity > $physical_quantity)
return false;
}
/*
* @since 1.5.0