diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index aae5fbcecd4..5379de84bef 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5305,7 +5305,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) { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 7b3d1e4637f..70a3bf73ffb 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"); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 8f0c1d36919..018676dec0d 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2947,7 +2947,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; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3d506c9951d..b5782835264 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1034,6 +1034,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);