diff --git a/admin/themes/default/sass/admin-theme.sass b/admin/themes/default/sass/admin-theme.sass index 33b4084b0..1e196b8df 100644 --- a/admin/themes/default/sass/admin-theme.sass +++ b/admin/themes/default/sass/admin-theme.sass @@ -108,6 +108,8 @@ @import "partials/select2" @import "partials/ndv3" +@import "partials/tooltip" + //Backward compatibility @import "partials/backward" diff --git a/admin/themes/default/sass/admin-theme_rtl.sass b/admin/themes/default/sass/admin-theme_rtl.sass index 712d08aa9..63af964be 100644 --- a/admin/themes/default/sass/admin-theme_rtl.sass +++ b/admin/themes/default/sass/admin-theme_rtl.sass @@ -112,6 +112,8 @@ //RTL @import "partials/rtl" +@import "partials/tooltip" + //Backward compatibility @import "partials/backward" diff --git a/admin/themes/default/sass/partials/_tooltip.sass b/admin/themes/default/sass/partials/_tooltip.sass new file mode 100644 index 000000000..986d49667 --- /dev/null +++ b/admin/themes/default/sass/partials/_tooltip.sass @@ -0,0 +1,30 @@ +.tooltip_cont + min-width: 280px + width: 100% + font-size: 14px + font-weight: 600 + .tip_header + margin-bottom: 10px + .tip-body > div + margin-bottom: 6px + +.tip_element_head + font-size: 12px + +.tip_element_value + font-size: 14px + font-weight: 400 + opacity: 0.8 + +.tip-body + display: grid + grid-template-columns: auto auto + &.tip-body-grid + grid-template-columns: 1fr 1fr + gap: 8px 16px + +.ui-tooltip, +.ui-tooltip.ui-widget-content + border: none + padding: 10px + box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.15) diff --git a/admin/themes/default/template/controllers/access/helpers/form/form.tpl b/admin/themes/default/template/controllers/access/helpers/form/form.tpl index 6d07fe6ee..258013c26 100644 --- a/admin/themes/default/template/controllers/access/helpers/form/form.tpl +++ b/admin/themes/default/template/controllers/access/helpers/form/form.tpl @@ -107,6 +107,47 @@ } perfect_access_js_gestion(this, perm, id_tab, tabsize, tabnumber, table); + if (perm == 'kpi') { + $(table + ' .kpi.' + id_tab).prop('checked', !!enabled); + } + + $(table + ' tr.kpi-row').each(function() { + var kpiTabId = $(this).data('kpi-parent'); + var kpiProfile = $(this).data('kpi-profile'); + var $kpiInputs = $(this).find('input.ajaxPower.kpi'); + if (!$kpiInputs.length || $kpiInputs.first().data('kpi-editable') != 1) { return; } + // For perm=view, read state directly from action — jQuery 1.11 .attr() doesn't update .prop() + var parentEnabled = (perm == 'view' && (id_tab == kpiTabId || id_tab == -1)) + ? !!enabled + : $(table + ' input.view.' + kpiTabId).first().is(':checked'); + if (!parentEnabled) { + $kpiInputs.prop('checked', false).prop('disabled', true); + } else { + $kpiInputs.prop('disabled', false); + if (perm == 'all' && (id_tab == -1 || id_tab == kpiTabId)) { + $kpiInputs.prop('checked', !!enabled).first().trigger('change'); + } + if (perm == 'view' && (id_tab == kpiTabId || id_tab == -1) && !!enabled) { + $kpiInputs.prop('checked', true); + $.ajax({ + url: "{$link->getAdminLink('AdminAccess')|addslashes}", + cache: false, + data: { + ajaxMode: '1', + id_tab: kpiTabId, + id_profile: kpiProfile, + perm: 'kpi', + enabled: 1, + submitAddAccess: '1', + action: 'updateAccess', + ajax: '1', + token: '{getAdminToken tab='AdminAccess'}' + } + }); + } + } + }); + $.ajax({ url: "{$link->getAdminLink('AdminAccess')|addslashes}", cache: false, @@ -349,6 +390,32 @@ + {if !empty($tab.has_kpi)} + +   » {l s='KPI'} + + + + + + + + + + + {/if} {foreach $tabs AS $child} {if $child.id_parent === $tab.id_tab} {if isset($access[$child.id_tab])} @@ -372,6 +439,32 @@ + {if !empty($child.has_kpi)} + +   » {l s='KPI'} + + + + + + + + + + + {/if} {/if} {/if} {/foreach} @@ -438,4 +531,4 @@ {/foreach} - + \ No newline at end of file diff --git a/admin/themes/default/template/controllers/carts/helpers/view/view.tpl b/admin/themes/default/template/controllers/carts/helpers/view/view.tpl index 7a09fc693..23ef21ed6 100644 --- a/admin/themes/default/template/controllers/carts/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/carts/helpers/view/view.tpl @@ -26,9 +26,7 @@ {extends file="helpers/view/view.tpl"} {block name="override_tpl"} -
- {$kpi} -
+
diff --git a/admin/themes/default/template/controllers/languages/helpers/form/form.tpl b/admin/themes/default/template/controllers/languages/helpers/form/form.tpl index 8d1dc403e..77baa0e70 100644 --- a/admin/themes/default/template/controllers/languages/helpers/form/form.tpl +++ b/admin/themes/default/template/controllers/languages/helpers/form/form.tpl @@ -69,11 +69,11 @@
{foreach $list.files as $key => $file} {if !file_exists($key)} - + {/if} {$key} {if !file_exists($key)} - + {/if}
{/foreach} diff --git a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl index b48493073..a8a692a98 100644 --- a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl +++ b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl @@ -51,7 +51,12 @@ {assign var=curr_id value=$cart->id_currency|intval} {foreach from=$cart_detail_data item=data} - {$data.room_num|escape:'html':'UTF-8'} {hook h='displayRoomNumAfter' data=$data type='adminOrder'} + {$data.room_num|escape:'html':'UTF-8'} + {if isset($data['connected_rooms'][$data.id_room])} + {include file="controllers/products/connected-rooms.tpl" htl_connected_rooms=$data['connected_rooms'][$data.id_room]} + {/if} + + {hook h='displayRoomNumAfter' data=$data type='adminOrder'}

{$data.room_type|escape:'html':'UTF-8'}

@@ -130,7 +135,7 @@ {* {displayPrice price=$data.amt_with_qty} *} - {if (isset($data.extra_demands) && $data.extra_demands) || (isset($data.additional_service) && $data.additional_service)} + {if (isset($data.extra_demands) && $data.extra_demands) || (isset($data.additional_service) && $data.additional_service) || (isset($data.selected_services) && $data.selected_services)} {displayPrice price=($data.amt_with_qty + $data.additional_services_auto_add_price + $data.demand_price + $data.additional_service_price)|escape:'html':'UTF-8'} {else} {displayPrice price=$data.amt_with_qty|escape:'html':'UTF-8'} diff --git a/admin/themes/default/template/controllers/orders/_product_line.tpl b/admin/themes/default/template/controllers/orders/_product_line.tpl index 546472ac2..cc5b54dbe 100644 --- a/admin/themes/default/template/controllers/orders/_product_line.tpl +++ b/admin/themes/default/template/controllers/orders/_product_line.tpl @@ -25,7 +25,11 @@ -

{$data.room_num}

+

{$data.room_num} + {if isset($data['connected_rooms'][$data.id_room])} + {include file="controllers/products/connected-rooms.tpl" htl_connected_rooms=$data['connected_rooms'][$data.id_room]} + {/if} +

{if $data.is_back_order} {l s='overbooked'} {/if} diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index a46eae393..d88ac6d39 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -456,7 +456,7 @@ {l s='Transaction ID'} {l s='Amount'} {l s='Invoice'} - + @@ -468,6 +468,11 @@ {$payment['transaction_id']|escape:'html':'UTF-8'} {displayPrice price=$payment['real_paid_amount'] currency=$payment['id_currency']} {if isset($payment['invoice_number'])}{$payment['invoice_number']}{else}--{/if} + {if isset($receipt_management_active) && $receipt_management_active} + + {l s='Receipt'} + + {/if} {l s='Details'} diff --git a/admin/themes/default/template/controllers/products/configuration.tpl b/admin/themes/default/template/controllers/products/configuration.tpl index 836d86955..8f4ff25df 100644 --- a/admin/themes/default/template/controllers/products/configuration.tpl +++ b/admin/themes/default/template/controllers/products/configuration.tpl @@ -67,6 +67,14 @@ + + + {hook h='displayHotelRoomListTableHeaderColumn'} {l s='--'} @@ -108,6 +116,21 @@ {* Since the data can also be used from post incase of errors, which will cause issues with the id index *} + + {if isset($room_info['id'])} + + + + + {if isset($room_info['connected_rooms_count'])}{$room_info['connected_rooms_count']|intval}{else}0{/if} + + + + {/if} + {if isset($room_info['id'])} {hook h='displayHotelRoomListTableRowColumn' index=$key id_room=$room_info['id']} {else} @@ -343,6 +366,7 @@
+ {assign var="connected_room_types" value=[]} + {if isset($htl_connected_rooms[$main_room_id].connected_room_types)} + {assign var="connected_room_types" value=$htl_connected_rooms[$main_room_id].connected_room_types} + {/if} + +
+
+
+
+ + + + + + + + + + {foreach from=$connected_room_types item=typeGroup} + {foreach from=$typeGroup.connected_rooms item=room} + + + + + + {/foreach} + {/foreach} + +
{l s='Room Type'}{l s='Connected Room'} + {l s='Action'} +
{$typeGroup.room_type_name|escape:'html':'UTF-8'}{$room.name|escape:'html':'UTF-8'} + + + +
+
+
+
+ + {l s='No connected rooms.'} +
+
+
+ {if isset($htl_not_connected_rooms) && $htl_not_connected_rooms|count > 0} + + {/if} +
+
+ {if isset($htl_not_connected_rooms) && $htl_not_connected_rooms|count > 0} + + + + + + + + +
+ + + + + + +
+ {/if} +
diff --git a/classes/Cart.php b/classes/Cart.php index ad5ee4302..d7421ec7d 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1833,7 +1833,7 @@ class CartCore extends ObjectModel $this->id, [], 0, - isset($product['id_hotel_cart_booking']) ? $product['id_hotel_cart_booking'] : null, + null, null, (int)$product['id_product'], null, @@ -1862,53 +1862,55 @@ class CartCore extends ObjectModel // by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices.... $totalPriceByProduct = 0; $priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id); - foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) { - $occupancy = array( - array( - 'adults' => $cartRoomInfo['adults'], - 'children' => $cartRoomInfo['children'], - 'child_ages' => json_decode($cartRoomInfo['child_ages']) - ) + + if ($type == Cart::ADVANCE_PAYMENT || $type == Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS) { + // getProductMinAdvPaymentAmountByIdCart already aggregates all rooms for this product internally, + // so call it once and add once — not inside the per-room loop. + $advProductPrice = $objAdvPayment->getProductMinAdvPaymentAmountByIdCart( + $this->id, + $product['id_product'], + 0, + 0, + $with_taxes ); - // get the real price of the room type - $roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( - $cartRoomInfo['id_product'], - $cartRoomInfo['date_from'], - $cartRoomInfo['date_to'], - $occupancy, - Group::getCurrent()->id, - $cartRoomInfo['id_cart'], - $cartRoomInfo['id_guest'], - $cartRoomInfo['id_room'], - 0 - ); - if ($with_taxes) { - $totalPriceByProduct = $roomTotalPrice['total_price_tax_incl']; - } else { - $totalPriceByProduct = $roomTotalPrice['total_price_tax_excl']; - } - - // If customer has selected advance payment of the cart - if ($type == Cart::ADVANCE_PAYMENT || $type == Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS) { - $advProductPrice = $objAdvPayment->getProductMinAdvPaymentAmountByIdCart( - $this->id, - $cartRoomInfo['id_product'], - 0, - 0, - $with_taxes - ); - - // set advance payment price only if it is greater than real price - if ($advProductPrice < $totalPriceByProduct) { - $totalPriceByProduct = $advProductPrice; - } - } - - // Rounding as per configurations if ($ps_round_type == Order::ROUND_TOTAL) { - $products_total[$id_tax_rules_group.'_'.$id_address] += Tools::processPriceRounding($totalPriceByProduct); + $products_total[$id_tax_rules_group.'_'.$id_address] += Tools::processPriceRounding($advProductPrice); } else { - $products_total[$id_tax_rules_group] += Tools::processPriceRounding($totalPriceByProduct); + $products_total[$id_tax_rules_group] += Tools::processPriceRounding($advProductPrice); + } + } else { + foreach ($roomTypesByIdProduct as $key => $cartRoomInfo) { + $occupancy = array( + array( + 'adults' => $cartRoomInfo['adults'], + 'children' => $cartRoomInfo['children'], + 'child_ages' => json_decode($cartRoomInfo['child_ages']) + ) + ); + // get the real price of the room type + $roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( + $cartRoomInfo['id_product'], + $cartRoomInfo['date_from'], + $cartRoomInfo['date_to'], + $occupancy, + Group::getCurrent()->id, + $cartRoomInfo['id_cart'], + $cartRoomInfo['id_guest'], + $cartRoomInfo['id_room'], + 0 + ); + if ($with_taxes) { + $totalPriceByProduct = $roomTotalPrice['total_price_tax_incl']; + } else { + $totalPriceByProduct = $roomTotalPrice['total_price_tax_excl']; + } + + // Rounding as per configurations + if ($ps_round_type == Order::ROUND_TOTAL) { + $products_total[$id_tax_rules_group.'_'.$id_address] += Tools::processPriceRounding($totalPriceByProduct); + } else { + $products_total[$id_tax_rules_group] += Tools::processPriceRounding($totalPriceByProduct); + } } } } diff --git a/classes/Profile.php b/classes/Profile.php index 39637163a..54900fb44 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -81,7 +81,7 @@ class ProfileCore extends ObjectModel public function add($autodate = true, $null_values = false) { if (parent::add($autodate, true)) { - $result = Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'access (SELECT '.(int)$this->id.', id_tab, 0, 0, 0, 0 FROM '._DB_PREFIX_.'tab)'); + $result = Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'access (SELECT '.(int)$this->id.', id_tab, 0, 0, 0, 0, 0 FROM '._DB_PREFIX_.'tab)'); $result &= Db::getInstance()->execute(' INSERT INTO '._DB_PREFIX_.'module_access (`id_profile`, `id_module`, `configure`, `view`, `uninstall`) @@ -138,6 +138,7 @@ class ProfileCore extends ObjectModel 'add' => 1, 'edit' => 1, 'delete' => 1, + 'kpi' => 1, ); } } else { @@ -151,6 +152,7 @@ class ProfileCore extends ObjectModel $result[$key]['delete'] = (int) $profileAccess['delete']; $result[$key]['add'] = (int) $profileAccess['add']; $result[$key]['edit'] = (int) $profileAccess['edit']; + $result[$key]['kpi'] = (int) $profileAccess['kpi']; } } diff --git a/classes/SpecificPrice.php b/classes/SpecificPrice.php index 1dd3829a2..79c63995e 100644 --- a/classes/SpecificPrice.php +++ b/classes/SpecificPrice.php @@ -367,12 +367,12 @@ class SpecificPriceCore extends ObjectModel `id_shop` '.self::formatIntInQuery(0, $id_shop).' AND `id_currency` '.self::formatIntInQuery(0, $id_currency).' AND `id_country` '.self::formatIntInQuery(0, $id_country). - ' AND `id_htl_cart_booking`='.(int)$id_htl_cart_booking.' '. + ' AND `id_htl_cart_booking` '.self::formatIntInQuery(0, $id_htl_cart_booking).' '. (Group::isFeatureActive() ? ' AND `id_group` '.self::formatIntInQuery(0, $id_group) : '').' '.$query_extra.' AND IF(`from_quantity` > 1, `from_quantity`, 0) <= '; $query .= (Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION') || !$id_cart || !$real_quantity) ? (int)$quantity : max(1, (int)$real_quantity); - $query .= ' ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `score` DESC, `to` DESC, `from` DESC'; + $query .= ' ORDER BY `id_htl_cart_booking` DESC, `id_product_attribute` DESC, `from_quantity` DESC, `score` DESC, `to` DESC, `from` DESC'; SpecificPrice::$_specificPriceCache[$key] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query); } diff --git a/classes/Tab.php b/classes/Tab.php index 662ad74b5..4f8dfed89 100644 --- a/classes/Tab.php +++ b/classes/Tab.php @@ -137,12 +137,12 @@ class TabCore extends ObjectModel } /* Query definition */ - $query = 'REPLACE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES '; - $query .= '(1, '.(int)$id_tab.', 1, 1, 1, 1),'; + $query = 'REPLACE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`, `kpi`) VALUES '; + $query .= '(1, '.(int)$id_tab.', 1, 1, 1, 1, 1),'; foreach ($profiles as $profile) { $rights = $profile['id_profile'] == $context->employee->id_profile ? 1 : 0; - $query .= '('.(int)$profile['id_profile'].', '.(int)$id_tab.', '.(int)$rights.', '.(int)$rights.', '.(int)$rights.', '.(int)$rights.'),'; + $query .= '('.(int)$profile['id_profile'].', '.(int)$id_tab.', '.(int)$rights.', '.(int)$rights.', '.(int)$rights.', '.(int)$rights.', '.(int)$rights.'),'; } $query = trim($query, ', '); return Db::getInstance()->execute($query); @@ -247,7 +247,7 @@ class TabCore extends ObjectModel * @return array tabs */ protected static $_cache_tabs = array(); - public static function getTabs($id_lang, $id_parent = null) + public static function getTabs($id_lang, $id_parent = null, $include_kpi = false) { if (!isset(self::$_cache_tabs[$id_lang])) { self::$_cache_tabs[$id_lang] = array(); @@ -274,10 +274,52 @@ class TabCore extends ObjectModel foreach (self::$_cache_tabs[$id_lang] as $array_parent) { $array_all = array_merge($array_all, $array_parent); } - return $array_all; + $tabs = $array_all; + } else { + $tabs = isset(self::$_cache_tabs[$id_lang][$id_parent]) ? self::$_cache_tabs[$id_lang][$id_parent] : array(); } - return (isset(self::$_cache_tabs[$id_lang][$id_parent]) ? self::$_cache_tabs[$id_lang][$id_parent] : array()); + if ($include_kpi) { + $hookKpiClasses = array(); + $hookRows = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' + SELECT DISTINCT SUBSTRING(h.`name`, 7, LENGTH(h.`name`) - 24) AS `class_name` + FROM `'._DB_PREFIX_.'hook` h + INNER JOIN `'._DB_PREFIX_.'hook_module` hm + ON hm.`id_hook` = h.`id_hook` + AND hm.`id_shop` = '.(int)Context::getContext()->shop->id.' + INNER JOIN `'._DB_PREFIX_.'module` m + ON m.`id_module` = hm.`id_module` AND m.`active` = 1 + WHERE h.`name` LIKE \'action%KPIListingModifier\'' + ); + if (is_array($hookRows)) { + foreach ($hookRows as $row) { + $hookKpiClasses[$row['class_name']] = true; + } + } + + foreach ($tabs as &$tab) { + if (!empty($tab['module'])) { + $file = _PS_MODULE_DIR_.$tab['module'].'/controllers/admin/'.$tab['class_name'].'Controller.php'; + $class_name = $tab['class_name'].'Controller'; + } else { + $file = _PS_CONTROLLER_DIR_.'admin/'.$tab['class_name'].'Controller.php'; + $class_name = $tab['class_name'].'ControllerCore'; + } + if (file_exists($file) && !class_exists($class_name)) { + require_once $file; + } + try { + $objreflect = new ReflectionMethod($class_name, 'renderKpis'); + $tab['has_kpi'] = ($objreflect->getDeclaringClass()->getName() === $class_name) + || isset($hookKpiClasses[$tab['class_name']]); + } catch (ReflectionException $e) { + $tab['has_kpi'] = isset($hookKpiClasses[$tab['class_name']]); + } + } + unset($tab); + } + + return $tabs; } /** diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 88cb91075..9166f1750 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2010,7 +2010,9 @@ class AdminControllerCore extends Controller } if ($conf = Tools::getValue('conf')) { - $this->context->smarty->assign('conf', $this->json ? json_encode($this->_conf[(int)$conf]) : $this->_conf[(int)$conf]); + if (isset($this->_conf[$conf])) { + $this->context->smarty->assign('conf', $this->json ? json_encode($this->_conf[(int)$conf]) : $this->_conf[(int)$conf]); + } } foreach (array('errors', 'warnings', 'informations', 'confirmations') as $type) { @@ -2307,7 +2309,9 @@ class AdminControllerCore extends Controller $this->content .= $this->renderDetails(); } elseif (!$this->ajax) { $this->content .= $this->renderModulesList(); - $this->content .= $this->renderKpis(); + if ($this->tabAccess['kpi'] === 1) { + $this->content .= $this->renderKpis(); + } $this->content .= $this->renderList(); $this->content .= $this->renderOptions(); diff --git a/classes/order/Order.php b/classes/order/Order.php index 7bceb94cf..e5ed30602 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -1905,7 +1905,15 @@ class OrderCore extends ObjectModel $order_payment_detail->id_order = $this->id; $order_payment_detail->id_order_payment = (int)$payment->id; $order_payment_detail->amount = $amount; + $receipt_number = Configuration::get('PS_PAYMENT_RECEIPTS_START_NUMBER', null, null, $this->id_shop); + // If payment start number has been set, you clean the value of this configuration + if ($receipt_number) { + Configuration::updateValue('PS_PAYMENT_RECEIPTS_START_NUMBER', false, false, null, $this->id_shop); + }else{ + $receipt_number = OrderPaymentDetail::getLastPaymentReceiptNumber() + 1; + } + $order_payment_detail->receipt_number = $receipt_number; if ($payment->id_currency == $this->id_currency) { $this->total_paid_real += $order_payment_detail->amount; } else { @@ -1935,6 +1943,8 @@ class OrderCore extends ObjectModel return false; } + + /** * Returns the correct product taxes breakdown. * @@ -3148,4 +3158,26 @@ class OrderCore extends ObjectModel return $totalOrder; } + + public function getPaymentsTypes() + { + $module = Module::getInstanceByName('hotelreservationsystem'); + return array( + OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL => array( + 'key' => 'PAYMENT_TYPE_PAY_AT_HOTEL', + 'value' => OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL, + 'name' => $module->l('Pay at hotel') + ), + OrderPayment::PAYMENT_TYPE_ONLINE => array( + 'key' => 'PAYMENT_TYPE_ONLINE', + 'value' => OrderPayment::PAYMENT_TYPE_ONLINE, + 'name' => $module->l('Online') + ), + OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT => array( + 'key' => 'PAYMENT_TYPE_REMOTE_PAYMENT', + 'value' => OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT, + 'name' => $module->l('Remote payment') + ), + ); + } } diff --git a/classes/order/OrderPayment.php b/classes/order/OrderPayment.php index b3f3c981b..c20215785 100644 --- a/classes/order/OrderPayment.php +++ b/classes/order/OrderPayment.php @@ -159,4 +159,5 @@ class OrderPaymentCore extends ObjectModel { return Db::getInstance()->getValue('SELECT (SUM(`amount` * `conversion_rate`) / SUM(`amount`)) FROM `'._DB_PREFIX_.'order_payment` WHERE `order_reference` = \''.pSQL($order_reference).'\' AND `id_currency` = '.(int)$idCurrency); } + } diff --git a/classes/order/OrderPaymentDetail.php b/classes/order/OrderPaymentDetail.php index f1e616bc8..72ae48635 100644 --- a/classes/order/OrderPaymentDetail.php +++ b/classes/order/OrderPaymentDetail.php @@ -26,6 +26,7 @@ class OrderPaymentDetailCore extends ObjectModel public $id_order_payment; public $id_order; public $amount; + public $receipt_number; public $date_add; public static $definition = array( @@ -35,6 +36,7 @@ class OrderPaymentDetailCore extends ObjectModel 'id_order_payment' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isNegativePrice', 'required' => true), + 'receipt_number' => array('type' => self::TYPE_INT, 'validate' => 'isGenericName', 'size' => 64), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), ) ); @@ -71,4 +73,49 @@ class OrderPaymentDetailCore extends ObjectModel WHERE oip.`id_order_invoice` = '.(int)$id_invoice ); } + + public static function getLastPaymentReceiptNumber() + { + $sql = 'SELECT MAX(`receipt_number`) FROM `'._DB_PREFIX_.'order_payment_detail`'; + if (Configuration::get('PS_PAYMENT_RECEIPTS_RESET')) { + $sql .= ' WHERE DATE_FORMAT(`date_add`, "%Y") = '.(int)date('Y'); + } + return Db::getInstance()->getValue($sql); + } + + public static function getPaymentDetailsByPaymentId($id_order_payment) + { + return Db::getInstance()->executeS(' + SELECT * + FROM `'._DB_PREFIX_.'order_payment_detail` + WHERE `id_order_payment` = '.(int)$id_order_payment + ); + } + + public static function getByDateInterval($date_from, $date_to) + { + $payment_list = Db::getInstance()->executeS(' + SELECT DISTINCT opd.* + FROM `'._DB_PREFIX_.'order_payment_detail` opd + LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = opd.`id_order`) + WHERE DATE_ADD(opd.`date_add`, INTERVAL -1 DAY) <= \''.pSQL($date_to).'\' + AND opd.`date_add` >= \''.pSQL($date_from).'\' + AND opd.`receipt_number` > 0 + '.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').' + ORDER BY opd.`date_add` ASC, opd.`id_order_payment_detail` ASC + '); + + return ObjectModel::hydrateCollection('OrderPaymentDetail', $payment_list); + } + + public function getPaymentReceiptNumberFormated($id_lang, $id_shop = null) + { + $format = '%1$s%2$06d'; + + if (Configuration::get('PS_PAYMENT_RECEIPTS_USE_YEAR')) { + $format = '%1$s%2$06d/%3$s'; + } + + return sprintf($format, Configuration::get('PS_PAYMENT_RECEIPTS_PREFIX', (int)$id_lang, null, (int)$id_shop), $this->receipt_number, date('Y', strtotime($this->date_add))); + } } diff --git a/classes/pdf/HTMLTemplateBookingVoucher.php b/classes/pdf/HTMLTemplateBookingVoucher.php new file mode 100644 index 000000000..c4e5d17df --- /dev/null +++ b/classes/pdf/HTMLTemplateBookingVoucher.php @@ -0,0 +1,396 @@ +order = $order; + $this->smarty = $smarty; + $this->date = Tools::displayDate(date('Y-m-d')); + $this->title = sprintf(self::l('Booking Voucher - %s'), $this->order->reference); + $this->shop = new Shop((int)$this->order->id_shop); + } + + /** + * @return string HTML header + */ + public function getHeader() + { + $this->assignCommonHeaderData(); + $this->smarty->assign(array('header' => self::l('Booking Voucher'))); + + return $this->smarty->fetch($this->getTemplate('header')); + } + + /** + * Assembles all voucher data inline and renders the template. + * + * @return string HTML content + */ + public function getContent() + { + // --- Bookings --- + $objHotelBookingDetail = new HotelBookingDetail(); + $bookings = $objHotelBookingDetail->getBookingDataByOrderId((int)$this->order->id); + if (!is_array($bookings)) { + $bookings = array(); + } + + // --- Order state --- + $orderState = $this->order->getCurrentStateFull((int)$this->order->id_lang); + + // --- Hotel / property --- + $objHotel = null; + $idHotel = HotelBookingDetail::getIdHotelByIdOrder((int)$this->order->id); + if ($idHotel) { + $objHotel = new HotelBranchInformation((int)$idHotel, (int)$this->order->id_lang); + if (!Validate::isLoadedObject($objHotel)) { + $objHotel = null; + } + } + + $hotelAddress = ''; + $paymentPolicy = ''; + $cancellationPolicy = ''; + + if ($objHotel) { + $policies = is_array($objHotel->policies) ? '' : (string)$objHotel->policies; + if ($policies) { + $policyText = html_entity_decode($policies, ENT_QUOTES, 'UTF-8'); + $policyText = preg_replace('//i', "\n", $policyText); + $policyText = strip_tags($policyText); + $policyText = preg_replace("/[\r\n]+/", "\n", $policyText); + $paymentPolicy = nl2br(trim($policyText)); + } + + $objBranchRefundRules = new HotelBranchRefundRules(); + $refundRules = $objBranchRefundRules->getHotelRefundRules( + (int)$objHotel->id, 0, 1, (int)$this->order->id_lang, 1 + ); + if (is_array($refundRules) && !empty($refundRules)) { + $policyBlocks = array(); + foreach ($refundRules as $rule) { + $ruleName = isset($rule['name']) ? trim(strip_tags($rule['name'])) : ''; + $ruleDescription = isset($rule['description']) ? trim($rule['description']) : ''; + if ($ruleName === '' && $ruleDescription === '') { + continue; + } + $block = $ruleName !== '' ? ''.Tools::safeOutput($ruleName).'' : ''; + if ($ruleDescription !== '') { + $block .= ($block !== '' ? ': ' : '').$ruleDescription; + } + $policyBlocks[] = $block; + } + if (!empty($policyBlocks)) { + $cancellationPolicy = implode('

