production scheduler fix
This commit is contained in:
@@ -214,9 +214,9 @@ class EcmStockState extends SugarBean {
|
||||
$GLOBALS['db']->query(
|
||||
"UPDATE ecmproducts as p
|
||||
INNER JOIN (
|
||||
SELECT round(sum(quantity*price)/sum(quantity),2) as avg_price, product_id FROM ecmstockstates GROUP BY product_id
|
||||
SELECT round(sum(quantity*price)/sum(quantity),2) as avg_price, product_id, SUM(quantity) as stock_state FROM ecmstockstates GROUP BY product_id
|
||||
) s ON p.id=s.product_id
|
||||
SET p.ems_price = s.avg_price
|
||||
SET p.ems_price = s.avg_price, p.ems_qty_in_stock = s.stock_state
|
||||
WHERE p.id='$product_id'"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user