Total Invoice Payment for Order and Due amount is calculated for the specific invoice

This commit is contained in:
Sumit Panwar
2024-06-08 17:12:48 +05:30
parent b5925817de
commit 0f4abcaeb4
4 changed files with 5 additions and 3 deletions

View File

@@ -1015,7 +1015,7 @@ class OrderInvoiceCore extends ObjectModel
$payments = OrderPaymentDetail::getByInvoiceId($this->id);
foreach ($payments as $payment) {
/** @var OrderPayment $payment */
$amount += $payment['amount'];
$amount += ($payment['amount'] / $payment['conversion_rate']);
}
Cache::store($cache_id, $amount);
return $amount;

View File

@@ -650,6 +650,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$footer['additional_service_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 0, null, $idsOrderDetail) + $totalDemandsPriceTI;
$footer['total_convenience_fee_te'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT, $idsOrderDetail);
$footer['total_convenience_fee_ti'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT, $idsOrderDetail);
$footer['total_paid_real'] = $this->order_invoice->getTotalPaid();
$data = array(
'cart_htl_data' => $cart_htl_data,
'service_product_data' => $service_product_data,

View File

@@ -26,7 +26,7 @@
/* Debug only */
if (!defined('_PS_MODE_DEV_')) {
define('_PS_MODE_DEV_', false);
define('_PS_MODE_DEV_', true);
}
/* Compatibility warning */
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);

View File

@@ -138,7 +138,7 @@
{l s='Due Amount' pdf='true'}
</td>
<td class="white">
{displayPrice currency=$order->id_currency price=($order->total_paid - $order->total_paid_real)}
{displayPrice currency=$order->id_currency price=($footer.total_paid_tax_incl - $footer.total_paid_real)}
</td>
</tr>
{/if}