', $policyBlocks); + } + } + + if ($idHotelAddress = $objHotel->getHotelIdAddress()) { + $objHotelAddress = new Address((int)$idHotelAddress); + if (Validate::isLoadedObject($objHotelAddress)) { + $objHotelAddress->firstname = $objHotel->hotel_name; + $hotelAddress = AddressFormat::generateAddress( + $objHotelAddress, + array('avoid' => array('lastname')), + '
', + ' ' + ); + } + } + } + + // --- Rooms, services, occupancy --- + $totalRooms = 0; + $totalRoomNights = 0; + $totalGuests = 0; + $serviceGroups = array(); + $roomTypeRows = array(); + + foreach ($bookings as $booking) { + $nights = (int)HotelHelper::getNumberOfDays($booking['date_from'], $booking['date_to']); + if ($nights <= 0) { + $nights = 1; + } + + $totalGuests += (int)$booking['adults'] + (int)$booking['children']; + $totalRoomNights += $nights; + $totalRooms++; + + $dateFrom = ($booking['date_from'] && $booking['date_from'] !== '0000-00-00 00:00:00') + ? Tools::displayDate($booking['date_from'], null, false) : '--'; + $dateTo = ($booking['date_to'] && $booking['date_to'] !== '0000-00-00 00:00:00') + ? Tools::displayDate($booking['date_to'], null, false) : '--'; + + // Services for this booking + $bookingServices = array(); + + $objBookingDemand = new HotelBookingDemands(); + $extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands( + (int)$this->order->id, 0, 0, 0, 0, 0, 0, 0, + (int)$booking['id'], (int)$booking['id_order_detail'] + ); + if (is_array($extraDemands)) { + foreach ($extraDemands as $demand) { + $bookingServices[] = array('name' => $demand['name'], 'quantity' => 1); + } + } + + // Auto-added services bundled with room price (for cost calculation only) + $objServiceProductOrderDetail = new ServiceProductOrderDetail(); + $autoAddedWithRoomPriceTaxExcl = (float)$objServiceProductOrderDetail->getRoomTypeServiceProducts( + (int)$this->order->id, 0, 0, + isset($booking['id_product']) ? (int)$booking['id_product'] : 0, + isset($booking['date_from']) ? $booking['date_from'] : 0, + isset($booking['date_to']) ? $booking['date_to'] : 0, + isset($booking['id_room']) ? (int)$booking['id_room'] : 0, + 1, 0, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM + ); + + // Additional services chosen by guest + $additionalServices = $objServiceProductOrderDetail->getRoomTypeServiceProducts( + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, null, 0, (int)$booking['id'] + ); + if (isset($additionalServices[(int)$booking['id']]['additional_services'])) { + foreach ($additionalServices[(int)$booking['id']]['additional_services'] as $service) { + $bookingServices[] = array('name' => $service['name'], 'quantity' => (int)$service['quantity']); + } + } + + if (!empty($bookingServices)) { + $serviceGroups[] = array( + 'room_type_name' => isset($booking['room_type_name']) ? $booking['room_type_name'] : '', + 'check_in_date' => $dateFrom, + 'check_out_date' => $dateTo, + 'room_count' => $totalRooms, + 'services' => $bookingServices, + ); + } + + $roomTotalWithAutoServicesTaxExcl = (float)$booking['total_price_tax_excl'] + $autoAddedWithRoomPriceTaxExcl; + + // Aggregate per room type + date range + $roomTypeRowKey = implode('|', array( + (int)$booking['id_order_detail'], + isset($booking['room_type_name']) ? $booking['room_type_name'] : '', + isset($booking['date_from']) ? $booking['date_from'] : '', + isset($booking['date_to']) ? $booking['date_to'] : '', + )); + + if (!isset($roomTypeRows[$roomTypeRowKey])) { + $idOrderDetail = (int)$booking['id_order_detail']; + $detailTaxes = $idOrderDetail ? OrderDetail::getTaxListStatic($idOrderDetail) : null; + $orderDetailTaxLabel = self::l('No tax'); + if ($detailTaxes) { + $taxTemp = array(); + foreach ($detailTaxes as $tax) { + $objTax = new Tax($tax['id_tax']); + $taxTemp[] = sprintf(self::l('%1$s%2$s%%'), $objTax->rate + 0, ' '); + } + $orderDetailTaxLabel = implode(', ', $taxTemp); + } + + $roomTypeRows[$roomTypeRowKey] = array( + 'room_type_name' => isset($booking['room_type_name']) ? $booking['room_type_name'] : '', + 'order_detail_tax_label' => $orderDetailTaxLabel, + 'rooms' => 0, + 'adults' => 0, + 'children' => 0, + 'nights' => $nights, + 'check_in_date' => $dateFrom, + 'check_out_date' => $dateTo, + 'unit_price_tax_excl' => 0, + 'total_price_tax_excl' => 0, + ); + } + + $roomTypeRows[$roomTypeRowKey]['rooms'] += 1; + $roomTypeRows[$roomTypeRowKey]['adults'] += (int)$booking['adults']; + $roomTypeRows[$roomTypeRowKey]['children'] += (int)$booking['children']; + $roomTypeRows[$roomTypeRowKey]['total_price_tax_excl'] += $roomTotalWithAutoServicesTaxExcl; + } + + foreach ($roomTypeRows as &$roomTypeRow) { + $denominator = (int)$roomTypeRow['nights'] * (int)$roomTypeRow['rooms']; + if ($denominator > 0) { + $roomTypeRow['unit_price_tax_excl'] = Tools::ps_round( + $roomTypeRow['total_price_tax_excl'] / $denominator, + 6, + $this->order->round_mode + ); + } + } + unset($roomTypeRow); + + $guestAddress = ''; + $guest = new Customer((int)$this->order->id_customer); + + $addressId = (int)$this->order->id_address_invoice ?: (int)$this->order->id_address_delivery; + if ($addressId) { + $address = new Address($addressId); + if (Validate::isLoadedObject($address)) { + $guestAddress = AddressFormat::generateAddress($address, array(), '
', ' '); + } + } + + if ($idCustomerGuestDetail = OrderCustomerGuestDetail::isCustomerGuestBooking((int)$this->order->id)) { + $objGuest = new OrderCustomerGuestDetail((int)$idCustomerGuestDetail); + if (Validate::isLoadedObject($objGuest)) { + $guest = $objGuest; + } + } + // --- Totals --- + $objBookingDemand = new HotelBookingDemands(); + $totalDemandsPriceTE = (float)$objBookingDemand->getRoomTypeBookingExtraDemands( + (int)$this->order->id, 0, 0, 0, 0, 1, 1, 0 + ); + $totalDemandsPriceTI = (float)$objBookingDemand->getRoomTypeBookingExtraDemands( + (int)$this->order->id, 0, 0, 0, 0, 1, 1, 1 + ); + + $orderDetails = OrderDetail::getList((int)$this->order->id); + $idsOrderDetail = is_array($orderDetails) + ? array_unique(array_map('intval', array_column($orderDetails, 'id_order_detail'))) + : array(); + + $footer = array( + 'room_price_tax_excl' => 0, + 'service_products_price_tax_excl' => 0, + 'additional_service_price_tax_excl' => 0, + 'total_convenience_fee_te' => 0, + ); + $roomsCostTaxIncl = 0; + $serviceProductsCostTaxIncl = 0; + $additionalServicesCostTaxIncl = 0; + $convenienceFeeTaxIncl = 0; + + if (!empty($idsOrderDetail)) { + $footer['room_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail); + $roomsCostTaxIncl = $this->order->getTotalProductsWithTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail); + $footer['service_products_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE, false, false, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE, false, false, $idsOrderDetail); + $serviceProductsCostTaxIncl = $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE, false, false, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE, false, false, $idsOrderDetail); + $footer['additional_service_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 0, null, $idsOrderDetail) + $totalDemandsPriceTE; + $additionalServicesCostTaxIncl = $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 0, null, $idsOrderDetail) + $totalDemandsPriceTI; + $footer['total_convenience_fee_te'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT, $idsOrderDetail); + $convenienceFeeTaxIncl = $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT, $idsOrderDetail); + } + + $productDiscountsTaxIncl = (float)$this->order->total_discounts_tax_incl; + foreach ($this->order->getCartRules() as $cartRule) { + if (!empty($cartRule['free_shipping'])) { + $productDiscountsTaxIncl -= (float)$this->order->total_shipping_tax_incl; + } + } + if ($productDiscountsTaxIncl < 0) { + $productDiscountsTaxIncl = 0; + } + + $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']; + $totalWithoutDiscountTaxIncl = $roomsCostTaxIncl + $serviceProductsCostTaxIncl + $additionalServicesCostTaxIncl + $convenienceFeeTaxIncl; + $footer['total_tax_without_discount'] = max(0, $totalWithoutDiscountTaxIncl - $footer['total_without_discount_te']); + $grandTotal = max(0.0, $totalWithoutDiscountTaxIncl - $productDiscountsTaxIncl); + $footer['product_discounts_tax_incl'] = $productDiscountsTaxIncl; + $footer['total_paid_tax_incl'] = $grandTotal; + $footer['amount_due'] = Tools::ps_round( + max(0, $grandTotal - (float)$this->order->getTotalPaid()), + _PS_PRICE_COMPUTE_PRECISION_, + $this->order->round_mode + ); + + $paymentMethods = array(); + $payments = $this->order->getOrderPaymentDetail(); + if (is_array($payments) && $payments) { + foreach ($payments as $paymentDetail) { + $method = isset($paymentDetail['payment_method']) ? trim($paymentDetail['payment_method']) : ''; + if (!$method) { + $method = $this->order->payment; + } + $amount = isset($paymentDetail['real_paid_amount']) + ? (float)$paymentDetail['real_paid_amount'] + : (float)$paymentDetail['amount']; + $idCurrency = isset($paymentDetail['id_currency']) + ? (int)$paymentDetail['id_currency'] + : (int)$this->order->id_currency; + $paymentMethods[] = $method.': '.Tools::displayPrice($amount, $idCurrency); + } + } + $paymentMethod = $paymentMethods ? implode('

