Merge branch 'develop' into gli-2066

This commit is contained in:
vishalsingh.qlo325
2024-05-27 13:21:39 +05:30
38 changed files with 274 additions and 173 deletions

View File

@@ -60,22 +60,39 @@ $exclude_packs = (bool)Tools::getValue('exclude_packs', true);
$bookingProduct = (int) Tools::getValue('booking_product');
$idHotel = (int) Tools::getValue('id_hotel');
$context = Context::getContext();
$sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`
FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product AND pl.id_lang = '.(int)$context->language->id.Shop::addSqlRestrictionOnLang('pl').')
$sqlSelect = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`';
$sqlFrom = ' FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p');
$sqlJoin =' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.`id_lang` = '.(int) $context->language->id.Shop::addSqlRestrictionOnLang('pl').')
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.')
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$context->language->id.')
WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\')'.
ON (image_shop.`id_product` = p.`id_product` AND image_shop.`cover`=1 AND image_shop.`id_shop`='.(int) $context->shop->id.')
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int) $context->language->id.')';
$sqlWhere = ' WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\')'.
(!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : ' ').
(!empty($excludePackItself) ? ' AND p.id_product <> '.$excludePackItself.' ' : ' ').
($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : '').
($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : '').
($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : '').
' GROUP BY p.id_product';
($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : '');
$sqlGroupBy = ' GROUP BY p.id_product';
if ($idHotel && $bookingProduct) {
// To get hotel info for the booking product only
$sqlSelect .= ', hbil.`hotel_name`, hbil.`id` AS id_hotel ';
$sqlJoin .= ' LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt
ON hrt.`id_product` = p.`id_product`
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil
ON pl.`id_lang` = hbil.`id_lang` AND hbil.`id` = hrt.`id_hotel`';
$sqlWhere .= ' AND hbil.`id`='.(int) $idHotel ;
}
$sql = $sqlSelect.' '.$sqlFrom.' '.$sqlJoin.' '.$sqlWhere.' '.$sqlGroupBy;
$items = Db::getInstance()->executeS($sql);

View File

@@ -869,7 +869,7 @@
<div class="panel" id="refundForm">
<div class="panel-heading">
<i class="icon-bed"></i> &nbsp;{l s='Rooms Booking Detail'} <span class="badge">{$order_detail_data|@count}</span>
{if !$order->hasBeenDelivered()}
{if !$order->hasBeenDelivered() && $currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED')}
<button type="button" id="add_room" class="btn btn-primary pull-right">
<i class="icon-plus-sign"></i> {l s='Add Rooms'}
</button>

View File

@@ -18,7 +18,7 @@
*}
<div class="modal-body">
<form action="{$current_index}&amp;viewOrder&amp;id_order={$order->id}{if isset($smarty.get.token)}&amp;token={$smarty.get.token|escape:'html':'UTF-8'}{/if}" method="post">
<form action="{$current_index}&amp;vieworder&amp;id_order={$order->id}{if isset($smarty.get.token)}&amp;token={$smarty.get.token|escape:'html':'UTF-8'}{/if}" method="post">
<div class="form-group">
<label class="control-label">{l s='Note Detail'}</label>
<input type="hidden" name="id_order_invoice" id="id_order_invoice" value="" />

View File

@@ -72,9 +72,11 @@ class NotificationCore
SELECT SQL_CALC_FOUND_ROWS o.`id_order`, o.`id_customer`, o.`total_paid`, o.`id_currency`, o.`date_upd`, c.`firstname`, c.`lastname`
FROM `'._DB_PREFIX_.'orders` as o
LEFT JOIN `'._DB_PREFIX_.'customer` as c ON (c.`id_customer` = o.`id_customer`)
WHERE `id_order` > '.(int)$id_last_element.
Shop::addSqlRestriction(false, 'o').'
ORDER BY `id_order` DESC
LEFT JOIN '._DB_PREFIX_.'htl_booking_detail hbd ON (hbd.id_order = o.id_order)
WHERE o.`id_order` > '.(int)$id_last_element.
Shop::addSqlRestriction(false, 'o'). HotelBranchInformation::addHotelRestriction(false, 'hbd').'
GROUP BY o.`id_order`
ORDER BY o.`id_order` DESC
LIMIT 5';
break;

