// Context part 10

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7642 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-07-18 15:27:32 +00:00
parent 0dbcebf01e
commit 7b8f139103
24 changed files with 375 additions and 304 deletions
+1 -2
View File
@@ -90,14 +90,13 @@ class StockMvtCore extends ObjectModel
// Search missing stock movement on products without attributes
$sql = 'SELECT s.id_stock, (s.quantity - SUM(IFNULL(sm.quantity, 0))) AS qty
FROM '._DB_PREFIX_.'product p
INNER JOIN '._DB_PREFIX_.'stock s ON s.id_product = p.id_product
'.Product::sqlStock('p', null, true).'
LEFT JOIN '._DB_PREFIX_.'stock_mvt sm ON s.id_stock = sm.id_stock
WHERE (
SELECT COUNT(*) FROM '._DB_PREFIX_.'stock s2
WHERE s2.id_product = p.id_product
AND s2.id_product_attribute > 0
) = 0
'.Shop::sqlSharedStock('s').'
GROUP BY s.id_product, s.id_shop
HAVING qty <> 0';
$products_without_attributes = Db::getInstance()->ExecuteS($sql);