From b1e518da274f9d7b9e4c406e40dc2205f3cec5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 14 Apr 2025 21:06:56 +0200 Subject: [PATCH 1/3] fix missing translation (#33844) * fix missing translation * fix missing translation * fix missing translation * fix missing translation * fix missing translation --- dev/translation/ignore_translation_keys.lst | 3 --- htdocs/admin/modules.php | 6 +++--- htdocs/langs/en_US/other.lang | 2 ++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index d85ac6636da..506c03fab85 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -676,7 +676,6 @@ RECUR RSS RateIndirect Re-Open -Rechercher ReconciledBy RecordNotFound RecruitmentJobPosition @@ -808,8 +807,6 @@ SupplierMissingRef Synchronize Syslog TLS/STARTTLS -TLSv1 -TLSv1.2 TYPE_ Tabs Tag diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index a80dc11596a..952ac0f902e 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -8,8 +8,8 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2021-2025 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1347,7 +1347,7 @@ if ($mode == 'marketplace') {
- + ">trans('Reset') ?>   diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index fbb3dab2265..75b3461e42d 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -374,3 +374,5 @@ RephraseStyleProfessional=Professional style RephraseStyleHumouristic=Humouristic style TextRephraser=Text style rephraser AIEnhancements=AI Enhancements +TLSv1=TLSv1 +TLSv1.2=TLSv1.2 From dfe8433b6b2fcb0ba1d813f728fc5a2431d35989 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Mon, 14 Apr 2025 21:08:53 +0200 Subject: [PATCH 2/3] NEW: add setasnumber for forms (#33845) * add setasnumber * fix bad attribute from dev time * more generic solution --- htdocs/core/class/html.formsetup.class.php | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index a41b8a3cc42..f1e60578050 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -817,6 +817,8 @@ class FormSetupItem $val_const = GETPOST($this->confKey, 'restricthtml'); } elseif ($this->type == 'email') { $val_const = GETPOST($this->confKey, 'alphawithlgt'); + } elseif ($this->type == 'number') { + $val_const = GETPOSTINT($this->confKey); } else { $val_const = GETPOST($this->confKey, 'alphanohtml'); } @@ -1411,6 +1413,31 @@ class FormSetupItem return $this; } + /** + * Set type of input as number + * @param int $min minimum value for input number + * @param int $max maximum value for input number + * @param int $step legal number intervals + * + * @return self + */ + public function setAsNumber($min = null, $max = null, $step = null) + { + $this->type = 'number'; //for GETPOSTINT + $this->fieldAttr['type'] = 'number'; //generic thanks to generateAttributesStringFromArray + if (!is_null($min)) { + $this->fieldAttr['min'] = $min; + } + if (!is_null($max)) { + $this->fieldAttr['max'] = $max; + } + if (!is_null($step)) { + $this->fieldAttr['step'] = $step; + } + return $this; + } + + /** * Set type of input as string * From f19cce51f773dd676e8a3564d120da5897822f32 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Mon, 14 Apr 2025 21:56:34 +0200 Subject: [PATCH 3/3] FIX compute pending amount on debit request when using bank transfer mass action from supplier invoice list (#33843) --- htdocs/fourn/facture/list.php | 40 +++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 64deb435293..0ea9626f17f 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -406,14 +406,40 @@ if (empty($reshook)) { if (!empty($listofbills)) { $nbwithdrawrequestok = 0; foreach ($listofbills as $aBill) { - $db->begin(); - $result = $aBill->demande_prelevement($user, $aBill->resteapayer, 'bank-transfer', 'supplier_invoice'); - if ($result > 0) { - $db->commit(); - $nbwithdrawrequestok++; - } else { - $db->rollback(); + $pendingAmount = 0; + $sqlPending = "SELECT SUM(pfd.amount) as amount"; + $sqlPending .= " FROM ".$db->prefix()."prelevement_demande as pfd"; + $sqlPending .= " LEFT JOIN ".$db->prefix()."prelevement_lignes as pl ON pfd.fk_prelevement_bons = pl.fk_prelevement_bons"; + $sqlPending .= " WHERE fk_facture_fourn = ".((int) $aBill->id); + $sqlPending .= " AND (pl.statut IS NULL OR pl.statut = 0)"; + $sqlPending .= " AND pfd.type = 'ban'"; + $resPending = $db->query($sqlPending); + if (!$resPending) { + $aBill->error = $db->lasterror(); + $aBill->errors[] = $aBill->error; setEventMessages($aBill->error, $aBill->errors, 'errors'); + } else { + if ($objPending = $db->fetch_object($resPending)) { + $pendingAmount = (float) $objPending->amount; + } + $db->free($resPending); + + $requestAmount = $aBill->resteapayer - $pendingAmount; + if ($requestAmount > 0) { + $db->begin(); + $result = $aBill->demande_prelevement($user, $requestAmount, 'bank-transfer', 'supplier_invoice'); + if ($result > 0) { + $db->commit(); + $nbwithdrawrequestok++; + } else { + $db->rollback(); + setEventMessages($aBill->error, $aBill->errors, 'errors'); + } + } else { + $aBill->error = 'WithdrawRequestErrorNilAmount'; + $aBill->errors[] = $aBill->error; + setEventMessages($aBill->error, $aBill->errors, 'errors'); + } } } if ($nbwithdrawrequestok > 0) {