// Code cleaning
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16837 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
96040e1cb5
commit
e60df09495
1 file changed
+5
-7
@@ -487,15 +487,13 @@ class Loyalty extends Module
|
|||||||
include_once(dirname(__FILE__).'/LoyaltyModule.php');
|
include_once(dirname(__FILE__).'/LoyaltyModule.php');
|
||||||
|
|
||||||
$totalPrice = 0;
|
$totalPrice = 0;
|
||||||
$details = OrderReturn::getOrdersReturnDetail((int)($params['orderReturn']->id));
|
$details = OrderReturn::getOrdersReturnDetail((int)$params['orderReturn']->id);
|
||||||
foreach ($details AS $detail)
|
foreach ($details AS $detail)
|
||||||
{
|
{
|
||||||
$price_wt = Db::getInstance()->getValue('
|
$totalPrice += Db::getInstance()->getValue('
|
||||||
SELECT product_price * (1 + (tax_rate / 100)) price
|
SELECT ROUND(total_price_tax_incl, 2)
|
||||||
FROM '._DB_PREFIX_.'order_detail od
|
FROM '._DB_PREFIX_.'order_detail od
|
||||||
WHERE id_order_detail = '.(int)($detail['id_order_detail']));
|
WHERE id_order_detail = '.(int)$detail['id_order_detail']);
|
||||||
|
|
||||||
$totalPrice += number_format($price_wt, 2, '.', '') * $detail['product_quantity'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$loyaltyNew = new LoyaltyModule();
|
$loyaltyNew = new LoyaltyModule();
|
||||||
@@ -643,7 +641,7 @@ class Loyalty extends Module
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
$loyaltyNew = new LoyaltyModule();
|
$loyaltyNew = new LoyaltyModule();
|
||||||
$loyaltyNew->points = -1 * LoyaltyModule::getNbPointsByPrice(number_format($orderDetail->product_price * (1 + $orderDetail->tax_rate / 100), 2, '.', '')) * $orderDetail->product_quantity;
|
$loyaltyNew->points = -1 * LoyaltyModule::getNbPointsByPrice(number_format($orderDetail->total_price_tax_incl, 2, '.', ''));
|
||||||
$loyaltyNew->id_loyalty_state = (int)LoyaltyStateModule::getCancelId();
|
$loyaltyNew->id_loyalty_state = (int)LoyaltyStateModule::getCancelId();
|
||||||
$loyaltyNew->id_order = (int)$params['order']->id;
|
$loyaltyNew->id_order = (int)$params['order']->id;
|
||||||
$loyaltyNew->id_customer = (int)$loyalty->id_customer;
|
$loyaltyNew->id_customer = (int)$loyalty->id_customer;
|
||||||
|
|||||||
Reference in new issue
Block a user