From f532f85d8ca5c48877fde1efc0806f98f15f6d02 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 26 Sep 2025 20:54:21 +0200 Subject: [PATCH 01/20] fix: remove space in global conf test (#35484) --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 81d90568684..1cf2eb63f87 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3240,7 +3240,7 @@ class Facture extends CommonInvoice $this->date = dol_now(); $this->date_lim_reglement = $this->calculate_date_lim_reglement(); } - if (!empty($conf->global-> INVOICE_CHECK_POSTERIOR_DATE)) { + if (!empty($conf->global->INVOICE_CHECK_POSTERIOR_DATE)) { $last_of_type = $this->willBeLastOfSameType(true); if (!$last_of_type[0]) { $this->error = $langs->transnoentities("ErrorInvoiceIsNotLastOfSameType", $this->ref, dol_print_date($this->date, 'day'), dol_print_date($last_of_type[1], 'day')); From 8bb63c596365626d7fcc5a22b1cd4ecff5d4f7af Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Sat, 27 Sep 2025 12:06:40 +0200 Subject: [PATCH 02/20] Test on autoassign --- .github/workflows/pr-18.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 47fb32ac8ea..7281f43278e 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -38,4 +38,5 @@ jobs: run: | gh pr edit "$url" --add-reviewer rycks gh pr edit "$url" --add-reviewer lvessiller-opendsi + gh pr edit "$url" --add-reviewer eldy From acf5e30b30d889ea90e371edeaaece4cd0968467 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 27 Sep 2025 12:07:43 +0200 Subject: [PATCH 03/20] FIX missing entity filter (#35517) --- htdocs/holiday/month_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index ab1cd83ee0b..3ec2ef666b4 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -156,7 +156,7 @@ $year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month); $sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday, cp.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid"; -$sql .= " WHERE cp.rowid > 0"; +$sql .= " WHERE cp.entity IN (".getEntity('holiday').") AND cp.rowid > 0"; $sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED; $sql .= " AND ("; $sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')"; From faf2971ff7fe70bd1d9835b87663fd4cb1ad9499 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 13:54:11 +0200 Subject: [PATCH 04/20] Try to fix Ci 18 --- .github/workflows/pr-18.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 7281f43278e..4643b902997 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -34,7 +34,7 @@ jobs: - name: Assign reviewer env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} - url: ${{ github.event.pull_request.html_url }} + url: ${{ github.event.pull_request_target.html_url }} run: | gh pr edit "$url" --add-reviewer rycks gh pr edit "$url" --add-reviewer lvessiller-opendsi From 283efbbffe002589abf89fd819c3525b422ae4fd Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 13:57:10 +0200 Subject: [PATCH 05/20] Test CI --- .github/workflows/pr-18.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 4643b902997..b11003676d2 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -34,8 +34,10 @@ jobs: - name: Assign reviewer env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} - url: ${{ github.event.pull_request_target.html_url }} + url: ${{ github.event.pull_request.html_url }} run: | + echo "url=$url"" + echo "env.url=${{env.url}}" gh pr edit "$url" --add-reviewer rycks gh pr edit "$url" --add-reviewer lvessiller-opendsi gh pr edit "$url" --add-reviewer eldy From d25847602b4dc6e4b5befadeea629ab1a0adec90 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Wed, 1 Oct 2025 13:59:27 +0200 Subject: [PATCH 06/20] missing fk_user_creat value (#35576) --- htdocs/compta/cashcontrol/class/cashcontrol.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index fd4b38b5f66..e03758aa6f9 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -196,6 +196,7 @@ class CashControl extends CommonObject $sql .= ", cash"; $sql .= ", cheque"; $sql .= ", card"; + $sql .= ", fk_user_creat"; $sql .= ") VALUES ("; //$sql .= "'(PROV)', "; $sql .= ((int) $conf->entity); @@ -210,6 +211,7 @@ class CashControl extends CommonObject $sql .= ", ".price2num($this->cash, 'MT'); $sql .= ", ".price2num($this->cheque, 'MT'); $sql .= ", ".price2num($this->card, 'MT'); + $sql .= ", ".((int) $user->id); $sql .= ")"; $this->db->begin(); From 80494870c0eb5507b707878489bf7592d199269d Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 14:33:56 +0200 Subject: [PATCH 07/20] Try to fix CI 18 --- .github/workflows/pr-18.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index b11003676d2..9ca068bd9c5 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -36,9 +36,8 @@ jobs: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} url: ${{ github.event.pull_request.html_url }} run: | - echo "url=$url"" echo "env.url=${{env.url}}" - gh pr edit "$url" --add-reviewer rycks - gh pr edit "$url" --add-reviewer lvessiller-opendsi - gh pr edit "$url" --add-reviewer eldy + gh pr edit "${{env.url}}" --add-reviewer rycks + gh pr edit "${{env.url}}" --add-reviewer lvessiller-opendsi + gh pr edit "${{env.url}}" --add-reviewer eldy From d9563ac0ed8700d472564adeee5e953d236e7d2a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 1 Oct 2025 14:49:29 +0200 Subject: [PATCH 08/20] Update pr-18.yaml (#35577) Co-authored-by: Laurent Destailleur From a3969c1d2cca5a7402d36fa5c6474170ae32f449 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 1 Oct 2025 16:21:05 +0200 Subject: [PATCH 09/20] FIX: php 8+ warnings when creating deposits (#35582) --- htdocs/compta/facture/card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index bb96c2c2f81..cce03935d69 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1507,6 +1507,9 @@ if (empty($reshook)) { } foreach ($TTotalByTva as $tva => &$total) { + if (empty($amountdeposit[$tva])) { + $amountdeposit[$tva] = 0; + } $coef = $total / $srcobject->total_ttc; // Calc coef $am = $amount * $coef; $amount_ttc_diff += $am; @@ -1531,6 +1534,9 @@ if (empty($reshook)) { if ($qualified) { $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? $tva_tx = $lines[$i]->tva_tx; + if (empty($amountdeposit[$tva_tx])) { + $amountdeposit[$tva_tx] = 0; + } $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100; } } From 64cf2513bdd82aaf8f858ac5c129a5ecab5662ed Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 16:54:52 +0200 Subject: [PATCH 10/20] Clean CI --- .github/workflows/pr-18.yaml | 3 +-- .github/workflows/test.yaml | 28 ---------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 9ca068bd9c5..467e071487f 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -39,5 +39,4 @@ jobs: echo "env.url=${{env.url}}" gh pr edit "${{env.url}}" --add-reviewer rycks gh pr edit "${{env.url}}" --add-reviewer lvessiller-opendsi - gh pr edit "${{env.url}}" --add-reviewer eldy - + #gh pr edit "${{env.url}}" --add-reviewer eldy diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 97f218fce4d..00000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Test github actions -on: - workflow_dispatch: - pull_request: - types: [opened, reopened, synchronize] - push: - -env: - ENVGHT: ${{ secrets.GITHUB_TOKEN }} - ENVGHU: ${{ github.token }} - TEST_ACCESS_KEY: ${{ secrets.TEST_ACCESS_KEY }} - TEST_VAR_REPO: ${{ vars.TEST_VAR_REPO }} - ENVLOCAL: "varenvlocal" - -jobs: - testjob: - runs-on: ubuntu-latest - steps: - - name: Log - run: | - echo "Run action by ${{ github.actor }}" - echo "github.token=${{ github.token }}" - echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" - echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" - echo "repo-token: ${{secrets.GITHUB_TOKEN}}" - echo "secret repository TEST_ACCESS_KEY: ${{secrets.TEST_ACCESS_KEY}}" - echo "variable repository : ${{vars.TEST_VAR_REPO}}" - echo "ENVLOCAL: ${{env.ENVLOCAL}}" From 52ae202affd0e99c6dc02770718a3a645f0d1c66 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 16:59:49 +0200 Subject: [PATCH 11/20] Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 --- .github/workflows/pr-18.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 467e071487f..45b5507f870 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -16,6 +16,11 @@ on: branches: - "18.0" + +permissions: + pull-requests: write + + jobs: pr18: runs-on: ubuntu-latest From 40e4a6959f82f58379cca715ee31c27cb2d34428 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 19:17:22 +0200 Subject: [PATCH 12/20] Fix CI --- .github/workflows/pr-18.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 45b5507f870..23f53665925 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -19,13 +19,16 @@ on: permissions: pull-requests: write - + issues: write jobs: - pr18: + assign-and-label-v18: runs-on: ubuntu-latest steps: + #- name: Install GitHub CLI + # run: sudo apt-get install gh + - name: Generate a token id: generate-token uses: actions/create-github-app-token@v2 @@ -45,3 +48,11 @@ jobs: gh pr edit "${{env.url}}" --add-reviewer rycks gh pr edit "${{env.url}}" --add-reviewer lvessiller-opendsi #gh pr edit "${{env.url}}" --add-reviewer eldy + gh pr edit "${{env.url}}" -add-label "Pending analysis of PR (maintenance team)" + + - name: Set a label + uses: vkirilichev/changed-lines-count-labeler@v0.2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/changed-lines-count-labeler.yml + continue-on-error: true From e1b919366e1c30e5b4a8fb4cd3e64a7fa493eff8 Mon Sep 17 00:00:00 2001 From: "Thomas C." <56068416+Thomas905@users.noreply.github.com> Date: Wed, 1 Oct 2025 19:18:31 +0200 Subject: [PATCH 13/20] FIX : To have only the sender's entity when sending mail (#31053) * fix * Update html.formmail.class.php * Update html.formmail.class.php --------- Co-authored-by: Laurent Destailleur Co-authored-by: lvessiller-opendsi --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 49669a4c02c..c54bdab2949 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -627,7 +627,7 @@ class FormMail extends Form // Add also email aliases from the c_email_senderprofile table $sql = "SELECT rowid, label, email FROM ".$this->db->prefix()."c_email_senderprofile"; - $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).")"; + $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).") AND entity in getEntity('c_email_senderprofile')"; $sql .= " ORDER BY position"; $resql = $this->db->query($sql); if ($resql) { From 43c233668360669b08282b5e52f0ed94c7d33351 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 19:28:36 +0200 Subject: [PATCH 14/20] Log --- .github/workflows/pr-18.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 23f53665925..e47df02caa2 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -6,7 +6,7 @@ # Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr". # -name: Set reviewer for v18 +name: Set reviewer and label for v18 on: pull_request_target: types: [opened, synchronize, reopened] From f85b53a4ca6ecbe22c0d211e91bbdae2b9ba0069 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 19:29:30 +0200 Subject: [PATCH 15/20] Test CI --- .github/workflows/pr-18.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index e47df02caa2..8c46435869f 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -48,11 +48,11 @@ jobs: gh pr edit "${{env.url}}" --add-reviewer rycks gh pr edit "${{env.url}}" --add-reviewer lvessiller-opendsi #gh pr edit "${{env.url}}" --add-reviewer eldy - gh pr edit "${{env.url}}" -add-label "Pending analysis of PR (maintenance team)" + gh pr edit "${{env.url}}" --add-label "Pending analysis of PR (maintenance team)" - - name: Set a label - uses: vkirilichev/changed-lines-count-labeler@v0.2 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - configuration-path: .github/changed-lines-count-labeler.yml - continue-on-error: true + #- name: Set a label + # uses: vkirilichev/changed-lines-count-labeler@v0.2 + # with: + # repo-token: ${{ secrets.GITHUB_TOKEN }} + # configuration-path: .github/changed-lines-count-labeler.yml + # continue-on-error: true From 477d755bbc96823d093dfbb7770c8ded8b131a82 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 1 Oct 2025 19:32:40 +0200 Subject: [PATCH 16/20] Clean CI files --- .github/changed-lines-count-labeler.yml | 3 --- .../workflows/pr-18-autolabel.yaml.disabled | 21 ------------------- .github/workflows/pr-18.yaml | 9 +------- 3 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 .github/changed-lines-count-labeler.yml delete mode 100644 .github/workflows/pr-18-autolabel.yaml.disabled diff --git a/.github/changed-lines-count-labeler.yml b/.github/changed-lines-count-labeler.yml deleted file mode 100644 index 39e663821fb..00000000000 --- a/.github/changed-lines-count-labeler.yml +++ /dev/null @@ -1,3 +0,0 @@ -# Add this tag for any changes for more than 1 line -"Pending analysis of PR (maintenance team)": - min: 1 diff --git a/.github/workflows/pr-18-autolabel.yaml.disabled b/.github/workflows/pr-18-autolabel.yaml.disabled deleted file mode 100644 index feb9ee17c97..00000000000 --- a/.github/workflows/pr-18-autolabel.yaml.disabled +++ /dev/null @@ -1,21 +0,0 @@ -name: "Set label for v18" -on: - pull_request: - types: [opened, synchronize, reopened] - branches: - - "18.0" - push: - branches: - - "18.0" - -jobs: - changed-lines-count-labeler: - runs-on: ubuntu-latest - name: An action for automatically labelling pull requests based on the changed lines count - steps: - - name: Set a label - uses: vkirilichev/changed-lines-count-labeler@v0.2 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - configuration-path: .github/changed-lines-count-labeler.yml - continue-on-error: true diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 8c46435869f..5898b157a2c 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -48,11 +48,4 @@ jobs: gh pr edit "${{env.url}}" --add-reviewer rycks gh pr edit "${{env.url}}" --add-reviewer lvessiller-opendsi #gh pr edit "${{env.url}}" --add-reviewer eldy - gh pr edit "${{env.url}}" --add-label "Pending analysis of PR (maintenance team)" - - #- name: Set a label - # uses: vkirilichev/changed-lines-count-labeler@v0.2 - # with: - # repo-token: ${{ secrets.GITHUB_TOKEN }} - # configuration-path: .github/changed-lines-count-labeler.yml - # continue-on-error: true + gh pr edit "${{env.url}}" --add-label "Assigned to v18 maintenance Team" From 24146d89c5c790fc6bf28225a460468b1e2fa525 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 1 Oct 2025 19:54:50 +0200 Subject: [PATCH 17/20] FIX #35568 (#35569) * FIX #35568 * FIX clear "thirdparty" object before or during the fetch --------- Co-authored-by: Laurent Destailleur --- htdocs/core/actions_massactions.inc.php | 3 ++- htdocs/fourn/class/fournisseur.commande.class.php | 3 +++ htdocs/fourn/class/fournisseur.facture.class.php | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 9c71e3414c8..cefe13171e1 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1146,6 +1146,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { $objecttmp = new $objectclass($db); $nbok = 0; foreach ($toselect as $toselectid) { + $objecttmp->thirdparty = null; // Clear if another value was already set by fetch_thirdparty $result = $objecttmp->fetch($toselectid); if ($result > 0) { $outputlangs = $langs; @@ -1160,7 +1161,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->default_lang)) { $newlang = $objecttmp->default_lang; // for thirdparty } - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty $objecttmp->fetch_thirdparty(); $newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 15bad54c10d..ee155e7ad3d 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -427,7 +427,10 @@ class CommandeFournisseur extends CommonOrder $this->ref = $obj->ref; $this->ref_supplier = $obj->ref_supplier; + $this->socid = $obj->fk_soc; + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + $this->fourn_id = $obj->fk_soc; $this->statut = $obj->fk_statut; $this->status = $obj->fk_statut; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a64b1a8893d..5e4181e2559 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1006,6 +1006,7 @@ class FactureFournisseur extends CommonInvoice $this->extraparams = isset($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array(); $this->socid = $obj->socid; + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty $this->socnom = $obj->socnom; // Retrieve all extrafield From ffe07999cf98fafc197ee333a432d933ba145e72 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 2 Oct 2025 02:39:29 +0200 Subject: [PATCH 18/20] FIX: pgsql: error when calculating depreciations (#34213) * FIX: pgsql: error when calculating depreciations * FIX: asset deprectiation: optimize sql * FIX: travis --- htdocs/asset/class/asset.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 876600fe448..29616b60d48 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -928,12 +928,13 @@ class Asset extends CommonObject } // Delete old lines - $sql = "DELETE " . MAIN_DB_PREFIX . "asset_depreciation FROM " . MAIN_DB_PREFIX . "asset_depreciation"; - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab ON ab.doc_type = 'asset' AND ab.fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid"; - $sql .= " WHERE " . MAIN_DB_PREFIX . "asset_depreciation.fk_asset = " . (int) $this->id; - $sql .= " AND " . MAIN_DB_PREFIX . "asset_depreciation.depreciation_mode = '" . $this->db->escape($mode_key) . "'"; - $sql .= " AND ab.fk_docdet IS NULL"; - if ($last_depreciation_date !== "") $sql .= " AND " . MAIN_DB_PREFIX . "asset_depreciation.ref != ''"; + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "asset_depreciation"; + $sql .= " WHERE fk_asset = " . (int) $this->id; + $sql .= " AND depreciation_mode = '" . $this->db->escape($mode_key) . "'"; + $sql .= " AND NOT EXISTS (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset' AND fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid)"; + if ($last_depreciation_date !== "") { + $sql .= " AND ref != ''"; + } $resql = $this->db->query($sql); if (!$resql) { $this->errors[] = $langs->trans('AssetErrorClearDepreciationLines') . ': ' . $this->db->lasterror(); From 1525b9c85e13c43a5e767936efa17f31ef405515 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 2 Oct 2025 03:17:57 +0200 Subject: [PATCH 19/20] Rename label --- .github/workflows/pr-18.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 5898b157a2c..f13993e8a20 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -48,4 +48,4 @@ jobs: gh pr edit "${{env.url}}" --add-reviewer rycks gh pr edit "${{env.url}}" --add-reviewer lvessiller-opendsi #gh pr edit "${{env.url}}" --add-reviewer eldy - gh pr edit "${{env.url}}" --add-label "Assigned to v18 maintenance Team" + gh pr edit "${{env.url}}" --add-label "Issue for v18 maintenance Team" From b1d57a6bd1a1c5d86cfc6ca33ec0c13c1481cd53 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 2 Oct 2025 15:36:47 +0200 Subject: [PATCH 20/20] FIX sql syntax error (#35588) --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index c54bdab2949..ae25899b67b 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -627,7 +627,7 @@ class FormMail extends Form // Add also email aliases from the c_email_senderprofile table $sql = "SELECT rowid, label, email FROM ".$this->db->prefix()."c_email_senderprofile"; - $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).") AND entity in getEntity('c_email_senderprofile')"; + $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).") AND entity IN (".getEntity('c_email_senderprofile').")"; $sql .= " ORDER BY position"; $resql = $this->db->query($sql); if ($resql) {