', $paymentMethods) : $this->order->payment; + + $data = array( + 'order' => $this->order, + 'order_state' => $orderState, + 'booking_date' => Tools::displayDate($this->order->date_add, null, false), + 'issue_date' => Tools::displayDate(date('Y-m-d'), null, false), + 'hotel' => $objHotel, + 'hotel_address' => $hotelAddress, + 'guest' => $guest, + 'guest_address' => $guestAddress, + 'total_guests' => (int)$totalGuests, + 'total_rooms' => (int)$totalRooms, + 'total_room_nights' => (int)$totalRoomNights, + 'room_type_rows' => array_values($roomTypeRows), + 'service_groups' => $serviceGroups, + 'payment_method' => $paymentMethod, + 'footer' => $footer, + 'payment_policy' => $paymentPolicy, + 'cancellation_policy' => $cancellationPolicy, + ); + + if (Tools::getValue('debug')) { + die(json_encode($data)); + } + $this->smarty->assign($data); + + return $this->smarty->fetch($this->getTemplate('booking-voucher')); + } + + /** + * @return string + */ + public function getBulkFilename() + { + return self::l('BookingVouchers').'.pdf'; + } + + /** + * @return string + */ + public function getFilename() + { + return sprintf(self::l('BOOKING VOUCHER - Refrence No. #%s.pdf'), $this->order->reference); + } +} diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php index 6d0cf19ec..d4a02d904 100644 --- a/classes/pdf/HTMLTemplateInvoice.php +++ b/classes/pdf/HTMLTemplateInvoice.php @@ -476,8 +476,32 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] = 1; $fullDate = (isset($context->controller->show_full_date) && $context->controller->show_full_date && (date('Y-m-d', strtotime($data_v['date_from'])) == date('Y-m-d', strtotime($data_v['date_to'])))) ? true : false; - $cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = Tools::displayDate($data_v['date_from'], null, $fullDate); - $cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = Tools::displayDate($data_v['date_to'], null, $fullDate); + $display_date_from = $data_v['date_from']; + $display_date_to = $data_v['date_to']; + if ((int)$data_v['id_status'] === HotelBookingDetail::STATUS_CHECKED_OUT) { + if ($data_v['check_in']) { + $display_date_from = $data_v['check_in']; + } + if ($data_v['check_out']) { + $display_date_to = $data_v['check_out']; + } + } elseif ((int)$data_v['id_status'] === HotelBookingDetail::STATUS_CHECKED_IN) { + if ($data_v['check_in']) { + $display_date_from = $data_v['check_in']; + } + if ($data_v['check_out_time']) { + $display_date_to = date('Y-m-d', strtotime($data_v['date_to'])) . ' ' . date('H:i:s', strtotime($data_v['check_out_time'])); + } + } else { + if ($data_v['check_in_time']) { + $display_date_from = date('Y-m-d', strtotime($data_v['date_from'])) . ' ' . date('H:i:s', strtotime($data_v['check_in_time'])); + } + if ($data_v['check_out_time']) { + $display_date_to = date('Y-m-d', strtotime($data_v['date_to'])) . ' ' . date('H:i:s', strtotime($data_v['check_out_time'])); + } + } + $cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = Tools::displayDate($display_date_from, null, true); + $cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = Tools::displayDate($display_date_to, null, true); $cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'] = $num_days; $cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] = $data_v['adults']; $cart_htl_data[$type_key]['date_diff'][$date_join]['children'] = $data_v['children']; diff --git a/classes/pdf/HTMLTemplatePaymentReceipt.php b/classes/pdf/HTMLTemplatePaymentReceipt.php new file mode 100644 index 000000000..ec5ab1c87 --- /dev/null +++ b/classes/pdf/HTMLTemplatePaymentReceipt.php @@ -0,0 +1,171 @@ +paymentReceipt = $paymentReceipt; + $this->smarty = $smarty; + $this->date = Tools::displayDate($this->paymentReceipt->date_add); + $id_lang = Context::getContext()->language->id; + $this->orderPayment = new OrderPayment((int)$this->paymentReceipt->id_order_payment); + if (!Validate::isLoadedObject($this->orderPayment)) { + throw new PrestaShopException('Cannot load the payment associated with this payment receipt.'); + } + + $this->order = new Order((int)$this->paymentReceipt->id_order); + + if (!Validate::isLoadedObject($this->order)) { + throw new PrestaShopException('Cannot load the order associated with this payment receipt.'); + } + + $id_shop = (int)$this->order->id_shop; + $this->shop = new Shop($id_shop); + $this->orderPayment->amount = $this->paymentReceipt->amount; + $this->title = $this->paymentReceipt->getPaymentReceiptNumberFormated($id_lang, $id_shop); + } + + /** + * Returns the template's HTML header + * + * @return string HTML header + */ + public function getHeader() + { + $this->assignCommonHeaderData(); + $this->smarty->assign(array( + 'header' => HTMLTemplatePaymentReceipt::l('Receipt'), + )); + + return $this->smarty->fetch($this->getTemplate('header')); + } + + public function getFooter() + { + $shop_address = $this->getShopAddress(); + + $id_shop = (int)$this->shop->id; + + $this->smarty->assign(array( + 'shop_address' => $shop_address, + 'shop_fax' => Configuration::get('PS_SHOP_FAX', null, null, $id_shop), + 'shop_phone' => Configuration::get('PS_SHOP_PHONE', null, null, $id_shop), + 'shop_email' => Configuration::get('PS_SHOP_EMAIL', null, null, $id_shop), + 'free_text' => Configuration::get('PS_PAYMENT_RECEIPTS_FREE_TEXT', (int)Context::getContext()->language->id, null, $id_shop) + )); + + return $this->smarty->fetch($this->getTemplate('footer')); + } + + public function getContent() + { + $delivery_address = $invoice_address = new Address((int)$this->order->id_address_invoice); + $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '
', ' '); + $formatted_delivery_address = ''; + + if ($this->order->id_address_delivery != $this->order->id_address_invoice) { + $delivery_address = new Address((int)$this->order->id_address_delivery); + $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '
', ' '); + } + + $formattedHotelAddress = ''; + if (Module::isInstalled('hotelreservationsystem')) { + if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($this->order->id)) { + $objHotelBranchInfo = new HotelBranchInformation((int) $idHotel, Context::getContext()->language->id); + $invoiceAddressPatternRules['avoid'][] = 'lastname'; + if ($idHotelAddress = $objHotelBranchInfo->getHotelIdAddress()) { + $objHotelAddress = new Address((int) $idHotelAddress); + $objHotelAddress->firstname = $objHotelBranchInfo->hotel_name; + $formattedHotelAddress = AddressFormat::generateAddress($objHotelAddress, $invoiceAddressPatternRules, '
', ' '); + } + } + } + $customer = new Customer((int)$this->order->id_customer); + $getPaymentTypes = $this->order->getPaymentsTypes(); + $this->orderPayment->payment_type = isset($getPaymentTypes[$this->orderPayment->payment_type]) ? $getPaymentTypes[$this->orderPayment->payment_type] : null; + + $legal_free_text = Configuration::get('PS_PAYMENT_RECEIPTS_LEGAL_FREE_TEXT', (int)Context::getContext()->language->id, null, (int)$this->order->id_shop); + + $this->smarty->assign(array( + 'order' => $this->order, + 'payment_list' => array($this->orderPayment), + 'delivery_address' => $formatted_delivery_address, + 'invoice_address' => $formatted_invoice_address, + 'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address), + 'customer' => $customer, + 'hotel_address' => $formattedHotelAddress, + 'legal_free_text' => $legal_free_text, + )); + + $smarty_tpls = array( + 'style_tab' => $this->smarty->fetch($this->getTemplate('payment-receipt.style-tab')), + 'addresses_tab' => $this->smarty->fetch($this->getTemplate('payment-receipt.addresses-tab')), + 'payment_info_tab' => $this->smarty->fetch($this->getTemplate('payment-receipt.payment-info-tab')), + ); + $this->smarty->assign($smarty_tpls); + return $this->smarty->fetch($this->getTemplate('payment-receipt')); + + } + + public function getFilename() + { + return 'payment-receipt-'.sprintf('%06d', $this->paymentReceipt->id).'.pdf'; + } + + public function getBulkFilename() + { + return 'payment-receipts.pdf'; + } + + protected function getPaymentType($paymentType = null) + { + $paymentTypeName = null; + switch ($paymentType) { + case OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL: + $paymentTypeName = HTMLTemplatePaymentReceipt::l('Pay at hotel'); + break; + case OrderPayment::PAYMENT_TYPE_ONLINE: + $paymentTypeName = HTMLTemplatePaymentReceipt::l('Online'); + break; + case OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT: + $paymentTypeName = HTMLTemplatePaymentReceipt::l('Remote payment'); + break; + default: + $paymentTypeName = null; + break; + } + return $paymentTypeName; + } +} diff --git a/classes/pdf/PDF.php b/classes/pdf/PDF.php index 626d3a51a..69985fa7f 100644 --- a/classes/pdf/PDF.php +++ b/classes/pdf/PDF.php @@ -41,6 +41,8 @@ class PDFCore const TEMPLATE_ORDER_SLIP = 'OrderSlip'; const TEMPLATE_DELIVERY_SLIP = 'DeliverySlip'; const TEMPLATE_SUPPLY_ORDER_FORM = 'SupplyOrderForm'; + const TEMPLATE_BOOKING_VOUCHER = 'BookingVoucher'; + const TEMPLATE_PAYMENT_RECEIPT = 'PaymentReceipt'; /** * @param $objects diff --git a/composer.json b/composer.json index 74ff00cb0..db48f1054 100644 --- a/composer.json +++ b/composer.json @@ -1,22 +1,52 @@ { - "require": { - "php": ">=5.4 <8.0", - "ext-simplexml": "*", - "ext-curl": "*", - "ext-gd": "*", - "ext-zip": "*", - "ext-soap": "*" - }, - "name": "webkul/qloapps", + "name": "qloapps/qloapps", "description": "QloApps is an Open-source and Free hotel reservation system and booking engine. With the help of QloApps, you can launch your hotel booking website without any cost and take & manage online bookings.", "type": "project", + "homepage": "https://qloapps.com", "license": "OSL-3.0", + "keywords": [ + "qloapps", + "hospitality", + "booking-engine", + "hotel-booking-website", + "hotel-management-system", + "hotel-reservation-system", + "property-management-system", + "cms" + ], "authors": [ { - "name": "webkul", - "email": "support@qloapps.com" + "name": "QloApps", + "email": "support@qloapps.com", + "homepage": "https://qloapps.com" + }, + { + "name": "QloApps Community", + "homepage": "https://github.com/Qloapps/QloApps/graphs/contributors" } ], - "minimum-stability": "dev", - "prefer-stable": true + "support": { + "docs": "https://qloapps.com/docs/", + "email": "support@qloapps.com", + "forum": "https://forums.qloapps.com/", + "source": "https://github.com/Qloapps/QloApps" + }, + "require": { + "php": ">8.0 <8.5", + "ext-curl": "*", + "ext-dom": "*", + "ext-gd": "*", + "ext-mcrypt": "*", + "ext-openssl": "*", + "ext-pdo_mysql": "*", + "ext-phar": "*", + "ext-simplexml": "*", + "ext-soap": "*", + "ext-zip": "*" + }, + "minimum-stability": "stable", + "prefer-stable": true, + "config": { + "sort-packages": true + } } \ No newline at end of file diff --git a/config/xml/themes/default.xml b/config/xml/themes/default.xml index 72ce2aae3..b8d22534f 100644 --- a/config/xml/themes/default.xml +++ b/config/xml/themes/default.xml @@ -18,8 +18,8 @@ - - + + @@ -32,8 +32,8 @@ - - + + @@ -45,7 +45,6 @@ - diff --git a/controllers/admin/AdminAccessController.php b/controllers/admin/AdminAccessController.php index 74ef79b09..0d588c240 100644 --- a/controllers/admin/AdminAccessController.php +++ b/controllers/admin/AdminAccessController.php @@ -56,7 +56,7 @@ class AdminAccessControllerCore extends AdminController { $current_profile = (int)$this->getCurrentProfileId(); $profiles = Profile::getProfiles($this->context->language->id); - $tabs = Tab::getTabs($this->context->language->id); + $tabs = Tab::getTabs($this->context->language->id, null, true); $accesses = array(); foreach ($profiles as $profile) { $accesses[$profile['id_profile']] = Profile::getProfileAccesses($profile['id_profile']); @@ -214,7 +214,7 @@ class AdminAccessControllerCore extends AdminController if (Tools::isSubmit('submitAddAccess')) { $perm = Tools::getValue('perm'); - if (!in_array($perm, array('view', 'add', 'edit', 'delete', 'all'))) { + if (!in_array($perm, array('view', 'add', 'edit', 'delete', 'all', 'kpi'))) { throw new PrestaShopException('permission does not exist'); } diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index f76331422..b72199d67 100644 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -181,69 +181,85 @@ class AdminCartsControllerCore extends AdminController public function renderKpis() { - $time = time(); - $kpis = array(); + $objCart = new Cart(Tools::getValue('id_cart')); + if (Validate::isLoadedObject($objCart)) { + $currency = new Currency($objCart->id_currency); + $summary = $objCart->getSummaryDetails(); + $tax_calculation_method = Group::getPriceDisplayMethod(Group::getCurrent()->id); + $total_price = ($tax_calculation_method == PS_TAX_EXC) + ? $summary['total_price_without_tax'] + : $summary['total_price']; - $daysForConversionRate = Configuration::get('PS_KPI_CONVERSION_RATE_NB_DAYS'); - - $helper = new HelperKpi(); - $helper->id = 'box-conversion-rate'; - $helper->icon = 'icon-sort-by-attributes-alt'; - //$helper->chart = true; - $helper->color = 'color1'; - $helper->title = $this->l('Conversion Rate', null, null, false); - if ($daysForConversionRate == 1) { - $helper->subtitle = $daysForConversionRate.' '.$this->l('day', null, null, false); + $helper = new HelperKpi(); + $helper->id = 'box-kpi-cart'; + $helper->icon = 'icon-shopping-cart'; + $helper->color = 'color1'; + $helper->title = $this->l('Total Cart', null, null, false); + $helper->subtitle = sprintf($this->l('Cart #%06d', null, null, false), $objCart->id); + $helper->value = Tools::displayPrice($total_price, $currency); + $this->kpis[] = $helper; } else { - $helper->subtitle = $daysForConversionRate.' '.$this->l('days', null, null, false); - } - if (ConfigurationKPI::get('CONVERSION_RATE_CHART') !== false) { - $helper->data = ConfigurationKPI::get('CONVERSION_RATE_CHART'); - } - $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=conversion_rate'; - $this->kpis[] = $helper; + $daysForConversionRate = Configuration::get('PS_KPI_CONVERSION_RATE_NB_DAYS'); - $helper = new HelperKpi(); - $helper->id = 'box-carts'; - $helper->icon = 'icon-shopping-cart'; - $helper->color = 'color2'; - $helper->title = $this->l('Abandoned Carts', null, null, false); - $date_from = date(Context::getContext()->language->date_format_lite, strtotime('-2 day')); - $date_to = date(Context::getContext()->language->date_format_lite, strtotime('-1 day')); - $helper->subtitle = sprintf($this->l('From %s to %s', null, null, false), $date_from, $date_to); - $helper->href = $this->context->link->getAdminLink('AdminCarts').'&action=filterOnlyAbandonedCarts&date_from='.date('Y-m-d', strtotime('-2 day')).'&date_to='.date('Y-m-d', strtotime('-1 day')); - $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=abandoned_cart'; - $this->kpis[] = $helper; + $helper = new HelperKpi(); + $helper->id = 'box-conversion-rate'; + $helper->icon = 'icon-sort-by-attributes-alt'; + //$helper->chart = true; + $helper->color = 'color1'; + $helper->title = $this->l('Conversion Rate', null, null, false); + if ($daysForConversionRate == 1) { + $helper->subtitle = $daysForConversionRate.' '.$this->l('day', null, null, false); + } else { + $helper->subtitle = $daysForConversionRate.' '.$this->l('days', null, null, false); + } + if (ConfigurationKPI::get('CONVERSION_RATE_CHART') !== false) { + $helper->data = ConfigurationKPI::get('CONVERSION_RATE_CHART'); + } + $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=conversion_rate'; + $this->kpis[] = $helper; - $daysForAvgOrderVal = Configuration::get('PS_ORDER_KPI_AVG_ORDER_VALUE_NB_DAYS'); - $helper = new HelperKpi(); - $helper->id = 'box-average-order'; - $helper->icon = 'icon-money'; - $helper->color = 'color3'; - $helper->title = $this->l('Average Order Value', null, null, false); - if ($daysForAvgOrderVal == 1) { - $helper->subtitle = $daysForAvgOrderVal.' '.$this->l('day', null, null, false); - } else { - $helper->subtitle = $daysForAvgOrderVal.' '.$this->l('days', null, null, false); + $helper = new HelperKpi(); + $helper->id = 'box-carts'; + $helper->icon = 'icon-shopping-cart'; + $helper->color = 'color2'; + $helper->title = $this->l('Abandoned Carts', null, null, false); + $date_from = date(Context::getContext()->language->date_format_lite, strtotime('-2 day')); + $date_to = date(Context::getContext()->language->date_format_lite, strtotime('-1 day')); + $helper->subtitle = sprintf($this->l('From %s to %s', null, null, false), $date_from, $date_to); + $helper->href = $this->context->link->getAdminLink('AdminCarts').'&action=filterOnlyAbandonedCarts&date_from='.date('Y-m-d', strtotime('-2 day')).'&date_to='.date('Y-m-d', strtotime('-1 day')); + $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=abandoned_cart'; + $this->kpis[] = $helper; + + $daysForAvgOrderVal = Configuration::get('PS_ORDER_KPI_AVG_ORDER_VALUE_NB_DAYS'); + $helper = new HelperKpi(); + $helper->id = 'box-average-order'; + $helper->icon = 'icon-money'; + $helper->color = 'color3'; + $helper->title = $this->l('Average Order Value', null, null, false); + if ($daysForAvgOrderVal == 1) { + $helper->subtitle = $daysForAvgOrderVal.' '.$this->l('day', null, null, false); + } else { + $helper->subtitle = $daysForAvgOrderVal.' '.$this->l('days', null, null, false); + } + + $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=average_order_value'; + $this->kpis[] = $helper; + + $daysForProfitPerVisitor = Configuration::get('PS_ORDER_KPI_PER_VISITOR_PROFIT_NB_DAYS'); + $helper = new HelperKpi(); + $helper->id = 'box-net-profit-visitor'; + $helper->icon = 'icon-user'; + $helper->color = 'color4'; + $helper->title = $this->l('Net Profit per Visitor', null, null, false); + if ($daysForProfitPerVisitor == 1) { + $helper->subtitle = $daysForProfitPerVisitor.' '.$this->l('day', null, null, false); + } else { + $helper->subtitle = $daysForProfitPerVisitor.' '.$this->l('days', null, null, false); + } + $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=netprofit_visit'; + $this->kpis[] = $helper; } - $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=average_order_value'; - $this->kpis[] = $helper; - - $daysForProfitPerVisitor = Configuration::get('PS_ORDER_KPI_PER_VISITOR_PROFIT_NB_DAYS'); - $helper = new HelperKpi(); - $helper->id = 'box-net-profit-visitor'; - $helper->icon = 'icon-user'; - $helper->color = 'color4'; - $helper->title = $this->l('Net Profit per Visitor', null, null, false); - if ($daysForProfitPerVisitor == 1) { - $helper->subtitle = $daysForProfitPerVisitor.' '.$this->l('day', null, null, false); - } else { - $helper->subtitle = $daysForProfitPerVisitor.' '.$this->l('days', null, null, false); - } - $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=netprofit_visit'; - $this->kpis[] = $helper; - return parent::renderKpis(); } @@ -254,6 +270,9 @@ class AdminCartsControllerCore extends AdminController if (!($cart = $this->loadObject(true))) { return; } + if ($this->tabAccess['kpi'] === 1) { + $this->content .= $this->renderKpis(); + } $customer = new Customer($cart->id_customer); $currency = new Currency($cart->id_currency); $this->context->cart = $cart; @@ -340,16 +359,6 @@ class AdminCartsControllerCore extends AdminController $cartHtlData = array(); } - $helper = new HelperKpi(); - $helper->id = 'box-kpi-cart'; - $helper->icon = 'icon-shopping-cart'; - $helper->color = 'color1'; - $helper->title = $this->l('Total Cart', null, null, false); - $helper->subtitle = sprintf($this->l('Cart #%06d', null, null, false), $cart->id); - $helper->value = Tools::displayPrice($total_price, $currency); - $kpi = $helper->generate(); - //end - // get standalone products in cart $objServiceProductCartDetail = new ServiceProductCartDetail(); $hotelProducts = $objServiceProductCartDetail->getServiceProductsInCart( @@ -381,7 +390,6 @@ class AdminCartsControllerCore extends AdminController 'cart_htl_data' => $cartHtlData,//by webkul hotel rooms in order data 'standalone_products' => $standaloneProducts, 'hotel_products' => $hotelProducts, - 'kpi' => $kpi, 'products' => $products, 'discounts' => $cart->getCartRules(), 'cart_orders' => $cartOrders, @@ -1121,7 +1129,7 @@ class AdminCartsControllerCore extends AdminController if ($bookingInfo['id'] == $idBookingData) { $amtWithQty = $bookingInfo['amt_with_qty']; $bookingInfo['amt_with_qty'] = Tools::displayPrice($amtWithQty); - $bookingInfo['total_price'] = Tools::displayPrice($amtWithQty + $bookingInfo['demand_price']); + $bookingInfo['total_price'] = Tools::displayPrice($amtWithQty + $bookingInfo['demand_price'] + $bookingInfo['additional_service_price'] + $bookingInfo['additional_services_auto_add_price']); $response = array( 'curr_booking_info' => $bookingInfo, 'cart_info' => $this->ajaxReturnVars(), diff --git a/controllers/admin/AdminDashboardController.php b/controllers/admin/AdminDashboardController.php index 3571b7960..b944aff8e 100644 --- a/controllers/admin/AdminDashboardController.php +++ b/controllers/admin/AdminDashboardController.php @@ -168,6 +168,10 @@ class AdminDashboardControllerCore extends AdminController return parent::renderOptions(); } + if ($this->tabAccess['kpi'] === 1) { + $this->content .= $this->renderKpis(); + } + // $translations = array( // 'Calendar' => $this->l('Calendar', 'AdminStatsTab'), // 'Day' => $this->l('Day', 'AdminStatsTab'), diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 446ebf491..aac780979 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -391,12 +391,15 @@ class AdminOrdersControllerCore extends AdminController ); } - $this->page_header_toolbar_btn['print'] = array( - 'short' => $this->l('Print'), - 'href' => 'javascript:window.print()', - 'desc' => $this->l('Print order'), - 'class' => 'icon-print', - ); + if (HotelBookingDetail::getIdHotelByIdOrder($order->id, false) && !$this->lite_display) { + $this->page_header_toolbar_btn['booking_voucher'] = array( + 'short' => $this->l('Booking Voucher'), + 'href' => $this->context->link->getAdminLink('AdminPdf').'&submitAction=generateBookingVoucherPDF&id_order='.$order->id, + 'desc' => $this->l('View booking voucher'), + 'class' => 'icon-file-text', + 'target' => true, + ); + } if ($this->tabAccess['edit'] === 1) { if (((int) $order->isReturnable()) @@ -467,7 +470,9 @@ class AdminOrdersControllerCore extends AdminController } $paymentTypes = array(); - foreach ($this->getPaymentsTypes() as $paymentType) { + $objOrder = new Order(); + + foreach ($objOrder->getPaymentsTypes() as $paymentType) { if ($paymentType['value'] != OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT) { $paymentTypes[] = $paymentType; } @@ -682,7 +687,7 @@ class AdminOrdersControllerCore extends AdminController 'order' => $objOrder, 'currencies' => $currencies, 'payment_methods' => $payment_methods, - 'payment_types' => $this->getPaymentsTypes(), + 'payment_types' => $objOrder->getPaymentsTypes(), 'invoices_collection' => $objOrder->getInvoicesCollection(), 'current_id_lang' => $this->context->language->id, ) @@ -1344,6 +1349,8 @@ class AdminOrdersControllerCore extends AdminController parent::setMedia(); $this->addJqueryUI('ui.datepicker'); + $this->addJqueryUI('ui.tooltip', 'base', true); + $this->addJS(_PS_JS_DIR_.'vendor/d3.v3.min.js'); if ($this->display == 'view') { @@ -3214,7 +3221,9 @@ class AdminOrdersControllerCore extends AdminController return; } - $this->content .= $this->renderKpis(); + if ($this->tabAccess['kpi'] === 1) { + $this->content .= $this->renderKpis(); + } $customer = new Customer($order->id_customer); $carrier = new Carrier($order->id_carrier); @@ -3574,6 +3583,7 @@ class AdminOrdersControllerCore extends AdminController $order_detail_data[$key]['amt_with_qty_tax_incl'] = $value['total_price_tax_incl']; $order_detail_data[$key]['room_type_info'] = $objHotelRoomType->getRoomTypeInfoByIdProduct($value['id_product']); $order_detail_data[$key]['total_room_tax'] = $order_detail_data[$key]['total_room_price_ti'] - $order_detail_data[$key]['total_room_price_te']; + $order_detail_data[$key]['connected_rooms'] = HotelConnectedRoom::getConnectedRooms($value['id_room'], null, null, (int) Context::getContext()->language->id); if (isset($value['refund_info']) && $value['refund_info']['refunded'] @@ -3763,8 +3773,9 @@ class AdminOrdersControllerCore extends AdminController 'invoices_collection' => $order->getInvoicesCollection(), 'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(), 'payment_methods' => $payment_methods, - 'payment_types' => $this->getPaymentsTypes(), + 'payment_types' => $order->getPaymentsTypes(), 'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop), + 'receipt_management_active' => Configuration::get('PS_PAYMENT_RECEIPTS', null, null, $order->id_shop), 'display_warehouse' => (int)Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'), 'HOOK_CONTENT_ORDER' => Hook::exec( 'displayAdminOrderContentOrder', @@ -7273,26 +7284,6 @@ class AdminOrdersControllerCore extends AdminController return $products; } - protected function getPaymentsTypes() - { - return array( - OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL => array( - 'key' => 'PAYMENT_TYPE_PAY_AT_HOTEL', - 'value' => OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL, - 'name' => $this->l('Pay at hotel') - ), - OrderPayment::PAYMENT_TYPE_ONLINE => array( - 'key' => 'PAYMENT_TYPE_ONLINE', - 'value' => OrderPayment::PAYMENT_TYPE_ONLINE, - 'name' => $this->l('Online') - ), - OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT => array( - 'key' => 'PAYMENT_TYPE_REMOTE_PAYMENT', - 'value' => OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT, - 'name' => $this->l('Remote payment') - ), - ); - } /** * @param OrderInvoice $order_invoice diff --git a/controllers/admin/AdminPaymentReceiptsController.php b/controllers/admin/AdminPaymentReceiptsController.php new file mode 100644 index 000000000..1ca890269 --- /dev/null +++ b/controllers/admin/AdminPaymentReceiptsController.php @@ -0,0 +1,192 @@ +bootstrap = true; + parent::__construct(); + $this->context = Context::getContext(); + $this->lang = false; + $this->table = 'order_payment'; + + $this->fields_options = array( + 'general' => array( + 'title' => $this->l('Payment receipts options'), + 'fields' => array( + 'PS_PAYMENT_RECEIPTS' => array( + 'title' => $this->l('Enable Receipts'), + 'desc' => $this->l('If enabled, receipts will be generated for order payments.'), + 'cast' => 'intval', + 'type' => 'bool' + ), + 'PS_PAYMENT_RECEIPTS_PREFIX' => array( + 'title' => $this->l('Receipt prefix'), + 'desc' => $this->l('Prefix used for receipt name (e.g. #IN00001).'), + 'size' => 6, + 'type' => 'textLang' + ), + 'PS_PAYMENT_RECEIPTS_USE_YEAR' => array( + 'title' => $this->l('Add current year to receipt number'), + 'cast' => 'intval', + 'type' => 'bool' + ), + 'PS_PAYMENT_RECEIPTS_RESET' => array( + 'title' => $this->l('Reset Receipt progressive number at beginning of the year'), + 'cast' => 'intval', + 'type' => 'bool' + ), + 'PS_PAYMENT_RECEIPTS_START_NUMBER' => array( + 'title' => $this->l('Receipt number'), + 'desc' => sprintf($this->l('The next receipt will begin with this number, and then increase with each additional receipt. Set to 0 if you want to keep the current number (which is #%s).'), OrderPaymentDetail::getLastPaymentReceiptNumber() + 1), + 'size' => 6, + 'type' => 'text', + 'cast' => 'intval' + ), + 'PS_PAYMENT_RECEIPTS_LEGAL_FREE_TEXT' => array( + 'title' => $this->l('Legal free text'), + 'desc' => $this->l('Use this field to display additional text on your receipt, like specific legal information. It will appear below the payment methods summary.'), + 'size' => 50, + 'type' => 'textareaLang', + ), + 'PS_PAYMENT_RECEIPTS_FREE_TEXT' => array( + 'title' => $this->l('Footer text'), + 'desc' => $this->l('This text will appear at the bottom of the receipt, below your company details.'), + 'size' => 50, + 'type' => 'textLang', + ) + ), + 'submit' => array('title' => $this->l('Save')) + ) + ); + } + + public function initContent() + { + $this->display = 'edit'; + $this->initTabModuleList(); + $this->initToolbar(); + $this->initPageHeaderToolbar(); + $this->table = 'order_payment'; + $this->content .= $this->initFormByDate(); + + $this->content .= $this->renderOptions(); + + $this->context->smarty->assign(array( + 'content' => $this->content, + 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn + )); + } + + public function initFormByDate() + { + $this->fields_form = array( + 'legend' => array( + 'title' => $this->l('By date'), + 'icon' => 'icon-calendar' + ), + 'input' => array( + array( + 'type' => 'date', + 'label' => $this->l('From'), + 'name' => 'date_from', + 'maxlength' => 10, + 'required' => true, + 'hint' => $this->l('Format: 2011-12-31 (inclusive).') + ), + array( + 'type' => 'date', + 'label' => $this->l('To'), + 'name' => 'date_to', + 'maxlength' => 10, + 'required' => true, + 'hint' => $this->l('Format: 2012-12-31 (inclusive).') + ) + ), + 'submit' => array( + 'title' => $this->l('Generate PDF file by date'), + 'id' => 'submitPrint', + 'icon' => 'process-icon-download-alt' + ) + ); + + $this->fields_value = array( + 'date_from' => date('Y-m-d'), + 'date_to' => date('Y-m-d') + ); + + $this->table = 'order_payment'; + $this->show_toolbar = false; + $this->show_form_cancel_button = false; + $this->toolbar_title = $this->l('Print PDF invoices'); + return parent::renderForm(); + } + + public function initToolbarTitle() + { + $this->toolbar_title = array_unique($this->breadcrumbs); + } + + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + unset($this->page_header_toolbar_btn['cancel']); + } + + public function postProcess() + { + if(Tools::isSubmit('submitAddorder_payment')) { + if (!Validate::isDate(Tools::getValue('date_from'))) { + $this->errors[] = $this->l('Invalid "From" date'); + } + + if (!Validate::isDate(Tools::getValue('date_to'))) { + $this->errors[] = $this->l('Invalid "To" date'); + } + if(Tools::getValue('date_from') > Tools::getValue('date_to')) { + $this->errors[] = $this->l('"From" date must be earlier than "To" date'); + } + if (!count($this->errors)) { + if (count(OrderPaymentDetail::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')))) { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generatePaymentReceiptsPDF&date_from='.urlencode(Tools::getValue('date_from')).'&date_to='.urlencode(Tools::getValue('date_to'))); + } + + $this->errors[] = $this->l('No payment receipt has been found for this period.'); + } + }else{ + parent::postProcess(); + } + } + + public function beforeUpdateOptions() + { + if ((int)Tools::getValue('PS_PAYMENT_RECEIPTS_START_NUMBER') != 0 && (int)Tools::getValue('PS_PAYMENT_RECEIPTS_START_NUMBER') <= OrderPaymentDetail::getLastPaymentReceiptNumber()) { + $this->errors[] = $this->l('Invalid receipt number.').OrderPaymentDetail::getLastPaymentReceiptNumber().')'; + } + } +} + diff --git a/controllers/admin/AdminPdfController.php b/controllers/admin/AdminPdfController.php index 7fba0f8e1..2b74dad25 100644 --- a/controllers/admin/AdminPdfController.php +++ b/controllers/admin/AdminPdfController.php @@ -64,6 +64,15 @@ class AdminPdfControllerCore extends AdminController } } + public function processGenerateBookingVoucherPDF() + { + if (Tools::isSubmit('id_order')) { + $this->generateBookingVoucherPDFByIdOrder(Tools::getValue('id_order')); + } else { + die(Tools::displayError('The order ID is missing.')); + } + } + public function processGenerateOrderSlipPDF() { $order_slip = new OrderSlip((int)Tools::getValue('id_order_slip')); @@ -93,7 +102,6 @@ class AdminPdfControllerCore extends AdminController public function processGenerateInvoicesPDF() { $order_invoice_collection = OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')); - if (!count($order_invoice_collection)) { die(Tools::displayError('No invoice was found.')); } @@ -150,14 +158,38 @@ class AdminPdfControllerCore extends AdminController $id_supply_order = (int)Tools::getValue('id_supply_order'); $supply_order = new SupplyOrder($id_supply_order); - if (!Validate::isLoadedObject($supply_order)) { die(Tools::displayError('The supply order cannot be found within your database.')); } $this->generatePDF($supply_order, PDF::TEMPLATE_SUPPLY_ORDER_FORM); + } + + public function processGeneratePaymentReceiptsPDF() + { + $order_payment_collection = OrderPaymentDetail::getByDateInterval( + Tools::getValue('date_from'), + Tools::getValue('date_to') + ); + + if (!count($order_payment_collection)) { + die(Tools::displayError('No payment receipt was found.')); + } + + $this->generatePDF($order_payment_collection, PDF::TEMPLATE_PAYMENT_RECEIPT); } + public function processGeneratePaymentReceipt() + { + $idOrderPaymentDetail = (int) Tools::getValue('id_order_payment_detail'); + $orderPaymentDetail = new OrderPaymentDetail($idOrderPaymentDetail); + if (!Validate::isLoadedObject($orderPaymentDetail)) { + die(Tools::displayError('The order payment detail cannot be found.')); + } + $this->generatePDF($orderPaymentDetail, PDF::TEMPLATE_PAYMENT_RECEIPT); + } + + public function generateDeliverySlipPDFByIdOrder($id_order) { $order = new Order((int)$id_order); @@ -202,6 +234,23 @@ class AdminPdfControllerCore extends AdminController $this->generatePDF($order_invoice, PDF::TEMPLATE_INVOICE); } + public function generateBookingVoucherPDFByIdOrder($id_order) + { + $order = new Order((int)$id_order); + if (!Validate::isLoadedObject($order)) { + die(Tools::displayError('The order cannot be found within your database.')); + } + + $objHotelBookingDetail = new HotelBookingDetail(); + $bookingDetails = $objHotelBookingDetail->getBookingDataByOrderId((int)$order->id); + if (empty($bookingDetails)) { + die(Tools::displayError('No booking voucher is available for this order.')); + } + + $pdf = new PDF($order, PDF::TEMPLATE_BOOKING_VOUCHER, Context::getContext()->smarty); + $pdf->render('I'); + } + public function generatePDF($object, $template) { $pdf = new PDF($object, $template, Context::getContext()->smarty); diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index b7514d75a..59bfb805b 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1602,7 +1602,8 @@ class AdminProductsControllerCore extends AdminController ) { $this->addJqueryUI(array( 'ui.core', - 'ui.widget' + 'ui.widget', + 'ui.tooltip' )); $this->addjQueryPlugin(array( @@ -3160,6 +3161,7 @@ class AdminProductsControllerCore extends AdminController $disableDates = $objRoomDisableDates->getRoomDisableDates($room['id']); $room['disable_dates_json'] = json_encode($disableDates); } + $room['connected_rooms_count'] = HotelConnectedRoom::getTotalConnectedRooms($room['id']); } $data->assign('htl_room_info', $hotelRoomInfo); @@ -3787,6 +3789,7 @@ class AdminProductsControllerCore extends AdminController $this->errors[] = $this->l('This stay cannot be deleted as this stay contains future booking.'); } if (empty($this->errors)) { + $response['affected_rooms'] = HotelConnectedRoom::getTotalConnectedRooms(null, $idRoom); if ($objRoomInfo->delete()) { $response['success'] = true; } else { @@ -5513,7 +5516,9 @@ class AdminProductsControllerCore extends AdminController if (empty($this->errors)) { foreach ($roomsInfo as $roomInfo) { $objHotelRoomInfo = new HotelRoomInformation($roomInfo['id']); - $objHotelRoomInfo->id_status = $roomInfo['id_status']; + if (!empty($roomInfo['id_status'])) { + $objHotelRoomInfo->id_status = $roomInfo['id_status']; + } if (isset($roomInfo['floor']) && $roomInfo['floor'] != '') { $objHotelRoomInfo->floor = $roomInfo['floor']; } @@ -5714,4 +5719,102 @@ class AdminProductsControllerCore extends AdminController return $tpl->fetch(); } + + public function ajaxProcessGetNotConnectedRooms() + { + $roomId = (int) Tools::getValue('room_id'); + $roomTypeId = (int) Tools::getValue('room_type_id'); + $allGroups = HotelConnectedRoom::getNotConnectedRooms($roomId, $this->context->language->id); + $rooms = isset($allGroups[$roomTypeId]) ? $allGroups[$roomTypeId]['rooms'] : array(); + die(Tools::jsonEncode(['success' => true, 'rooms' => $rooms])); + } + + public function ajaxProcessInitConnectedRoomModal() + { + $response['hasError'] = 1; + $roomId = (int) Tools::getValue('room_id'); + $objRoom = new HotelRoomInformation($roomId); + $idProduct = (int) $objRoom->id_product; + $idHotel = (int) $objRoom->id_hotel; + + $this->context->smarty->assign(array( + 'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms($roomId, null, null, $this->context->language->id), + 'htl_not_connected_rooms' => HotelConnectedRoom::getNotConnectedRooms($roomId, $this->context->language->id), + 'main_room_id' => $roomId, + 'current_roomtype' => $idProduct, + )); + + $modal = array( + 'modal_id' => 'connectedRoomModal', + 'modal_class' => 'modal-md', + 'modal_title' => '  '.$this->l('Connected Room').' ', + 'modal_content' => $this->context->smarty->fetch('controllers/products/modal-connected-rooms.tpl'), + 'modal_actions' => array(), + ); + + $this->context->smarty->assign($modal); + $response['hasError'] = 0; + $response['modalHtml'] = $this->context->smarty->fetch('modal.tpl'); + + die(Tools::jsonEncode($response)); + } + + public function ajaxProcessManageConnectedRoom() + { + if ($this->tabAccess['edit'] !== 1) { + die(json_encode(['success' => false, 'message' => $this->l('You do not have permission to edit this.')])); + } + + $mode = Tools::getValue('mode'); + $roomId = (int) Tools::getValue('room_id'); + $connectedRoomId = (int) Tools::getValue('connected_room_id'); + $connectedId = (int) Tools::getValue('connected_id'); + $objRoom = new HotelRoomInformation($roomId); + $idProduct = (int) $objRoom->id_product; + $idHotel = (int) $objRoom->id_hotel; + + if ($mode === 'add') { + $connection = new HotelConnectedRoom(); + $connection->id_room = $roomId; + $connection->id_room_connected = $connectedRoomId; + if ($connection->add()) { + $this->context->smarty->assign(array( + 'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms($roomId, null, null, $this->context->language->id), + 'htl_not_connected_rooms' => HotelConnectedRoom::getNotConnectedRooms($roomId, $this->context->language->id), + 'main_room_id' => $roomId, + 'current_roomtype' => $idProduct, + )); + die(json_encode([ + 'html' => $this->context->smarty->fetch('controllers/products/modal-connected-rooms.tpl'), + 'success' => true, + 'message' => $this->l('Room connected successfully.'), + 'connected_count' => HotelConnectedRoom::getTotalConnectedRooms($roomId), + ])); + } + die(json_encode(['success' => false, 'message' => $this->l('Failed to connect room.')])); + } + + if ($mode === 'delete') { + if (!$connectedId) { + die(json_encode(['success' => false, 'message' => $this->l('Invalid data.')])); + } + $objHotelConnectedRoom = new HotelConnectedRoom($connectedId); + if ($objHotelConnectedRoom->delete()) { + $this->context->smarty->assign(array( + 'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms($roomId, null, null, $this->context->language->id), + 'htl_not_connected_rooms' => HotelConnectedRoom::getNotConnectedRooms($roomId, $this->context->language->id), + 'main_room_id' => $roomId, + 'current_roomtype' => $idProduct, + )); + die(json_encode([ + 'success' => true, + 'html' => $this->context->smarty->fetch('controllers/products/modal-connected-rooms.tpl'), + 'message' => $this->l('Connected room removed successfully.'), + 'connected_count' => HotelConnectedRoom::getTotalConnectedRooms($roomId), + ])); + } + die(json_encode(['success' => false, 'message' => $this->l('Failed to remove connected room.')])); + } + } + } diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php index e19e9cf08..f25677620 100644 --- a/controllers/front/OrderConfirmationController.php +++ b/controllers/front/OrderConfirmationController.php @@ -203,8 +203,8 @@ class OrderConfirmationControllerCore extends FrontController //// By webkul New way to calculate product prices with feature Prices $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days; $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days; - $cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = $data_v['total_price_tax_incl']*$var_quant; - $cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_excl'] = $data_v['total_price_tax_excl']*$var_quant; + $cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl']; + $cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += $data_v['total_price_tax_excl']; $cart_htl_data[$type_key]['date_diff'][$date_join]['is_backorder'] = $data_v['is_back_order']; if ($data_v['is_back_order']) { $any_back_order = 1; diff --git a/controllers/front/PdfBookingVoucherController.php b/controllers/front/PdfBookingVoucherController.php new file mode 100644 index 000000000..0ba3302c9 --- /dev/null +++ b/controllers/front/PdfBookingVoucherController.php @@ -0,0 +1,70 @@ +context->customer->isLogged() && !Tools::getValue('secure_key')) { + Tools::redirect('index.php?controller=authentication&back=pdf-booking-voucher'); + } + + $idOrder = (int)Tools::getValue('id_order'); + if (!Validate::isUnsignedId($idOrder)) { + die(Tools::displayError('The booking voucher was not found.')); + } + + $order = new Order($idOrder); + if (!Validate::isLoadedObject($order)) { + die(Tools::displayError('The booking voucher was not found.')); + } + + $secureKey = Tools::getValue('secure_key'); + if ($secureKey) { + if ($order->secure_key !== $secureKey) { + die(Tools::displayError('The booking voucher was not found.')); + } + } elseif ($order->id_customer != (int)$this->context->customer->id) { + die(Tools::displayError('The booking voucher was not found.')); + } + + $this->order = $order; + } + + public function display() + { + $pdf = new PDF($this->order, PDF::TEMPLATE_BOOKING_VOUCHER, $this->context->smarty); + $pdf->render(); + } +} diff --git a/install/classes/datas.php b/install/classes/datas.php index f002ca12d..a5b3cf59c 100644 --- a/install/classes/datas.php +++ b/install/classes/datas.php @@ -150,7 +150,12 @@ class Datas 'name' => 'newsletter', 'default' => 1, 'help' => 'Get news from QloApps', - ) + ), + 'enable_ssl' => array( + 'name' => 'ssl', + 'default' => 0, + 'help' => 'Enable SSL for QloApps', + ), ); protected $datas = array(); diff --git a/install/controllers/console/process.php b/install/controllers/console/process.php index def56c22b..ffa033860 100644 --- a/install/controllers/console/process.php +++ b/install/controllers/console/process.php @@ -238,6 +238,7 @@ class InstallControllerConsoleProcess extends InstallControllerConsole 'admin_lastname' => $this->datas->admin_lastname, 'admin_password' => $this->datas->admin_password, 'admin_email' => $this->datas->admin_email, + 'enable_ssl' => $this->datas->enable_ssl, 'marketing_consent' => $this->datas->marketing_consent, 'configuration_agrement' => true, 'send_informations' => true, diff --git a/install/data/db_structure.sql b/install/data/db_structure.sql index a61b5ba08..ed26f73f5 100644 --- a/install/data/db_structure.sql +++ b/install/data/db_structure.sql @@ -8,6 +8,7 @@ CREATE TABLE `PREFIX_access` ( `add` int(11) NOT NULL, `edit` int(11) NOT NULL, `delete` int(11) NOT NULL, + `kpi` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id_profile`,`id_tab`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION; @@ -1514,6 +1515,7 @@ CREATE TABLE `PREFIX_order_payment_detail` ( `id_order_payment` INT(10) unsigned NOT NULL, `id_order` INT(10) unsigned NOT NULL, `amount` DECIMAL(10,2) NOT NULL, + `receipt_number` INT(10) NOT NULL, `date_add` DATETIME NOT NULL, PRIMARY KEY (`id_order_payment_detail`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION; diff --git a/install/data/xml/configuration.xml b/install/data/xml/configuration.xml index e8e2ac993..9e5658518 100644 --- a/install/data/xml/configuration.xml +++ b/install/data/xml/configuration.xml @@ -133,6 +133,9 @@ #IN + + + #IN {"avoid":[]} @@ -152,6 +155,9 @@ 1 + + 1 + 360 diff --git a/install/data/xml/meta.xml b/install/data/xml/meta.xml index 4c9a0b225..581bd5ca3 100644 --- a/install/data/xml/meta.xml +++ b/install/data/xml/meta.xml @@ -32,14 +32,18 @@ password 1 + + supplier 1 @@ -92,14 +96,18 @@ order 1 + + order-opc 1 @@ -144,10 +152,12 @@ module-cashondelivery-validation 0 + our-properties 1 diff --git a/install/data/xml/tab.xml b/install/data/xml/tab.xml index 34302e0c6..2eaa33cff 100644 --- a/install/data/xml/tab.xml +++ b/install/data/xml/tab.xml @@ -102,6 +102,9 @@ AdminInvoices + + AdminPaymentReceipts + diff --git a/install/data/xml/theme_meta.xml b/install/data/xml/theme_meta.xml index ce42c1a27..0a23d98fd 100644 --- a/install/data/xml/theme_meta.xml +++ b/install/data/xml/theme_meta.xml @@ -39,9 +39,5 @@ - - - - diff --git a/install/langs/bg/data/meta.xml b/install/langs/bg/data/meta.xml index 2cb836a57..477b6da88 100644 --- a/install/langs/bg/data/meta.xml +++ b/install/langs/bg/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/bn/data/meta.xml b/install/langs/bn/data/meta.xml index 57422b652..712181078 100644 --- a/install/langs/bn/data/meta.xml +++ b/install/langs/bn/data/meta.xml @@ -19,8 +19,8 @@ contact-us - হোটেল প্রাইম - এটি এমন একটি স্থান যেখানে আরাম এবং বিলাসিতা প্রকৃতির সাথে মিলিত হয়েছে! + + @@ -42,18 +42,22 @@ password-recovery + + সরবরাহকারী সরবরাহকারির তালিকা @@ -138,18 +142,22 @@ order + + অর্ডার @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/br/data/meta.xml b/install/langs/br/data/meta.xml index 064e8ab57..ce3e8cbb4 100644 --- a/install/langs/br/data/meta.xml +++ b/install/langs/br/data/meta.xml @@ -19,8 +19,8 @@ entrar-em-contato-conosco - Hotel Prime - Um lugar onde o conforto e o luxo se misturam com a natureza! + + @@ -42,18 +42,22 @@ forgot, password, e-mail, new, reset recuperar-senha + + Fornecedores Lista de fornecedores @@ -138,18 +142,22 @@ pedido + + Pedido @@ -168,10 +176,12 @@ confirmação-do-pedido + diff --git a/install/langs/cs/data/meta.xml b/install/langs/cs/data/meta.xml index c566a1a06..d15d88d00 100644 --- a/install/langs/cs/data/meta.xml +++ b/install/langs/cs/data/meta.xml @@ -19,8 +19,8 @@ napiste-nam - Hotel Prime - Místo, kde se komfort a luxus mísí s přírodou! + + @@ -42,18 +42,22 @@ password-recovery + + Dodavatelé Suppliers list @@ -138,18 +142,22 @@ objednavka + + Rychlá Objednávka @@ -168,10 +176,12 @@ potvrzeni-objednavky + diff --git a/install/langs/de/data/meta.xml b/install/langs/de/data/meta.xml index f79a747c2..b490fa981 100644 --- a/install/langs/de/data/meta.xml +++ b/install/langs/de/data/meta.xml @@ -19,8 +19,8 @@ kontaktieren-sie-uns - Hotel Prime - Ein Ort, an dem Komfort und Luxus mit der Natur verschmelzen! + + @@ -42,18 +42,22 @@ vergessen, Kennwort, E-Mail, neu, Reset kennwort-wiederherstellung + + Zulieferer Zuliefererliste @@ -138,18 +142,22 @@ bestellung + + Bestellung @@ -168,10 +176,12 @@ bestellbestatigung + diff --git a/install/langs/en/data/configuration.xml b/install/langs/en/data/configuration.xml index b4bf4ef61..610649713 100644 --- a/install/langs/en/data/configuration.xml +++ b/install/langs/en/data/configuration.xml @@ -3,6 +3,9 @@ #IN + + #IN + #DE diff --git a/install/langs/en/data/meta.xml b/install/langs/en/data/meta.xml index 531c61efb..5f4fa253b 100644 --- a/install/langs/en/data/meta.xml +++ b/install/langs/en/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/en/data/tab.xml b/install/langs/en/data/tab.xml index 403df2844..35ed98780 100644 --- a/install/langs/en/data/tab.xml +++ b/install/langs/en/data/tab.xml @@ -33,6 +33,7 @@ + diff --git a/install/langs/es/data/meta.xml b/install/langs/es/data/meta.xml index ba7665bca..2f7f8eb60 100644 --- a/install/langs/es/data/meta.xml +++ b/install/langs/es/data/meta.xml @@ -19,8 +19,8 @@ contactanos - Hotel Prime - ¡Un lugar donde el confort y el lujo se mezclan con la naturaleza! + + @@ -42,18 +42,22 @@ contraseña, has olvidado, e-mail, nuevo, regeneración recuperacion-contraseña + + Proveedores Lista de proveedores @@ -138,18 +142,22 @@ pedido + + Pedido @@ -168,10 +176,12 @@ confirmacion-pedido + diff --git a/install/langs/fa/data/meta.xml b/install/langs/fa/data/meta.xml index 6cccce71b..efe792c08 100644 --- a/install/langs/fa/data/meta.xml +++ b/install/langs/fa/data/meta.xml @@ -19,8 +19,8 @@ contact-us - هتل پرایم - مکانی که در آن راحتی و لوکس بودن با طبیعت ترکیب شده‌اند! + + @@ -42,18 +42,22 @@ password-recovery + + تامین کننده ها لیست تامین کننده ها @@ -138,18 +142,22 @@ order + + سفارش @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/fr/data/meta.xml b/install/langs/fr/data/meta.xml index 5939be426..a3f4b6356 100644 --- a/install/langs/fr/data/meta.xml +++ b/install/langs/fr/data/meta.xml @@ -19,8 +19,8 @@ nous-contacter - Hôtel Prime - Un endroit où le confort et le luxe se mélangent avec la nature ! + + @@ -42,18 +42,22 @@ recuperation-mot-de-passe + + Fournisseurs Liste des fournisseurs @@ -138,18 +142,22 @@ commande + + Commande @@ -168,10 +176,12 @@ confirmation-commande + diff --git a/install/langs/he/data/meta.xml b/install/langs/he/data/meta.xml index 758bcf4fb..6e4e74b0c 100644 --- a/install/langs/he/data/meta.xml +++ b/install/langs/he/data/meta.xml @@ -19,8 +19,8 @@ צור-קשר - מלון פריים - מקום שבו נוחות ולוקסוס משתלבים עם הטבע! + + @@ -42,18 +42,22 @@ שחזור-סיסמה + + ספקים רשימת ספקים @@ -138,18 +142,22 @@ הזמנה + + הזמנה @@ -168,10 +176,12 @@ אימות-הזמנה + diff --git a/install/langs/hr/data/meta.xml b/install/langs/hr/data/meta.xml index 7057dfacb..c1b1b4d50 100644 --- a/install/langs/hr/data/meta.xml +++ b/install/langs/hr/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/hu/data/meta.xml b/install/langs/hu/data/meta.xml index 8d36562c3..2eaba831e 100644 --- a/install/langs/hu/data/meta.xml +++ b/install/langs/hu/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/id/data/meta.xml b/install/langs/id/data/meta.xml index 77819f8cd..a2d237d81 100644 --- a/install/langs/id/data/meta.xml +++ b/install/langs/id/data/meta.xml @@ -19,8 +19,8 @@ hubungi-kami - Hotel Prime - Tempat di mana kenyamanan dan kemewahan berpadu dengan alam! + + @@ -42,18 +42,22 @@ forgot, password, e-mail, new, reset lupa-password + + Supplier Daftar supplier @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ konfirmasi-pembelian + diff --git a/install/langs/it/data/meta.xml b/install/langs/it/data/meta.xml index 22485f8c0..d76e76389 100644 --- a/install/langs/it/data/meta.xml +++ b/install/langs/it/data/meta.xml @@ -19,8 +19,8 @@ contattarci - Hotel Prime -Un luogo dove il comfort e il lusso si mescolano con la natura! + + @@ -42,18 +42,22 @@ dimenticato, password, e-mail, nuovo, reset recupero-password + + Fornitori Elenco fornitori @@ -138,18 +142,22 @@ ordine + + Ordine @@ -168,10 +176,12 @@ conferma-ordine + diff --git a/install/langs/lt/data/meta.xml b/install/langs/lt/data/meta.xml index 3a18628ef..9edaf7602 100644 --- a/install/langs/lt/data/meta.xml +++ b/install/langs/lt/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - Vieta, kur komfortas ir prabanga dera su gamta! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/mk/data/meta.xml b/install/langs/mk/data/meta.xml index 541576642..56f0d3810 100644 --- a/install/langs/mk/data/meta.xml +++ b/install/langs/mk/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/nl/data/meta.xml b/install/langs/nl/data/meta.xml index 3a6cfe94d..d2ad17c19 100644 --- a/install/langs/nl/data/meta.xml +++ b/install/langs/nl/data/meta.xml @@ -19,8 +19,8 @@ contact-met-ons-opnemen - Hotel Prime - Een plek waar comfort en luxe samengaan met de natuur! + + @@ -42,18 +42,22 @@ forgot, password, e-mail, new, reset wachtwoord-opvragen + + Leveranciers Lijst met leveranciers @@ -132,18 +136,22 @@ bestelling + + Bestelling @@ -162,10 +170,12 @@ order-bevestiging + diff --git a/install/langs/no/data/meta.xml b/install/langs/no/data/meta.xml index 9fb17959f..442acfa9e 100644 --- a/install/langs/no/data/meta.xml +++ b/install/langs/no/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/pl/data/meta.xml b/install/langs/pl/data/meta.xml index 0934c53e1..61c8f1c8c 100644 --- a/install/langs/pl/data/meta.xml +++ b/install/langs/pl/data/meta.xml @@ -19,8 +19,8 @@ kontakt - Hotel Prime - Miejsce, gdzie komfort i luksus łączą się z naturą! + + @@ -42,18 +42,22 @@ przypomnienie, hasło, e-mail, nowy odzyskiwanie-hasla + + Dostawcy Lista dostawców @@ -138,18 +142,22 @@ zamowienie + + Zamówienie @@ -168,10 +176,12 @@ potwierdzenie-zamowienia + diff --git a/install/langs/pt/data/meta.xml b/install/langs/pt/data/meta.xml index 25504b1e0..f46abbe2d 100644 --- a/install/langs/pt/data/meta.xml +++ b/install/langs/pt/data/meta.xml @@ -19,8 +19,8 @@ contacte-nos - Hotel Prime - Um lugar onde o conforto e o luxo se misturam com a natureza! + + @@ -42,18 +42,22 @@ esqueci-me, recuperar, palavra-passe, e-mail, nova, reset recuperar-palavra-passe + + Fornecedores Lista de Fornecedores @@ -138,18 +142,22 @@ encomenda + + Encomenda Rápida @@ -168,10 +176,12 @@ confirmacao-encomenda + diff --git a/install/langs/qc/data/meta.xml b/install/langs/qc/data/meta.xml index 551c9e9e9..d83c56aa5 100644 --- a/install/langs/qc/data/meta.xml +++ b/install/langs/qc/data/meta.xml @@ -19,8 +19,8 @@ nous-contacter - Hôtel Prime - Un endroit où le confort et le luxe se mêlent à la nature ! + + @@ -42,18 +42,22 @@ recuperation-mot-de-passe + + Fournisseurs Liste des fournisseurs @@ -132,18 +136,22 @@ commande + + Commande @@ -162,10 +170,12 @@ confirmation-commande + diff --git a/install/langs/ro/data/meta.xml b/install/langs/ro/data/meta.xml index 1183e23ba..6b93eee1e 100644 --- a/install/langs/ro/data/meta.xml +++ b/install/langs/ro/data/meta.xml @@ -19,8 +19,8 @@ contact - Hotel Prime - Un loc unde confortul și luxul se îmbină cu natura! + + @@ -42,18 +42,22 @@ recuperare-parola + + Furnizori Lista furnizorilor @@ -138,18 +142,22 @@ comanda + + Comandă @@ -168,10 +176,12 @@ confirmare-comanda + diff --git a/install/langs/ru/data/meta.xml b/install/langs/ru/data/meta.xml index f32b4d38c..908c81c4b 100644 --- a/install/langs/ru/data/meta.xml +++ b/install/langs/ru/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Отель Прайм - Место, где комфорт и роскошь сочетаются с природой! + + @@ -42,18 +42,22 @@ забыли пароль, e-mail, новый пароль,восстановить пароль password-recovery + + Поставщики Список поставщиков @@ -138,18 +142,22 @@ order + + Быстрый заказ @@ -162,10 +170,12 @@ guest-tracking + diff --git a/install/langs/si/data/meta.xml b/install/langs/si/data/meta.xml index 33e1e78b2..a6b3d6a23 100644 --- a/install/langs/si/data/meta.xml +++ b/install/langs/si/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/sr/data/meta.xml b/install/langs/sr/data/meta.xml index 1c68f04c5..7aff1d638 100644 --- a/install/langs/sr/data/meta.xml +++ b/install/langs/sr/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/sv/data/meta.xml b/install/langs/sv/data/meta.xml index 0c8036887..ef818fd95 100644 --- a/install/langs/sv/data/meta.xml +++ b/install/langs/sv/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/tw/data/meta.xml b/install/langs/tw/data/meta.xml index c1a2ca7ed..a73b12ef7 100644 --- a/install/langs/tw/data/meta.xml +++ b/install/langs/tw/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Prime 酒店 - 一個舒適與奢華與自然融合的地方! + + @@ -42,18 +42,22 @@ forgot, password, e-mail, new, reset password-recovery + + 供應商 供應商列表 @@ -138,18 +142,22 @@ order + + 訂單 @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/vn/data/meta.xml b/install/langs/vn/data/meta.xml index 69a0bba3d..1a84b1dc9 100644 --- a/install/langs/vn/data/meta.xml +++ b/install/langs/vn/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Khách sạn Prime - Nơi mà sự thoải mái và sang trọng hòa quyện với thiên nhiên! + + @@ -42,18 +42,22 @@ password-recovery + + Nhà cung cấp Suppliers list @@ -138,18 +142,22 @@ order + + Đơn hàng @@ -168,10 +176,12 @@ order-confirmation + diff --git a/install/langs/zh/data/meta.xml b/install/langs/zh/data/meta.xml index 9fb5a12ce..2c6fe190c 100644 --- a/install/langs/zh/data/meta.xml +++ b/install/langs/zh/data/meta.xml @@ -19,8 +19,8 @@ contact-us - Hotel Prime - A place where comfort and luxury are blended with nature! + + @@ -42,18 +42,22 @@ password-recovery + + Suppliers Suppliers list @@ -138,18 +142,22 @@ order + + Order @@ -168,10 +176,12 @@ order-confirmation + diff --git a/mails/en/account.html b/mails/en/account.html index c80631219..d5e047532 100644 --- a/mails/en/account.html +++ b/mails/en/account.html @@ -68,10 +68,10 @@ - + Hi {firstname} {lastname},
Thank you for creating a customer account at {shop_name}. -
+ @@ -83,14 +83,14 @@   - +

Your {shop_name} login details

Here are your login details:
E-mail address: {email}
-
+   @@ -106,7 +106,7 @@   - +

Important Security Tips:

  1. Always keep your account details safe.
  2. @@ -114,7 +114,7 @@
  3. Change your password regularly.
  4. Should you suspect someone is using your account illegally, please notify us immediately.
-
+   @@ -126,9 +126,9 @@ - + You can now place orders on our website: {shop_name} - + diff --git a/mails/en/awaiting_payment.html b/mails/en/awaiting_payment.html index c6bc613c6..d83fbe902 100644 --- a/mails/en/awaiting_payment.html +++ b/mails/en/awaiting_payment.html @@ -69,10 +69,10 @@ - + Hi {firstname} {lastname},
{order_header_line_html} -
+ @@ -84,13 +84,13 @@   - +

Order {order_name} - Awaiting payment

Order reference: {order_name}
Payment method: {payment_method}
-
+   @@ -103,18 +103,18 @@ {extra_mail_content_html} - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/backoffice_order.html b/mails/en/backoffice_order.html index 0b40f8b35..f779ea6ef 100644 --- a/mails/en/backoffice_order.html +++ b/mails/en/backoffice_order.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,12 +83,12 @@   - +

A new order has been generated on your behalf.

Please go on {order_link} to finalize the payment. -
+   diff --git a/mails/en/booking_extra_demands.tpl b/mails/en/booking_extra_demands.tpl index a4551d61f..d205d25cc 100644 --- a/mails/en/booking_extra_demands.tpl +++ b/mails/en/booking_extra_demands.tpl @@ -23,22 +23,22 @@ {if $smarty.foreach.demandRow.first} - + {$data_v['name']}
{$rm_v['data_form']|date_format:"%d-%m-%Y"} {l s='to'} {$rm_v['data_to']|date_format:"%d-%m-%Y"}
{l s='Stay'} - {$roomCount} -
+ {/if} - + {$demand['name']} - + - + {convertPrice price=$demand['total_price_tax_excl']} - + {/foreach} @@ -81,31 +81,31 @@ {if $smarty.foreach.serviceRow.first} - + {$data_v['name']}
{$rm_v['data_form']|date_format:"%d-%m-%Y"} {l s='to'} {$rm_v['data_to']|date_format:"%d-%m-%Y"}
{l s='Stay'} - {$roomCount} -
+ {/if} - + {$service['name']} - + - + {if $service['allow_multiple_quantity']} {$service['quantity']} {else} {l s='--'} {/if} - + - + {convertPrice price=$service['total_price_tax_excl']} - + {/foreach} diff --git a/mails/en/booking_extra_demands.txt b/mails/en/booking_extra_demands.txt index a73cdf3ea..37d959047 100644 --- a/mails/en/booking_extra_demands.txt +++ b/mails/en/booking_extra_demands.txt @@ -13,22 +13,22 @@ {foreach name=demandRow from=$roomDemand['extra_demands'] item=demand} {if $smarty.foreach.demandRow.first} - + {$data_v['name']}
{$rm_v['data_form']|date_format:"%d-%m-%Y"} {l s='to'} {$rm_v['data_to']|date_format:"%d-%m-%Y"}
{l s='Stay'} - {$roomCount} -
+ {/if} - + {$demand['name']} - + - + {convertPrice price=$demand['total_price_tax_excl']} - + {/foreach} diff --git a/mails/en/contact.html b/mails/en/contact.html index 5c5aa9d53..210b11f5d 100644 --- a/mails/en/contact.html +++ b/mails/en/contact.html @@ -68,9 +68,9 @@ - + Message from a {shop_name} customer - + @@ -82,11 +82,11 @@   - + {contact_content_html} - +   diff --git a/mails/en/contact_form.html b/mails/en/contact_form.html index 73a8a7143..2a6cc0301 100644 --- a/mails/en/contact_form.html +++ b/mails/en/contact_form.html @@ -69,9 +69,9 @@ - + Your message to {shop_name} Customer Service - + @@ -83,7 +83,7 @@   - + Your message has been sent successfully.

Message: {message}

@@ -91,7 +91,7 @@ Product: {product_name}
Attached file: {attached_file}
-
+   @@ -103,10 +103,10 @@ - + We will answer as soon as possible. - + diff --git a/mails/en/credit_slip.html b/mails/en/credit_slip.html index 6aee0c304..40928b0e2 100644 --- a/mails/en/credit_slip.html +++ b/mails/en/credit_slip.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,12 +83,12 @@   - +

Order {order_name} - Credit slip created

We have generated a credit slip in your name for order with the reference {order_name}. -
+   @@ -100,10 +100,10 @@ - + You can review this credit slip and download your invoice from the "My credit slips" section of your account by clicking "My account" on our website. - + diff --git a/mails/en/credit_slip_voucher.html b/mails/en/credit_slip_voucher.html index e864fd62b..6f5ba20a6 100644 --- a/mails/en/credit_slip_voucher.html +++ b/mails/en/credit_slip_voucher.html @@ -71,9 +71,9 @@ - + Hi {firstname} {lastname},
-
+ @@ -85,7 +85,7 @@   - +

VOUCHER GENERATED

@@ -95,7 +95,7 @@ Voucher Code: {voucher_code} for an amount of {voucher_amount}.

To use this voucher just copy and paste this code during payment process for your next order.
-
+   diff --git a/mails/en/download_product.html b/mails/en/download_product.html index a9d6b6e9a..a42775e85 100644 --- a/mails/en/download_product.html +++ b/mails/en/download_product.html @@ -69,10 +69,10 @@ - + Hi {firstname} {lastname},
Thank you for your order with the reference {order_name} from {shop_name} -
+ @@ -84,14 +84,14 @@   - +

Product(s) now available for download

You have {nbProducts} product(s) now available for download using the following link(s):

{virtualProducts}
-
+   @@ -103,18 +103,18 @@ - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/employee_password.html b/mails/en/employee_password.html index 7b1b059c9..d17759824 100644 --- a/mails/en/employee_password.html +++ b/mails/en/employee_password.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,7 +83,7 @@   - +

Your {shop_name} login information

@@ -93,7 +93,7 @@ Password: {passwd}
E-mail address: {email}
-
+   diff --git a/mails/en/forward_msg.html b/mails/en/forward_msg.html index 07728db09..f9d56a845 100644 --- a/mails/en/forward_msg.html +++ b/mails/en/forward_msg.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,7 +83,7 @@   - +

Customer service - Forwarded discussion

@@ -91,7 +91,7 @@ Discussion history: {messages}

{employee} added "{comment}"
-
+   diff --git a/mails/en/guest_to_customer.html b/mails/en/guest_to_customer.html index 0dc1e5c9a..fbed53b8a 100644 --- a/mails/en/guest_to_customer.html +++ b/mails/en/guest_to_customer.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,7 +83,7 @@   - +

Your customer account creation

@@ -91,7 +91,7 @@ E-mail address: {email}

Password: {passwd}
-
+   @@ -103,19 +103,19 @@ - + Please be careful when sharing these login details with others. - + - + You can access your customer account on our website: {shop_url} - + diff --git a/mails/en/in_transit.html b/mails/en/in_transit.html index 6c5318515..56b82dd3e 100644 --- a/mails/en/in_transit.html +++ b/mails/en/in_transit.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,14 +83,14 @@   - +

Order {order_name} - In transit

Your order with the reference {order_name} is currently in transit.

You can track your package using the following link: {followup}
-
+   @@ -102,18 +102,18 @@ - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/log_alert.html b/mails/en/log_alert.html index 13766029f..66299ede6 100644 --- a/mails/en/log_alert.html +++ b/mails/en/log_alert.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,13 +83,13 @@   - +

You have received a new log alert

Warning: you have received a new log alert in your Back Office.

You can check for it in the "Tools" > "Logs" section of your Back Office.
-
+   diff --git a/mails/en/order_canceled.html b/mails/en/order_canceled.html index 5271ab209..52f2eb3f4 100644 --- a/mails/en/order_canceled.html +++ b/mails/en/order_canceled.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,12 +83,12 @@   - +

Order canceled - {order_name}

Your order with the reference {order_name} has been canceled. -
+   @@ -104,7 +104,7 @@   - +

Here are your order details:

@@ -112,7 +112,7 @@ Order reference: {order_name}
Order total: {total_paid}

-
+
{order_hotel_detail_html} @@ -127,18 +127,18 @@ {extra_mail_content_html} - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/order_changed.html b/mails/en/order_changed.html index c224bc3ff..4e700defb 100644 --- a/mails/en/order_changed.html +++ b/mails/en/order_changed.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,12 +83,12 @@   - +

Order {order_name} - Order changed

Your order with the reference {order_name} from {hotel_hotel_name} has been changed by the merchant. -
+   @@ -100,18 +100,18 @@ - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/order_conf.html b/mails/en/order_conf.html index 5e58397d2..dc29689fd 100755 --- a/mails/en/order_conf.html +++ b/mails/en/order_conf.html @@ -71,10 +71,10 @@ - + Hi {firstname} {lastname},
{order_header_line_html} -
+ @@ -86,14 +86,14 @@   - +

Order details

Order: {order_name} Placed on {date}

Payment: {payment}
-
+   @@ -123,18 +123,18 @@ - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/order_conf_admin.html b/mails/en/order_conf_admin.html index 28729c428..a5117aa9e 100755 --- a/mails/en/order_conf_admin.html +++ b/mails/en/order_conf_admin.html @@ -70,10 +70,10 @@ - + Hi {firstname} {lastname},
{order_header_line_html} -
+ @@ -85,14 +85,14 @@   - +

Customer details

Name: {customer_name}

Email: {customer_email}
-
+   @@ -108,14 +108,14 @@   - +

Order details

Order: {order_name} Placed on {date}

Payment: {payment}
-
+   diff --git a/mails/en/order_conf_cart_rules.tpl b/mails/en/order_conf_cart_rules.tpl index 7a1a683b0..bf4468f07 100644 --- a/mails/en/order_conf_cart_rules.tpl +++ b/mails/en/order_conf_cart_rules.tpl @@ -5,9 +5,9 @@ - + {$cart_rule['voucher_name']} - + @@ -18,9 +18,9 @@ - + {$cart_rule['voucher_reduction']} - + diff --git a/mails/en/order_conf_product_list.tpl b/mails/en/order_conf_product_list.tpl index 525e38b70..ba0127f33 100644 --- a/mails/en/order_conf_product_list.tpl +++ b/mails/en/order_conf_product_list.tpl @@ -5,9 +5,9 @@   - + {$product['reference']} - +   @@ -18,9 +18,9 @@   - + {$product['name']} - +   @@ -31,9 +31,9 @@   - + {$product['unit_price']} - +   @@ -44,9 +44,9 @@   - + {$product['quantity']} - +   @@ -57,9 +57,9 @@   - + {$product['price']} - +   @@ -73,10 +73,10 @@   - + {$product['name']}
{$customization['customization_text']} -
+   @@ -87,9 +87,9 @@   - + {$product['unit_price']} - +   @@ -100,9 +100,9 @@   - + {$customization['customization_quantity']} - +   @@ -113,9 +113,9 @@   - + {$customization['quantity']} - +   diff --git a/mails/en/order_customer_comment.html b/mails/en/order_customer_comment.html index 6dd6fedcf..c9c18b7f1 100644 --- a/mails/en/order_customer_comment.html +++ b/mails/en/order_customer_comment.html @@ -68,9 +68,9 @@ - + Message from a customer - + @@ -82,14 +82,14 @@   - + You have received a new message regarding booking with the reference {order_name}.

Name: {firstname} {lastname}

E-mail: {email}

Customer message:
{message}

-
+   diff --git a/mails/en/order_hotel_detail.tpl b/mails/en/order_hotel_detail.tpl index 7def2f0e4..fe8cebcc9 100644 --- a/mails/en/order_hotel_detail.tpl +++ b/mails/en/order_hotel_detail.tpl @@ -1,5 +1,5 @@ {if isset($list['hotel_name']) && $list['hotel_name']} - +

{l s='Property details'}:

@@ -9,5 +9,5 @@ {l s='Property Email'}: {$list['hotel_email']}
{l s='Total Stays'}: {$list['num_rooms']}

-
+
{/if} \ No newline at end of file diff --git a/mails/en/order_merchant_comment.html b/mails/en/order_merchant_comment.html index 4cbc9d7b8..e57e34375 100644 --- a/mails/en/order_merchant_comment.html +++ b/mails/en/order_merchant_comment.html @@ -68,9 +68,9 @@ - + Hi {firstname} {lastname}, - + @@ -82,7 +82,7 @@   - +

Message from {shop_name}

@@ -90,7 +90,7 @@ You have received a new message from {shop_name} regarding booking with the reference {order_name}.

Message:
{message}
-
+   diff --git a/mails/en/order_refund_completed_admin.html b/mails/en/order_refund_completed_admin.html index 0c1baf06c..d1647d8fc 100755 --- a/mails/en/order_refund_completed_admin.html +++ b/mails/en/order_refund_completed_admin.html @@ -71,10 +71,10 @@ - + Hi {firstname} {lastname},
A request has been completed for the {refund_for_txt} cancellation. -
+ @@ -87,7 +87,7 @@   - +

Order details

Order: {order_reference} Placed on {order_date}

@@ -96,7 +96,7 @@ Payment Mode: {payment_mode}

Transaction Id: {id_transaction}

-
+   @@ -119,12 +119,12 @@   - +

Customer details

Customer name: {customer_name}

Customer email: {customer_email}

-
+   diff --git a/mails/en/order_refund_completed_customer.html b/mails/en/order_refund_completed_customer.html index 211a19f11..0cb997673 100755 --- a/mails/en/order_refund_completed_customer.html +++ b/mails/en/order_refund_completed_customer.html @@ -71,10 +71,10 @@ - + Hi {firstname} {lastname},
Your request for {refund_for_txt} cancellation has been completed. -
+ @@ -86,7 +86,7 @@   - +

Order details

Order: {order_reference} Placed on {order_date}

@@ -95,7 +95,7 @@ Payment Mode: {payment_mode}

Transaction Id: {id_transaction}

-
+   @@ -117,10 +117,10 @@ - + You can review your booking cancelation requests from the "Booking Refund Requests" section of your customer account by clicking "My account". - + diff --git a/mails/en/order_refund_denied_admin.html b/mails/en/order_refund_denied_admin.html index 2a1ef1624..ddb75a8d2 100755 --- a/mails/en/order_refund_denied_admin.html +++ b/mails/en/order_refund_denied_admin.html @@ -71,10 +71,10 @@ - + Hi {firstname} {lastname},
A request has been denied for the {refund_for_txt} cancellation. -
+ @@ -87,13 +87,13 @@   - +

Order details

Order: {order_reference} Placed on {order_date}

Refund Status: {status_name}

-
+   @@ -116,12 +116,12 @@   - +

Customer details

Customer name: {customer_name}

Customer email: {customer_email}

-
+   diff --git a/mails/en/order_refund_denied_customer.html b/mails/en/order_refund_denied_customer.html index c997eb0a3..67ea54f76 100755 --- a/mails/en/order_refund_denied_customer.html +++ b/mails/en/order_refund_denied_customer.html @@ -71,10 +71,10 @@ - + Hi {firstname} {lastname},
Your request for {refund_for_txt} cancellation has been denied. -
+ @@ -86,13 +86,13 @@   - +

Order details

Order: {order_reference} Placed on {order_date}

Refund Status: {status_name}

-
+   @@ -114,10 +114,10 @@ - + You can review your booking cancelation requests from the "Booking Refund Requests" section of your customer account by clicking "My account". - + diff --git a/mails/en/order_refund_pending_admin.html b/mails/en/order_refund_pending_admin.html index 36d245469..e85a274c7 100755 --- a/mails/en/order_refund_pending_admin.html +++ b/mails/en/order_refund_pending_admin.html @@ -71,10 +71,10 @@ - + Hi {firstname} {lastname},
A request has been generated for {refund_for_txt} cancellations. -
+ @@ -87,14 +87,14 @@   - +

Order details

Order: {order_reference} Placed on {order_date}

Refund Status: {status_name}

Cancelation Reason: {cancelation_reason}

-
+   @@ -117,12 +117,12 @@   - +

Customer details

Customer name: {customer_name}

Customer email: {customer_email}

-
+   diff --git a/mails/en/order_refund_pending_customer.html b/mails/en/order_refund_pending_customer.html index 2b439d093..6e885fa96 100755 --- a/mails/en/order_refund_pending_customer.html +++ b/mails/en/order_refund_pending_customer.html @@ -71,10 +71,10 @@ - + Hi {firstname} {lastname},
Your request for {refund_for_txt} cancellation has been submitted successfully. -
+ @@ -86,13 +86,13 @@   - +

Order details

Order: {order_reference} Placed on {order_date}

Refund Status: {status_name}

-
+   @@ -114,10 +114,10 @@ - + You can review your booking cancelation requests from the "Booking Refund Requests" section of your customer account by clicking "My account". - + diff --git a/mails/en/order_return_state.html b/mails/en/order_return_state.html index fd3de585a..104104849 100644 --- a/mails/en/order_return_state.html +++ b/mails/en/order_return_state.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,13 +83,13 @@   - +

Return #{id_order_return} - update

We have updated the progress on your return #{id_order_return}, the new status is: "{state_order_return}"
-
+   @@ -102,10 +102,10 @@ {extra_mail_content_html} - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + diff --git a/mails/en/overbooking.html b/mails/en/overbooking.html index b58f70c8b..8ca343851 100755 --- a/mails/en/overbooking.html +++ b/mails/en/overbooking.html @@ -71,12 +71,12 @@ - + Hi {firstname} {lastname},

Thank you for booking with {hotel_hotel_name}!

Bookings in this order are Not Confirmed yet !!
We are sorry for your inconvenience. Please contact hotel to get final confirmation for your bookings. -
+ @@ -88,14 +88,14 @@   - +

Order details

Order: {order_name} Placed on {date}

Payment: {payment}

Status: {order_status}
-
+   @@ -127,18 +127,18 @@ - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. - + diff --git a/mails/en/overbooking_admin.html b/mails/en/overbooking_admin.html index a19795a02..c64acd1ec 100755 --- a/mails/en/overbooking_admin.html +++ b/mails/en/overbooking_admin.html @@ -70,12 +70,12 @@ - + Hi {firstname} {lastname},

New bookings are created on {hotel_hotel_name}!

Bookings in this order have Overbookings !!
This order is not confirmed yet. Please check the order details to resolve overbookings. -
+ @@ -87,14 +87,14 @@   - +

Customer details

Name: {customer_name}

Email: {customer_email}
-
+   @@ -110,7 +110,7 @@   - +

Order details

@@ -118,7 +118,7 @@ Payment: {payment}

Status: {order_status}
-
+   diff --git a/mails/en/partial_payment_accepted.html b/mails/en/partial_payment_accepted.html index 61b578477..953846164 100644 --- a/mails/en/partial_payment_accepted.html +++ b/mails/en/partial_payment_accepted.html @@ -69,10 +69,10 @@ - + Hi {firstname} {lastname},
{order_header_line_html} -
+ @@ -84,7 +84,7 @@   - +

Order {order_name} - Payment processed

@@ -93,7 +93,7 @@ Total Booking Amount: {total_paid}

Partial Payment Amount: {advance_paid_amount}

Total Paid Amount: {total_paid_real}

-
+   @@ -106,18 +106,18 @@ {extra_mail_content_html} - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/password.html b/mails/en/password.html index e6fd5726b..803a94c72 100644 --- a/mails/en/password.html +++ b/mails/en/password.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,14 +83,14 @@   - +

Your new {shop_name} login details

E-mail address: {email}
Password: {passwd}
-
+   @@ -102,18 +102,18 @@ - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/password_query.html b/mails/en/password_query.html index 3a9071826..3825facc8 100644 --- a/mails/en/password_query.html +++ b/mails/en/password_query.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,7 +83,7 @@   - +

Password reset request for {shop_name}

@@ -91,7 +91,7 @@ Please note that this will change your current password.

To confirm this action, please use the following link:
{url}
-
+   diff --git a/mails/en/payment_accepted.html b/mails/en/payment_accepted.html index 97d84f255..b99974481 100644 --- a/mails/en/payment_accepted.html +++ b/mails/en/payment_accepted.html @@ -69,10 +69,10 @@ - + Hi {firstname} {lastname},
{order_header_line_html} -
+ @@ -84,12 +84,12 @@   - +

Order {order_name} - Payment processed

Your payment for order with the reference {order_name} was successfully processed. -
+   @@ -102,18 +102,18 @@ {extra_mail_content_html} - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/payment_error.html b/mails/en/payment_error.html index ba3a129d7..af3d28bb5 100644 --- a/mails/en/payment_error.html +++ b/mails/en/payment_error.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,13 +83,13 @@   - +

Order {order_name} - Payment processing error

There is a problem with your payment for {shop_name} order with the reference {order_name}. Please contact us at your earliest convenience.
-
+   @@ -102,18 +102,18 @@ {extra_mail_content_html} - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/processing.html b/mails/en/processing.html index de01bd0ab..cc1fabbe7 100644 --- a/mails/en/processing.html +++ b/mails/en/processing.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,12 +83,12 @@   - +

Order {order_name} - Processing

We are currently processing your {shop_name} order with the reference {order_name}. -
+   @@ -101,18 +101,18 @@ {extra_mail_content_html} - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/refund.html b/mails/en/refund.html index 5004f8183..b0f59304a 100644 --- a/mails/en/refund.html +++ b/mails/en/refund.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,12 +83,12 @@   - +

Order {order_name} - Refund processed

We have processed your {shop_name} refund for order with the reference {order_name}. -
+   @@ -101,18 +101,18 @@ {extra_mail_content_html} - + You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our website. - + - + If you have a guest account, you can follow your order via the "Guest Tracking" section on our website. - + diff --git a/mails/en/reply_msg.html b/mails/en/reply_msg.html index 7eafe00e4..de24a620d 100644 --- a/mails/en/reply_msg.html +++ b/mails/en/reply_msg.html @@ -80,7 +80,7 @@   - +

Message from {contact_name}


Title: {subject}


diff --git a/mails/en/shipped.html b/mails/en/shipped.html index f0e3c9a5e..815ce0a3b 100644 --- a/mails/en/shipped.html +++ b/mails/en/shipped.html @@ -69,10 +69,10 @@ - + Hi {firstname} {lastname},
Your order has been shipped -
+ @@ -84,13 +84,13 @@   - +

Order {order_name} - Shipped

Your order with the reference {order_name} has been shipped.
Thank you for booking with {shop_name}!
-
+   diff --git a/mails/en/voucher.html b/mails/en/voucher.html index 5be2a4031..471eebe48 100644 --- a/mails/en/voucher.html +++ b/mails/en/voucher.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,14 +83,14 @@   - +

Order {order_name} - Voucher created

A voucher has been created in your name as a result of your order with the reference {order_name}.

Voucher code: {voucher_num} in the amount of {voucher_amount}

Simply copy/paste this code during the payment process for your next order.
-
+   diff --git a/mails/en/voucher_new.html b/mails/en/voucher_new.html index 634666db7..6bc02205d 100644 --- a/mails/en/voucher_new.html +++ b/mails/en/voucher_new.html @@ -69,9 +69,9 @@ - + Hi {firstname} {lastname}, - + @@ -83,13 +83,13 @@   - +

This is to inform you about the creation of a voucher.

Here is the code of your voucher: {voucher_num}

Simply copy/paste this code during the payment process for your next order.
-
+   diff --git a/modules/bankwire/views/templates/mail/mail_template_html.tpl b/modules/bankwire/views/templates/mail/mail_template_html.tpl index 7d1634d33..012591c35 100644 --- a/modules/bankwire/views/templates/mail/mail_template_html.tpl +++ b/modules/bankwire/views/templates/mail/mail_template_html.tpl @@ -25,7 +25,7 @@   - +

{l s='Here are the bank details for your transfer:' mod='bankwire' lang=$lang}

@@ -35,7 +35,7 @@ {l s='Account details:' mod='bankwire' lang=$lang} {$bankwire_details}
{l s='Bank address:' mod='bankwire' lang=$lang} {$bankwire_address} -
+
  diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index 39dfb1639..681f0c98f 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -54,8 +54,6 @@ class Blocknewsletter extends Module $this->tab = 'front_office_features'; $this->need_instance = 0; - $this->controllers = array('verification'); - $this->bootstrap = true; parent::__construct(); diff --git a/modules/blocknewsletter/mails/en/newsletter_conf.html b/modules/blocknewsletter/mails/en/newsletter_conf.html index cff837649..2c5f51f75 100644 --- a/modules/blocknewsletter/mails/en/newsletter_conf.html +++ b/modules/blocknewsletter/mails/en/newsletter_conf.html @@ -68,9 +68,9 @@ - + Hi, - + @@ -82,13 +82,13 @@   - + Thank you for subscribing to our newsletter! If you wish to unsubscribe, please click here. - +   diff --git a/modules/blocknewsletter/mails/en/newsletter_verif.html b/modules/blocknewsletter/mails/en/newsletter_verif.html index 1c55f012e..9ec521952 100644 --- a/modules/blocknewsletter/mails/en/newsletter_verif.html +++ b/modules/blocknewsletter/mails/en/newsletter_verif.html @@ -68,9 +68,9 @@ - + Hi, - + @@ -82,11 +82,11 @@   - + Thank you for subscribing to our newsletter, please confirm your request by clicking here. - +   diff --git a/modules/blocknewsletter/mails/en/newsletter_voucher.html b/modules/blocknewsletter/mails/en/newsletter_voucher.html index 457b8a35e..89cbaa5e7 100644 --- a/modules/blocknewsletter/mails/en/newsletter_voucher.html +++ b/modules/blocknewsletter/mails/en/newsletter_voucher.html @@ -69,9 +69,9 @@ - + Hi, - + @@ -83,7 +83,7 @@   - +

Newsletter subscription

@@ -94,7 +94,7 @@ Please note that the voucher will be valid on your first order. -
+   diff --git a/modules/cheque/views/templates/mail/mail_template_html.tpl b/modules/cheque/views/templates/mail/mail_template_html.tpl index 8b33da90c..607e4fe81 100644 --- a/modules/cheque/views/templates/mail/mail_template_html.tpl +++ b/modules/cheque/views/templates/mail/mail_template_html.tpl @@ -25,7 +25,7 @@   - +

{l s='Here are the bank details for your check:' mod='cheque' lang=$lang}

@@ -34,7 +34,7 @@ {l s='Payable to the order of:' mod='cheque' lang=$lang} {$cheque_name}
{l s='Please mail your check to:' mod='cheque' lang=$lang} {$cheque_address_html} -
+
  diff --git a/modules/dashguestcycle/dashguestcycle.php b/modules/dashguestcycle/dashguestcycle.php index b12d17126..1ea2f9876 100644 --- a/modules/dashguestcycle/dashguestcycle.php +++ b/modules/dashguestcycle/dashguestcycle.php @@ -46,7 +46,7 @@ class DashGuestCycle extends Module public function install() { return (parent::install() - && $this->registerHook('dashboardTop') + && $this->registerHook('actionAdminDashboardKPIListingModifier') && $this->registerHook('dashboardZoneTwo') && $this->registerHook('dashboardData') && $this->registerHook('actionAdminControllerSetMedia') @@ -60,9 +60,120 @@ class DashGuestCycle extends Module } } - public function hookDashboardTop() + public function hookActionAdminDashboardKPIListingModifier(array $params) { - return $this->display(__FILE__, 'dashboard-top.tpl'); + $idHotel = (int)$this->context->cookie->stats_id_hotel; + $kpiValues = $this->getKpiValues($idHotel); + + $kpisData = array( + array( + 'id' => 'box-dgc-arrivals', + 'color' => 'color1', + 'title' => $this->l('Arrivals'), + 'tooltip' => $this->l('The number of arrivals scheduled for today.'), + 'value' => $kpiValues['box-dgc-arrivals'], + ), + array( + 'id' => 'box-dgc-departures', + 'color' => 'color2', + 'title' => $this->l('Departures'), + 'tooltip' => $this->l('The number of departures scheduled for today.'), + 'value' => $kpiValues['box-dgc-departures'], + ), + array( + 'id' => 'box-dgc-new-bookings', + 'color' => 'color3', + 'title' => $this->l('New Bookings'), + 'tooltip' => $this->l('The number of new bookings created today so far.'), + 'value' => $kpiValues['box-dgc-new-bookings'], + ), + array( + 'id' => 'box-dgc-occupied', + 'color' => 'color4', + 'title' => $this->l('Occupied Rooms'), + 'tooltip' => $this->l('The count of rooms currently occupied by guests.'), + 'value' => $kpiValues['box-dgc-occupied'], + ), + array( + 'id' => 'box-dgc-messages', + 'color' => 'color5', + 'title' => $this->l('Guest Messages'), + 'tooltip' => $this->l('The number of new messages received from guests today.'), + 'value' => $kpiValues['box-dgc-messages'], + ), + array( + 'id' => 'box-dgc-cancelled', + 'color' => 'color6', + 'title' => $this->l('Cancelled Bookings'), + 'tooltip' => $this->l('The number of bookings cancelled today so far.'), + 'value' => $kpiValues['box-dgc-cancelled'], + ), + array( + 'id' => 'box-dgc-guests', + 'color' => 'color1', + 'title' => $this->l('Guests (Adults/Children)'), + 'tooltip' => $this->l('The number of adults and children scheduled to stay today.'), + 'value' => $kpiValues['box-dgc-guests'], + ), + ); + + foreach ($kpisData as $data) { + $helper = new HelperKpi(); + $helper->id = $data['id']; + $helper->color = $data['color']; + $helper->title = $data['title']; + $helper->tooltip = $data['tooltip']; + $helper->value = $data['value']; + $params['kpis'][] = $helper; + } + } + + private function getKpiValues($idHotel) + { + $dateToday = date('Y-m-d'); + + if (Configuration::get('PS_DASHBOARD_SIMULATION')) { + $totalArrivals = rand(100, 1000); + $arrived = rand(0, $totalArrivals); + $totalDepartures = rand(100, 1000); + $departed = rand(0, $totalDepartures); + $newBookings = rand(10, 500); + $occupied = rand(10, 500); + $newMessages = rand(0, 20); + $cancelledBookings = rand(0, 20); + $totalAdults = rand(100, 1000); + $children = rand(0, $totalAdults); + } else { + $arrivalsData = AdminStatsController::getArrivalsByDate($dateToday, $idHotel); + $departuresData = AdminStatsController::getDeparturesByDate($dateToday, $idHotel); + $guestsData = AdminStatsController::getGuestsByDate($dateToday, $idHotel); + + $arrived = (int) $arrivalsData['arrived']; + $totalArrivals = (int) $arrivalsData['total_arrivals']; + $departed = (int) $departuresData['departed']; + $totalDepartures = (int) $departuresData['total_departures']; + $newBookings = count(AdminStatsController::getNewBookingsInfoByDate($dateToday, $idHotel)); + $occupied = (int) AdminStatsController::getDistinctRoomBookingsCount( + date('Y-m-d', strtotime('-1 day')), + $dateToday, + $idHotel, + HotelBookingDetail::STATUS_CHECKED_IN + ); + $newMessages = (int) CustomerMessage::getMessagesByDate($dateToday); + $cancelledBookings = (int) AdminStatsController::getCancelledBookingsByDate($dateToday, $idHotel); + $totalAdults = (int) $guestsData['adults']; + $children = (int) $guestsData['children']; + } + + return array( + 'box-dgc-arrivals' => sprintf('%02d', $arrived).'/'.sprintf('%02d', $totalArrivals), + 'box-dgc-departures' => sprintf('%02d', $departed).'/'.sprintf('%02d', $totalDepartures), + 'box-dgc-new-bookings' => sprintf('%02d', $newBookings), + 'box-dgc-occupied' => sprintf('%02d', $occupied), + 'box-dgc-messages' => sprintf('%02d', $newMessages), + 'box-dgc-cancelled' => sprintf('%02d', $cancelledBookings), + 'box-dgc-guests' => sprintf('%02d', $totalAdults).'/'.sprintf('%02d', $children), + ); } public function hookDashboardZoneTwo() @@ -76,37 +187,10 @@ class DashGuestCycle extends Module $dataTable = array(); $dateToday = date('Y-m-d'); - if (Configuration::get('PS_DASHBOARD_SIMULATION')) { - $dataValue['dgc_total_arrivals'] = sprintf('%02d', rand(100, 1000)); - $dataValue['dgc_arrived'] = sprintf('%02d', rand(0, $dataValue['dgc_total_arrivals'])); - $dataValue['dgc_total_departures'] = sprintf('%02d', rand(100, 1000)); - $dataValue['dgc_departed'] = sprintf('%02d', rand(0, $dataValue['dgc_total_departures'])); - $dataValue['dgc_new_bookings'] = sprintf('%02d', rand(10, 500)); - $dataValue['dgc_occupied'] = sprintf('%02d', rand(10, 500)); - $dataValue['dgc_new_messages'] = sprintf('%02d', rand(0, 20)); - $dataValue['dgc_cancelled_bookings'] = sprintf('%02d', rand(0, 20)); - $dataValue['dgc_guests_adults'] = sprintf('%02d', rand(100, 1000)); - $dataValue['dgc_guests_children'] = sprintf('%02d', rand(0, $dataValue['dgc_guests_adults'])); - } else { - // set badges data - $arrivalsData = AdminStatsController::getArrivalsByDate($dateToday, $params['id_hotel']); - $departuresData = AdminStatsController::getDeparturesByDate($dateToday, $params['id_hotel']); - $guestsData = AdminStatsController::getGuestsByDate($dateToday, $params['id_hotel']); - $dataValue['dgc_arrived'] = sprintf('%02d', $arrivalsData['arrived']); - $dataValue['dgc_total_arrivals'] = sprintf('%02d', $arrivalsData['total_arrivals']); - $dataValue['dgc_departed'] = sprintf('%02d', $departuresData['departed']); - $dataValue['dgc_total_departures'] = sprintf('%02d', $departuresData['total_departures']); - $dataValue['dgc_new_bookings'] = sprintf('%02d', count(AdminStatsController::getNewBookingsInfoByDate($dateToday, $params['id_hotel']))); - $dataValue['dgc_occupied'] = sprintf('%02d', AdminStatsController::getDistinctRoomBookingsCount( - date('Y-m-d', strtotime('-1 day')), - $dateToday, - $params['id_hotel'], - HotelBookingDetail::STATUS_CHECKED_IN - )); - $dataValue['dgc_new_messages'] = sprintf('%02d', CustomerMessage::getMessagesByDate($dateToday)); - $dataValue['dgc_cancelled_bookings'] = sprintf('%02d', AdminStatsController::getCancelledBookingsByDate($dateToday, $params['id_hotel'])); - $dataValue['dgc_guests_adults'] = sprintf('%02d', $guestsData['adults']); - $dataValue['dgc_guests_children'] = sprintf('%02d', $guestsData['children']); + + // KPI box values — updated on every AJAX refresh (demo toggle, date change) + foreach ($this->getKpiValues((int) $params['id_hotel']) as $boxId => $value) { + $dataValue[$boxId . ' .value'] = $value; } // set tables data diff --git a/modules/dashguestcycle/views/css/dashguestcycle.css b/modules/dashguestcycle/views/css/dashguestcycle.css index 0f8e7ca14..7fd58544d 100644 --- a/modules/dashguestcycle/views/css/dashguestcycle.css +++ b/modules/dashguestcycle/views/css/dashguestcycle.css @@ -20,76 +20,6 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 */ -#dashguestcycle { - padding-bottom: 5px; -} - -#dashguestcycle .badges-wrapper { - white-space: nowrap; - overflow: auto; - margin: -5px; - margin-bottom: 0px; - padding-bottom: 10px; - font-size: 0; -} - -#dashguestcycle .badge-wrapper { - display: inline-block; - width: 14.28%; - min-width: 145px; - padding: 5px; -} - -#dashguestcycle .badge-item { - position: relative; - min-width: 135px; - height: 80px; - border-radius: 10px; - background: #FFFFFF; - box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.15); -} - -#dashguestcycle .badge-strip { - position: absolute; - width: 10px; - height: 100%; - border-top-left-radius: 10px; - border-bottom-left-radius: 10px; -} - -#dashguestcycle .badge-content-wrapper { - height: 100%; -} - -#dashguestcycle .badge-content-wrapper p { - color: #00AFF0; - margin-bottom: 0; -} - -#dashguestcycle .title-wrapper, #dashguestcycle .value-wrapper { - display: table; - width: 100%; - height: 50%; - padding: 0 10px; -} - -#dashguestcycle .title-wrapper p { - display: table-cell; - vertical-align: middle; - font-weight: normal; - font-size: 13px; - line-height: 15px; - white-space: normal; -} - -#dashguestcycle .value-wrapper p { - display: table-cell; - vertical-align: top; - font-weight: bold; - font-size: 24px; - line-height: 30px; -} - #dashguestcycle .tab-content { max-height: 300px; overflow-y: auto; @@ -97,4 +27,107 @@ #dashguestcycle table tbody>tr>td { padding: 8px 7px; +} + +/* ── KPI row container: strip panel chrome ──────────────────────────────── */ +.kpi-container { + background: transparent !important; + border: none !important; + box-shadow: none !important; + padding: 0 0 15px !important; +} + +.kpi-container .kpis-wrap { + flex-wrap: nowrap !important; + overflow-x: auto; + gap: 8px; + margin: 0 !important; +} + +.kpi-container .kpis-wrap .kpi-wrap { + width: 14.28% !important; + min-width: 110px; + padding: 0 !important; + margin-bottom: 0 !important; +} + +.kpi-container .box-stats { + height: 80px !important; + background: #fff !important; + border-radius: 10px !important; + overflow: hidden; + font-size: inherit !important; +} + +.kpi-container .box-stats .kpi-content { + border: none !important; + border-left: 10px solid !important; + border-radius: 0 !important; + height: 100% !important; + padding: 8px 12px !important; + align-items: center !important; + gap: 0 !important; +} + +.kpi-container .box-stats .kpi-content .kpi-data { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + gap: 4px; +} + +.kpi-container .box-stats .kpi-content .title-subtitle { + justify-content: center !important; + width: 100%; +} + +.kpi-container .box-stats .kpi-content .title-subtitle .title-container .title { + font-size: 13px !important; + font-weight: normal !important; + color: #555 !important; + display: block; + text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.kpi-container .box-stats .kpi-content .value-container { + width: 100%; + text-align: center; +} + +.kpi-container .box-stats .kpi-content .value-container .value { + font-size: 24px !important; + font-weight: bold !important; + min-height: auto !important; + display: block; + text-align: center; +} + +.kpi-container .box-stats .kpi-content .arrow { + display: none !important; +} + +.kpi-container .box-stats.color1 .kpi-content { border-left-color: #266FFE !important; } +.kpi-container .box-stats.color1 .value { color: #266FFE !important; } + +.kpi-container .box-stats.color2 .kpi-content { border-left-color: #72C3F0 !important; } +.kpi-container .box-stats.color2 .value { color: #72C3F0 !important; } + +.kpi-container .box-stats.color3 .kpi-content { border-left-color: #56CE56 !important; } +.kpi-container .box-stats.color3 .value { color: #56CE56 !important; } + +.kpi-container .box-stats.color4 .kpi-content { border-left-color: #FFC148 !important; } +.kpi-container .box-stats.color4 .value { color: #FFC148 !important; } + +.kpi-container .box-stats.color5 .kpi-content { border-left-color: #A569DF !important; } +.kpi-container .box-stats.color5 .value { color: #A569DF !important; } + +.kpi-container .box-stats.color6 .kpi-content { border-left-color: #FF4036 !important; } +.kpi-container .box-stats.color6 .value { color: #FF4036 !important; } + +.kpi-container .actions-wrap { + display: none !important; } \ No newline at end of file diff --git a/modules/dashguestcycle/views/templates/hook/dashboard-top.tpl b/modules/dashguestcycle/views/templates/hook/dashboard-top.tpl deleted file mode 100644 index 1d904e3b9..000000000 --- a/modules/dashguestcycle/views/templates/hook/dashboard-top.tpl +++ /dev/null @@ -1,143 +0,0 @@ -{** -* NOTICE OF LICENSE -* -* This source file is subject to the Open Software License version 3.0 -* that is bundled with this package in the file LICENSE.md -* It is also available through the world-wide-web at this URL: -* https://opensource.org/license/osl-3-0-php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to support@qloapps.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade this module to a newer -* versions in the future. If you wish to customize this module for your needs -* please refer to https://store.webkul.com/customisation-guidelines for more information. -* -* @author Webkul IN -* @copyright Since 2010 Webkul -* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 -*} - -
