// Removing red error message when orders total is diferent form the total paid if there are multiple orders with the same reference
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11385 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -205,7 +205,7 @@
|
|||||||
<hr />
|
<hr />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<p class="error" style="{if $order->total_paid_tax_incl == $total_paid}display: none;{/if}">
|
<p class="error" style="{if $orders_total_paid_tax_incl == $total_paid}display: none;{/if}">
|
||||||
{l s='Warning:'} {displayPrice price=$total_paid currency=$currency->id}
|
{l s='Warning:'} {displayPrice price=$total_paid currency=$currency->id}
|
||||||
{l s='paid instead of'} <span class="total_paid">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</span>
|
{l s='paid instead of'} <span class="total_paid">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1475,6 +1475,22 @@ class OrderCore extends ObjectModel
|
|||||||
|
|
||||||
return Tools::ps_round($total, 2);
|
return Tools::ps_round($total, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the sum of total_paid_tax_incl of the orders with similar reference
|
||||||
|
*
|
||||||
|
* @since 1.5.0.1
|
||||||
|
* @return float
|
||||||
|
*/
|
||||||
|
public function getOrdersTotalPaid()
|
||||||
|
{
|
||||||
|
return Db::getInstance()->getValue('
|
||||||
|
SELECT SUM(total_paid_tax_incl)
|
||||||
|
FROM `'._DB_PREFIX_.'orders`
|
||||||
|
WHERE `reference` = '.(int)$this->reference.'
|
||||||
|
AND `id_cart` = '.(int)$this->id_cart
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1024,6 +1024,7 @@ class AdminOrdersControllerCore extends AdminController
|
|||||||
'customerStats' => $customer->getStats(),
|
'customerStats' => $customer->getStats(),
|
||||||
'products' => $products,
|
'products' => $products,
|
||||||
'discounts' => $order->getCartRules(),
|
'discounts' => $order->getCartRules(),
|
||||||
|
'orders_total_paid_tax_incl' => $order->getOrdersTotalPaid(), // Get the sum of total_paid_tax_incl of the order with similar reference
|
||||||
'total_paid' => $order->getTotalPaid(),
|
'total_paid' => $order->getTotalPaid(),
|
||||||
'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id),
|
'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id),
|
||||||
'slips' => OrderSlip::getOrdersSlip($order->id_customer, $order->id),
|
'slips' => OrderSlip::getOrdersSlip($order->id_customer, $order->id),
|
||||||
|
|||||||
Reference in New Issue
Block a user