Added: Added Hotel address and removed hotel column from the room type table in the booking invoice.

Added: Added Hotel address and removed hotel column from the room type table in the booking invoice.
This commit is contained in:
Rohit Jain
2025-05-15 12:12:44 +05:30
committed by GitHub
3 changed files with 16 additions and 9 deletions

View File

@@ -314,10 +314,17 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$service_product_data = array();
$room_extra_demands = array();
$room_additinal_services = array();
$formattedHotelAddress = '';
if (Module::isInstalled('hotelreservationsystem')) {
$obj_htl_bk_dtl = new HotelBookingDetail();
$obj_rm_type = new HotelRoomType();
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
$objHotelBranchInfo = new HotelBranchInformation((int) HotelBookingDetail::getIdHotelByIdOrder($order_obj->id), $this->context->language->id);
$invoiceAddressPatternRules['avoid'][] = 'lastname';
if ($idHotelAddress = $objHotelBranchInfo->getHotelIdAddress()) {
$objHotelAddress = new Address((int) $idHotelAddress);
$objHotelAddress->firstname = $objHotelBranchInfo->hotel_name;
$formattedHotelAddress = AddressFormat::generateAddress($objHotelAddress, $invoiceAddressPatternRules, '<br />', ' ');
}
$customer = new Customer($this->order->id_customer);
if (!empty($order_details)) {
@@ -591,6 +598,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
'cart_rules' => $cart_rules,
'delivery_address' => $formatted_delivery_address,
'invoice_address' => $formatted_invoice_address,
'hotel_address' => $formattedHotelAddress,
'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address),
'tax_excluded_display' => $tax_excluded_display,
'display_product_images' => $display_product_images,

View File

@@ -31,7 +31,12 @@
{$delivery_address}
{/if}
</td> -->
<td width="33%"></td>
<td width="33%">
<span class="bold">{l s='Hotel Detail' pdf='true'}</span><br/><br/>
{if $hotel_address}
{$hotel_address}
{/if}
</td>
<td width="33%"></td>
<td width="33%">
<span class="bold">{l s='Customer Detail' pdf='true'}</span><br/><br/>

View File

@@ -27,14 +27,13 @@
<table class="product" class="bordered-table" width="100%" cellpadding="4" cellspacing="0">
<thead>
<tr>
<th colspan="{if $display_product_images}9{else}8{/if}" class="header">{l s='Rooms Details' pdf='true'}</th>
<th colspan="{if $display_product_images}8{else}7{/if}" class="header">{l s='Rooms Details' pdf='true'}</th>
</tr>
<tr>
{if $display_product_images}
<th class="product header small">{l s='Room Image' pdf='true'}</th>
{/if}
<th class="product header small">{l s='Room Description' pdf='true'}</th>
<th class="product header small">{l s='Hotel' pdf='true'}</th>
<th class="product header small">{l s='Tax Rate(s)' pdf='true'}</th>
{* {if isset($layout.before_discount)}
<th class="product header small">{l s='Base price' pdf='true'} <br /> {l s='(Tax excl.)' pdf='true'}</th>
@@ -62,11 +61,6 @@
{$data_v['name']}
</p>
</td>
<td class="product center">
<p>
{$data_v['hotel_name']}
</p>
</td>
<td class="product center">
{$data_v['order_detail_tax_label']}
</td>