From 8dd7a22482dcb0a5048dce045dad04881f87cd73 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 20 Mar 2023 09:45:02 +0100 Subject: [PATCH 01/10] FIX limit after order in get objects in category --- htdocs/categories/class/categorie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 786af013dc6..87c0888ed6f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -848,10 +848,10 @@ class Categorie extends CommonObject if (($type == 'customer' || $type == 'supplier') && $user->socid > 0) { $sql .= " AND o.rowid = ".((int) $user->socid); } + $sql .= $this->db->order($sortfield, $sortorder); if ($limit > 0 || $offset > 0) { $sql .= $this->db->plimit($limit + 1, $offset); } - $sql .= $this->db->order($sortfield, $sortorder); dol_syslog(get_class($this)."::getObjectsInCateg", LOG_DEBUG); $resql = $this->db->query($sql); From 14fd90dbaddb4ae845f9461ea8e94a7d3554388f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Mar 2023 14:20:35 +0100 Subject: [PATCH 02/10] Fix sign in llx_bank of amount_main_currency --- htdocs/install/mysql/migration/repair.sql | 21 +++++++++++++-------- htdocs/install/mysql/tables/llx_bank.sql | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 737ee1bf511..4c6c4fc1117 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -569,14 +569,19 @@ UPDATE llx_facturedet SET situation_percent = 100 WHERE situation_percent IS NUL DELETE FROM llx_rights_def WHERE module = 'hrm' AND perms = 'employee'; --- Sequence to fix the content of llx_bank.amount_main_currency --- Note: amount is amount in currency of bank account + +-- Sequence to fix the content of llx_bank.amount_main_currency (value was empty and should not for payment on bank account with a different currency so when amount_main_currency is different than amount) +-- Note: amount is amount in the currency of the bank account -- Note: pamount is always amount into the main currency --- Note: pmulticurrencyamount is in currency of invoice --- Note: amount_main_currency must be amount in main currency +-- Note: pmulticurrencyamount is in the currency of invoice +-- Note: amount_main_currency must be NULL or amount in main currency of company (we set it when the currency of the bank account differs from main currency) -- DROP TABLE tmp_bank; --- CREATE TABLE tmp_bank SELECT b.rowid, b.amount, p.rowid as pid, p.amount as pamount, p.multicurrency_amount as pmulticurrencyamount FROM llx_bank as b INNER JOIN llx_bank_url as bu ON bu.fk_bank=b.rowid AND bu.type = 'payment' INNER JOIN llx_paiement as p ON bu.url_id = p.rowid WHERE p.multicurrency_amount <> 0 AND p.multicurrency_amount <> p.amount; --- UPDATE llx_bank as b SET b.amount_main_currency = (SELECT tb.pamount FROM tmp_bank as tb WHERE tb.rowid = b.rowid) WHERE b.amount_main_currency IS NULL; +-- CREATE TABLE tmp_bank SELECT b.rowid, b.amount, p.rowid as pid, p.amount as pamount, p.multicurrency_amount as pmulticurrencyamount, b.datec FROM llx_bank as b INNER JOIN llx_bank_url as bu ON bu.fk_bank=b.rowid AND bu.type = 'payment' INNER JOIN llx_paiement as p ON bu.url_id = p.rowid WHERE p.multicurrency_amount <> 0 AND p.multicurrency_amount <> p.amount; +-- UPDATE llx_bank as b SET b.amount_main_currency = (SELECT tb.pamount FROM tmp_bank as tb WHERE tb.rowid = b.rowid) WHERE b.amount_main_currency IS NULL AND b.rowid IN (SELECT rowid FROM tmp_bank); -- DROP TABLE tmp_bank2; --- CREATE TABLE tmp_bank2 SELECT b.rowid, b.amount, p.rowid as pid, p.amount as pamount, p.multicurrency_amount as pmulticurrencyamount FROM llx_bank as b INNER JOIN llx_bank_url as bu ON bu.fk_bank=b.rowid AND bu.type = 'payment_supplier' INNER JOIN llx_paiementfourn as p ON bu.url_id = p.rowid WHERE p.multicurrency_amount <> 0 AND p.multicurrency_amount <> p.amount; --- UPDATE llx_bank as b SET b.amount_main_currency = (SELECT tb.pamount FROM tmp_bank2 as tb WHERE tb.rowid = b.rowid) WHERE b.amount_main_currency IS NULL; +-- CREATE TABLE tmp_bank2 SELECT b.rowid, b.amount, p.rowid as pid, - p.amount as pamount, - p.multicurrency_amount as pmulticurrencyamount, b.datec FROM llx_bank as b INNER JOIN llx_bank_url as bu ON bu.fk_bank=b.rowid AND bu.type = 'payment_supplier' INNER JOIN llx_paiementfourn as p ON bu.url_id = p.rowid WHERE p.multicurrency_amount <> 0 AND p.multicurrency_amount <> p.amount; +-- UPDATE llx_bank as b SET b.amount_main_currency = (SELECT tb.pamount FROM tmp_bank2 as tb WHERE tb.rowid = b.rowid) WHERE b.amount_main_currency IS NULL AND b.rowid IN (SELECT rowid FROM tmp_bank2); + +-- Sequence to fix the content of llx_bank.amount_main_currency (sign was wrong with some version) +-- UPDATE llx_bank as b SET b.amount_main_currency = -b.amount_main_currency WHERE b.amount IS NOT NULL AND b.amount_main_currency IS NOT NULL AND SIGN(b.amount_main_currency) <> SIGN(b.amount); + diff --git a/htdocs/install/mysql/tables/llx_bank.sql b/htdocs/install/mysql/tables/llx_bank.sql index d0a8e34790b..e5194cadc88 100644 --- a/htdocs/install/mysql/tables/llx_bank.sql +++ b/htdocs/install/mysql/tables/llx_bank.sql @@ -25,7 +25,7 @@ create table llx_bank datev date, -- date de valeur dateo date, -- date operation amount double(24,8) NOT NULL default 0, -- amount in the currency of the bank account - amount_main_currency double(24,8) NULL, -- amount in the main currency of the company + amount_main_currency double(24,8) NULL, -- amount in the main currency of the company when payment done in a bank account with a different currency label varchar(255), fk_account integer, fk_user_author integer, From 3f45699695d733e602db61ccd6daaadb7dc40654 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Mar 2023 14:25:08 +0100 Subject: [PATCH 03/10] Prepare 16.0.5 --- ChangeLog | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f9e22813487..70e8cd5ad06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,51 @@ English Dolibarr ChangeLog ***** ChangeLog for 16.0.5 compared to 16.0.4 ***** -TODO +FIX: 16.0 propalestats Unknown column 'p.fk_soc' in 'on clause' +FIX: #23804 +FIX: #23860 +FIX: #23966 Error "Param dbt_keyfield is required but not defined" +FIX: accountancy lettering: better error management +FIX: accountancy lettering: correctly calculated number of lettering operations done +FIX: accountancy lettering: error management and prevention +FIX: accountancy lettering: prevent null results when fetching link with payments +FIX: Add missing hook on LibStatut +FIX: Add more context for selectForFormsListWhere Hook +FIX: attach file and send by mail in ticket +FIX: bad check on if in get_all_ways +FIX: Cannot import find type_fees with cgenericdic.class because it has id and not rowid +FIX: clicktodial backtopage +FIX: discount wasn't taken into account when adding a line in BOM +FIX: expense reports: error when selecting mileage fees expense type if MAIN_USE_EXPENSE_IK disabled +FIX: expense reports: JS error when selecting mileage fees expense type if MAIN_USE_EXPENSE_IK disabled +FIX: Extrafields in Notes to unify with orders or invoices. +FIX: fatal error on clicktodial backtopage +FIX: filter sql accounting account +FIX: Get data back on product update +FIX: Get data back when error on command create +FIX: label dictionary is used by barcode and member module +FIX: mandatory date for service didnt work for invoice +FIX: missing "authorid" for getNomUrl link right access +FIX: missing getEntity filter +FIX: vulnerability: missing protection on ajax public ticket page for valid email. +FIX: Missing right to edit service note when module product is disabled +FIX: multicompany compatibility +FIX: object $user is not defined +FIX: Object of class LDAP\Connection could not be converted to string +FIX: parse error and NAN +FIX: product ref fourn same size in supplier order/invoice as in product price fourn +FIX: Profit calculation on project preview tab. +FIX: Remove orphelan $this->db->rollback() in the function insertExtrafields() +FIX: request new password with "mc" and "twofactor" authentication +FIX: Resolve error message due to missing arguments +FIX: select for task in event card +FIX: several email sent to the same recipient when adding message from ticket +FIX: shipping list for external user +FIX: SQL error "unknown column p.fk_soc" because ANSI-92 joins take precedence over ANSI-89 joins +FIX: strato pdf +FIX: typos in getAttchments() $arrayobject +FIX: whitespaces +FIX: wrong url param name action ***** ChangeLog for 16.0.4 compared to 16.0.3 ***** From 033d375cd84a325ea79e78f4437b8032b1292c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Mar 2023 12:02:05 +0100 Subject: [PATCH 04/10] Fix ordering by u.fk_user --- htdocs/user/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e92fbf33280..9c1be29fc34 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -344,6 +344,7 @@ $morehtmlright = ""; // Build and execute select // -------------------------------------------------------------------- $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.office_phone, u.user_mobile, u.email, u.api_key, u.accountancy_code, u.gender, u.employee, u.photo,"; +$sql .= " u.fk_user,"; $sql .= " u.salary, u.datelastlogin, u.datepreviouslogin,"; $sql .= " u.ldap_sid, u.statut as status, u.entity,"; $sql .= " u.tms as date_update, u.datec as date_creation,"; From fe4b99387151db4ce204eba25926464900ca52d3 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 21 Mar 2023 17:05:46 +0100 Subject: [PATCH 05/10] FIX change date on select date input when prefix is used --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 890e662f726..f10ecf5f763 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6522,7 +6522,7 @@ class Form if (empty($labeladddateof)) { $labeladddateof = $langs->trans("DateInvoice"); } - $retstring .= ' -