From 947dadfaa80da81946869e7fd81a967a44640beb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 2 Apr 2023 08:28:56 +0200 Subject: [PATCH 1/5] Fix v18 migration script --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 1f53780461e..fd063b40a26 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -494,7 +494,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } // Scripts for 18.0 - $afterversionarray = explode('.', '170.9'); + $afterversionarray = explode('.', '17.0.9'); $beforeversionarray = explode('.', '18.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { migrate_contractdet_rank(); From 1d70280ec24decd9741c4a622bf82ffb5e756fc2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 2 Apr 2023 12:01:46 +0200 Subject: [PATCH 2/5] In FR, activate constant INVOICE_DISABLE_REPLACEMENT by default --- htdocs/master.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 38933d291e7..a1e5220e07a 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -227,6 +227,12 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { // For FR, default value of option to show category of operations is on by default. Decret n°2099-1299 2022-10-07 $conf->global->INVOICE_CATEGORY_OF_OPERATION = 1; } + if ($mysoc->country_code == 'FR' && !isset($conf->global->INVOICE_DISABLE_REPLACEMENT)) { + // For FR, the replacement invoice type is not allowed. + // From an accounting point of view, this creates holes in the numbering of the invoice. + // This is very problematic during a fiscal control. + $conf->global->INVOICE_DISABLE_REPLACEMENT = 1; + } if ($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) { // For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account). From 7bf287aadf508ec61e33c7bb63eec4dc37dc6071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 3 Apr 2023 12:10:31 +0200 Subject: [PATCH 3/5] fix edit extrafields if missing mandatory value --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 00dec927f9e..5404f831a65 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -209,7 +209,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?> -trans("Totalizable"); ?>> +trans("Totalizable"); ?>> textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")); ?> @@ -220,7 +220,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> - trans("AllEntities"); ?>> + trans("AllEntities"); ?>> From cca08ee18de64d8ccc086c88c5854f8872544a95 Mon Sep 17 00:00:00 2001 From: hystepik Date: Mon, 3 Apr 2023 12:22:05 +0200 Subject: [PATCH 4/5] Fix : user group date midif to match database --- htdocs/user/class/api_users.class.php | 2 +- htdocs/user/class/usergroup.class.php | 4 ++-- htdocs/user/group/card.php | 1 + htdocs/user/group/list.php | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index bb1d9d95294..f1941b8c079 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -747,7 +747,7 @@ class Users extends DolibarrApi unset($cleanObject->clicktodial_loaded); unset($cleanObject->datec); - unset($cleanObject->datem); + unset($cleanObject->tms); unset($cleanObject->members); unset($cleanObject->note); unset($cleanObject->note_private); diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 7f237b385ad..f07975b4ea3 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -91,7 +91,7 @@ class UserGroup extends CommonObject * * @var integer */ - public $datem; + public $tms; /** * @var string Description @@ -931,7 +931,7 @@ class UserGroup extends CommonObject $this->name = 'DOLIBARR GROUP SPECIMEN'; $this->note = 'This is a note'; $this->datec = time(); - $this->datem = time(); + $this->tms = time(); // Members of this group is just me $this->members = array( diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 60c1c30e9fb..b9d16874604 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -209,6 +209,7 @@ if (empty($reshook)) { $object->name = GETPOST("nom", 'alphanohtml'); $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml'))); + $object->tms = dol_now(); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 54117de403a..85df729d00f 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -173,7 +173,7 @@ $morecss = array(); // Build and execute select // -------------------------------------------------------------------- -$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; +$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid"; @@ -471,7 +471,7 @@ while ($i < $imaxinloop) { if (!$i) { $totalarray['nbfield']++; } - print ''.dol_print_date($db->jdate($obj->datem), "dayhour").''; + print ''.dol_print_date($db->jdate($obj->tms), "dayhour").''; if (!$i) { $totalarray['nbfield']++; } From 9eb458d1d07750cee31be2ecdc3b8a4382912118 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 3 Apr 2023 13:32:37 +0200 Subject: [PATCH 5/5] Fix secirity access on create supplier order and invoice --- htdocs/core/lib/security.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 710eab4d878..3c9ca5e34d9 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -402,7 +402,6 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '', } if ($features == 'fournisseur') { // When vendor invoice and pruchase order are into module 'fournisseur' $features = 'fournisseur'; - $feature2 = ''; if ($object->element == 'invoice_supplier') { $feature2 = 'facture'; } elseif ($object->element == 'order_supplier') {