Merge branch 'develop' into gli-2856
This commit is contained in:
@@ -256,6 +256,7 @@
|
||||
<th>{l s='ID'}</th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th></th>
|
||||
<th class="fixed-width-sm text-center">{l s='Quantity'}</th>
|
||||
<th>{l s='Unit Price (tax excl.)'}</th>
|
||||
<th>{l s='Total Price (tax excl.)'}</th>
|
||||
<th>{l s='Total Price (tax incl.)'}</th>
|
||||
@@ -276,6 +277,13 @@
|
||||
<span class="badge badge-info label">{l s='Auto added'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if isset($service['allow_multiple_quantity']) && $service['allow_multiple_quantity']}
|
||||
{$service['quantity']}
|
||||
{else}
|
||||
{l s='--'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{displayPrice price=$service['unit_price_tax_excl'] currency=$orderCurrency}
|
||||
{if $service['price_calculation_method'] == Product::PRICE_CALCULATION_METHOD_PER_DAY}
|
||||
|
||||
@@ -3044,7 +3044,7 @@ abstract class ModuleCore
|
||||
);
|
||||
$reflectionClassModule = new ReflectionClass($overrideClassName.'Override'.$uniq);
|
||||
|
||||
$moduleClassFileArray = $this->getCommentedClass($moduleClassFileArray, $reflectionClassModule, $reflectionClassOverride, $overrideClassFileArray);
|
||||
$moduleClassFileArray = $this->getCommentedClass($moduleClassFileArray, $reflectionClassModule, $reflectionClassOverride, $overrideClassFileArray, $overrideClassName);
|
||||
|
||||
// Insert the methods from module override in override
|
||||
$generatedCodeToCopy = array_slice($moduleClassFileArray, $reflectionClassModule->getStartLine() + 1, $reflectionClassModule->getEndLine() - $reflectionClassModule->getStartLine() - 2);
|
||||
@@ -3091,7 +3091,7 @@ abstract class ModuleCore
|
||||
);
|
||||
$reflectionClassModule = new ReflectionClass($overrideClassName.'Override'.$uniq);
|
||||
|
||||
$moduleClassFileArray = $this->getCommentedClass($moduleClassFileArray, $reflectionClassModule);
|
||||
$moduleClassFileArray = $this->getCommentedClass($moduleClassFileArray, $reflectionClassModule, null, null, $overrideClassName);
|
||||
|
||||
file_put_contents($overrideClassFilePath, preg_replace($patternEscapeCommon, '', $moduleClassFileArray));
|
||||
|
||||
@@ -3102,7 +3102,7 @@ abstract class ModuleCore
|
||||
return true;
|
||||
}
|
||||
|
||||
private function getCommentedClass($moduleClassFileArray, $reflectionClassModule, $reflectionClassOverride = null, $overrideClassFileArray = null)
|
||||
private function getCommentedClass($moduleClassFileArray, $reflectionClassModule, $reflectionClassOverride = null, $overrideClassFileArray = null, $className = '')
|
||||
{
|
||||
// Check if none of the methods already exists in the override class
|
||||
foreach ($reflectionClassModule->getMethods() as $method) {
|
||||
@@ -3110,15 +3110,15 @@ abstract class ModuleCore
|
||||
if ($reflectionClassOverride->hasMethod($method->getName())) {
|
||||
$overrideMethodInfo = $reflectionClassOverride->getMethod($method->getName());
|
||||
if (preg_match('/module: (.*)/ism', $overrideClassFileArray[$overrideMethodInfo->getStartLine() - 5], $name) && preg_match('/date: (.*)/ism', $overrideClassFileArray[$overrideMethodInfo->getStartLine() - 4], $date) && preg_match('/version: ([0-9.]+)/ism', $overrideClassFileArray[$overrideMethodInfo->getStartLine() - 3], $version)) {
|
||||
throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overridden by the module %3$s version %4$s at %5$s.'), $method->getName(), $classname, $name[1], $version[1], $date[1]));
|
||||
throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overridden by the module %3$s version %4$s at %5$s.'), $method->getName(), $className, $name[1], $version[1], $date[1]));
|
||||
}
|
||||
throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overridden.'), $method->getName(), $classname));
|
||||
throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overridden.'), $method->getName(), $className));
|
||||
}
|
||||
}
|
||||
|
||||
$moduleClassFileArray = preg_replace('/((:?public|private|protected)\s+(static\s+)?function\s+(?:\b'.$method->getName().'\b))/ism', "/*\n * module: ".$this->name."\n * date: ".date('Y-m-d H:i:s')."\n * version: ".$this->version."\n */\n $1", $moduleClassFileArray);
|
||||
if ($moduleClassFileArray === null) {
|
||||
throw new Exception(sprintf(Tools::displayError('Failed to override method %1$s in class %2$s.'), $method->getName(), $classname));
|
||||
throw new Exception(sprintf(Tools::displayError('Failed to override method %1$s in class %2$s.'), $method->getName(), $className));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3126,13 +3126,13 @@ abstract class ModuleCore
|
||||
foreach ($reflectionClassModule->getProperties() as $property) {
|
||||
if ($reflectionClassOverride) {
|
||||
if ($reflectionClassOverride->hasProperty($property->getName())) {
|
||||
throw new Exception(sprintf(Tools::displayError('The property %1$s in the class %2$s is already defined.'), $property->getName(), $classname));
|
||||
throw new Exception(sprintf(Tools::displayError('The property %1$s in the class %2$s is already defined.'), $property->getName(), $className));
|
||||
}
|
||||
}
|
||||
|
||||
$moduleClassFileArray = preg_replace('/((?:public|private|protected)\s)\s*(static\s)?\s*(\$\b'.$property->getName().'\b)/ism', "/*\n * module: ".$this->name."\n * date: ".date('Y-m-d H:i:s')."\n * version: ".$this->version."\n */\n $1$2$3", $moduleClassFileArray);
|
||||
if ($moduleClassFileArray === null) {
|
||||
throw new Exception(sprintf(Tools::displayError('Failed to override property %1$s in class %2$s.'), $property->getName(), $classname));
|
||||
throw new Exception(sprintf(Tools::displayError('Failed to override property %1$s in class %2$s.'), $property->getName(), $className));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3140,13 +3140,13 @@ abstract class ModuleCore
|
||||
foreach ($reflectionClassModule->getConstants() as $constant => $value) {
|
||||
if ($reflectionClassOverride) {
|
||||
if ($reflectionClassOverride->hasConstant($constant)) {
|
||||
throw new Exception(sprintf(Tools::displayError('The constant %1$s in the class %2$s is already defined.'), $constant, $classname));
|
||||
throw new Exception(sprintf(Tools::displayError('The constant %1$s in the class %2$s is already defined.'), $constant, $className));
|
||||
}
|
||||
}
|
||||
|
||||
$moduleClassFileArray = preg_replace('/(const\s)\s*(\b'.$constant.'\b)/ism', "/*\n * module: ".$this->name."\n * date: ".date('Y-m-d H:i:s')."\n * version: ".$this->version."\n */\n $1$2", $moduleClassFileArray);
|
||||
if ($moduleClassFileArray === null) {
|
||||
throw new Exception(sprintf(Tools::displayError('Failed to override constant %1$s in class %2$s.'), $constant, $classname));
|
||||
throw new Exception(sprintf(Tools::displayError('Failed to override constant %1$s in class %2$s.'), $constant, $className));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2577,6 +2577,7 @@ class OrderCore extends ObjectModel
|
||||
)) {
|
||||
$totals = array_reduce($serviceProductDetail, function ($carry, $item) use ($order_detail) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail((int) $item['id_htl_booking_detail']);
|
||||
$numDays = 1;
|
||||
if ((Product::PRICE_CALCULATION_METHOD_PER_DAY == $order_detail['product_price_calculation_method'])
|
||||
&& (!$numDays = HotelHelper::getNumberOfDays($objHotelBookingDetail->date_from, $objHotelBookingDetail->date_to))
|
||||
) {
|
||||
|
||||
@@ -2992,7 +2992,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->icon = 'icon-money';
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Total Due Amount', null, null, false);
|
||||
$minValue = ('0.' . str_repeat('0', (Configuration::get('PS_PRICE_DISPLAY_PRECISION') - 1)) . '1');
|
||||
$priceDisplayPrecision = (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION');
|
||||
$minValue = ('0.' . ($priceDisplayPrecision ? str_repeat('0', ($priceDisplayPrecision - 1)) : '') . '1');
|
||||
|
||||
// get all valid order states for due amount calculations
|
||||
$validOrderStatesFilter = '';
|
||||
|
||||
@@ -33,6 +33,7 @@ class AdminSearchConfControllerCore extends AdminController
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminDashboard'));
|
||||
$this->bootstrap = true;
|
||||
$this->table = 'alias';
|
||||
$this->className = 'Alias';
|
||||
|
||||
@@ -228,9 +228,9 @@
|
||||
<!-- <tab id="Store_Contacts" id_parent="Preferences" active="1" hide_host_mode="0">
|
||||
<class_name>AdminStores</class_name>
|
||||
</tab> -->
|
||||
<tab id="Search_1" id_parent="Preferences" active="1" hide_host_mode="0">
|
||||
<!-- <tab id="Search_1" id_parent="Preferences" active="1" hide_host_mode="0">
|
||||
<class_name>AdminSearchConf</class_name>
|
||||
</tab>
|
||||
</tab> -->
|
||||
<tab id="Maintenance" id_parent="Preferences" active="1" hide_host_mode="0">
|
||||
<class_name>AdminMaintenance</class_name>
|
||||
</tab>
|
||||
|
||||
@@ -42,5 +42,6 @@
|
||||
<theme_meta id="theme_meta_33" id_theme="1" id_meta="33" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_34" id_theme="1" id_meta="34" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_35" id_theme="1" id_meta="35" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_37" id_theme="1" id_meta="37" left_column="0" right_column="0"/>
|
||||
</entities>
|
||||
</entity_theme_meta>
|
||||
|
||||
@@ -197,8 +197,8 @@ class WkCustomNavigationLink extends ObjectModel
|
||||
'id_cms' => 0,
|
||||
'show_at_navigation' => 1,
|
||||
'show_at_footer' => 0,
|
||||
'is_custom_link' => 1,
|
||||
'link' => $objLink->getPageLink('our-properties'),
|
||||
'is_custom_link' => 0,
|
||||
'link' => 'our-properties',
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -532,12 +532,13 @@ class Dashactivity extends Module
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
$priceDisplayPrecision = (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION');
|
||||
return array(
|
||||
'DASHACTIVITY_CART_ACTIVE' => Tools::getValue('DASHACTIVITY_CART_ACTIVE', Configuration::get('DASHACTIVITY_CART_ACTIVE')),
|
||||
'DASHACTIVITY_CART_ABANDONED_MIN' => Tools::getValue('DASHACTIVITY_CART_ABANDONED_MIN', Configuration::get('DASHACTIVITY_CART_ABANDONED_MIN')),
|
||||
'DASHACTIVITY_CART_ABANDONED_MAX' => Tools::getValue('DASHACTIVITY_CART_ABANDONED_MAX', Configuration::get('DASHACTIVITY_CART_ABANDONED_MAX')),
|
||||
'DASHACTIVITY_VISITOR_ONLINE' => Tools::getValue('DASHACTIVITY_VISITOR_ONLINE', Configuration::get('DASHACTIVITY_VISITOR_ONLINE')),
|
||||
'min_due_amount' => ('0.' . str_repeat('0', (Configuration::get('PS_PRICE_DISPLAY_PRECISION') - 1)) . '1')
|
||||
'min_due_amount' => ('0.' . ($priceDisplayPrecision ? str_repeat('0', ($priceDisplayPrecision - 1)) : '') . '1')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1718,7 +1718,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
}
|
||||
}
|
||||
$productFeaturePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($value['id_product'], $date_from, $date_to, self::useTax(), 0, 0, 0, 0, 1, 1, $bookingParams['occupancy']);
|
||||
if (!empty($price) && ($price['from'] > $productFeaturePrice || $price['to'] < $productFeaturePrice)) {
|
||||
if (!empty($price) && ((float) $price['from'] > $productFeaturePrice || (float) $price['to'] < $productFeaturePrice)) {
|
||||
unset($bookingData['rm_data'][$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user