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 '