Merge branch 'ticket-14974-refundvoucher' into develop

This commit is contained in:
Michael RICOIS 2017-12-01 14:47:23 +01:00
commit c970d88e64

View File

@ -42,8 +42,12 @@ class Ant_Refund_Discount extends Module
if ($this->debuglog) file_put_contents(_PS_ROOT_DIR_.'/log/ant_refund_discount.log', 'Discount : '.$orderParams->total_discounts."\n");
if ($this->debuglog) file_put_contents(_PS_ROOT_DIR_.'/log/ant_refund_discount.log', print_r($params, 1), FILE_APPEND);
// Select if a discount is associated to the order
$nbDiscount = Db::getInstance()->getValue("SELECT count(*) AS nb FROM `"._DB_PREFIX_."order_discount` od
WHERE od.`id_order`=".(int)$orderParams->id);
// If we have no discount
if ($orderParams->total_discounts == 0) {
if ($nbDiscount == 0) {
return;
}