-
-
-
- {hook h="displayDashboardBadgeListBefore"} -
-
-
-
-
-

{l s="Arrivals" mod='dashguestcycle'}

-
-
-

- / -

-
-
-
-
-
-
-
-
-
-

{l s="Departures" mod='dashguestcycle'}

-
-
-

- / -

-
-
-
-
-
-
-
-
-
-

{l s="New Bookings" mod='dashguestcycle'}

-
-
-

- -

-
-
-
-
-
-
-
-
-
-

{l s='Occupied Rooms' mod='dashguestcycle'}

-
-
-

- -

-
-
-
-
-
-
-
-
-
-

- {l s="Guest Messages" mod='dashguestcycle'} -

-
-
-

- -

-
-
-
-
-
-
-
-
-
-

- {l s="Cancelled Bookings" mod='dashguestcycle'} -

-
-
-

- -

-
-
-
-
-
-
-
-
-
-

- {l s="Guests (Adults/Children)" mod='dashguestcycle'} -

-
-
-

- / -

-
-
-
-
- {hook h="displayDashboardBadgeListAfter"} -
-
-
-
diff --git a/modules/hotelreservationsystem/classes/HotelBranchInformation.php b/modules/hotelreservationsystem/classes/HotelBranchInformation.php index ba0046321..df821c092 100644 --- a/modules/hotelreservationsystem/classes/HotelBranchInformation.php +++ b/modules/hotelreservationsystem/classes/HotelBranchInformation.php @@ -53,7 +53,7 @@ class HotelBranchInformation extends ObjectModel 'id_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'email' => array('type' => self::TYPE_STRING,'validate' => 'isEmail', 'size' => 255, 'required' => true), 'id_property_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), - 'rating' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), + 'rating' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'check_in' => array('type' => self::TYPE_STRING, 'required' => true), 'check_out' => array('type' => self::TYPE_STRING, 'required' => true), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), @@ -1162,7 +1162,7 @@ class HotelBranchInformation extends ObjectModel { // set additional hotel address and restriction fields validations here if (isset($this->webservice_validation) && $this->webservice_validation) { - if ($this->rating < 1 || $this->rating > 5) { + if ($this->rating && ($this->rating < 1 || $this->rating > 5)) { $message = Tools::displayError('Rating must be between 1 and 5.'); } elseif (!strtotime($this->check_in)) { $message = Tools::displayError('Check In time is invalid.'); diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index e62da10fd..087d5b44f 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -1331,6 +1331,7 @@ class HotelCartBookingData extends ObjectModel ); $cart_detail_data[$key]['amt_with_qty'] = $roomTypeDateRangePrice['total_price_tax_excl']; + $cart_detail_data[$key]['connected_rooms'] = HotelConnectedRoom::getConnectedRooms((int) $obj_htl_room_info->id, null, null, Context::getContext()->language->id); } } if ($cart_detail_data) { diff --git a/modules/hotelreservationsystem/classes/HotelConnectedRoom.php b/modules/hotelreservationsystem/classes/HotelConnectedRoom.php new file mode 100644 index 000000000..f1142d51d --- /dev/null +++ b/modules/hotelreservationsystem/classes/HotelConnectedRoom.php @@ -0,0 +1,180 @@ + 'htl_connected_room', + 'primary' => 'id_connected_room', + 'fields' => array( + 'id_room' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), + 'id_room_connected' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), + 'date_add' => array('type' => self::TYPE_DATE), + 'date_upd' => array('type' => self::TYPE_DATE), + ), + ); + + public static function getConnectedRooms($idRoom = null, $idRoomType = null, $idHotel = null, $idLang = null) + { + $idLang = $idLang ? (int) $idLang : (int) Context::getContext()->language->id; + + $sql = 'SELECT + hcr.id_connected_room, + hcr.id_room, + base_room.room_num AS room_name, + connected_room.id AS id_room_connected, + connected_room.id_product AS id_room_type, + conn_pl.name AS room_type_name, + connected_room.room_num AS connected_room_name + FROM `' . _DB_PREFIX_ . 'htl_connected_room` hcr + INNER JOIN `' . _DB_PREFIX_ . 'htl_room_information` connected_room + ON connected_room.id = hcr.id_room_connected + INNER JOIN `' . _DB_PREFIX_ . 'htl_room_information` base_room + ON base_room.id = hcr.id_room + LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` conn_pl + ON (conn_pl.id_product = connected_room.id_product AND conn_pl.id_lang = ' . $idLang . ') + WHERE 1'; + + if ($idRoom !== null) { + $sql .= ' AND hcr.id_room = ' . $idRoom; + } + if ($idRoomType !== null) { + $sql .= ' AND base_room.id_product = ' . (int) $idRoomType; + } + if ($idHotel !== null) { + $sql .= ' AND base_room.id_hotel = ' . (int) $idHotel; + } + + $sql .= ' ORDER BY hcr.id_room, connected_room.id_product, connected_room.room_num'; + + $results = Db::getInstance()->executeS($sql); + if ($results === false) { + return array(); + } + + $connectedRooms = array(); + foreach ($results as $row) { + $roomId = (int) $row['id_room']; + $roomTypeId = (int) $row['id_room_type']; + + if (!isset($connectedRooms[$roomId])) { + $connectedRooms[$roomId] = array( + 'name' => $row['room_name'], + 'connected_room_types' => array(), + ); + } + + if (!isset($connectedRooms[$roomId]['connected_room_types'][$roomTypeId])) { + $connectedRooms[$roomId]['connected_room_types'][$roomTypeId] = array( + 'room_type_name' => $row['room_type_name'], + 'connected_rooms' => array(), + ); + } + + $connectedRooms[$roomId]['connected_room_types'][$roomTypeId]['connected_rooms'][] = array( + 'id_connected_room' => (int) $row['id_connected_room'], + 'id_room' => (int) $row['id_room_connected'], + 'name' => $row['connected_room_name'], + ); + } + + return $connectedRooms; + } + + public static function getNotConnectedRooms($idRoom, $idLang = null) + { + $idRoom = (int) $idRoom; + if ($idRoom <= 0) { + return array(); + } + $idLang = $idLang ? (int) $idLang : (int) Context::getContext()->language->id; + + $sql = 'SELECT hri.id AS id_room, hri.id_product AS id_room_type, pl.name AS room_type_name, hri.room_num AS room_name + FROM `' . _DB_PREFIX_ . 'htl_room_information` hri + LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl + ON (pl.id_product = hri.id_product AND pl.id_lang = ' . $idLang . ') + WHERE hri.id != ' . $idRoom . ' + AND hri.id_hotel = ( + SELECT id_hotel FROM `' . _DB_PREFIX_ . 'htl_room_information` WHERE id = ' . $idRoom . ' + ) + AND NOT EXISTS ( + SELECT 1 FROM `' . _DB_PREFIX_ . 'htl_connected_room` cr + WHERE cr.id_room = ' . $idRoom . ' AND cr.id_room_connected = hri.id + ) + ORDER BY pl.name ASC, hri.room_num ASC'; + + $results = Db::getInstance()->executeS($sql); + + $grouped = array(); + foreach ($results as $row) { + $typeId = (int) $row['id_room_type']; + if (!isset($grouped[$typeId])) { + $grouped[$typeId] = array( + 'id_room_type' => $typeId, + 'name' => $row['room_type_name'], + 'rooms' => array(), + ); + } + $grouped[$typeId]['rooms'][] = array( + 'id_room' => (int) $row['id_room'], + 'name' => $row['room_name'], + ); + } + return $grouped; + } + + public static function getTotalConnectedRooms($idRoom = 0, $idRoomConnected = 0) + { + $idRoom = (int) $idRoom; + $idRoomConnected = (int) $idRoomConnected; + + if ($idRoom <= 0 && $idRoomConnected > 0) { + $sql = 'SELECT DISTINCT id_room + FROM `' . _DB_PREFIX_ . 'htl_connected_room` + WHERE id_room_connected = ' . $idRoomConnected; + + $results = Db::getInstance()->executeS($sql); + if ($results === false) { + return array(); + } + return array_column($results, 'id_room'); + } + + $sql = 'SELECT COUNT(*) FROM `' . _DB_PREFIX_ . 'htl_connected_room` hcr + INNER JOIN `' . _DB_PREFIX_ . 'htl_room_information` hri + ON hri.id = hcr.id_room_connected + WHERE hcr.id_room = ' . $idRoom; + + return (int) Db::getInstance()->getValue($sql); + } + +} diff --git a/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php b/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php index bc5372a90..5ce9d376d 100644 --- a/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php +++ b/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php @@ -262,7 +262,7 @@ class HotelOrderRefundRules extends ObjectModel ON (horr.`id_refund_rule` = hbrr.`id_refund_rule`) LEFT JOIN `'._DB_PREFIX_.'htl_order_refund_rules_lang` horrl ON (horrl.`id_refund_rule` = horr.`id_refund_rule` AND horrl.`id_lang` = '.(int) $idLang.') - LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd + INNER JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (hbd.`id_hotel` = hbrr.`id_hotel` AND hbd.`id_order` = '.(int) $idOrder.') WHERE horr.`days` <= '.(int) $days.' GROUP BY hbrr.`id_refund_rule` diff --git a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php index 5d754acad..c6bcf2899 100644 --- a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php +++ b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php @@ -568,6 +568,17 @@ class HotelReservationSystemDb SELECT 5, `id_lang`, 'Hotel Amenities Block', 'Configure Hotels Amenities settings. You can display hotel amenities images using this block. This block will be displayed on home page.' FROM `"._DB_PREFIX_."lang` ORDER BY `id_lang`;", + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_connected_room` ( + `id_connected_room` int(11) NOT NULL AUTO_INCREMENT, + `id_room` int(11) NOT NULL, + `id_room_connected` int(11) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_connected_room`), + UNIQUE KEY `uniq_room_connection` (`id_room`, `id_room_connected`), + KEY `idx_id_room` (`id_room`), + KEY `idx_id_room_connected` (`id_room_connected`) + ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;", ); } @@ -633,7 +644,8 @@ class HotelReservationSystemDb `'._DB_PREFIX_.'htl_property_type_lang`, `'._DB_PREFIX_.'htl_access`, `'._DB_PREFIX_.'htl_settings_link`, - `'._DB_PREFIX_.'htl_settings_link_lang`' + `'._DB_PREFIX_.'htl_settings_link_lang`, + `'._DB_PREFIX_.'htl_connected_room`' ); } } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 67dc5b574..0b2afba1f 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -407,10 +407,6 @@ class AdminAddHotelController extends ModuleAdminController $this->errors[] = $this->l('Check Out time must be before Check In time.'); } - if (!$rating) { - $this->errors[] = $this->l('Rating is required field.'); - } - if (!$address = trim($address)) { $this->errors[] = $this->l('Address is required field.'); } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index de6c2ee98..f45cfde25 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -386,6 +386,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController 'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'), 'link' => $this->context->link, 'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL, + 'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms(null, null, $this->id_hotel, $this->context->language->id), )); if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) { @@ -1036,6 +1037,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController // add fullcalender plugin $this->addJqueryUI('ui.tooltip', 'base', true); $this->removeJS(Media::getJqueryUIPath('effects.core', 'base', false), false); + $this->addCSS(array(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css')); $this->addCSS(_PS_JS_DIR_.'fullcalendar/main.css'); $this->addJs(_PS_JS_DIR_.'fullcalendar/main.js'); diff --git a/modules/hotelreservationsystem/define.php b/modules/hotelreservationsystem/define.php index c5e7b3df7..7e1a388d5 100644 --- a/modules/hotelreservationsystem/define.php +++ b/modules/hotelreservationsystem/define.php @@ -50,6 +50,7 @@ require_once 'classes/HotelBranchRefundRules.php'; require_once 'classes/HotelBedType.php'; require_once 'classes/HotelRoomTypeBedType.php'; require_once 'classes/HotelPropertyType.php'; +require_once 'classes/HotelConnectedRoom.php'; // linked products require_once 'classes/RoomTypeServiceProduct.php'; diff --git a/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css b/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css index a207087a6..e3b6077b2 100644 --- a/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css +++ b/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css @@ -577,36 +577,6 @@ p.room_cat_data .fc-today-button:disabled { display: none; } -/* book now page tooltip */ -.tooltip_cont { - min-width: 280px; - width: 100%; - font-size: 14px; - font-weight: 600; - /* display: grid; */ -} -.tooltip_cont .tip_header { - margin-bottom: 10px; -} -.tooltip_cont .tip-body > div { - margin-bottom: 6px; -} -.tip_element_head { - font-size: 12px; -} -.tip_element_value { - font-size: 16px; - opacity: 0.6; -} -.tip-body { - display: grid; - grid-template-columns: auto auto; -} -body.adminhotelroomsbooking .ui-tooltip { - border: unset; - padding: 10px; - box-shadow: 0px 0px 15px 0px #00000026; -} #room-reallocation-modal .modal-footer { padding: 15px 0px 0px 0px diff --git a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl index 39906ccf0..81d2c91f5 100644 --- a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl @@ -233,11 +233,11 @@
- +
'; }, + validateFiles: function () { + $('#review-general-errors').hide(); + let isValid = true; + $('.images-field input.input-images').each(function (iInput, input) { + let files = input.files; + let dataTransfer = new DataTransfer(); + $.each(files, function (iFile, file) { + if (file.type.startsWith('image/')) { + dataTransfer.items.add(file); + } else { + isValid = false; + } + }); + input.files = dataTransfer.files; + if (!input.files.length) { + $(input).remove(); + } + }); + if (!isValid) { + QhrReviewForm.showGeneralErrors(qlo_hotel_review_js_vars.texts.allowed_extensions); + } + return isValid; + }, getFilesCount: function() { var count = 0; $('.images-field input.input-images').each(function(i, input) { @@ -156,6 +179,9 @@ var QhrReviewImages = { } }); input.files = dataTransfer.files; + if (input.files.length === 0) { + $(input).remove(); + } }, resetPreviews: function() { $('.previews-wrap').html(''); @@ -241,8 +267,9 @@ $(document).on('change', 'input.input-images', function(e) { var filesCount = QhrReviewImages.getFilesCount(); if (filesCount > qlo_hotel_review_js_vars.num_images_max) { QhrReviewImages.removeLastInput(); - alert(qlo_hotel_review_js_vars.texts.num_files); + QhrReviewForm.showGeneralErrors(qlo_hotel_review_js_vars.texts.num_files); } else { + QhrReviewImages.validateFiles(); QhrReviewImages.updatePreviews(); if (filesCount == qlo_hotel_review_js_vars.num_images_max) { diff --git a/modules/qlohotelreview/views/templates/hook/add-review-popup.tpl b/modules/qlohotelreview/views/templates/hook/add-review-popup.tpl index a838127d8..1ba6f6936 100644 --- a/modules/qlohotelreview/views/templates/hook/add-review-popup.tpl +++ b/modules/qlohotelreview/views/templates/hook/add-review-popup.tpl @@ -40,6 +40,7 @@
+

{l s='Allowed formats are: .jpg, .jpeg, .png' mod='qlohotelreview'}

diff --git a/modules/wkfooterlangcurrencyblock/config.xml b/modules/wkfooterlangcurrencyblock/config.xml deleted file mode 100644 index 83e560e71..000000000 --- a/modules/wkfooterlangcurrencyblock/config.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - wkfooterlangcurrencyblock - - - - - - 0 - 0 - - \ No newline at end of file diff --git a/pdf/booking-voucher.tpl b/pdf/booking-voucher.tpl new file mode 100644 index 000000000..15cfe229e --- /dev/null +++ b/pdf/booking-voucher.tpl @@ -0,0 +1,339 @@ +{** +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + +{assign var=pdf_style_template value=$smarty.const._PS_PDF_DIR_|cat:'invoice.style-tab.tpl'} +{include file=$pdf_style_template} + + + + + + + + + + + + + + {* *} + + + + + + + + + + + + {if $service_groups} + + + + + + + {/if} + +
+ + + + + + + + + + + + + + + + + + + + + + +
{l s='BOOKING INFORMATION' pdf='true'}
{l s='Booking Reference' pdf='true'}{$order->reference|escape:'html':'UTF-8'}{l s='Booking Date' pdf='true'}{$booking_date|escape:'html':'UTF-8'}{l s='Voucher Issue Date' pdf='true'}{$issue_date|escape:'html':'UTF-8'}
{l s='Status' pdf='true'}{if $order_state && isset($order_state.name)}{$order_state.name|escape:'html':'UTF-8'}{/if}{l s='Total Rooms' pdf='true'}{$total_rooms|intval}{l s='Total Nights' pdf='true'}{$total_room_nights|intval}
+
 
+ + + + + + + + + + + + + + + + + + + + + + +
{l s='PROPERTY DETAILS' pdf='true'}
{l s='Property' pdf='true'}{if $hotel}{$hotel->hotel_name|escape:'html':'UTF-8'}{/if}
{l s='Email' pdf='true'}{if $hotel}{$hotel->email|escape:'html':'UTF-8'}{/if}
{l s='Phone' pdf='true'}{if $hotel}{$hotel->phone|escape:'html':'UTF-8'}{/if}
{l s='Address' pdf='true'}{if $hotel_address}{$hotel_address nofilter}{else}--{/if}
+
  + + + + + + + + + + + + + + + + + + + + + + + + + + +
{l s='GUEST INFORMATION' pdf='true'}
{l s='Primary Guest' pdf='true'}{$guest->firstname|escape:'html':'UTF-8'} {$guest->lastname|escape:'html':'UTF-8'}
{l s='Email' pdf='true'}{$guest->email|escape:'html':'UTF-8'}
{l s='Phone' pdf='true'}{$guest->phone|escape:'html':'UTF-8'}
{l s='Address' pdf='true'}{if $guest_address|strip_tags|trim}{$guest_address nofilter}{else}--{/if}
{l s='Total Guests' pdf='true'}{$total_guests|intval}
+
 
+ + + + + + + + + + + + + + + + + {if $room_type_rows} + {foreach from=$room_type_rows item=room_type_row} + {cycle values="color_line_even,color_line_odd" assign=bgcolor_class} + + + + + + + + + + {/foreach} + {else} + + + + {/if} + +
{l s='ROOM DETAILS' pdf='true'}
{l s='Room Description' pdf='true'}{l s='Tax Rate(s)' pdf='true'}{l s='Unit Price' pdf='true'}
{l s='(Tax excl.)' pdf='true'}
{l s='Rooms' pdf='true'}{l s='Check-in Date' pdf='true'}{l s='Check-out Date' pdf='true'}{l s='Total' pdf='true'}
{l s='(Tax excl.)' pdf='true'}
{$room_type_row.room_type_name|escape:'html':'UTF-8'}{$room_type_row.order_detail_tax_label}{displayPrice currency=$order->id_currency price=$room_type_row.unit_price_tax_excl} + {if $room_type_row.adults <= 9}0{/if}{$room_type_row.adults|intval} {if $room_type_row.adults > 1}{l s='Adults' pdf='true'}{else}{l s='Adult' pdf='true'}{/if}{if $room_type_row.children}, {if $room_type_row.children <= 9}0{/if}{$room_type_row.children|intval} {if $room_type_row.children > 1}{l s='Children' pdf='true'}{else}{l s='Child' pdf='true'}{/if}{/if}
{if $room_type_row.rooms <= 9}0{/if}{$room_type_row.rooms|intval} {if $room_type_row.rooms > 1}{l s='Rooms' pdf='true'}{else}{l s='Room' pdf='true'}{/if} +
{$room_type_row.check_in_date|escape:'html':'UTF-8'}{$room_type_row.check_out_date|escape:'html':'UTF-8'}{displayPrice currency=$order->id_currency price=$room_type_row.total_price_tax_excl}
{l s='No room details available.' pdf='true'}
+
 
+ + + + + + + + + + + {foreach from=$service_groups item=group} + {foreach from=$group.services item=service name=service_loop} + + {if $smarty.foreach.service_loop.first} + + {/if} + + + + {/foreach} + {/foreach} + +
{l s='SERVICES DETAILS' pdf='true'}
{l s='Room Type' pdf='true'}{l s='Service Name' pdf='true'}{l s='Qty' pdf='true'}
{$group.room_type_name|escape:'html':'UTF-8'}
+ {$group.check_in_date|escape:'html':'UTF-8'} - {$group.check_out_date|escape:'html':'UTF-8'}
+ {l s='Room' pdf='true'} - {$group.room_count|intval} +
{$service.name|escape:'html':'UTF-8'}{$service.quantity|intval}
+
+ +
 
+ + + + + + +
+ + + + + + + + + + + + + + +
{l s='PAYMENT INFORMATION' pdf='true'}
{l s='Payment Method' pdf='true'}{$payment_method nofilter}
{l s='Payment Status' pdf='true'}{if $order_state && isset($order_state.name)}{$order_state.name|escape:'html':'UTF-8'}{/if}
+
+ + + + + + {if isset($footer.room_price_tax_excl) && $footer.room_price_tax_excl} + + + + + {/if} + {if isset($footer.service_products_price_tax_excl) && $footer.service_products_price_tax_excl} + + + + + {/if} + {if isset($footer.additional_service_price_tax_excl) && $footer.additional_service_price_tax_excl} + + + + + {/if} + {if isset($footer.total_convenience_fee_te) && $footer.total_convenience_fee_te} + + + + + {/if} + + + + + {if $footer.total_tax_without_discount > 0} + + + + + {/if} + {if isset($footer.product_discounts_tax_incl) && $footer.product_discounts_tax_incl > 0} + + + + + {/if} + + + + + {if $footer.amount_due > 0} + + + + + {/if} + +
{l s='TOTAL AMOUNT' pdf='true'}
{l s='Total Rooms Cost (tax excl.)' pdf='true'}{displayPrice currency=$order->id_currency price=$footer.room_price_tax_excl}
{l s='Total Products cost (tax excl.)' pdf='true'}{displayPrice currency=$order->id_currency price=$footer.service_products_price_tax_excl}
{l s='Extra Services Cost (tax excl.)' pdf='true'}{displayPrice currency=$order->id_currency price=$footer.additional_service_price_tax_excl}
{l s='Convenience Fee (tax excl.)' pdf='true'}{displayPrice currency=$order->id_currency price=$footer.total_convenience_fee_te}
{l s='Total (Tax excl.)' pdf='true'}{displayPrice currency=$order->id_currency price=$footer.total_without_discount_te}
{l s='Total Tax' pdf='true'}{displayPrice currency=$order->id_currency price=$footer.total_tax_without_discount}
{l s='Total Discounts' pdf='true'}- {displayPrice currency=$order->id_currency price=$footer.product_discounts_tax_incl}
{l s='Final Booking Amount' pdf='true'}{displayPrice currency=$order->id_currency price=$footer.total_paid_tax_incl}
{l s='Due Amount' pdf='true'}{displayPrice currency=$order->id_currency price=$footer.amount_due}
+
+ +{if $cancellation_policy} +
 
+ + + + + + + + + +
{l s='CANCELLATION POLICY' pdf='true'}
{$cancellation_policy nofilter}
+{/if} + +
 
+ + + + + + + + + + + + + +
{l s='PROPERTY POLICIES' pdf='true'}
+ {l s='Check-in Time:' pdf='true'} + {if $hotel && $hotel->check_in && $hotel->check_in != '00:00:00'}{$hotel->check_in|escape:'html':'UTF-8'}{else}__________{/if} +            + {l s='Check-out Time:' pdf='true'} + {if $hotel && $hotel->check_out && $hotel->check_out != '00:00:00'}{$hotel->check_out|escape:'html':'UTF-8'}{else}__________{/if} +
+ {l s='Hotel Policies:' pdf='true'}
+
+ {if isset($payment_policy) && $payment_policy|strip_tags|trim} + {$payment_policy nofilter} + {else} + ______________________________
+ ______________________________
+ ______________________________ + {/if} +
+ +{if isset($HOOK_DISPLAY_PDF) && $HOOK_DISPLAY_PDF|strip_tags|trim} +
 
+ + + + +
{$HOOK_DISPLAY_PDF}
+{/if} diff --git a/pdf/invoice.extra-demands-tab.tpl b/pdf/invoice.extra-demands-tab.tpl index 69c4d6b3d..d2a24c11e 100644 --- a/pdf/invoice.extra-demands-tab.tpl +++ b/pdf/invoice.extra-demands-tab.tpl @@ -114,8 +114,8 @@ {/foreach} {/if} + {assign var=roomCount value=$roomCount+1} {/foreach} - {assign var=roomCount value=$roomCount+1} diff --git a/pdf/payment-receipt.addresses-tab.tpl b/pdf/payment-receipt.addresses-tab.tpl new file mode 100644 index 000000000..2ca023cbe --- /dev/null +++ b/pdf/payment-receipt.addresses-tab.tpl @@ -0,0 +1,49 @@ +{* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + + + + + + + + +
+ {if !empty($hotel_address)} + {l s='Hotel Detail' pdf='true'}

+ {$hotel_address} + {/if} +
+ {l s='Customer Detail' pdf='true'}

+ {if $invoice_address} + {$invoice_address} + {else} + {$customer->firstname} {$customer->lastname} +
+ {$customer->phone} + {/if} +
\ No newline at end of file diff --git a/pdf/payment-receipt.payment-info-tab.tpl b/pdf/payment-receipt.payment-info-tab.tpl new file mode 100644 index 000000000..048dd3171 --- /dev/null +++ b/pdf/payment-receipt.payment-info-tab.tpl @@ -0,0 +1,50 @@ +{* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + +{if isset($payment_list) && $payment_list} + + + + + + + + + + + + + + + {foreach from=$payment_list key=rm_k item=payment} + {cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class} + + + + + + + + {/foreach} + +
{l s='Payment Details' pdf='true'}
{l s='Payment Method' pdf='true'}{l s='Payment Type' pdf='true'}{l s='Transaction ID' pdf='true'}{l s='Amount' pdf='true'}{l s='Payment Date' pdf='true'}
{$payment->payment_method|default:'-'}{$payment->payment_type.name|default:'-'}{$payment->transaction_id|default:'-'}{displayPrice currency=$payment->id_currency price=$payment->amount}{dateFormat date=$payment->date_add full=true}
+{/if} \ No newline at end of file diff --git a/pdf/payment-receipt.style-tab.tpl b/pdf/payment-receipt.style-tab.tpl new file mode 100644 index 000000000..e6fb20ae7 --- /dev/null +++ b/pdf/payment-receipt.style-tab.tpl @@ -0,0 +1,200 @@ +{* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + +{assign var=color_header value="#F0F0F0"} +{assign var=color_border value="#000000"} +{assign var=color_border_lighter value="#CCCCCC"} +{assign var=color_line_even value="#FFFFFF"} +{assign var=color_line_odd value="#F9F9F9"} +{assign var=font_size_text value="9pt"} +{assign var=font_size_header value="9pt"} +{assign var=font_size_product value="9pt"} +{assign var=height_header value="20px"} +{assign var=table_padding value="4px"} + + diff --git a/pdf/payment-receipt.tpl b/pdf/payment-receipt.tpl new file mode 100644 index 000000000..a0a0141d3 --- /dev/null +++ b/pdf/payment-receipt.tpl @@ -0,0 +1,76 @@ +{* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + +{$style_tab} + + + + + + + + + + + + + + + + + + + + + + + + + {if isset($HOOK_DISPLAY_PDF)} + + + + + + + + {/if} + +
+ + {$addresses_tab} + +
 
+ {$payment_info_tab} +
 
+ + + + + +
+

{$legal_free_text|escape:'html':'UTF-8'|nl2br}

+
+ +
 
+ {$HOOK_DISPLAY_PDF} +
diff --git a/themes/debug.tpl b/themes/debug.tpl index 87fef347d..ebe7b79f4 100644 --- a/themes/debug.tpl +++ b/themes/debug.tpl @@ -103,6 +103,10 @@ font-style: italic; } + .template-name { + color: brown; + } + #table_assigned_vars th { color: blue; } @@ -123,7 +127,7 @@

included templates & config files (load time in seconds)

{foreach $template_data as $template} - {$template.name} + {$template.name} (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"} ) diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index 682198561..4ddc47a2e 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -148,6 +148,16 @@
+
+
{l s='Booking Voucher'}
+ +
+
{l s='Status'}
@@ -647,6 +657,16 @@
+
+
{l s='Booking Voucher'}
+ +
+
{l s='Status'}