From 07512d1dadb10f74323d3ab72b2ecba9ee319e1e Mon Sep 17 00:00:00 2001 From: kkhelifa-opendsi Date: Wed, 27 Aug 2025 03:06:19 +0200 Subject: [PATCH 01/10] FIX - Fix missing token for disable custom group category for compta report (page /htdocs/accountancy/admin/categories_list.php) (#35084) --- htdocs/accountancy/admin/categories_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 16dbba074a2..3706a6f5d5b 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -896,7 +896,7 @@ if ($resql) { // Active print ''; if ($canbedisabled) { - print ''.$actl[$obj->active].''; + print ''.$actl[$obj->active].''; } else { print $langs->trans("AlwaysActive"); } From 1f29c7758c3b235531c647f740f2103cf5af4e4f Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 27 Aug 2025 11:30:26 +0200 Subject: [PATCH 02/10] FIX: accountancy general ledger: bad handling of hook return (#34029) * FIX: accountancy general ledger: bad handling of hook return * FIX: accountancy balance: bad handling of hook return --- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 2d0642c9642..ee006db56b9 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -303,7 +303,7 @@ if ($action != 'export_csv') { $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; if (empty($reshook)) { - $newcardbutton = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; + $newcardbutton .= 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; print ' +SCRIPT; + exit; + } +} /** * Abort invoice creationg with a given error message From b05be5e1df570483cd47b6ef0e1ad0d684257440 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Thu, 4 Sep 2025 13:01:26 +0300 Subject: [PATCH 08/10] Fix discount applied 2 times on contract (#35219) on update line the discount was apply 2 times ! no problem on insert line. Already solved on v22 --- htdocs/contrat/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index c20651a2488..79238cd486e 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -756,10 +756,11 @@ if (empty($reshook)) { $price_ht = price2num(GETPOST('elprice'), 'MU'); $remise_percent = price2num(GETPOST('elremise_percent'), 2); - if ($remise_percent > 0) { + // Discount applied 2 times => see line 803 + /*if ($remise_percent > 0) { $remise = round(($price_ht * $remise_percent / 100), 2); $price_ht = ($price_ht - $remise); - } + }*/ $objectline->fk_product = GETPOST('idprod', 'int'); $objectline->description = GETPOST('product_desc', 'restricthtml'); From c6b62915f6864c1ca45a81145049e32689dab383 Mon Sep 17 00:00:00 2001 From: bohdanpotuzhnyi <72936384+bohdanpotuzhnyi@users.noreply.github.com> Date: Thu, 4 Sep 2025 13:26:47 +0200 Subject: [PATCH 09/10] support RFC5789 (patch) (#35213) --- htdocs/core/lib/geturl.lib.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 7eb5d57d502..bbd21393fa6 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -30,7 +30,7 @@ * - common local lookup ips like 127.*.*.* are automatically added * * @param string $url URL to call. - * @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'DELETE' + * @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PATCH', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'PATCHALREADYFORMATED', 'DELETE' * @param string $param Parameters of URL (x=value1&y=value2) or may be a formatted content with $postorget='PUTALREADYFORMATED' * @param integer $followlocation 0=Do not follow, 1=Follow location. * @param string[] $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....) @@ -144,6 +144,19 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } elseif ($postorget == 'PUTALREADYFORMATED') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // param = content of post, like a xml string + } elseif ($postorget == 'PATCH') { + $array_param = null; + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // RFC 5789 + if (!is_array($param)) { + parse_str($param, $array_param); + } else { + dol_syslog("parameter param must be a string", LOG_WARNING); + $array_param = $param; + } + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param)); + } elseif ($postorget == 'PATCHALREADYFORMATED') { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // RFC 5789 + curl_setopt($ch, CURLOPT_POSTFIELDS, $param); } elseif ($postorget == 'HEAD') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD' curl_setopt($ch, CURLOPT_NOBODY, true); From a69ba88857138c0707a8830c35055539c597e18d Mon Sep 17 00:00:00 2001 From: kkhelifa-opendsi Date: Thu, 4 Sep 2025 13:27:49 +0200 Subject: [PATCH 10/10] FIX: Correct the calculation of the amount of the current period between the period provided (#35083) --- htdocs/compta/resultat/result.php | 52 +++++++++++++++++-------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 0634c8bdac2..94266434b35 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -505,33 +505,37 @@ if ($modecompta == 'CREANCES-DETTES') { $yeartoprocess++; } - //var_dump($monthtoprocess.'_'.$yeartoprocess); - if (isset($cpt['account_number'])) { - $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultM = 0; + if (($yeartoprocess == $start_year && ($k + 1) >= $date_startmonth && $k < $date_endmonth) || + ($yeartoprocess == $start_year + 1 && ($k + 1) < $date_startmonth) + ) { + //var_dump($monthtoprocess.'_'.$yeartoprocess); + if (isset($cpt['account_number'])) { + $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultM = 0; + } else { + $resultM = $AccCat->sdc; + } } else { - $resultM = $AccCat->sdc; + $resultM = 0; + } + if (empty($totCat['M'][$k])) { + $totCat['M'][$k] = $resultM; + } else { + $totCat['M'][$k] += $resultM; + } + if (empty($sommes[$code]['M'][$k])) { + $sommes[$code]['M'][$k] = $resultM; + } else { + $sommes[$code]['M'][$k] += $resultM; + } + if (isset($cpt['account_number'])) { + $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM; } - } else { - $resultM = 0; - } - if (empty($totCat['M'][$k])) { - $totCat['M'][$k] = $resultM; - } else { - $totCat['M'][$k] += $resultM; - } - if (empty($sommes[$code]['M'][$k])) { - $sommes[$code]['M'][$k] = $resultM; - } else { - $sommes[$code]['M'][$k] += $resultM; - } - if (isset($cpt['account_number'])) { - $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM; - } - $resultN += $resultM; + $resultN += $resultM; + } } if (empty($totCat)) {