Fixed: Tourism tax flow and code review changes implemented

This commit is contained in:
shazar rahman
2026-08-07 20:03:28 +05:30
parent ee4fb7a07a
commit 2abdb5b1e1
63 changed files with 3399 additions and 2380 deletions

View File

@@ -687,27 +687,13 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$footer['total_without_discount_te'] = $footer['room_price_tax_excl'] + $footer['total_convenience_fee_te'] + $footer['additional_service_price_tax_excl'] + $footer['service_products_price_tax_excl'];
$footer['total_without_discount_ti'] = $footer['room_price_tax_incl'] + $footer['total_convenience_fee_ti'] + $footer['additional_service_price_tax_incl'] + $footer['service_products_price_tax_incl'];
$footer['total_tax_without_discount'] = $footer['total_without_discount_ti'] - $footer['total_without_discount_te'];
$footer['total_tourism_tax'] = OrderTourismTax::getOrderTourismTaxTotal((int) $this->order->id);
$footer['total_tax_without_discount'] = $footer['total_without_discount_ti'] - $footer['total_without_discount_te'] - $footer['total_tourism_tax'];
if ($footer['total_tax_without_discount'] < 0) {
$footer['total_tax_without_discount'] = 0;
}
$ttBreakdown = Configuration::get('QLO_USE_TOURISM_TAX') ? HotelOrderTourismTax::getBreakdownForInvoice((int) $this->order->id) : array();
$footer['tourism_tax_breakdown'] = $ttBreakdown;
$footer['tourism_tax_online'] = 0.0;
$footer['tourism_tax_at_hotel'] = 0.0;
foreach ($ttBreakdown as $ttRow) {
if ((int) $ttRow['collection_type'] === 0) {
$footer['tourism_tax_online'] += (float) $ttRow['total_amount'];
} else {
$footer['tourism_tax_at_hotel'] += (float) $ttRow['total_amount'];
}
}
if ($footer['tourism_tax_online'] > 0) {
$footer['total_tax_without_discount'] = max(0.0, $footer['total_tax_without_discount'] - $footer['tourism_tax_online']);
}
$data = array(
'cart_htl_data' => $cart_htl_data,
'is_hotel_order' => HotelBookingDetail::getIdHotelByIdOrder($this->order->id),