From e3f2e1bd55fc5f69ecf0163d25d9a37bc73871e9 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Tue, 24 Jun 2025 16:02:07 +0200 Subject: [PATCH 1/7] fix: negative quantity in reception are allowed and must be managed on revert stock mvt (#34615) --- htdocs/reception/class/reception.class.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 8751583acb5..c93e900e6ea 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1977,10 +1977,6 @@ class Reception extends CommonObject $qty = $obj->qty; - - if ($qty <= 0) { - continue; - } dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); //var_dump($this->lines[$i]); From 82abb0e8ed804b0d27258027960ef2dffda69ae3 Mon Sep 17 00:00:00 2001 From: atm-irvine <165771178+atm-irvine@users.noreply.github.com> Date: Wed, 25 Jun 2025 19:19:16 +0200 Subject: [PATCH 2/7] fix(bookkeeping): doc_ref too long (#34628) --- htdocs/accountancy/class/bookkeeping.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 501b689fd9a..e63334650fd 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -232,6 +232,7 @@ class BookKeeping extends CommonObject } if (isset($this->doc_ref)) { $this->doc_ref = trim($this->doc_ref); + $this->doc_ref = dol_trunc($this->doc_ref, 300); // We limit to 300 chars to avoid problems with too long ref in DB } if (isset($this->fk_doc)) { $this->fk_doc = (int) $this->fk_doc; From 57a256791fa239644e5b714fd8b46d51bad7a957 Mon Sep 17 00:00:00 2001 From: Marc <99648320+emheyarssi@users.noreply.github.com> Date: Wed, 25 Jun 2025 19:21:54 +0200 Subject: [PATCH 3/7] FIX #34618 (#34621) Update api_salaries.class.php Replace POST with PUT --- htdocs/salaries/class/api_salaries.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/class/api_salaries.class.php b/htdocs/salaries/class/api_salaries.class.php index 648d7d0efaf..549a1d2b4be 100644 --- a/htdocs/salaries/class/api_salaries.class.php +++ b/htdocs/salaries/class/api_salaries.class.php @@ -350,7 +350,7 @@ class Salaries extends DolibarrApi * @param array $request_data data * @return Object PaymentSalary object * - * @url POST {id}/payments + * @url PUT {id}/payments * * @throws RestException */ From 3280be45835f87f284e46f70ea926b4dbea59136 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 25 Jun 2025 19:26:58 +0200 Subject: [PATCH 4/7] fix: remove php warning (#34614) * fix php warning * fix php warning --------- Co-authored-by: Laurent Destailleur --- htdocs/reception/class/reception.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index c93e900e6ea..327f946caa1 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -573,7 +573,7 @@ class Reception extends CommonObject if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('RECEPTION_ALLOW_NEGATIVE_QTY'))) { continue; } - dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); + dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid); //var_dump($this->lines[$i]); $mouvS = new MouvementStock($this->db); @@ -1977,7 +1977,7 @@ class Reception extends CommonObject $qty = $obj->qty; - dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); + dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid); //var_dump($this->lines[$i]); $mouvS = new MouvementStock($this->db); From dc852ba93f4e9b7825af69a403935d241a5876ce Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 25 Jun 2025 19:27:49 +0200 Subject: [PATCH 5/7] FIX: if filter is set on export for Duree type filed, then there is SQL error (#34616) --- htdocs/exports/class/export.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index c90d354bcc2..ca85fad2e21 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -354,7 +354,6 @@ class Export } break; case 'Duree': - break; case 'Numeric': // if there is a signe + if (strpos($ValueField, "+") > 0) { @@ -575,7 +574,6 @@ class Export $szMsg = $langs->trans('ExportDateFilter'); break; case 'Duree': - break; case 'Numeric': $szMsg = $langs->trans('ExportNumericFilter'); break; From 094dd3a9d1b680fe9b38e9198a1125fdab45bf8d Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Fri, 27 Jun 2025 00:30:00 +0200 Subject: [PATCH 6/7] FIX 21.0: $height and $width can be ints, but also 'auto' (#34636) * FIX 21.0: $height and $width can be ints, but also 'auto' (which is commonly used), so check for this special value before typecasting * Update html.form.class.php * Update html.form.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f5c2527bd68..b519abf38f9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5900,8 +5900,8 @@ class Form $formconfirm .= ' resizable: false, - height: \'' . ((int) $height) . '\', - width: \'' . ((int) $width) . '\', + height: \'' . dol_escape_js($height) . '\', + width: \'' . dol_escape_js($width) . '\', modal: true, closeOnEscape: false, buttons: { From 75c34567435deb124320cbf404c36d5f3d7c0553 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Sat, 28 Jun 2025 13:14:11 +0200 Subject: [PATCH 7/7] FIX #34654 --- htdocs/core/actions_builddoc.inc.php | 16 ++++------------ htdocs/core/actions_massactions.inc.php | 25 +++++++++---------------- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 0a5f63de9aa..04b5a627d56 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -81,18 +81,10 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) } // To be sure vars is defined - if (empty($hidedetails)) { - $hidedetails = 0; - } - if (empty($hidedesc)) { - $hidedesc = 0; - } - if (empty($hideref)) { - $hideref = 0; - } - if (empty($moreparams)) { - $moreparams = null; - } + $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); + $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); + $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); + $moreparams = isset($moreparams) ? $moreparams : null; $result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); if ($result <= 0) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index a7e03343b91..9c71e3414c8 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -32,6 +32,7 @@ // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined // $uploaddir may be defined (example to $conf->project->dir_output."/";) +// $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not. // $toselect may be defined // $diroutputmassaction may be defined @@ -1010,10 +1011,10 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) { $model = $objecttmp->model_pdf; $ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records // To be sure vars is defined - $hidedetails = !empty($hidedetails) ? $hidedetails : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); - $hidedesc = !empty($hidedesc) ? $hidedesc : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); - $hideref = !empty($hideref) ? $hideref : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); - $moreparams = !empty($moreparams) ? $moreparams : null; + $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); + $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); + $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); + $moreparams = isset($moreparams) ? $moreparams : null; $result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { @@ -1169,18 +1170,10 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { } // To be sure vars is defined - if (empty($hidedetails)) { - $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); - } - if (empty($hidedesc)) { - $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); - } - if (empty($hideref)) { - $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); - } - if (empty($moreparams)) { - $moreparams = null; - } + $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); + $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); + $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); + $moreparams = isset($moreparams) ? $moreparams : null; $result = $objecttmp->generateDocument($objecttmp->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);