// Fixed #PSCFV-3702

This commit is contained in:
dMetzger
2012-08-21 13:21:16 +00:00
parent e460e7df72
commit 0cf3ef3a9c
+1 -1
View File
@@ -226,7 +226,7 @@ class OrderReturnCore extends ObjectModel
public static function addReturnedQuantity(&$products, $id_order)
{
$details = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT od.id_order_detail, IFNULL(GREATEST(od.product_quantity_return, ord.product_quantity),0) as qty_returned
SELECT od.id_order_detail, GREATEST(od.product_quantity_return, IFNULL(ord.product_quantity,0)) as qty_returned
FROM '._DB_PREFIX_.'order_detail od
LEFT JOIN '._DB_PREFIX_.'order_return_detail ord
ON ord.id_order_detail = od.id_order_detail