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

This commit is contained in:
dSevere
2011-12-02 15:23:01 +00:00
parent 5259d4e64e
commit 6fddfce5e7
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