changes in calculating advance_paid_amount in orders table

This commit is contained in:
Sumit Panwar
2021-12-24 12:09:05 +05:30
parent 2a34e41b67
commit 34aa95c60c

View File

@@ -355,7 +355,11 @@ abstract class PaymentModuleCore extends Module
// advance payment information
$order->is_advance_payment = $this->context->cart->is_advance_payment;
$order->advance_paid_amount = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_);
if ($order->is_advance_payment) {
$order->advance_paid_amount = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_);
} else {
$order->advance_paid_amount = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_);
}
// Creating order
$result = $order->add();