From c52b76cb2e9f941cee6e1e4bde425f7c09d50db3 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 14 Apr 2025 19:24:42 +0200 Subject: [PATCH 1/4] FIX Order error translation (#33834) --- htdocs/langs/en_US/errors.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 1a1571fba34..671eae89cd4 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -327,6 +327,7 @@ ErrorGeneratingBarcode=Error while generating the barcode (probably invalid code ErrorTypeMenu=Impossible to add another menu for the same module on the navbar, not handle yet ErrorObjectNotFound = The object %s is not found, please check your url ErrorCountryCodeMustBe2Char=Country code must be a 2 character string +SomeShipmentExists=Error, there is some shipment linked to the order. Deletion refused. ErrorTableExist=Table %s already exist ErrorDictionaryNotFound=Dictionary %s not found From d7758f9ae6744f91a9adae1456346734485acc28 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Mon, 14 Apr 2025 19:25:41 +0200 Subject: [PATCH 2/4] FIX bank payment rejection on SEPA (backport commit 100a657) (#33838) --- .../class/rejetprelevement.class.php | 40 ++++++++++++------- htdocs/compta/prelevement/line.php | 2 +- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 27e27fe60bd..000b5389976 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -76,27 +76,28 @@ class RejetPrelevement } /** - * Create + * Create a reject * * @param User $user User object * @param int $id Id * @param string $motif Motif - * @param int $date_rejet Date rejet + * @param int $date_rejet Date reject * @param int $bonid Bon id - * @param int $facturation Facturation - * @return void + * @param int $facturation 1=Bill the reject + * @return int Return >=0 if OK, <0 if KO */ public function create($user, $id, $motif, $date_rejet, $bonid, $facturation = 0) { - global $langs, $conf; + global $langs; $error = 0; $this->id = $id; $this->bon_id = $bonid; $now = dol_now(); - dol_syslog("RejetPrelevement::Create id $id"); - $bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); + dol_syslog("RejetPrelevement::Create id ".$id); + + $bankaccount = ($this->type == 'bank-transfer' ? getDolGlobalString('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalString('PRELEVEMENT_ID_BANKACCOUNT')); $facs = $this->getListInvoices(1); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; @@ -152,17 +153,16 @@ class RejetPrelevement $fac->fetch($facs[$i][0]); - // Make a negative payment - //$pai = new Paiement($this->db); + $amountrejected = $facs[$i][1]; + // Make a negative payment + // Amount must be an array (id of invoice -> amount) $pai->amounts = array(); - /* - * We replace the comma with a point otherwise some - * PHP installs sends only the part integer negative - */ + //var_dump($this->type);exit; + + $pai->amounts[$facs[$i][0]] = price2num($amountrejected * -1); // The payment must be negative because it is a refund - $pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * ($this->type == 'bank-transfer' ? 1 : -1)); $pai->datepaye = $date_rejet; $pai->paiementid = 3; // type of payment: withdrawal $pai->num_paiement = $fac->ref; @@ -175,7 +175,13 @@ class RejetPrelevement $error++; dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]); } else { - $result = $pai->addPaymentToBank($user, 'payment', '(InvoiceRefused)', $bankaccount, '', ''); + // We record entry into bank + $mode = 'payment'; + if ($this->type == 'bank-transfer') { + $mode = 'payment_supplier'; + } + + $result = $pai->addPaymentToBank($user, $mode, '(InvoiceRefused)', $bankaccount, '', ''); if ($result < 0) { dol_syslog("RejetPrelevement::Create AddPaymentToBan Error"); $error++; @@ -200,9 +206,13 @@ class RejetPrelevement if ($error == 0) { dol_syslog("RejetPrelevement::Create Commit"); $this->db->commit(); + + return 1; } else { dol_syslog("RejetPrelevement::Create Rollback"); $this->db->rollback(); + + return -1; } } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index e91d76aca21..617d079c694 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -85,7 +85,7 @@ $error = 0; if ($action == 'confirm_rejet' && $permissiontoadd) { if (GETPOST("confirm") == 'yes') { if (GETPOST('remonth', 'int')) { - $daterej = mktime(2, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $daterej = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); } if (empty($daterej)) { From f5b11b78daf2a247781e8d5edd25736870e3ab1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 19 Apr 2025 11:46:22 +0200 Subject: [PATCH 3/4] fix typo (#33920) --- 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 880c450f798..7f3a5678671 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6248,7 +6248,7 @@ class Form $TCurrency = array(); $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; + $sql .= " WHERE entity IN ('" . getEntity('multicurrency') . "')"; if ($filter) { $sql .= " AND " . $filter; } From 61df34acd6e2f63de700fcb12cfe96a075a98797 Mon Sep 17 00:00:00 2001 From: William Mead Date: Mon, 21 Apr 2025 10:42:51 +0200 Subject: [PATCH 4/4] Fixed public ticket layout for Safari (#33933) --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4ee2d59f8a9..732a03b9d5f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1546,7 +1546,7 @@ div.fiche { } .flexcontainer { - browser->name, array('chrome', 'firefox'))) { + browser->name, array('chrome', 'firefox', 'safari'))) { echo 'display: inline-flex;'."\n"; } ?> flex-flow: row wrap; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a1ca45245ac..b218fcdb35f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1772,7 +1772,7 @@ div.fiche>form>div.div-table-responsive { } .flexcontainer { - browser->name, array('chrome', 'firefox'))) { + browser->name, array('chrome', 'firefox', 'safari'))) { echo 'display: inline-flex;'."\n"; } ?> flex-flow: row wrap;