From 58d67c0922a3ac86e20f6b0ed547c067bd9b2067 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 8 Sep 2022 11:52:10 +0200 Subject: [PATCH 1/4] fix #22145 : impossible to delete ticket --- htdocs/ticket/class/ticket.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 9ee7d2c81b6..9c95e56870a 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1016,6 +1016,19 @@ class Ticket extends CommonObject } } + // Delete all child tables + + if (!$error) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_ticket"; + $sql .= " WHERE fk_ticket = ".(int) $this->id; + + $result = $this->db->query($sql); + if (!$result) { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."ticket"; $sql .= " WHERE rowid=".((int) $this->id); From 5b213b2b1a2aae6d444b47f1b4c5db91df84bb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 8 Sep 2022 15:18:52 +0200 Subject: [PATCH 2/4] doc --- 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 ec8e4a93b80..2c89a456961 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4903,7 +4903,7 @@ class Facture extends CommonInvoice /** * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT) - * @return number or -1 if not available + * @return float or -1 if not available */ public function getRetainedWarrantyAmount($rounding = -1) { From de9c12359533023c0ba93dfa0ee41925c95ce985 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Sep 2022 16:40:53 +0200 Subject: [PATCH 3/4] Fix bad var --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 057b32e89ca..ae31004869e 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2917,7 +2917,7 @@ class SupplierProposalLine extends CommonObjectLine $this->product_label = $objp->product_label; $this->product_desc = $objp->product_desc; - $this->ref_fourn = $objp->ref_produit_forun; + $this->ref_fourn = $objp->ref_produit_fourn; // Multicurrency $this->fk_multicurrency = $objp->fk_multicurrency; From 3b62935435beff2de56e78e98b0e8925312c792a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Sep 2022 18:08:43 +0200 Subject: [PATCH 4/4] Fix bad perm --- htdocs/core/lib/product.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 117871b4712..17f5c829cd6 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -59,7 +59,7 @@ function product_prepare_head($object) if (!empty($object->status_buy) || (!empty($conf->margin->enabled) && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase if ((((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->lire) - || (!empty($conf->margin->enabled) && $user->rights->margin->liretous) + || (!empty($conf->margin->enabled) && $user->rights->margins->liretous) ) { $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id; $head[$h][1] = $langs->trans("BuyingPrices");