// Fixed #PSCFV-3702

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16934 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-08-21 13:21:16 +00:00
parent 683a0c3bf3
commit e25a53352b
+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