From 2c163b8163b4ec80f839e2ae88b695105c85599d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 2 Mar 2021 15:22:22 +0100 Subject: [PATCH 01/17] fix #16510 --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9ebe63c44d0..73a2ae92b3c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6988,7 +6988,7 @@ abstract class CommonObject $out .= "\n"; // Add code to manage list depending on others if (!empty($conf->use_javascript_ajax)) { - $out .= getJSListDependancies(); + $out .= $this->getJSListDependancies(); } $out .= ' '."\n"; From c5ac79e34c9abdbb5386081e3c7cb527e809704d Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 2 Mar 2021 15:24:55 +0100 Subject: [PATCH 02/17] Fix #16432 : Update of getCountriesinEEX --- htdocs/core/lib/company.lib.php | 58 +++++++++------------------------ 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c6cd0998326..80e15565c4f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -710,51 +710,25 @@ function getFormeJuridiqueLabel($code) */ function getCountriesInEEC() { - global $conf; + global $conf, $db; + $country_code_in_EEC = array(); - // List of all country codes that are in europe for european vat rules - // List found on http://ec.europa.eu/taxation_customs/common/faq/faq_1179_en.htm#9 - $country_code_in_EEC = array( - 'AT', // Austria - 'BE', // Belgium - 'BG', // Bulgaria - 'CY', // Cyprus - 'CZ', // Czech republic - 'DE', // Germany - 'DK', // Danemark - 'EE', // Estonia - 'ES', // Spain - 'FI', // Finland - 'FR', // France - 'GB', // United Kingdom - 'GR', // Greece - 'HR', // Croatia - 'NL', // Holland - 'HU', // Hungary - 'IE', // Ireland - 'IM', // Isle of Man - Included in UK - 'IT', // Italy - 'LT', // Lithuania - 'LU', // Luxembourg - 'LV', // Latvia - 'MC', // Monaco - Included in France - 'MT', // Malta - //'NO', // Norway - 'PL', // Poland - 'PT', // Portugal - 'RO', // Romania - 'SE', // Sweden - 'SK', // Slovakia - 'SI', // Slovenia - 'UK', // United Kingdom - //'CH', // Switzerland - No. Swizerland in not in EEC - ); + $sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc"; + $sql .= " WHERE cc.eec = 1"; + $sql .= " AND cc.active = 1"; - if (!empty($conf->global->MAIN_COUNTRIES_IN_EEC)) { - // For example MAIN_COUNTRIES_IN_EEC = 'AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,NL,HU,IE,IM,IT,LT,LU,LV,MC,MT,PL,PT,RO,SE,SK,SI,UK' - $country_code_in_EEC = explode(',', $conf->global->MAIN_COUNTRIES_IN_EEC); + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $objp = $db->fetch_object($resql); + $country_code_in_EEC[] = $objp->code; + $i++; + } + } else { + dol_print_error($db); } - return $country_code_in_EEC; } From fc86784cfc62b54b347bd88aadf4a1f00a289d10 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 2 Mar 2021 16:03:14 +0100 Subject: [PATCH 03/17] Fix #16432 : update with eldy advices --- htdocs/core/lib/company.lib.php | 34 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 80e15565c4f..1e6542d7ed1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -710,24 +710,30 @@ function getFormeJuridiqueLabel($code) */ function getCountriesInEEC() { + // List of all country codes that are in europe for european vat rules + // List found on http://ec.europa.eu/taxation_customs/common/faq/faq_1179_en.htm#9 global $conf, $db; $country_code_in_EEC = array(); - $sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc"; - $sql .= " WHERE cc.eec = 1"; - $sql .= " AND cc.active = 1"; - - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) { - $objp = $db->fetch_object($resql); - $country_code_in_EEC[] = $objp->code; - $i++; - } + if (!empty($conf->global->MAIN_COUNTRIES_IN_EEC)) { + // For example MAIN_COUNTRIES_IN_EEC = 'AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,NL,HU,IE,IM,IT,LT,LU,LV,MC,MT,PL,PT,RO,SE,SK,SI,UK' + $country_code_in_EEC = explode(',', $conf->global->MAIN_COUNTRIES_IN_EEC); } else { - dol_print_error($db); + $sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc"; + $sql .= " WHERE cc.eec = 1"; + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $objp = $db->fetch_object($resql); + $country_code_in_EEC[] = $objp->code; + $i++; + } + } else { + dol_print_error($db); + } } return $country_code_in_EEC; } From b374a8a00b28ddb15fd2149326cb2bdcc98a2216 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 2 Mar 2021 15:03:36 +0000 Subject: [PATCH 04/17] Fixing style errors. --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1e6542d7ed1..25ba7afff84 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -721,7 +721,7 @@ function getCountriesInEEC() } else { $sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc"; $sql .= " WHERE cc.eec = 1"; - + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); From 2eaa6ad6c6ba11327e05fda2c14a3ff8abe6ca7c Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 2 Mar 2021 16:21:43 +0100 Subject: [PATCH 05/17] Fix #16432 : Add cache use in function --- htdocs/core/lib/company.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 25ba7afff84..0bdfbd28a7d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -718,6 +718,9 @@ function getCountriesInEEC() if (!empty($conf->global->MAIN_COUNTRIES_IN_EEC)) { // For example MAIN_COUNTRIES_IN_EEC = 'AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,NL,HU,IE,IM,IT,LT,LU,LV,MC,MT,PL,PT,RO,SE,SK,SI,UK' $country_code_in_EEC = explode(',', $conf->global->MAIN_COUNTRIES_IN_EEC); + } elseif (!empty($conf->cache['country_code_in_EEC'])) { + // Use of cache to reduce number of database requests + $country_code_in_EEC = $conf->cache['country_code_in_EEC']; } else { $sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc"; $sql .= " WHERE cc.eec = 1"; @@ -734,6 +737,7 @@ function getCountriesInEEC() } else { dol_print_error($db); } + $conf->cache['country_code_in_EEC'] = $country_code_in_EEC; } return $country_code_in_EEC; } From 30c6e268a16448201dc7c34b20061b864e60b1e5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 2 Mar 2021 22:55:43 +0100 Subject: [PATCH 06/17] fix warning --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/tpl/extrafields_view.tpl.php | 1 - htdocs/projet/class/project.class.php | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 21457b37848..06bd44ed345 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1985,7 +1985,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = global $conf, $langs; if ($tzoutput === 'auto') { - $tzoutput = (empty($conf) ? 'tzserver' : $conf->tzuserinputkey); + $tzoutput = (empty($conf) ? 'tzserver' : (isset($conf->tzuserinputkey)?$conf->tzuserinputkey:'tzserver')); } // Clean parameters diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9db0ae13824..01ea40af0fe 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -46,7 +46,6 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - //var_dump($extrafields->attributes[$object->table_element]); if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index c6e9799afa7..b0acb7869b1 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -708,6 +708,7 @@ class Project extends CommonObject /* Return array even if empty*/ return $elements; } else { + //$this->error = $this->db->error; dol_print_error($this->db); } } From 7eb3e324c7a6789583432527e0d96459960a1a6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Mar 2021 23:09:55 +0100 Subject: [PATCH 07/17] FIX #16503 --- htdocs/comm/propal/card.php | 15 ++++++++------- htdocs/commande/card.php | 11 ++++++----- htdocs/compta/facture/card-rec.php | 8 ++++---- htdocs/compta/facture/card.php | 8 ++++---- htdocs/contrat/card.php | 17 ++++++++++------- htdocs/core/lib/functions.lib.php | 2 +- htdocs/fichinter/card.php | 12 ++++-------- htdocs/fourn/commande/card.php | 12 ++++++------ htdocs/fourn/commande/dispatch.php | 4 ++-- htdocs/fourn/facture/card.php | 13 ++++++------- htdocs/product/inventory/inventory.php | 1 - htdocs/supplier_proposal/card.php | 10 +++++----- 12 files changed, 56 insertions(+), 57 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index eb3e3ef375a..6779adc60c6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -796,9 +796,9 @@ if (empty($reshook)) } elseif ($action == 'addline' && $usercancreate) { // Add line // Set if we used free entry or predefined product $predef = ''; - $product_desc = (GETPOSTISSET('dp_desc') ?GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht')); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht')); + $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { @@ -1153,10 +1153,11 @@ if (empty($reshook)) { // Define info_bits $info_bits = 0; - if (preg_match('/\*/', GETPOST('tva_tx'))) + if (preg_match('/\*/', GETPOST('tva_tx'))) { $info_bits |= 0x01; + } - // Clean parameters + // Clean parameters $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml')); // Define vat_rate @@ -1164,13 +1165,13 @@ if (empty($reshook)) $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); - $pu_ht = GETPOST('price_ht'); + $pu_ht = price2num(GETPOST('price_ht'), '', 2); // Add buying price $fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : ''); $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index eccb6cd4ca6..1ef37552f1f 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -632,8 +632,8 @@ if (empty($reshook)) // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { @@ -989,14 +989,15 @@ if (empty($reshook)) $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml')); - $pu_ht = GETPOST('price_ht'); + $pu_ht = price2num(GETPOST('price_ht'), '', 2); $vat_rate = (GETPOST('tva_tx') ?GETPOST('tva_tx') : 0); - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); // Define info_bits $info_bits = 0; - if (preg_match('/\*/', $vat_rate)) + if (preg_match('/\*/', $vat_rate)) { $info_bits |= 0x01; + } // Define vat_rate $vat_rate = str_replace('*', '', $vat_rate); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 393595bc0a8..effaa649a21 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -438,8 +438,8 @@ if (empty($reshook)) // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $prod_entry_mode = GETPOST('prod_entry_mode', 'alpha'); if ($prod_entry_mode == 'free') { @@ -724,10 +724,10 @@ if (empty($reshook)) //$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); //$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml') ? GETPOST('product_desc', 'restricthtml') : GETPOST('desc', 'restricthtml')); - $pu_ht = GETPOST('price_ht'); + $pu_ht = price2num(GETPOST('price_ht'), '', 2); $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $qty = GETPOST('qty'); - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); // Define info_bits $info_bits = 0; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9f7b9e77af3..907d18987ea 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1895,8 +1895,8 @@ if (empty($reshook)) // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOST('dp_desc', 'none') ?GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht')); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht')); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $prod_entry_mode = GETPOST('prod_entry_mode', 'alpha'); if ($prod_entry_mode == 'free') { @@ -2216,10 +2216,10 @@ if (empty($reshook)) $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml') ? GETPOST('product_desc', 'restricthtml') : GETPOST('desc', 'restricthtml')); - $pu_ht = GETPOST('price_ht'); + $pu_ht = price2num(GETPOST('price_ht'), '', 2); $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $qty = GETPOST('qty'); - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); // Define info_bits $info_bits = 0; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4e33fb6d308..8b1367a12bb 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -384,8 +384,8 @@ if (empty($reshook)) // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht', 'CU')); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); if (GETPOST('prod_entry_mode', 'alpha') == 'free') { $idprod = 0; @@ -638,8 +638,9 @@ if (empty($reshook)) $vat_rate = GETPOST('eltva_tx'); // Define info_bits $info_bits = 0; - if (preg_match('/\*/', $vat_rate)) + if (preg_match('/\*/', $vat_rate)) { $info_bits |= 0x01; + } // Define vat_rate $vat_rate = str_replace('*', '', $vat_rate); @@ -658,10 +659,12 @@ if (empty($reshook)) } // ajout prix d'achat - $fk_fournprice = $_POST['fournprice']; - if (!empty($_POST['buying_price'])) - $pa_ht = $_POST['buying_price']; - else $pa_ht = null; + $fk_fournprice = GETPOST('fournprice'); + if (GETPOST('buying_price')) { + $pa_ht = price2num(GETPOST('buying_price'), '', 2); + } else { + $pa_ht = null; + } $fk_unit = GETPOST('unit', 'alpha'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 21457b37848..1bb54763f5b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4871,7 +4871,7 @@ function price2num($amount, $rounding = '', $option = 0) $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\_]/', '', $amount); } - if ($option == 2 && $thousand == '.' && preg_match('/\.(\d\d\d)$/', (string) $amount)) { // It means the . is used as a thousand separator and string come frominput data, so 1.123 is 1123 + if ($option == 2 && $thousand == '.' && preg_match('/\.(\d\d\d)$/', (string) $amount)) { // It means the . is used as a thousand separator and string come from input data, so 1.123 is 1123 $amount = str_replace($thousand, '', $amount); } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index a4fed934936..0b919c3eb4b 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -576,14 +576,12 @@ if (empty($reshook)) */ elseif ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save', 'alpha') == $langs->trans("Save")) { $objectline = new FichinterLigne($db); - if ($objectline->fetch($lineid) <= 0) - { + if ($objectline->fetch($lineid) <= 0) { dol_print_error($db); exit; } - if ($object->fetch($objectline->fk_fichinter) <= 0) - { + if ($object->fetch($objectline->fk_fichinter) <= 0) { dol_print_error($db); exit; } @@ -603,8 +601,7 @@ if (empty($reshook)) $objectline->array_options = $array_options; $result = $objectline->update($user); - if ($result < 0) - { + if ($result < 0) { dol_print_error($db); exit; } @@ -614,8 +611,7 @@ if (empty($reshook)) $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (!empty($newlang)) - { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index db5e906ec85..8367e04ef10 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -363,17 +363,17 @@ if (empty($reshook)) if ($prod_entry_mode == 'free') { $idprod = 0; - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod = GETPOST('idprod', 'int'); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = ''; } $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); $remise_percent = GETPOST('remise_percent'.$predef); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -689,7 +689,7 @@ if (empty($reshook)) if (GETPOST('price_ht') != '') { $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); + $ht = price2num(GETPOST('price_ht'), '', 2); } else { $vatratecleaned = $vat_rate; if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" @@ -698,12 +698,12 @@ if (empty($reshook)) $vatratecode = $reg[2]; } - $ttc = price2num(GETPOST('price_ttc')); + $ttc = price2num(GETPOST('price_ttc'), '', 2); $ht = $ttc / (1 + ($vatratecleaned / 100)); $price_base_type = 'HT'; } - $pu_ht_devise = GETPOST('multicurrency_subprice'); + $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2); // Extrafields Lines $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 78db7e85a47..6a42ad77aa3 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -462,13 +462,13 @@ if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionne $qty = $supplierorderdispatch->qty; $entrepot = $supplierorderdispatch->fk_entrepot; $product = $supplierorderdispatch->fk_product; - $price = GETPOST('price'); + $price = price2num(GETPOST('price'), '', 2); $comment = $supplierorderdispatch->comment; $eatby = $supplierorderdispatch->fk_product; $sellby = $supplierorderdispatch->sellby; $batch = $supplierorderdispatch->batch; - $supplierorderdispatch->qty = GETPOST('qty', 'int'); + $supplierorderdispatch->qty = price2num(GETPOST('qty', 'alpha'), 'MS', 2); $supplierorderdispatch->fk_entrepot = GETPOST('fk_entrepot'); $result = $supplierorderdispatch->update($user); } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index eb6a87af040..80491d5edfe 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1079,12 +1079,11 @@ if (empty($reshook)) $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); - if (GETPOST('price_ht') != '' || GETPOST('multicurrency_subprice') != '') - { - $up = price2num(GETPOST('price_ht')); + if (GETPOST('price_ht') != '' || GETPOST('multicurrency_subprice') != '') { + $up = price2num(GETPOST('price_ht'), '', 2); $price_base_type = 'HT'; } else { - $up = price2num(GETPOST('price_ttc')); + $up = price2num(GETPOST('price_ttc'), '', 2); $price_base_type = 'TTC'; } @@ -1183,17 +1182,17 @@ if (empty($reshook)) if ($prod_entry_mode == 'free') { $idprod = 0; - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod = GETPOST('idprod', 'int'); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = ''; } $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); $remise_percent = GETPOST('remise_percent'.$predef); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index d5c9ec4966b..53a4daf19bd 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -423,7 +423,6 @@ if ($object->id > 0) print ''; // Line to add a new line in inventory - //if ($action == 'addline') { if ($object->status == $object::STATUS_VALIDATED) { print ''; print ''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index cca21d3a305..6f848fcd775 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -547,17 +547,17 @@ if (empty($reshook)) $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { $idprod = 0; - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod = GETPOST('idprod', 'int'); - $price_ht = price2num(GETPOST('price_ht'), 'MU'); + $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); $tva_tx = ''; } $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); $remise_percent = GETPOST('remise_percent'.$predef); - $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU'); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); @@ -853,7 +853,7 @@ if (empty($reshook)) if (GETPOST('price_ht') != '') { - $ht = price2num(GETPOST('price_ht')); + $ht = price2num(GETPOST('price_ht'), '', 2); } if (GETPOST('price_ttc') != '') @@ -866,7 +866,7 @@ if (empty($reshook)) $vatratecode = $reg[2]; } - $ttc = price2num(GETPOST('price_ttc')); + $ttc = price2num(GETPOST('price_ttc'), '', 2); $ht = $ttc / (1 + ($vatratecleaned / 100)); } From 4e5849e50b01c4efbbdaaf41a53254a34da8e43b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 2 Mar 2021 23:13:05 +0100 Subject: [PATCH 08/17] remove debug --- htdocs/core/tpl/extrafields_view.tpl.php | 1 + htdocs/projet/class/project.class.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 01ea40af0fe..9db0ae13824 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -46,6 +46,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + //var_dump($extrafields->attributes[$object->table_element]); if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b0acb7869b1..c6e9799afa7 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -708,7 +708,6 @@ class Project extends CommonObject /* Return array even if empty*/ return $elements; } else { - //$this->error = $this->db->error; dol_print_error($this->db); } } From 9f4bdd86b43f2a7f2e437079d3e97c4cb138a8a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Mar 2021 23:48:33 +0100 Subject: [PATCH 09/17] More robust test --- test/phpunit/SocieteTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 32b224bb584..0435a5e80f4 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -91,6 +91,10 @@ class SocieteTest extends PHPUnit\Framework\TestCase print "\n".__METHOD__." constant MAIN_DISABLEPROFIDRULES must be empty (if a module set it, disable module).\n"; die(); } + if ($langs->defaultlang != 'en_US') { + print "\n".__METHOD__." default language of company must be set to autodetect.\n"; die(); + } + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. print __METHOD__."\n"; @@ -347,6 +351,8 @@ class SocieteTest extends PHPUnit\Framework\TestCase print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertNotEquals($result, ''); + $localobject->country_code = 'FR'; + $result=$localobject->isInEEC(); print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n"; $this->assertTrue(true, $result); From 348b8d2ffe3747b41c7f128369319973eb01ff2f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Mar 2021 23:55:41 +0100 Subject: [PATCH 10/17] More phpunit tests --- htdocs/core/lib/company.lib.php | 2 +- test/phpunit/SocieteTest.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c6cd0998326..fdbac5f3348 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -772,7 +772,7 @@ function isInEEC($object) $country_code_in_EEC = getCountriesInEEC(); - //print "dd".$this->country_code; + //print "dd".$object->country_code; return in_array($object->country_code, $country_code_in_EEC); } diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 0435a5e80f4..aa57d987238 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -355,7 +355,20 @@ class SocieteTest extends PHPUnit\Framework\TestCase $result=$localobject->isInEEC(); print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n"; - $this->assertTrue(true, $result); + $this->assertTrue($result); + + $localobject->country_code = 'US'; + + $result=$localobject->isInEEC(); + print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n"; + $this->assertFalse($result); + + /*$localobject->country_code = 'GB'; + + $result=$localobject->isInEEC(); + print __METHOD__." id=".$localobject->id." country_code=".$localobject->country_code." result=".$result."\n"; + $this->assertTrue($result); + */ $localobject->info($localobject->id); print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; From c2f0d9f42c0f0dfdaebd8fce2b4ed53b62dc42e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Mar 2021 23:57:37 +0100 Subject: [PATCH 11/17] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 06bd44ed345..e213466b58a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1985,7 +1985,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = global $conf, $langs; if ($tzoutput === 'auto') { - $tzoutput = (empty($conf) ? 'tzserver' : (isset($conf->tzuserinputkey)?$conf->tzuserinputkey:'tzserver')); + $tzoutput = (empty($conf) ? 'tzserver' : (isset($conf->tzuserinputkey) ? $conf->tzuserinputkey : 'tzserver')); } // Clean parameters From b5d1e36ece85764b9a28531eba6aa315df8df08e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Mar 2021 11:31:40 +0100 Subject: [PATCH 12/17] Fix include --- htdocs/core/lib/functions.lib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bace4411184..4dc1f7251c1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5811,9 +5811,12 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, if (($seller_in_cee && $buyer_in_cee)) { $isacompany = $thirdparty_buyer->isACompany(); if ($isacompany) { - if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID) && !isValidVATID($thirdparty_buyer)) { - //print 'VATRULE 6'; - return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); + if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + if (!isValidVATID($thirdparty_buyer)) { + //print 'VATRULE 6'; + return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); + } } //print 'VATRULE 3'; return 0; From a8bf47b9cec0a8767773028e496663814b86d504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 3 Mar 2021 12:02:48 +0100 Subject: [PATCH 13/17] fix unknown constant and variable --- htdocs/core/class/html.form.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index dd93dd268b7..8324e500c3c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7714,8 +7714,8 @@ class Form print ''.$objp->ref.''; print ''.$objp->ref_client.''; print ''; - if ($possiblelink[label] == 'LinkToContract') { - $form = new Form($db); + if ($possiblelink['label'] == 'LinkToContract') { + $form = new Form($this->db); print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; } print price($objp->total_ht).''; @@ -7732,8 +7732,6 @@ class Form dol_print_error($this->db); } print ''; - if ($num > 0) { - } //$linktoelem.=($linktoelem?'   ':''); if ($num > 0) { From 093eab188e230e8b2bcc935387feffdb68dc7252 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Mar 2021 12:02:57 +0100 Subject: [PATCH 14/17] Code comment --- htdocs/core/lib/functions.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1bb54763f5b..a66d1429941 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4866,7 +4866,7 @@ function price2num($amount, $rounding = '', $option = 0) // Convert value to universal number format (no thousand separator, '.' as decimal separator) if ($option != 1) { // If not a PHP number or unknown, we change or clean format - //print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'
'; + //print "\n".'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'
'; if (!is_numeric($amount)) { $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\_]/', '', $amount); } @@ -4896,6 +4896,7 @@ function price2num($amount, $rounding = '', $option = 0) $amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is . $amount = str_replace($dec, '.', $amount); } + //print ' XX'.$amount.' '.$rounding; // Now, make a rounding if required if ($rounding) @@ -4917,10 +4918,10 @@ function price2num($amount, $rounding = '', $option = 0) $nbofdectoround = max($conf->global->MAIN_MAX_DECIMALS_TOT, 8); // TODO Use param of currency } elseif (is_numeric($rounding)) $nbofdectoround = $rounding; - //print "RR".$amount.' - '.$nbofdectoround.'
'; + //print " RR".$amount.' - '.$nbofdectoround.'
'; if (dol_strlen($nbofdectoround)) $amount = round(is_string($amount) ? (float) $amount : $amount, $nbofdectoround); // $nbofdectoround can be 0. else return 'ErrorBadParameterProvidedToFunction'; - //print 'SS'.$amount.' - '.$nbofdec.' - '.$dec.' - '.$thousand.' - '.$nbofdectoround.'
'; + //print ' SS'.$amount.' - '.$nbofdec.' - '.$dec.' - '.$thousand.' - '.$nbofdectoround.'
'; // Convert amount to format with dolibarr dec and thousand (this is because PHP convert a number // to format defined by LC_NUMERIC after a calculation and we want source format to be defined by Dolibarr setup. From 5f8b52ffc98e0b04ef8083de041c725770e9f49b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Mar 2021 12:05:43 +0100 Subject: [PATCH 15/17] Code comment --- htdocs/core/lib/functions.lib.php | 7 ++++--- test/phpunit/FunctionsLibTest.php | 12 ++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 26f821750b9..0cf452d683c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5159,7 +5159,7 @@ function price2num($amount, $rounding = '', $option = 0) // Convert value to universal number format (no thousand separator, '.' as decimal separator) if ($option != 1) { // If not a PHP number or unknown, we change or clean format - //print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'
'; + //print "\n".'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'
'; if (!is_numeric($amount)) { $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\_]/', '', $amount); } @@ -5188,6 +5188,7 @@ function price2num($amount, $rounding = '', $option = 0) $amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is . $amount = str_replace($dec, '.', $amount); } + //print ' XX'.$amount.' '.$rounding; // Now, make a rounding if required if ($rounding) { @@ -5205,13 +5206,13 @@ function price2num($amount, $rounding = '', $option = 0) } elseif (is_numeric($rounding)) { $nbofdectoround = (int) $rounding; } - //print "RR".$amount.' - '.$nbofdectoround.'
'; + //print " RR".$amount.' - '.$nbofdectoround.'
'; if (dol_strlen($nbofdectoround)) { $amount = round(is_string($amount) ? (float) $amount : $amount, $nbofdectoround); // $nbofdectoround can be 0. } else { return 'ErrorBadParameterProvidedToFunction'; } - //print 'SS'.$amount.' - '.$nbofdec.' - '.$dec.' - '.$thousand.' - '.$nbofdectoround.'
'; + //print ' SS'.$amount.' - '.$nbofdec.' - '.$dec.' - '.$thousand.' - '.$nbofdectoround.'
'; // Convert amount to format with dolibarr dec and thousand (this is because PHP convert a number // to format defined by LC_NUMERIC after a calculation and we want source format to be defined by Dolibarr setup. diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index f1341c9a042..e43453b26ec 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -108,7 +108,15 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. if (! function_exists('mb_substr')) { - print "\n".__METHOD__." function mb_substr must be enabled.\n"; die(); + print "\n".__METHOD__." function mb_substr must be enabled.\n"; die(1); + } + + if ($conf->global->MAIN_MAX_DECIMALS_UNIT != 5) { + print "\n".__METHOD__." bad setup for number of digits for unit amount. Must be 5 for this test.\n"; die(1); + } + + if ($conf->global->MAIN_MAX_DECIMALS_TOT != 2) { + print "\n".__METHOD__." bad setup for number of digits for unit amount. Must be 2 for this test.\n"; die(1); } print __METHOD__."\n"; @@ -1294,7 +1302,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase $this->assertEquals(1000.123456, price2num('1 000.123456')); // Round down - $this->assertEquals(1000.12, price2num('1 000.123452', 'MT')); + $this->assertEquals(1000.12, price2num('1 000.123452', 'MT'), 'Error in round down with MT'); $this->assertEquals(1000.12345, price2num('1 000.123452', 'MU'), "Test MU"); // Round up From 2d9f00eb57214eb06f86233d24699650967dd1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 3 Mar 2021 12:24:44 +0100 Subject: [PATCH 16/17] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e09ea7d96a9..59892da0c88 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7519,7 +7519,7 @@ abstract class CommonObject */ public function getJSListDependancies($type = '_extra') { - $out .= ' + $out = '