diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index a2a24383e60..164f4f70f8f 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1159,7 +1159,8 @@ if ($num) { $fieldsforcontent[] = 'content_lines'; } - $parameters = array('fieldsforcontent' => &$fieldsforcontent, 'tabname' => $tabname[$id]); + $tabname=isset($tabname[$id]) ? $tabname[$id] :''; + $parameters = array('fieldsforcontent' => &$fieldsforcontent, 'tabname' => $tabname); $hookmanager->executeHooks('editEmailTemplateFieldsForContent', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks foreach ($fieldsforcontent as $tmpfieldlist) { diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 3f12424d8f9..f767eece5d1 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -84,8 +84,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { - reset($object->fields); // Reset is required to avoid key() to return null. - $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. + $sortfield = "t.ref"; // Set here default search field. By default 1st field in definition. } if (!$sortorder) { $sortorder = "ASC"; @@ -753,9 +752,7 @@ while ($i < $imaxinloop) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } - if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; - } elseif ($key == 'ref') { + if ($key == 'ref') { $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c2b272a5420..f3e9c18e8fe 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7237,7 +7237,7 @@ class Form $tmparray = array(); $tmparray['rowid'] = $obj->rowid; - $tmparray['type_vat'] = $obj->type_vat; + $tmparray['type_vat'] = ($obj->type_vat <= 0 ? 0 : $obj->type_vat); // Some version have type_vat corrupted with value -1 $tmparray['code'] = $obj->code; $tmparray['txtva'] = $obj->taux; $tmparray['nprtva'] = $obj->recuperableonly; @@ -7370,7 +7370,8 @@ class Form } else { $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente } - if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on + + if ($societe_vendeuse == $mysoc && getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country @@ -7419,7 +7420,6 @@ class Form } $num = count($arrayofvatrates); - if ($num > 0) { // Define the vat rate to pre-select (if defaulttx not forced so is -1 or '') if ($defaulttx < 0 || dol_strlen($defaulttx) == 0) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index fca650639e2..0a8a3d5cfc6 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2469,7 +2469,8 @@ if ($action == 'create') { // VAT $selectedvat = price2num($line->vatrate).(!empty($line->vat_src_code) ? ' ('.$line->vat_src_code.')' : ''); print ''; - print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $selectedvat), $mysoc, null, 0, 0, '', false, 1, 2); + // We must use null, null for seller and buyer as we don't know them for expense report. + print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $selectedvat), null, null, 0, 0, '', false, 1, 2); print ''; // Unit price @@ -2655,6 +2656,7 @@ if ($action == 'create') { // If option to have no default VAT on expense report is on, we force MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; } + // We must use null, null for seller and buyer as we don't know them for expense report. print $form->load_tva('vatrate', (!empty($vatrate) ? $vatrate : $defaultvat), null, null, 0, 0, '', false, 1); print ''; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 30f7e0a6eb6..8b08a61480c 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -693,4 +693,7 @@ ALTER TABLE llx_product_attribute_combination_price_level ADD UNIQUE INDEX uk_pr -- delete a constant that should not be set DELETE FROM llx_const WHERE name = 'INVOICE_USE_RETAINED_WARRANTY' AND value = -1; + DELETE FROM llx_hrm_skilldet WHERE rankorder = 0; + +UPDATE llx_c_tva SET type_vat = 0 WHERE type_vat < 0; diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 15eb86128af..18bb9f59c84 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -87,8 +87,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { - reset($object->fields); // Reset is required to avoid key() to return null. - $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. + $sortfield = "t.ref"; // Set here default search field. By default 1st field in definition. } if (!$sortorder) { $sortorder = "ASC";