Merge branch 'develop' into gli-2941
This commit is contained in:
@@ -229,11 +229,17 @@ abstract class PaymentModuleCore extends Module
|
||||
$this->currentOrderReference = $reference;
|
||||
|
||||
$order_creation_failed = false;
|
||||
$cart_total_paid = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
$full_cart_total = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$amount_paid = !$dont_touch_amount ? Tools::ps_round((float)$amount_paid, _PS_PRICE_COMPUTE_PRECISION_) : $amount_paid;
|
||||
|
||||
if ($amount_paid >= $full_cart_total) {
|
||||
$is_advance_payment = false;
|
||||
$cart_total_paid = $full_cart_total;
|
||||
} else {
|
||||
$is_advance_payment = true;
|
||||
$cart_total_paid = (float)Tools::ps_round(
|
||||
(float)$this->context->cart->getOrderTotal(true, CART::ADVANCE_PAYMENT),
|
||||
(float)$this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
}
|
||||
@@ -314,7 +320,6 @@ abstract class PaymentModuleCore extends Module
|
||||
$order->gift_message = $this->context->cart->gift_message;
|
||||
$order->mobile_theme = $this->context->cart->mobile_theme;
|
||||
$order->conversion_rate = $this->context->currency->conversion_rate;
|
||||
$amount_paid = !$dont_touch_amount ? Tools::ps_round((float)$amount_paid, _PS_PRICE_COMPUTE_PRECISION_) : $amount_paid;
|
||||
$order->total_paid_real = 0;
|
||||
|
||||
$order->total_products = (float)$this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS, $order->product_list, $id_carrier);
|
||||
@@ -371,7 +376,7 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
|
||||
// advance payment information
|
||||
$order->is_advance_payment = $this->context->cart->is_advance_payment;
|
||||
$order->is_advance_payment = (int)$is_advance_payment;
|
||||
$order->amount_paid = 0;
|
||||
if ($order->is_advance_payment) {
|
||||
$order->advance_paid_amount = (float)Tools::ps_round(
|
||||
@@ -892,7 +897,7 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
/*for saving details of the advance payment product wise*/
|
||||
$objBookingDetail->total_paid_amount = $total_price['total_price_tax_incl'];
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
if ($is_advance_payment) {
|
||||
$prod_adv_payment = $objAdvancedPayment->getIdAdvPaymentByIdProduct($idProduct);
|
||||
if (!$prod_adv_payment
|
||||
|| (isset($prod_adv_payment['payment_type']) && $prod_adv_payment['payment_type'])
|
||||
|
||||
Reference in New Issue
Block a user