From cba04c9648eaf5dabb970a4663a07b5cc710bd20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 13 Sep 2022 20:48:59 +0200 Subject: [PATCH 01/34] Update bonprelevement.class.php --- .../class/bonprelevement.class.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 18216c1cda6..06b912ec343 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -450,9 +450,6 @@ class BonPrelevement extends CommonObject dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error ".$this->error); } } - //var_dump($paiement->amounts); - //var_dump($thirdpartyid); - //var_dump($cursoramounts); } // Update withdrawal line @@ -1039,15 +1036,15 @@ class BonPrelevement extends CommonObject $account = new Account($this->db); if ($account->fetch($id) > 0) { $this->emetteur_code_banque = $account->code_banque; - $this->emetteur_code_guichet = $account->code_guichet; - $this->emetteur_numero_compte = $account->number; + $this->emetteur_code_guichet = $account->code_guichet; + $this->emetteur_numero_compte = $account->number; $this->emetteur_number_key = $account->cle_rib; - $this->emetteur_iban = $account->iban; - $this->emetteur_bic = $account->bic; + $this->emetteur_iban = $account->iban; + $this->emetteur_bic = $account->bic; - $this->emetteur_ics = ($type == 'bank-transfer' ? $account->ics_transfer : $account->ics); + $this->emetteur_ics = ($type == 'bank-transfer' ? $account->ics_transfer : $account->ics); - $this->raison_sociale = $account->proprio; + $this->raison_sociale = $account->proprio; } $this->factures = $factures_prev_id; @@ -1057,8 +1054,6 @@ class BonPrelevement extends CommonObject // This also set the property $this->total with amount that is included into file $result = $this->generate($format, $executiondate, $type); if ($result < 0) { - /*var_dump($this->error); - var_dump($this->invoice_in_error); */ $error++; } } @@ -1684,7 +1679,7 @@ class BonPrelevement extends CommonObject fclose($this->file); if (!empty($conf->global->MAIN_UMASK)) { - @chmod($this->file, octdec($conf->global->MAIN_UMASK)); + @chmod($this->filename, octdec($conf->global->MAIN_UMASK)); } return $result; From 7124b5bf755199b00173d7308a6799fa826942f8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 14 Sep 2022 05:16:50 +0200 Subject: [PATCH 02/34] FIX #22264 Accountancy - Translation on chart of accounts export --- htdocs/core/modules/modAccounting.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index e0bf3a9bbc5..83c1e99183f 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -256,11 +256,11 @@ class modAccounting extends DolibarrModules $r++; $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'Chartofaccounts'; - $this->export_icon[$r] = 'accounting'; + $this->export_icon[$r] = 'Accounting'; $this->export_permission[$r] = array(array("accounting", "chartofaccount")); $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); - $this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa.accountparent'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting"); + $this->export_entities_array[$r] = array(); // We define here only fields that use another picto $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'accounting_account as aa'; From 81e8b872a82279410520665bd3b4bd2b6c86d8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 14 Sep 2022 08:51:22 +0200 Subject: [PATCH 03/34] Update bonprelevement.class.php --- htdocs/compta/prelevement/class/bonprelevement.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 06b912ec343..0db7bc2b2b9 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -2175,7 +2175,8 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf;*/ } } else { - fputs($this->file, 'INCORRECT EMETTEUR '.$XML_SEPA_INFO.$CrLf); + fputs($this->file, 'INCORRECT EMETTEUR '.$this->raison_sociale.$CrLf); + $XML_SEPA_INFO = ''; } return $XML_SEPA_INFO; } From dd4be90525ace20821ba05adb775df11d00f611f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 14:15:41 +0200 Subject: [PATCH 04/34] Fix warning --- htdocs/core/class/conf.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 60ee78bbff5..6f08ea8f0ae 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -820,7 +820,7 @@ class Conf } // If we are in develop mode, we activate the option MAIN_SECURITY_CSRF_WITH_TOKEN to 1 if not already defined. - if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN) && $this->global->MAIN_FEATURES_LEVEL >= 2) { + if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN) && isset($this->global->MAIN_FEATURES_LEVEL) && $this->global->MAIN_FEATURES_LEVEL >= 2) { $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 1; } From 12ce79ab078d1663fc40a9846b1bfadd93321509 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 14:50:12 +0200 Subject: [PATCH 05/34] Fix rounding --- htdocs/core/lib/price.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 9be293a81ab..ca01317ad5d 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -372,16 +372,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // If rounding is not using base 10 (rare) if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { if ($price_base_type == 'HT') { - $result[0] = round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; + $result[0] = price2num(round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); $result[2] = price2num($result[0] + $result[1] + $result[9] + $result[10], 'MT'); } else { - $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[2] = round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; + $result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[2] = price2num(round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); $result[0] = price2num($result[2] - $result[1] - $result[9] - $result[10], 'MT'); } } From 5d39f7b6a33b4cb8808343c19ee702658b4c1884 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 15:20:17 +0200 Subject: [PATCH 06/34] Try to move to bionic --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92cd2059b15..7e900ebc77b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ # We use dist: xenial to have php 5.6+ available os: linux -dist: xenial -#dist: bionic +#dist: xenial +dist: bionic language: php @@ -20,7 +20,7 @@ services: addons: # Force postgresql to 9.4 (the oldest availablable on xenial) - postgresql: '9.4' + postgresql: '10' apt: sources: # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ @@ -74,6 +74,8 @@ notifications: before_install: - | + echo "Add ondrej PPA" + add-apt-repository -y ppa:ondrej/php echo "Disabling Xdebug for composer" export PHP_VERSION_NAME=$(phpenv version-name) cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini From 48f0a956822b73b50d6b4adabafda6f114e290ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 15:51:00 +0200 Subject: [PATCH 07/34] Try fix travis --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7e900ebc77b..ebab9b0d017 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ addons: # Let's install Apache with. - apache2 # mod_php is not supported by Travis. Add fcgi. We install FPM later on. - - libapache2-mod-fastcgi + #- libapache2-mod-fastcgi # We need pgloader for import mysql database into pgsql - pgloader @@ -72,6 +72,7 @@ notifications: on_failure: always use_notice: true + before_install: - | echo "Add ondrej PPA" @@ -240,6 +241,10 @@ before_script: - echo "Setting up Apache + FPM" + # setup link for php legacy + - sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php + # install apache web server + - sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | @@ -247,10 +252,11 @@ before_script: # Copy the included pool sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf fi - - sudo a2enmod rewrite actions fastcgi alias + - sudo a2enmod proxy_fcgi rewrite setenvif cgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - - sudo chown -R travis:travis /var/lib/apache2/fastcgi + #- sudo chown -R travis:travis /var/lib/apache2/fastcgi + # start php-fpm - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm # configure apache virtual hosts - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf From 1162d858ddfca0f85d7408986265d767a37ac924 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:01:07 +0200 Subject: [PATCH 08/34] Try fix rounding --- htdocs/core/class/commonobject.class.php | 28 +++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 513717b56de..b9b09450642 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3529,10 +3529,11 @@ abstract class CommonObject if (!$resqlfix) { dol_print_error($this->db, 'Failed to update line'); } - $this->total_tva -= $diff; - $this->total_ttc -= $diff; - $total_tva_by_vats[$obj->vatrate] -= $diff; - $total_ttc_by_vats[$obj->vatrate] -= $diff; + + $this->total_tva = (float) price2num($this->total_tva - $diff, '', 1); + $this->total_ttc = (float) price2num($this->total_ttc - $diff, '', 1); + $total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff, '', 1); + $total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff, '', 1); } } @@ -3559,9 +3560,16 @@ abstract class CommonObject } } + // Clean total + $this->total_ht = (float) price2num($this->total_ht); + $this->total_tva = (float) price2num($this->total_tva); + $this->total_localtax1 = (float) price2num($this->total_localtax1); + $this->total_localtax2 = (float) price2num($this->total_localtax2); + $this->total_ttc = (float) price2num($this->total_ttc); + $this->db->free($resql); - // Now update global field total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* + // Now update global fields total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* $fieldht = 'total_ht'; $fieldtva = 'tva'; $fieldlocaltax1 = 'localtax1'; @@ -3592,11 +3600,11 @@ abstract class CommonObject if (empty($nodatabaseupdate)) { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.' SET'; - $sql .= " ".$fieldht." = ".((float) price2num($this->total_ht)).","; - $sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva)).","; - $sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1)).","; - $sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2)).","; - $sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc)); + $sql .= " ".$fieldht." = ".((float) price2num($this->total_ht, 'MT', 1)).","; + $sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2, 'MT', 1)).","; + $sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc, 'MT', 1)); $sql .= ", multicurrency_total_ht = ".((float) price2num($this->multicurrency_total_ht, 'MT', 1)); $sql .= ", multicurrency_total_tva = ".((float) price2num($this->multicurrency_total_tva, 'MT', 1)); $sql .= ", multicurrency_total_ttc = ".((float) price2num($this->multicurrency_total_ttc, 'MT', 1)); From 802c06c15e744a70a38f63139145cbb65d389f9e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:15:13 +0200 Subject: [PATCH 09/34] Try travis fix --- .travis.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebab9b0d017..21b010b3704 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,19 @@ services: - mysql - postgresql + +before_install: +- | + echo "Add ondrej PPA" + sudo add-apt-repository -y ppa:ondrej/php + sudo apt-get update + echo "Disabling Xdebug for composer" + export PHP_VERSION_NAME=$(phpenv version-name) + echo $PHP_VERSION_NAME + cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini + phpenv config-rm xdebug.ini + echo + addons: # Force postgresql to 9.4 (the oldest availablable on xenial) postgresql: '10' @@ -25,6 +38,7 @@ addons: sources: # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ - pgdg-xenial + - sourceline: 'ppa:ondrej/php' packages: # We need a webserver to test the webservices # Let's install Apache with. @@ -73,16 +87,6 @@ notifications: use_notice: true -before_install: -- | - echo "Add ondrej PPA" - add-apt-repository -y ppa:ondrej/php - echo "Disabling Xdebug for composer" - export PHP_VERSION_NAME=$(phpenv version-name) - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini - phpenv config-rm xdebug.ini - echo - install: - | echo "Updating Composer" From 5afbfd0a0a96101a221bf9e1f80549ea6025f5d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:20:00 +0200 Subject: [PATCH 10/34] Try fix rounding --- htdocs/core/class/commonobject.class.php | 38 ++++++++++++++---------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4d09b8ae769..c9c7f096fd5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3494,10 +3494,11 @@ abstract class CommonObject if (!$resqlfix) { dol_print_error($this->db, 'Failed to update line'); } - $this->total_tva -= $diff; - $this->total_ttc -= $diff; - $total_tva_by_vats[$obj->vatrate] -= $diff; - $total_ttc_by_vats[$obj->vatrate] -= $diff; + + $this->total_tva = (float) price2num($this->total_tva - $diff, '', 1); + $this->total_ttc = (float) price2num($this->total_ttc - $diff, '', 1); + $total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff, '', 1); + $total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff, '', 1); } } @@ -3524,9 +3525,16 @@ abstract class CommonObject } } + // Clean total + $this->total_ht = (float) price2num($this->total_ht); + $this->total_tva = (float) price2num($this->total_tva); + $this->total_localtax1 = (float) price2num($this->total_localtax1); + $this->total_localtax2 = (float) price2num($this->total_localtax2); + $this->total_ttc = (float) price2num($this->total_ttc); + $this->db->free($resql); - // Now update global field total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* + // Now update global fields total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* $fieldht = 'total_ht'; $fieldtva = 'tva'; $fieldlocaltax1 = 'localtax1'; @@ -3557,16 +3565,16 @@ abstract class CommonObject if (empty($nodatabaseupdate)) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET'; - $sql .= " ".$fieldht." = ".price2num($this->total_ht).","; - $sql .= " ".$fieldtva." = ".price2num($this->total_tva).","; - $sql .= " ".$fieldlocaltax1." = ".price2num($this->total_localtax1).","; - $sql .= " ".$fieldlocaltax2." = ".price2num($this->total_localtax2).","; - $sql .= " ".$fieldttc." = ".price2num($this->total_ttc); - $sql .= ", multicurrency_total_ht = ".price2num($this->multicurrency_total_ht, 'MT', 1); - $sql .= ", multicurrency_total_tva = ".price2num($this->multicurrency_total_tva, 'MT', 1); - $sql .= ", multicurrency_total_ttc = ".price2num($this->multicurrency_total_ttc, 'MT', 1); - $sql .= ' WHERE rowid = '.$this->id; - + $sql .= " ".$fieldht." = ".((float) price2num($this->total_ht, 'MT', 1)).","; + $sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2, 'MT', 1)).","; + $sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc, 'MT', 1)); + $sql .= ", multicurrency_total_ht = ".((float) price2num($this->multicurrency_total_ht, 'MT', 1)); + $sql .= ", multicurrency_total_tva = ".((float) price2num($this->multicurrency_total_tva, 'MT', 1)); + $sql .= ", multicurrency_total_ttc = ".((float) price2num($this->multicurrency_total_ttc, 'MT', 1)); + $sql .= " WHERE rowid = ".((int) $this->id); + dol_syslog(get_class($this)."::update_price", LOG_DEBUG); $resql = $this->db->query($sql); From bab7ff256fc862bb2b93a61c739c38ddc2199f7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:35:22 +0200 Subject: [PATCH 11/34] Try fix travis --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21b010b3704..28d8b7004b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,6 @@ services: before_install: - | - echo "Add ondrej PPA" - sudo add-apt-repository -y ppa:ondrej/php - sudo apt-get update echo "Disabling Xdebug for composer" export PHP_VERSION_NAME=$(phpenv version-name) echo $PHP_VERSION_NAME @@ -47,6 +44,8 @@ addons: #- libapache2-mod-fastcgi # We need pgloader for import mysql database into pgsql - pgloader + - php5.6 + - php5.6-pgsql env: global: From d39eca4d50e3deaffb5442baacb5527f038fc1ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:36:29 +0200 Subject: [PATCH 12/34] Fix phpcs --- 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 c9c7f096fd5..5de1744a20d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3574,7 +3574,7 @@ abstract class CommonObject $sql .= ", multicurrency_total_tva = ".((float) price2num($this->multicurrency_total_tva, 'MT', 1)); $sql .= ", multicurrency_total_ttc = ".((float) price2num($this->multicurrency_total_ttc, 'MT', 1)); $sql .= " WHERE rowid = ".((int) $this->id); - + dol_syslog(get_class($this)."::update_price", LOG_DEBUG); $resql = $this->db->query($sql); From ebc3df35ee47ed860e13f0edb97bd5c4c0aeabc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 17:27:32 +0200 Subject: [PATCH 13/34] Try fix --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 28d8b7004b7..9ddc5fe0379 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,11 +21,17 @@ services: before_install: - | + echo "Add ondrej PPA" + sudo add-apt-repository -y ppa:ondrej/php + sudo apt-get update echo "Disabling Xdebug for composer" export PHP_VERSION_NAME=$(phpenv version-name) echo $PHP_VERSION_NAME + ls ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/ cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini phpenv config-rm xdebug.ini + phpenv rehash + phpenv config-add mysqli echo addons: @@ -46,6 +52,7 @@ addons: - pgloader - php5.6 - php5.6-pgsql + - php5.6-mysqli env: global: From 962018d5c74ba7f4361306c2649f30eb1b5244b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 18:14:34 +0200 Subject: [PATCH 14/34] Try fix --- .travis.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ddc5fe0379..a456e92752e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -448,8 +448,8 @@ script: - | echo "Unit testing" - # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. - set -e + # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log and apache error.log file. + set +e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunitresult=$? echo "Phpunit return code = $phpunitresult" @@ -461,6 +461,9 @@ after_script: ls $TRAVIS_BUILD_DIR/documents #cat $TRAVIS_BUILD_DIR/documents/dolibarr.log sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log + echo "After script - Output last lines of apache error.log" + ls /var/log/apache2 + sudo tail -n 50 /var/log/apache2/travis_error_log after_success: - | @@ -469,14 +472,14 @@ after_success: after_failure: - | echo Failure detected, so we show samples of log to help diagnose - # This part of code is executed only if previous command that fails are enclosed with set +e - # Upgrade log files + # This part of code is executed only if the command that fails are enclosed with set +e + # Show upgrade log files for ficlog in `ls $TRAVIS_BUILD_DIR/*.log` do echo "Debugging informations for file $ficlog" #cat $ficlog done - # Apache log file + # Show Apache log file echo "Debugging informations for file apache error.log" sudo cat /var/log/apache2/travis_error_log if [ "$DEBUG" = true ]; then From 2664f1bce041b142fe56298b4b534cc65d42cc8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 18:45:17 +0200 Subject: [PATCH 15/34] Test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a456e92752e..5247b051e23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,6 @@ before_install: cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini phpenv config-rm xdebug.ini phpenv rehash - phpenv config-add mysqli echo addons: @@ -53,6 +52,7 @@ addons: - php5.6 - php5.6-pgsql - php5.6-mysqli + - php5.6-xml env: global: From af0c6c0600eb610a6476481265d898d3d5670f3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 19:36:47 +0200 Subject: [PATCH 16/34] Try restore old travis script --- .travis.yml | 57 +++++++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5247b051e23..92cd2059b15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ # We use dist: xenial to have php 5.6+ available os: linux -#dist: xenial -dist: bionic +dist: xenial +#dist: bionic language: php @@ -18,41 +18,21 @@ services: - mysql - postgresql - -before_install: -- | - echo "Add ondrej PPA" - sudo add-apt-repository -y ppa:ondrej/php - sudo apt-get update - echo "Disabling Xdebug for composer" - export PHP_VERSION_NAME=$(phpenv version-name) - echo $PHP_VERSION_NAME - ls ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/ - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini - phpenv config-rm xdebug.ini - phpenv rehash - echo - addons: # Force postgresql to 9.4 (the oldest availablable on xenial) - postgresql: '10' + postgresql: '9.4' apt: sources: # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ - pgdg-xenial - - sourceline: 'ppa:ondrej/php' packages: # We need a webserver to test the webservices # Let's install Apache with. - apache2 # mod_php is not supported by Travis. Add fcgi. We install FPM later on. - #- libapache2-mod-fastcgi + - libapache2-mod-fastcgi # We need pgloader for import mysql database into pgsql - pgloader - - php5.6 - - php5.6-pgsql - - php5.6-mysqli - - php5.6-xml env: global: @@ -92,6 +72,13 @@ notifications: on_failure: always use_notice: true +before_install: +- | + echo "Disabling Xdebug for composer" + export PHP_VERSION_NAME=$(phpenv version-name) + cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini + phpenv config-rm xdebug.ini + echo install: - | @@ -251,10 +238,6 @@ before_script: - echo "Setting up Apache + FPM" - # setup link for php legacy - - sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php - # install apache web server - - sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | @@ -262,11 +245,10 @@ before_script: # Copy the included pool sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf fi - - sudo a2enmod proxy_fcgi rewrite setenvif cgi alias + - sudo a2enmod rewrite actions fastcgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - #- sudo chown -R travis:travis /var/lib/apache2/fastcgi - # start php-fpm + - sudo chown -R travis:travis /var/lib/apache2/fastcgi - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm # configure apache virtual hosts - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf @@ -448,8 +430,8 @@ script: - | echo "Unit testing" - # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log and apache error.log file. - set +e + # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. + set -e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunitresult=$? echo "Phpunit return code = $phpunitresult" @@ -461,9 +443,6 @@ after_script: ls $TRAVIS_BUILD_DIR/documents #cat $TRAVIS_BUILD_DIR/documents/dolibarr.log sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log - echo "After script - Output last lines of apache error.log" - ls /var/log/apache2 - sudo tail -n 50 /var/log/apache2/travis_error_log after_success: - | @@ -472,14 +451,14 @@ after_success: after_failure: - | echo Failure detected, so we show samples of log to help diagnose - # This part of code is executed only if the command that fails are enclosed with set +e - # Show upgrade log files + # This part of code is executed only if previous command that fails are enclosed with set +e + # Upgrade log files for ficlog in `ls $TRAVIS_BUILD_DIR/*.log` do echo "Debugging informations for file $ficlog" #cat $ficlog done - # Show Apache log file + # Apache log file echo "Debugging informations for file apache error.log" sudo cat /var/log/apache2/travis_error_log if [ "$DEBUG" = true ]; then From f53e3e9cce0710a4893123168fddb9b291ddf201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 09:42:44 +0200 Subject: [PATCH 17/34] Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 1e58f11aeb0..7404f2595e2 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -129,22 +129,32 @@ class Facture extends CommonInvoice /** * @var int Date expected for delivery * @deprecated + * @see delivery_date */ - public $date_livraison; // deprecated; Use delivery_date instead. + public $date_livraison; + /** + * @var int Date expected for delivery + */ public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) + /** + * @var string customer ref + * @deprecated + * @see ref_customer + */ + public $ref_client; + /** * @var string customer ref */ - public $ref_client; // deprecated; use ref_customer instead public $ref_customer; /** * @var int Ref Int * @deprecated */ - public $ref_int; // deprecated + public $ref_int; //Check constants for types public $type = self::TYPE_STANDARD; From d2cd06cb8d21e38e7b08662fb2afefc8673cb8eb Mon Sep 17 00:00:00 2001 From: jpb Date: Thu, 22 Sep 2022 23:27:13 +0200 Subject: [PATCH 18/34] remove ntoe update --- htdocs/don/card.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 960ff7e7b2d..377352b81b5 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -181,8 +181,6 @@ if (empty($reshook)) { $object->date = $donation_date; $object->public = $public_donation; $object->fk_project = (int) GETPOST("fk_project", 'int'); - $object->note_private = (string) GETPOST("note_private", 'restricthtml'); - $object->note_public = (string) GETPOST("note_public", 'restricthtml'); $object->modepaymentid = (int) GETPOST('modepayment', 'int'); // Fill array 'array_options' with data from add form From 3fdd34400ff56e922ef729135a917b9b38ad3f95 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 23 Sep 2022 05:12:21 +0200 Subject: [PATCH 19/34] FIX #22265 Accountancy - Account number expected in place of a rowid on export --- htdocs/core/modules/modAccounting.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index e0bf3a9bbc5..d294a470041 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -258,14 +258,16 @@ class modAccounting extends DolibarrModules $this->export_label[$r] = 'Chartofaccounts'; $this->export_icon[$r] = 'accounting'; $this->export_permission[$r] = array(array("accounting", "chartofaccount")); - $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); - $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); - $this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa.accountparent'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting"); + $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa2.account_number'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); + $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa2.account_number'=>"List:accounting_account:account_number", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); + $this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa2.account_number'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting"); $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'accounting_account as aa'; $this->export_sql_end[$r] .= ' ,'.MAIN_DB_PREFIX.'accounting_system as ac'; - $this->export_sql_end[$r] .= ' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').') '; + $this->export_sql_end[$r] .= ' ,'.MAIN_DB_PREFIX.'accounting_account as aa2'; + $this->export_sql_end[$r] .= ' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').')'; + $this->export_sql_end[$r] .= ' AND aa2.rowid = aa.account_parent AND aa2.active = 1 AND ac.pcg_version = aa2.fk_pcg_version AND aa2.entity IN ('.getEntity('accounting').')'; // Imports From 7d4b2a664e80b233e172625d3e137681763972fd Mon Sep 17 00:00:00 2001 From: Jean Date: Fri, 23 Sep 2022 16:47:54 +0200 Subject: [PATCH 20/34] FIX #22379 creating events on supplier order --- htdocs/user/class/user.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 4b6ee860c74..dd02873489d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -689,6 +689,7 @@ class User extends CommonObject 'inventory' => 'stock', 'invoice' => 'facture', 'invoice_supplier' => 'fournisseur', + 'order_supplier' => 'fournisseur', 'knowledgerecord' => 'knowledgerecord@knowledgemanagement', 'skill@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all" 'job@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all" From 194d7a2110cdd8324e368bec2840fe7d45780a35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 17:26:28 +0200 Subject: [PATCH 21/34] Update modAccounting.class.php --- htdocs/core/modules/modAccounting.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index d294a470041..6d1c6b1d876 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -259,7 +259,7 @@ class modAccounting extends DolibarrModules $this->export_icon[$r] = 'accounting'; $this->export_permission[$r] = array(array("accounting", "chartofaccount")); $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa2.account_number'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); - $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa2.account_number'=>"List:accounting_account:account_number", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); + $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa2.account_number'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); $this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa2.account_number'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting"); $this->export_sql_start[$r] = 'SELECT DISTINCT '; From 88ff4ad4bc4bf81c3fa7a8f95346423a71e807ed Mon Sep 17 00:00:00 2001 From: Jean Date: Sat, 24 Sep 2022 09:13:19 +0200 Subject: [PATCH 22/34] FIX #22379 creating events on supplier order --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index dd02873489d..e57fc387bc7 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -689,7 +689,7 @@ class User extends CommonObject 'inventory' => 'stock', 'invoice' => 'facture', 'invoice_supplier' => 'fournisseur', - 'order_supplier' => 'fournisseur', + 'order_supplier' => 'fournisseur', 'knowledgerecord' => 'knowledgerecord@knowledgemanagement', 'skill@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all" 'job@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all" From a919618bf4b324355c15d6c1026c8d8c5d059793 Mon Sep 17 00:00:00 2001 From: Jean Date: Sat, 24 Sep 2022 09:47:56 +0200 Subject: [PATCH 23/34] FIX #22382 Error on length of supplier reference --- htdocs/product/fournisseurs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 2fe78f11e99..f18cbc241e7 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -508,9 +508,9 @@ if ($id > 0 || $ref) { print ''.$langs->trans("SupplierRef").''; if ($rowid) { print ''; - print ''; + print ''; } else { - print ''; + print ''; } print ''; print ''; From fe501f7214935f16a1a6358b6febfd9cd29e583b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 11:42:05 +0200 Subject: [PATCH 24/34] Fix inventorycode --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ad666573b18..c77b8284698 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2041,7 +2041,7 @@ class CommandeFournisseur extends CommonOrder // $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on) $mouv->origin = &$this; $mouv->setOrigin($this->element, $this->id); - $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, $inventorycode); + $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, '', 0, $inventorycode); if ($result < 0) { $this->error = $mouv->error; $this->errors = $mouv->errors; From 322d0955f20e6cbf7ed93e40649458ae8e197c2a Mon Sep 17 00:00:00 2001 From: Guido Schratzer Date: Sat, 24 Sep 2022 17:58:58 +0300 Subject: [PATCH 25/34] FIX: Issue #16476 on massaction the pdf generation is not using the thirdparty language settings --- htdocs/core/actions_massactions.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index ddee2ad5fb4..c673111d0d7 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1388,6 +1388,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { + $objecttmp->fetch_thirdparty(); //load lang from thirdparty $outputlangs = $langs; $newlang = ''; From 33291b7cc791ed95ace0c565041607b43eae6303 Mon Sep 17 00:00:00 2001 From: priojk Date: Sat, 24 Sep 2022 17:19:52 +0200 Subject: [PATCH 26/34] FIX #21799 inactive companies cannot be selected --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index cb7e512bc36..c737ea63ebe 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1585,7 +1585,7 @@ if ($action == 'create') { //$warehouse_id = $soc->warehouse_id; } else { print ''; - print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'company').$form->select_company('', 'socid', '((s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer informations if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print '