diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 689c4e312c7..0a8995a3d40 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5306,7 +5306,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/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 1a10cf75537..de9912cfac0 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -951,18 +951,22 @@ if ($object->id > 0) { print ''; } print ''; - print ''; - print ''; - print ''; if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { print ''; print ''; print ''; print ''; print ''; + print ''; print ''; print ''; print ''; + print ''; + print ''; + } else { + print ''; + print ''; + print ''; } // Actions print ''; @@ -1161,9 +1165,9 @@ if ($object->id > 0) { } if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { print ''; - print ''.$langs->trans("Total").''; + print ''.$langs->trans("Total").''; print ''.price($totalExpectedValuation).''; - print ''.price($totalRealValuation).''; + print ''.price($totalRealValuation).''; print ''; print ''; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 4efe9dcf0e8..7d2bf3c2eb0 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -696,6 +696,7 @@ if (empty($reshook)) { $ref_supplier = $productsupplier->ref_supplier; // Get vat rate + $tva_npr = 0; if (!GETPOSTISSET('tva_tx')) { // If vat rate not provided from the form (the form has the priority) $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha')); $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha')); @@ -1295,7 +1296,7 @@ if ($action == 'create') { // Shipping Method if (isModEnabled("expedition")) { print ''.$langs->trans('SendingMethod').''; - print $form->selectShippingMethod(GETPOST('shipping_method_id') > 0 ? GETPOST('shipping_method_id', 'int') : $shipping_method_id, 'shipping_method_id', '', 1); + print $form->selectShippingMethod(GETPOST('shipping_method_id') > 0 ? GETPOST('shipping_method_id', 'int') : "", 'shipping_method_id', '', 1); print ''; } @@ -1303,7 +1304,7 @@ if ($action == 'create') { print ''.$langs->trans("DeliveryDate").''; print ''; $datedelivery = dol_mktime(0, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); - if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") { + if (!empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) { $tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); $syear = date("Y", $tmpdte); $smonth = date("m", $tmpdte); @@ -1320,7 +1321,7 @@ if ($action == 'create') { print ''.$langs->trans("DefaultModel").''; print ''; $list = ModelePDFSupplierProposal::liste_modeles($db); - $preselected = ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT : $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF); + $preselected = (!empty($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT) ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT : $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF); print $form->selectarray('model', $list, $preselected, 0, 0, 0, '', 0, 0, 0, '', '', 1); print ""; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 9d19e5d95c6..5306b0c0141 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1059,6 +1059,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);