View File

@@ -482,44 +482,44 @@ class AdminOrdersControllerCore extends AdminController
{
if ($this->display == 'view') {
/** @var Order $order */
$order = $this->loadObject();
if (Validate::isLoadedObject($order = $this->loadObject())) {
// hotel link in header
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
$this->toolbar_btn['hotel'] = array(
'href' => $this->context->link->getAdminLink('AdminAddHotel').'&id='.$idHotel.'&updatehtl_branch_info',
'desc' => $this->l('View Hotel'),
'class' => 'icon-building',
'target' => true,
);
}
// hotel link in header
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
$this->toolbar_btn['hotel'] = array(
'href' => $this->context->link->getAdminLink('AdminAddHotel').'&id='.$idHotel.'&updatehtl_branch_info',
'desc' => $this->l('View Hotel'),
'class' => 'icon-building',
'target' => true,
if (Configuration::get('PS_INVOICE') && $order->hasInvoice() && !$this->lite_display) {
$this->toolbar_btn['file'] = array(
'short' => $this->l('Invoice'),
'href' => $this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.$order->id,
'desc' => $this->l('View invoice'),
'class' => 'icon-file-text',
'target' => true,
);
}
$this->toolbar_btn['print'] = array(
'short' => $this->l('Print'),
'href' => 'javascript:window.print()',
'desc' => $this->l('Print order'),
'class' => 'icon-print',
);
}
if (Configuration::get('PS_INVOICE') && $order->hasInvoice() && !$this->lite_display) {
$this->toolbar_btn['file'] = array(
'short' => $this->l('Invoice'),
'href' => $this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.$order->id,
'desc' => $this->l('View invoice'),
'class' => 'icon-file-text',
'target' => true,
);
}
$this->toolbar_btn['print'] = array(
'short' => $this->l('Print'),
'href' => 'javascript:window.print()',
'desc' => $this->l('Print order'),
'class' => 'icon-print',
);
if (((int) $order->isReturnable()) && !$order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG)) {
$this->toolbar_btn['cancel'] = array(
'short' => ((float) $order->getTotalPaid()) ? $this->l('Refund') : $this->l('Cancel'),
'href' => '#refundForm',
'id' => 'desc-order-standard_refund',
'desc' => ((float) $order->getTotalPaid()) ? $this->l('Initiate refund') : $this->l('Cancel bookings'),
'class' => 'icon-exchange',
'target' => true,
);
if (((int) $order->isReturnable()) && !$order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG)) {
$this->toolbar_btn['cancel'] = array(
'short' => ((float) $order->getTotalPaid()) ? $this->l('Refund') : $this->l('Cancel'),
'href' => '#refundForm',
'id' => 'desc-order-standard_refund',
'desc' => ((float) $order->getTotalPaid()) ? $this->l('Initiate refund') : $this->l('Cancel bookings'),
'class' => 'icon-exchange',
'target' => true,
);
}
}
}
@@ -1623,6 +1623,9 @@ class AdminOrdersControllerCore extends AdminController
$this->errors[] = Tools::displayError('The date is invalid');
} elseif (!Validate::isUnsignedInt($payment_type)) {
$this->errors[] = Tools::displayError('Payment source is invalid');
// Amount cannot be less than paid amount by guest in negative price
} elseif ($amount < 0 && ($order->total_paid_real + $amount) < 0) {
$this->errors[] = sprintf(Tools::displayError('Amount cannot be less than -%s'), Tools::displayPrice($order->total_paid_real, new Currency($order->id_currency)));
} else {
if (!$order->addOrderPayment(
$amount,
@@ -1648,16 +1651,20 @@ class AdminOrdersControllerCore extends AdminController
} elseif (Tools::isSubmit('submitEditNote')) {
$note = Tools::getValue('note');
$order_invoice = new OrderInvoice((int)Tools::getValue('id_order_invoice'));
if (Validate::isLoadedObject($order_invoice) && Validate::isCleanHtml($note)) {
if ($this->tabAccess['edit'] === '1') {
$order_invoice->note = $note;
if ($order_invoice->save()) {
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order_invoice->id_order.'&vieworder&conf=4&token='.$this->token);
if (Validate::isLoadedObject($order_invoice)) {
if (Validate::isCleanHtml($note)) {
if ($this->tabAccess['edit'] === '1') {
$order_invoice->note = $note;
if ($order_invoice->save()) {
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order_invoice->id_order.'&vieworder&conf=4&token='.$this->token);
} else {
$this->errors[] = Tools::displayError('The invoice note was not saved.');
}
} else {
$this->errors[] = Tools::displayError('The invoice note was not saved.');
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
} else {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
$this->errors[] = Tools::displayError('Invalid note found.');
}
} else {
$this->errors[] = Tools::displayError('The invoice for edit note was unable to load. ');
@@ -2475,9 +2482,8 @@ class AdminOrdersControllerCore extends AdminController
public function renderView()
{
$order = new Order(Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order)) {
$this->errors[] = Tools::displayError('The order cannot be found within your database.');
if (!Validate::isLoadedObject($order = new Order(Tools::getValue('id_order')))) {
return;
}
$this->content .= $this->renderKpis();
@@ -4760,47 +4766,47 @@ class AdminOrdersControllerCore extends AdminController
if ($order_detail->id_order_invoice != $order_invoice->id) {
$old_order_invoice = new OrderInvoice($order_detail->id_order_invoice);
// We remove cost of products
$old_order_invoice->total_products -= $order_detail->total_price_tax_excl;
$old_order_invoice->total_products_wt -= $order_detail->total_price_tax_incl;
$old_order_invoice->total_products -= Tools::ps_round($order_detail->total_price_tax_excl, 6);
$old_order_invoice->total_products_wt -= Tools::ps_round($order_detail->total_price_tax_incl, 6);
$old_order_invoice->total_paid_tax_excl -= $order_detail->total_price_tax_excl;
$old_order_invoice->total_paid_tax_incl -= $order_detail->total_price_tax_incl;
$old_order_invoice->total_paid_tax_excl -= Tools::ps_round($order_detail->total_price_tax_excl, 6);
$old_order_invoice->total_paid_tax_incl -= Tools::ps_round($order_detail->total_price_tax_incl, 6);
$res &= $old_order_invoice->update();
$order_invoice->total_products += $order_detail->total_price_tax_excl;
$order_invoice->total_products_wt += $order_detail->total_price_tax_incl;
$order_invoice->total_products += Tools::ps_round($order_detail->total_price_tax_excl, 6);
$order_invoice->total_products_wt += Tools::ps_round($order_detail->total_price_tax_incl, 6);
$order_invoice->total_paid_tax_excl += $order_detail->total_price_tax_excl;
$order_invoice->total_paid_tax_incl += $order_detail->total_price_tax_incl;
$order_invoice->total_paid_tax_excl += Tools::ps_round($order_detail->total_price_tax_excl, 6);
$order_invoice->total_paid_tax_incl += Tools::ps_round($order_detail->total_price_tax_incl, 6);
$order_detail->id_order_invoice = $order_invoice->id;
}
}
if ($diff_price_tax_incl != 0 && $diff_price_tax_excl != 0) {
$order_detail->unit_price_tax_excl = $product_price_tax_excl;
$order_detail->unit_price_tax_incl = $product_price_tax_incl;
$order_detail->unit_price_tax_excl = Tools::ps_round($product_price_tax_excl, 6);
$order_detail->unit_price_tax_incl = Tools::ps_round($product_price_tax_incl, 6);
$order_detail->total_price_tax_incl += (float)$diff_price_tax_incl;
$order_detail->total_price_tax_excl += (float)$diff_price_tax_excl;
$order_detail->total_price_tax_incl += Tools::ps_round((float)$diff_price_tax_incl, 6);
$order_detail->total_price_tax_excl += Tools::ps_round((float)$diff_price_tax_excl, 6);
if (isset($order_invoice)) {
// Apply changes on OrderInvoice
$order_invoice->total_products += (float)$diff_price_tax_excl;
$order_invoice->total_products_wt += (float)$diff_price_tax_incl;
$order_invoice->total_products += Tools::ps_round((float)$diff_price_tax_excl, 6);
$order_invoice->total_products_wt += Tools::ps_round((float)$diff_price_tax_incl, 6);
$order_invoice->total_paid_tax_excl += (float)$diff_price_tax_excl;
$order_invoice->total_paid_tax_incl += (float)$diff_price_tax_incl;
$order_invoice->total_paid_tax_excl += Tools::ps_round((float)$diff_price_tax_excl, 6);
$order_invoice->total_paid_tax_incl += Tools::ps_round((float)$diff_price_tax_incl, 6);
}
// Apply changes on Order
$order = new Order($order_detail->id_order);
$order->total_products += (float)$diff_price_tax_excl;
$order->total_products_wt += (float)$diff_price_tax_incl;
$order->total_paid += (float)$diff_price_tax_incl;
$order->total_paid_tax_excl += (float)$diff_price_tax_excl;
$order->total_paid_tax_incl += (float)$diff_price_tax_incl;
$order->total_products += Tools::ps_round((float)$diff_price_tax_excl, 6);
$order->total_products_wt += Tools::ps_round((float)$diff_price_tax_incl, 6);
$order->total_paid += Tools::ps_round((float)$diff_price_tax_incl, 6);
$order->total_paid_tax_excl += Tools::ps_round((float)$diff_price_tax_excl, 6);
$order->total_paid_tax_incl += Tools::ps_round((float)$diff_price_tax_incl, 6);
$res &= $order->update();
}
@@ -5364,8 +5370,8 @@ class AdminOrdersControllerCore extends AdminController
} else {
// Calculate differences of price (Before / After)
$order_detail->total_price_tax_incl -= $diff_products_tax_incl;
$order_detail->total_price_tax_excl -= $diff_products_tax_excl;
$order_detail->total_price_tax_incl -= Tools::ps_round($diff_products_tax_incl, 6);
$order_detail->total_price_tax_excl -= Tools::ps_round($diff_products_tax_excl, 6);
$old_quantity = $order_detail->product_quantity;
@@ -5384,8 +5390,8 @@ class AdminOrdersControllerCore extends AdminController
if ($service['quantity'] >= $serviceOrderDetail->product_quantity) {
$serviceOrderDetail->delete();
} else {
$order_detail->total_price_tax_incl -= $service['total_price_tax_incl'];
$order_detail->total_price_tax_excl -= $service['total_price_tax_excl'];
$order_detail->total_price_tax_incl -= Tools::ps_round($service['total_price_tax_incl'], 6);
$order_detail->total_price_tax_excl -= Tools::ps_round($service['total_price_tax_excl'], 6);
$serviceOldQuantity = $serviceOrderDetail->product_quantity;
$serviceOrderDetail->product_quantity = $serviceOldQuantity - $service['quantity'];
@@ -5403,20 +5409,37 @@ class AdminOrdersControllerCore extends AdminController
if ($order_detail->id_order_invoice != 0) {
// values changes as values are calculated accoding to the quantity of the product by webkul
$order_invoice = new OrderInvoice($order_detail->id_order_invoice);
$order_invoice->total_paid_tax_excl -= ($diff_products_tax_excl + $roomExtraDemandTE + $additionlServicesTE);
$order_invoice->total_paid_tax_incl -= ($diff_products_tax_incl + $roomExtraDemandTI + $additionlServicesTI);
$order_invoice->total_products -= $diff_products_tax_excl;
$order_invoice->total_products_wt -= $diff_products_tax_incl;
$order_invoice->total_paid_tax_excl -= Tools::ps_round(($diff_products_tax_excl + $roomExtraDemandTE + $additionlServicesTE), 6);
$order_invoice->total_paid_tax_excl = $order_invoice->total_paid_tax_excl > 0 ? $order_invoice->total_paid_tax_excl : 0;
$order_invoice->total_paid_tax_incl -= Tools::ps_round(($diff_products_tax_incl + $roomExtraDemandTI + $additionlServicesTI), 6);
$order_invoice->total_paid_tax_incl = $order_invoice->total_paid_tax_incl > 0 ? $order_invoice->total_paid_tax_incl : 0;
$order_invoice->total_products -= Tools::ps_round($diff_products_tax_excl, 6);
$order_invoice->total_products = $order_invoice->total_products > 0 ? $order_invoice->total_products : 0;
$order_invoice->total_products_wt -= Tools::ps_round($diff_products_tax_incl, 6);
$order_invoice->total_products_wt = $order_invoice->total_products_wt > 0 ? $order_invoice->total_products_wt : 0;
$res &= $order_invoice->update();
}
// Update Order
// values changes as values are calculated accoding to the quantity of the product by webkul
$order->total_paid -= ($diff_products_tax_incl + $roomExtraDemandTI + $additionlServicesTI);
$order->total_paid_tax_incl -= ($diff_products_tax_incl + $roomExtraDemandTI + $additionlServicesTI);
$order->total_paid_tax_excl -= ($diff_products_tax_excl + $roomExtraDemandTE + $additionlServicesTE);
$order->total_products -= ($diff_products_tax_excl + $additionlServicesTE);
$order->total_products_wt -= ($diff_products_tax_incl + $additionlServicesTI);
$order->total_paid -= Tools::ps_round(($diff_products_tax_incl + $roomExtraDemandTI + $additionlServicesTI), 6);
$order->total_paid = $order->total_paid > 0 ? $order->total_paid : 0;
$order->total_paid_tax_incl -= Tools::ps_round(($diff_products_tax_incl + $roomExtraDemandTI + $additionlServicesTI), 6);
$order->total_paid_tax_incl = $order->total_paid_tax_incl > 0 ? $order->total_paid_tax_incl : 0;
$order->total_paid_tax_excl -= Tools::ps_round(($diff_products_tax_excl + $roomExtraDemandTE + $additionlServicesTE), 6);
$order->total_paid_tax_excl = $order->total_paid_tax_excl > 0 ? $order->total_paid_tax_excl : 0;
$order->total_products -= Tools::ps_round(($diff_products_tax_excl + $additionlServicesTE), 6);
$order->total_products = $order->total_products > 0 ? $order->total_products : 0;
$order->total_products_wt -= Tools::ps_round(($diff_products_tax_incl + $additionlServicesTI), 6);
$order->total_products_wt = $order->total_products_wt > 0 ? $order->total_products_wt : 0;
$res &= $order->update();

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Получено частично плащане</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>আংশিক পেমেন্ট প্রাপ্ত</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Pagamento parcial recebido</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Částečná platba přijata</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Teilzahlung erhalten</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Partial payment received</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Pago parcial recibido</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>پرداخت جزئی دریافت شد</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Paiement partiel reçu</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>תשלום חלקי התקבל</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Primljena djelomična uplata</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Részleges kifizetés megérkezett</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Pembayaran sebagian diterima</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Pagamento parziale ricevuto</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Gautas dalinis apmokėjimas</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Примено е делумно плаќање</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Gedeeltelijke betaling ontvangen</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Partial payment received</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Otrzymano częściową płatność</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Pagamento parcial recebido</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Paiement partiel reçu</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Plata parțială primită</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Частичная оплата получена</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>අර්ධ ගෙවීමක් ලැබී ඇත</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Делимична уплата примљена</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Delbetalning mottagen</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>已收到部分付款</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>Đã nhận được một phần thanh toán</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -45,7 +45,7 @@
<template/>
</order_state>
<order_state id="Partial_payment_accepted">
<name>Partial payment accepted</name>
<name>已收到部分付款</name>
<template>payment_accepted</template>
</order_state>
</entity_order_state>

View File

@@ -150,18 +150,6 @@ class AdminHotelFeaturesController extends ModuleAdminController
$this->errors[] = $this->l('Please add atleast one Child features.');
}
foreach ($languages as $lang) {
if (!trim(Tools::getValue('parent_ftr_name_'.$lang['id_lang']))) {
$objHotelFeatures->name[$lang['id_lang']] = Tools::getValue(
'parent_ftr_name_'.$defaultLangId
);
} else {
$objHotelFeatures->name[$lang['id_lang']] = Tools::getValue(
'parent_ftr_name_'.$lang['id_lang']
);
}
}
if (!count($this->errors)) {
if (isset($parentFeatureId) && $parentFeatureId) {
$objHotelFeatures = new HotelFeatures($parentFeatureId);
@@ -297,13 +285,20 @@ class AdminHotelFeaturesController extends ModuleAdminController
public function ajaxProcessDeleteFeature()
{
$idFeature = Tools::getValue('feature_id');
$objHotelFeatures = new HotelFeatures();
if ($objHotelFeatures->deleteHotelFeatures($idFeature)) {
die('success');
$response = array('status' => false);
if ($this->tabAccess['delete']) {
$idFeature = Tools::getValue('feature_id');
$objHotelFeatures = new HotelFeatures();
if ($objHotelFeatures->deleteHotelFeatures($idFeature)) {
$response['status'] = true;
} else {
$response['msg'] = $this->l('Some error occurred while deleting feature. Please try again.');
}
} else {
echo 0;
$response['msg'] = $this->l('You do not have the permission to delete this.');
}
$this->ajaxDie(json_encode($response));
}
public function setMedia()

View File

@@ -463,12 +463,13 @@ $(document).ready(function() {
action: 'deleteFeature',
},
method: 'POST',
success: function(data) {
if (data == 'success') {
dataType: 'json',
success: function(response) {
if (response.status) {
alert(success_delete_msg);
$('#grand_feature_div_' + ftr_id).remove();
} else {
alert(error_delete_msg);
alert(response.msg);
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {

View File

@@ -29,11 +29,20 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
$this->bootstrap = true;
$this->context = Context::getContext();
$this->_select = ' pl.`name`, hbil.`hotel_name` ';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
ON (pl.`id_product` = a.`id_product` AND pl.id_lang = '.(int) $this->context->language->id.')';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt
ON (hrt.`id_product` = a.`id_product`)';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil
ON (hrt.`id_hotel` = hbil.`id` AND hbil.`id_lang` = pl.`id_lang`)';
$this->fields_options = array(
'global' => array(
'title' => $this->l('Hotel Room Display Setting'),
'icon' => 'icon-cogs',
'fields' => array(
'title' => $this->l('Hotel Room Display Setting'),
'icon' => 'icon-cogs',
'fields' => array(
'HOTEL_ROOM_DISPLAY_HEADING' => array(
'title' => $this->l('Hotel Room Block Title'),
'type' => 'textLang',
@@ -73,6 +82,16 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
'search' => false,
'callback' => 'getProductImage',
),
'name' => array(
'title' => $this->l('Room Type'),
'align' => 'center',
'orderby' => false,
),
'hotel_name' => array(
'title' => $this->l('Hotel'),
'align' => 'center',
'orderby' => false,
),
'active' => array(
'title' => $this->l('Active'),
'align' => 'center',
@@ -109,6 +128,24 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
$this->identifier = 'id_room_block';
parent::__construct();
if ($this->hotelList = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1)) {
$objHotelRoomType = new HotelRoomType();
if ($this->loadObject(true)
&& $this->object->id
&& ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct((int) $this->object->id_product))
) {
$idsHotel = array_column($this->hotelList, 'id_hotel');
if (!in_array($roomTypeInfo['id_hotel'], $idsHotel)) {
$this->tabAccess['edit'] = 0;
$this->tabAccess['view'] = 0;
}
}
} else {
if ($this->loadObject(true) && $this->object->id) {
$this->tabAccess['view'] =0;
$this->tabAccess['edit'] =0;
}
}
}
public function getProductImage($idProduct)
@@ -152,23 +189,27 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
public function renderForm()
{
if (!($obj = $this->loadObject(true))) {
if (!($this->loadObject(true))) {
return;
} else if (!$this->object->id && empty($this->hotelList)) {
$this->warnings[] = $this->l('No hotel found to create new hotel room block.');
return;
}
$productName = $idProduct = false;
if ($this->display == 'edit') {
$objRoomBlock = new WkHotelRoomDisplay($obj->id);
$idProduct = $objRoomBlock->id_product;
$productName = false;
if ($idProduct = $this->object->id_product) {
$product = new Product($idProduct, false, Configuration::get('PS_LANG_DEFAULT'));
$productName = $product->name;
$objHotelRoomType = new HotelRoomType();
if ($roomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct((int) $product->id)) {
$this->fields_value['id_hotel'] = $roomInfo['id_hotel'];
}
}
$this->context->smarty->assign(
array(
'productName' => $productName,
'idProduct' => $idProduct,
'idProduct' => $idProduct
)
);
$html = $this->context->smarty->fetch(
@@ -182,6 +223,19 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
'icon' => 'icon-globe'
),
'input' => array(
array(
'type' => 'select',
'label' => $this->l('Select hotel'),
'name' => 'id_hotel',
'required' => true,
'class' => 'chosen',
'options' => array(
'query' => $this->hotelList,
'id' => 'id_hotel',
'name' => 'hotel_name'
),
'hint' => $this->l('Select the hotel to search for the room types.'),
),
array(
'label' => $this->l('Search Room Type'),
'type' => 'html',
@@ -384,7 +438,7 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
if (isset($pos[2]) && (int) $pos[2] === $idRoomBlock) {
if ($objRoomBlock = new WkHotelRoomDisplay((int) $pos[2])) {
if (isset($position)
&& $objRoomBlock->updatePosition($way, $position, $idRoomBlock)
&& $objRoomBlock->updatePosition($way, $position)
) {
echo 'ok position '.(int) $position.' for hotel room block '.(int) $pos[1].'\r\n';
} else {

View File

@@ -32,27 +32,31 @@ $(document).ready(function() {
var word = $(this).val();
var d = new Date();
var n = d.getTime();
trigger_ajax = $.ajax({
url: "ajax_products_list.php",
dataType: 'json',
data: {
q: word,
_: n,
booking_product: '1',
},
success: function(result) {
if (result) {
var html = '';
$.each(result, function(key, value) {
html += '<li class="suggestion_li"><a class="suggestion_a text-capitalize" data-primary="' + value.id + '" data-secondary="' + value.name + '">' + value.name + '</a></li>';
});
suggestion_ul.html(html).show();
} else {
suggestion_ul.empty().hide();
suggestion_ul.siblings("input#id_product").val(null);
var id_hotel = parseInt($('#id_hotel').val());
if (!isNaN(id_hotel)) {
trigger_ajax = $.ajax({
url: "ajax_products_list.php",
dataType: 'json',
data: {
q: word,
_: n,
booking_product: '1',
id_hotel: id_hotel
},
success: function(result) {
if (result) {
var html = '';
$.each(result, function(key, value) {
html += '<li class="suggestion_li"><a class="suggestion_a text-capitalize" data-primary="' + value.id + '" data-secondary="' + value.name + '">'+value.name+' (#'+value.id+')</a></li>';
});
suggestion_ul.html(html).show();
} else {
suggestion_ul.empty().hide();
suggestion_ul.siblings("input#id_product").val(null);
}
}
}
});
});
}
}
}
});
@@ -73,4 +77,9 @@ $(document).ready(function() {
$('ul.prod_suggest_ul').empty().hide();
}
});
$(document).on('change', '#id_hotel', function () {
// resetting the fields on hotel change
$('#id_product').val('');
$('#productName').val('');
});
});