Merge branch 'ticket-fidelite' into develop

This commit is contained in:
Marion Muszynski 2016-04-22 15:17:50 +02:00
commit 2db0ee384d

View File

@ -518,7 +518,7 @@ class Loyalty extends Module
}
$loyaltyNew = new LoyaltyModule();
$loyaltyNew->discount_value = 0;
$loyaltyNew->discount_value = -1 * (LoyaltyModule::getDiscountValueByPrice($totalPrice));
$loyaltyNew->id_loyalty_state = (int)LoyaltyStateModule::getCancelId();
$loyaltyNew->id_order = (int)$params['orderReturn']->id_order;
$loyaltyNew->id_customer = (int)$params['orderReturn']->id_customer;
@ -679,7 +679,7 @@ class Loyalty extends Module
$price = ($params['order']->total_paid - $params['order']->total_shipping) - (number_format($orderDetail->product_price * (1 + $orderDetail->tax_rate / 100), 2, '.', '') * $orderDetail->product_quantity);
if ($price>0) {
$loyaltyNew->discount_value = LoyaltyModule::getDiscountValueByPrice($price);
$loyaltyNew->discount_value = -1 * LoyaltyModule::getDiscountValueByPrice($price);
$loyaltyNew->id_loyalty_state = (int)LoyaltyStateModule::getDefaultId();
} else {
$loyaltyNew->discount_value = 0;