diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index ac987d49845..d00cba86e6a 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -4010,7 +4010,7 @@ class Product extends CommonObject
if ($this->type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (! empty($conf->productbatch->enabled)) {
- $langs->load("productbatch");
+ $langs->load("productbatch");
$label.="
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0, 2);
}
}
@@ -4361,12 +4361,12 @@ class Product extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products)
- * This function need a lot of load. If you use it on list, use a cache to execute it once for each product id.
- * If ENTREPOT_EXTRA_STATUS set, filtering on warehouse status possible.
+ * Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products)
+ * This function need a lot of load. If you use it on list, use a cache to execute it once for each product id.
+ * If ENTREPOT_EXTRA_STATUS set, filtering on warehouse status possible.
*
- * @param string $option '' = Load all stock info, also from closed and internal warehouses,
- * @return int < 0 if KO, > 0 if OK
+ * @param string $option '' = Load all stock info, also from closed and internal warehouses, 'nobatch', 'novirtual'
+ * @return int < 0 if KO, > 0 if OK
* @see load_virtual_stock(), loadBatchInfo()
*/
public function load_stock($option = '')
@@ -4396,7 +4396,8 @@ class Product extends CommonObject
$sql.= " WHERE w.entity IN (".getEntity('stock').")";
$sql.= " AND w.rowid = ps.fk_entrepot";
$sql.= " AND ps.fk_product = ".$this->id;
- if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) { $sql.= " AND w.statut IN (".$this->db->escape(implode(',', $warehouseStatus)).")";
+ if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) {
+ $sql.= " AND w.statut IN (".$this->db->escape(implode(',', $warehouseStatus)).")";
}
dol_syslog(get_class($this)."::load_stock", LOG_DEBUG);
@@ -4411,7 +4412,8 @@ class Product extends CommonObject
$this->stock_warehouse[$row->fk_entrepot] = new stdClass();
$this->stock_warehouse[$row->fk_entrepot]->real = $row->reel;
$this->stock_warehouse[$row->fk_entrepot]->id = $row->rowid;
- if ((! preg_match('/nobatch/', $option)) && $this->hasbatch()) { $this->stock_warehouse[$row->fk_entrepot]->detail_batch=Productbatch::findAll($this->db, $row->rowid, 1, $this->id);
+ if ((! preg_match('/nobatch/', $option)) && $this->hasbatch()) {
+ $this->stock_warehouse[$row->fk_entrepot]->detail_batch=Productbatch::findAll($this->db, $row->rowid, 1, $this->id);
}
$this->stock_reel+=$row->reel;
$i++;