[-] BO : #PSCFV-3011 - Add details of refund and returned products on the BO order page.

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16222 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-07-05 07:40:11 +00:00
parent 718e6a3b55
commit 1997bf6efb
7 changed files with 117 additions and 5 deletions
+15
View File
@@ -755,6 +755,21 @@ class OrderCore extends ObjectModel
{
return count($this->getHistory((int)($this->id_lang), false, false, OrderState::FLAG_DELIVERY));
}
/**
* Has products returned by the merchant or by the customer?
*/
public function hasProductReturned()
{
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT IFNULL(SUM(ord.product_quantity), SUM(product_quantity_return))
FROM `'._DB_PREFIX_.'orders` o
INNER JOIN `'._DB_PREFIX_.'order_detail` od
ON od.id_order = o.id_order
LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord
ON ord.id_order_detail = od.id_order_detail
WHERE o.id_order = '.(int)$this->id);
}
public function hasBeenPaid()
{