[-] Core: Fix #PSCFV-6067 stock was not reserved sometimes because of time
This commit is contained in:
@@ -473,7 +473,7 @@ class StockManagerCore implements StockManagerInterface
|
|||||||
$query->where('od.product_id = '.(int)$id_product);
|
$query->where('od.product_id = '.(int)$id_product);
|
||||||
if (0 != $id_product_attribute)
|
if (0 != $id_product_attribute)
|
||||||
$query->where('od.product_attribute_id = '.(int)$id_product_attribute);
|
$query->where('od.product_attribute_id = '.(int)$id_product_attribute);
|
||||||
$query->leftJoin('order_history', 'oh', 'oh.id_order = o.id_order AND oh.date_add = o.date_upd');
|
$query->leftJoin('order_history', 'oh', 'oh.id_order = o.id_order AND oh.id_order_state = o.current_state');
|
||||||
$query->leftJoin('order_state', 'os', 'os.id_order_state = oh.id_order_state');
|
$query->leftJoin('order_state', 'os', 'os.id_order_state = oh.id_order_state');
|
||||||
$query->where('os.shipped != 1');
|
$query->where('os.shipped != 1');
|
||||||
$query->where('o.valid = 1 OR (os.id_order_state != '.(int)Configuration::get('PS_OS_ERROR').'
|
$query->where('o.valid = 1 OR (os.id_order_state != '.(int)Configuration::get('PS_OS_ERROR').'
|
||||||
@@ -658,4 +658,4 @@ class StockManagerCore implements StockManagerInterface
|
|||||||
return $stocks;
|
return $stocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user