// Removing some id_warehouse

// Adding some checks with advanced_stock_management product attribute
This commit is contained in:
mDeflotte
2011-12-19 16:01:41 +00:00
parent 93e3cbe89d
commit bab4e9c6e1
10 changed files with 101 additions and 105 deletions
+8 -1
View File
@@ -101,6 +101,8 @@ class OrderInvoiceCore extends ObjectModel
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT *
FROM `'._DB_PREFIX_.'order_detail` od
LEFT JOIN `'._DB_PREFIX_.'product` p
ON p.id_product = od.product_id
WHERE od.`id_order` = '.(int)$this->id_order.'
AND od.`id_order_invoice` = '.(int)$this->id);
}
@@ -173,7 +175,12 @@ class OrderInvoiceCore extends ObjectModel
*/
protected function setProductCurrentStock(&$product)
{
$product['current_stock'] = StockManagerFactory::getManager()->getProductPhysicalQuantities($product['product_id'], $product['product_attribute_id'], null, true);
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
&& (int)$product['advanced_stock_management'] == 1
&& (int)$product['id_warehouse'] > 0)
$product['current_stock'] = StockManagerFactory::getManager()->getProductPhysicalQuantities($product['product_id'], $product['product_attribute_id'], null, true);
else
$product['current_stock'] = '--';
}
/**