Debug v17
This commit is contained in:
parent
24d7a72b06
commit
a34f69012e
@ -8066,8 +8066,10 @@ abstract class CommonObject
|
||||
$out .= '<!-- commonobject:showOptionals --> ';
|
||||
$out .= "\n";
|
||||
|
||||
$nbofextrafieldsshown = 0;
|
||||
$extrafields_collapse_num = '';
|
||||
$e = 0;
|
||||
$e = 0; // var to manage the modulo (odd/even)
|
||||
|
||||
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $label) {
|
||||
// Show only the key field in params
|
||||
if (is_array($params) && array_key_exists('onlykey', $params) && $key != $params['onlykey']) {
|
||||
@ -8151,6 +8153,8 @@ abstract class CommonObject
|
||||
break;
|
||||
}
|
||||
|
||||
$nbofextrafieldsshown++;
|
||||
|
||||
// Output value of the current field
|
||||
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
|
||||
$extrafields_collapse_num = '';
|
||||
@ -8247,7 +8251,7 @@ abstract class CommonObject
|
||||
$out .= '<td class="titlefieldcreate wordbreak';
|
||||
} elseif ($display_type == 'line') {
|
||||
$out .= '<div '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="fieldline_options_'.$key.' '.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.(!empty($this->id)?'_'.$this->id:'').'" '.$domData.' >';
|
||||
$out .= '<div style="display: inline-block; padding-right:4px" class="titlefieldcreate wordbreak';
|
||||
$out .= '<div style="display: inline-block; padding-right:4px" class="wordbreak';
|
||||
}
|
||||
//$out .= "titlefield";
|
||||
//if (GETPOST('action', 'restricthtml') == 'create') $out.='create';
|
||||
@ -8305,6 +8309,7 @@ abstract class CommonObject
|
||||
} else {
|
||||
$out .= ($display_type=='card' ? '</tr>' : '</div>');
|
||||
}
|
||||
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
@ -8315,6 +8320,10 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
$out .= '<!-- commonobject:showOptionals end --> '."\n";
|
||||
|
||||
if (empty($nbofextrafieldsshown)) {
|
||||
$out = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6318,7 +6318,7 @@ class Form
|
||||
// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
|
||||
// of using supplier invoices (this is a very bad idea !)
|
||||
if (empty($conf->global->EXPENSEREPORT_OVERRIDE_VAT)) {
|
||||
$title = ' title="'.$langs->trans('VATIsNotUsed').'"';
|
||||
$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
|
||||
$disabled = true;
|
||||
}
|
||||
}
|
||||
@ -6375,7 +6375,7 @@ class Form
|
||||
|
||||
if (!$options_only) {
|
||||
$return .= '</select>';
|
||||
//$return .= ajax_combobox($htmlname); // This break for the moment dynamic autoselection of a value when selecting a product in object lines
|
||||
//$return .= ajax_combobox($htmlname); // This break for the moment the dynamic autoselection of a value when selecting a product in object lines
|
||||
}
|
||||
} else {
|
||||
$return .= $this->error;
|
||||
|
||||
@ -6283,7 +6283,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
|
||||
if ($idprod > 0) {
|
||||
// Load product
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($idprod);
|
||||
$product->fetch($idprod);
|
||||
|
||||
if ($mysoc->country_code == $thirdpartytouse->country_code) { // If country to consider is ours
|
||||
if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object
|
||||
@ -6307,7 +6307,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
|
||||
|
||||
if (!$found) {
|
||||
if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) {
|
||||
// If vat of product for the country not found or not defined, we return the first found (sorting on use_default then higher vat of country).
|
||||
// If vat of product for the country not found or not defined, we return the first rate found (sorting on use_default, then on higher vat of country).
|
||||
$sql = "SELECT t.taux as vat_rate, t.code as default_vat_code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
||||
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code = '".$db->escape($thirdpartytouse->country_code)."'";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user