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

This commit is contained in:
mDeflotte
2012-07-05 07:40:11 +00:00
parent 5a28e22ae6
commit cc82ddf5cc
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()
{