diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 67627aeb8c4..d3ca1e430b9 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1217,7 +1217,7 @@ class Setup extends DolibarrApi $sql = "SELECT t.rowid as id, t.name, t.entity, t.elementtype, t.label, t.type, t.size, t.fieldcomputed, t.fielddefault,"; $sql .= " t.fieldunique, t.fieldrequired, t.perms, t.enabled, t.pos, t.alwayseditable, t.param, t.list, t.printable,"; - $sql .= " t.totalizable, t.langs, t.help, t.css, t.cssview, t.fk_user_author, t.fk_user_modif, t.datec, t.tms"; + $sql .= " t.totalizable, t.langs, t.help, t.css, t.cssview, t.csslist, t.fk_user_author, t.fk_user_modif, t.datec, t.tms"; $sql .= " FROM ".MAIN_DB_PREFIX."extrafields as t"; $sql .= " WHERE t.entity IN (".getEntity('extrafields').")"; if (!empty($elementtype)) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 83bf7b3f653..076c4de2117 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2234,7 +2234,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr foreach ($histo as $key => $value) { $actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo - $actionstatic->type_picto = $histo[$key]['apicto']; + $actionstatic->type_picto = $histo[$key]['apicto'] ?? ''; $actionstatic->type_code = $histo[$key]['acode']; $out .= ''; diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index c87f4982c5c..30bd7abd94b 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -138,7 +138,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition return 0; } - $date = $shipment->date_expedition; + $date = $shipment->date_shipping; $numFinal = get_next_value($db, $mask, 'expedition', 'ref', '', $objsoc, $date); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index fa7c86a86dd..ae7dc521d99 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1737,7 +1737,7 @@ if ($action == 'create') { print ''; print ''; - if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { + if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { $disabled = ''; if (isModEnabled('productbatch') && $product->hasbatch()) { $disabled = 'disabled="disabled"'; @@ -1749,6 +1749,18 @@ if ($action == 'create') { if (empty($disabled) && getDolGlobalString('STOCK_ALLOW_NEGATIVE_TRANSFER')) { print ''; } + } elseif ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { + $disabled = ''; + if (isModEnabled('productbatch') && $product->hasbatch()) { + $disabled = 'disabled="disabled"'; + } + if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. + $disabled = 'disabled="disabled"'; + } + print ' '; + if (empty($disabled) && getDolGlobalString('STOCK_ALLOW_NEGATIVE_TRANSFER')) { + print ''; + } } else { print $langs->trans("NA"); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 105df5bf34a..535c84e216f 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -683,7 +683,7 @@ if (empty($reshook)) { } */ - $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1); + $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, $emailCC, '', 0, -1); if ($mailfile) { // SEND diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 33a0b5f1dab..1b5edf77e7c 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1168,14 +1168,14 @@ if ($id > 0 || !empty($ref)) { $sql .= " e.rowid as warehouse_id, e.ref as entrepot,"; $sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec"; $sql .= " ,cd.rowid, cd.subprice"; - if ($conf->reception->enabled) { + if (isModEnabled('reception')) { $sql .= " ,cfd.fk_reception, r.date_delivery"; } $sql .= " FROM ".MAIN_DB_PREFIX."product as p,"; $sql .= " ".MAIN_DB_PREFIX."receptiondet_batch as cfd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseurdet as cd ON cd.rowid = cfd.fk_elementdet"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e ON cfd.fk_entrepot = e.rowid"; - if ($conf->reception->enabled) { + if (isModEnabled('reception')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."reception as r ON cfd.fk_reception = r.rowid"; } $sql .= " WHERE cfd.fk_element = ".((int) $object->id); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index b99220b84d5..7cbffdbdfd4 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -3000,57 +3000,58 @@ class SupplierProposalLine extends CommonObjectLine $result = $this->db->query($sql); if ($result) { - $objp = $this->db->fetch_object($result); + if ($objp = $this->db->fetch_object($result)) { + $this->id = $objp->rowid; + $this->fk_supplier_proposal = $objp->fk_supplier_proposal; + $this->fk_parent_line = $objp->fk_parent_line; + $this->label = $objp->custom_label; + $this->desc = $objp->description; + $this->qty = $objp->qty; + $this->subprice = $objp->subprice; + $this->tva_tx = $objp->tva_tx; + $this->remise_percent = $objp->remise_percent; + $this->fk_remise_except = $objp->fk_remise_except; + $this->fk_product = $objp->fk_product; + $this->info_bits = $objp->info_bits; + $this->date_start = $this->db->jdate($objp->date_start); + $this->date_end = $this->db->jdate($objp->date_end); - $this->id = $objp->rowid; - $this->fk_supplier_proposal = $objp->fk_supplier_proposal; - $this->fk_parent_line = $objp->fk_parent_line; - $this->label = $objp->custom_label; - $this->desc = $objp->description; - $this->qty = $objp->qty; - $this->subprice = $objp->subprice; - $this->tva_tx = $objp->tva_tx; - $this->remise_percent = $objp->remise_percent; - $this->fk_remise_except = $objp->fk_remise_except; - $this->fk_product = $objp->fk_product; - $this->info_bits = $objp->info_bits; - $this->date_start = $this->db->jdate($objp->date_start); - $this->date_end = $this->db->jdate($objp->date_end); + $this->total_ht = $objp->total_ht; + $this->total_tva = $objp->total_tva; + $this->total_ttc = $objp->total_ttc; - $this->total_ht = $objp->total_ht; - $this->total_tva = $objp->total_tva; - $this->total_ttc = $objp->total_ttc; + $this->fk_fournprice = $objp->fk_fournprice; - $this->fk_fournprice = $objp->fk_fournprice; + $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); + $this->pa_ht = $marginInfos[0]; + $this->marge_tx = $marginInfos[1]; + $this->marque_tx = $marginInfos[2]; - $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); - $this->pa_ht = $marginInfos[0]; - $this->marge_tx = $marginInfos[1]; - $this->marque_tx = $marginInfos[2]; + $this->special_code = $objp->special_code; + $this->product_type = $objp->product_type; + $this->rang = $objp->rang; - $this->special_code = $objp->special_code; - $this->product_type = $objp->product_type; - $this->rang = $objp->rang; + $this->ref = $objp->product_ref; // deprecated + $this->product_ref = $objp->product_ref; + $this->libelle = $objp->product_label; // deprecated + $this->product_label = $objp->product_label; + $this->product_desc = $objp->product_desc; - $this->ref = $objp->product_ref; // deprecated - $this->product_ref = $objp->product_ref; - $this->libelle = $objp->product_label; // deprecated - $this->product_label = $objp->product_label; - $this->product_desc = $objp->product_desc; + $this->ref_fourn = $objp->ref_produit_fourn; - $this->ref_fourn = $objp->ref_produit_fourn; + // Multicurrency + $this->fk_multicurrency = $objp->fk_multicurrency; + $this->multicurrency_code = $objp->multicurrency_code; + $this->multicurrency_subprice = $objp->multicurrency_subprice; + $this->multicurrency_total_ht = $objp->multicurrency_total_ht; + $this->multicurrency_total_tva = $objp->multicurrency_total_tva; + $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $this->fk_unit = $objp->fk_unit; - // Multicurrency - $this->fk_multicurrency = $objp->fk_multicurrency; - $this->multicurrency_code = $objp->multicurrency_code; - $this->multicurrency_subprice = $objp->multicurrency_subprice; - $this->multicurrency_total_ht = $objp->multicurrency_total_ht; - $this->multicurrency_total_tva = $objp->multicurrency_total_tva; - $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; - $this->fk_unit = $objp->fk_unit; - - $this->db->free($result); - return 1; + $this->db->free($result); + return 1; + } + return 0; } else { dol_print_error($this->db); return -1; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 0bdc8cc65fe..bdeb6e734db 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -510,7 +510,7 @@ class WebsitePage extends CommonObject * @param string $filtermode Filter mode (AND or OR) * @return int int <0 if KO, array of pages if OK */ - public function countAll($websiteid, string $filter = '', $filtermode = 'AND') + public function countAll($websiteid, $filter = '', $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG);