From de25cae7077a596e4608aacf9d6d1d28c0e11c0f Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Sep 2023 15:52:17 +0200 Subject: [PATCH 1/5] FIX #25853 Thirdparty Massaction --- htdocs/core/lib/functions.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b68f89f1e75df..603d4e7afc2f4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7,7 +7,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005-2019 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2010-2018 Juanjo Menent + * Copyright (C) 2010-2023 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2014 Cédric GROSS @@ -212,7 +212,8 @@ function isModEnabled($module) $arrayconv = array( 'project' => 'projet', 'contract' => 'contrat', - 'bank' => 'banque' + 'bank' => 'banque', + 'category' => 'categorie' ); if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { $arrayconv['supplier_order'] = 'fournisseur'; From d08190d424476756d9cafd839f3a9f821568aeb4 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Sep 2023 16:48:48 +0200 Subject: [PATCH 2/5] FIX #25704 Taxes Deleted from Vendor Invoices --- htdocs/fourn/class/fournisseur.facture.class.php | 14 +++++++++----- htdocs/fourn/facture/card.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index fa90786653286..f4c74bb50a81b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2020 Juanjo Menent + * Copyright (C) 2010-2023 Juanjo Menent * Copyright (C) 2013-2019 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García @@ -1200,8 +1200,12 @@ public function update($user = null, $notrigger = 0) if (empty($this->total_tva)) { $this->total_tva = 0; } - // if (isset($this->total_localtax1)) $this->total_localtax1=trim($this->total_localtax1); - // if (isset($this->total_localtax2)) $this->total_localtax2=trim($this->total_localtax2); + if (isset($this->total_localtax1)) { + $this->total_localtax1=trim($this->total_localtax1); + } + if (isset($this->total_localtax2)) { + $this->total_localtax2=trim($this->total_localtax2); + } if (isset($this->total_ttc)) { $this->total_ttc = trim($this->total_ttc); } @@ -1261,8 +1265,8 @@ public function update($user = null, $notrigger = 0) $sql .= " paye=".(isset($this->paye) ? ((int) $this->paye) : "0").","; $sql .= " close_code=".(isset($this->close_code) ? "'".$this->db->escape($this->close_code)."'" : "null").","; $sql .= " close_note=".(isset($this->close_note) ? "'".$this->db->escape($this->close_note)."'" : "null").","; - $sql .= " localtax1=".(isset($this->localtax1) ? ((float) $this->localtax1) : "null").","; - $sql .= " localtax2=".(isset($this->localtax2) ? ((float) $this->localtax2) : "null").","; + $sql .= " localtax1=".(isset($this->total_localtax1) ? ((float) $this->total_localtax1) : "null").","; + $sql .= " localtax2=".(isset($this->total_localtax2) ? ((float) $this->total_localtax2) : "null").","; $sql .= " total_ht=".(isset($this->total_ht) ? ((float) $this->total_ht) : "null").","; $sql .= " total_tva=".(isset($this->total_tva) ? ((float) $this->total_tva) : "null").","; $sql .= " total_ttc=".(isset($this->total_ttc) ? ((float) $this->total_ttc) : "null").","; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c882e3cff4abe..253921bb8c839 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2010-2019 Juanjo Menent + * Copyright (C) 2010-2023 Juanjo Menent * Copyright (C) 2013-2022 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García From ce5ab25cce61c6a9be741b3e7aeaf63043a48426 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Sep 2023 19:56:37 +0200 Subject: [PATCH 3/5] FIX #25704 Taxes Deleted from Vendor Invoices --- htdocs/fourn/class/fournisseur.facture.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f4c74bb50a81b..36f87ae73f094 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1200,14 +1200,14 @@ public function update($user = null, $notrigger = 0) if (empty($this->total_tva)) { $this->total_tva = 0; } - if (isset($this->total_localtax1)) { - $this->total_localtax1=trim($this->total_localtax1); + if (empty($this->total_localtax1)) { + $this->total_localtax1 = 0; } - if (isset($this->total_localtax2)) { - $this->total_localtax2=trim($this->total_localtax2); + if (empty($this->total_localtax2)) { + $this->total_localtax2= 0; } - if (isset($this->total_ttc)) { - $this->total_ttc = trim($this->total_ttc); + if (empty($this->total_ttc)) { + $this->total_ttc = 0; } if (isset($this->statut)) { $this->statut = (int) $this->statut; From ac92a06e804b9e1282593755671a9f65e42e8654 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Sep 2023 19:57:00 +0200 Subject: [PATCH 4/5] FIX #25704 Taxes Deleted from Vendor Invoices --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 36f87ae73f094..f6c78f69f7521 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1204,7 +1204,7 @@ public function update($user = null, $notrigger = 0) $this->total_localtax1 = 0; } if (empty($this->total_localtax2)) { - $this->total_localtax2= 0; + $this->total_localtax2 = 0; } if (empty($this->total_ttc)) { $this->total_ttc = 0; From 8621b05dc5414b52c064bee18d3eb5f575d12b88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Nov 2024 04:23:54 +0100 Subject: [PATCH 5/5] Update fournisseur.facture.class.php --- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 1527f1b14e3bb..f02b938b3b3e0 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1207,8 +1207,8 @@ public function update($user = null, $notrigger = 0) if (empty($this->total_localtax2)) { $this->total_localtax2 = 0; } - if (empty($this->total_ttc)) { - $this->total_ttc = 0; + if (isset($this->total_ttc)) { + $this->total_ttc = (float) $this->total_ttc; } if (isset($this->statut)) { $this->statut = (int) $this->statut;