diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ee5bb19bc9a..d5b0d898a9c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1636,9 +1636,13 @@ class Form * @param int $forcecombo Force to use combo box * @param string $morecss Add more css on select * @param int $hidepriceinlabel 1=Hide prices in label + * @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used + * 'warehouseopen' = select products from open warehouses, + * 'warehouseclosed' = select products from closed warehouses, + * 'warehouseinternal' = select products from warehouses for internal correct/transfer only * @return void */ - function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0) + function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='') { global $langs,$conf; @@ -1657,7 +1661,7 @@ class Form unset($producttmpselect); } // mode=1 means customers products - $urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished; + $urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished.'&warehousestatus='.$warehouseStatus; //Price by customer if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { $urloption.='&socid='.$socid; @@ -1678,7 +1682,7 @@ class Form } else { - print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid,$showempty,$forcecombo,$morecss,$hidepriceinlabel); + print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid,$showempty,$forcecombo,$morecss,$hidepriceinlabel, $warehouseStatus); } } @@ -1699,28 +1703,54 @@ class Form * @param int $forcecombo Force to use combo box * @param string $morecss Add more css on select * @param int $hidepriceinlabel 1=Hide prices in label + * @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used + * 'warehouseopen' = select products from open warehouses, + * 'warehouseclosed' = select products from closed warehouses, + * 'warehouseinternal' = select products from warehouses for internal correct/transfer only * @return array Array of keys for json */ - function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0) + function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0, $warehouseStatus='') { global $langs,$conf,$user,$db; $out=''; $outarray=array(); - $sql = "SELECT "; - $sql.= " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.stock, p.fk_price_expression"; + $warehouseStatusArray = array(); + if (! empty($warehouseStatus)) + { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + if (preg_match('/warehouseclosed/', $warehouseStatus)) + { + $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; + } + if (preg_match('/warehouseopen/', $warehouseStatus)) + { + $warehouseStatusArray[] = Entrepot::STATUS_OPEN_ALL; + } + if (preg_match('/warehouseinternal/', $warehouseStatus)) + { + $warehouseStatusArray[] = Entrepot::STATUS_OPEN_INTERNAL; + } + } + $selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; + (count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock"; + + $sql = "SELECT "; + $sql.= $selectFields . $selectFieldsGrouped; //Price by customer if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { $sql.=' ,pcp.rowid as idprodcustprice, pcp.price as custprice, pcp.price_ttc as custprice_ttc,'; $sql.=' pcp.price_base_type as custprice_base_type, pcp.tva_tx as custtva_tx'; + $selectFields.= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx"; } // Multilang : we add translation if (! empty($conf->global->MAIN_MULTILANGS)) { $sql.= ", pl.label as label_translated"; + $selectFields.= ", label_translated"; } // Price by quantity if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) @@ -1733,8 +1763,15 @@ class Form if ($price_level >= 1 && !empty($conf->global->PRODUIT_MULTIPRICES)) $sql.= " AND price_level=".$price_level; $sql.= " ORDER BY date_price"; $sql.= " DESC LIMIT 1) as price_by_qty"; + $selectFields.= ", price_rowid, price_by_qty"; } $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; + if (count($warehouseStatusArray)) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid"; + } + //Price by customer if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_customer_price as pcp ON pcp.fk_soc=".$socid." AND pcp.fk_product=p.rowid"; @@ -1745,6 +1782,10 @@ class Form $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang='". $langs->getDefaultLang() ."'"; } $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; + if (count($warehouseStatusArray)) + { + $sql.= ' AND (p.fk_product_type = 1 OR e.statut IN ('.implode(',',$warehouseStatusArray).'))'; + } if ($finished == 0) { $sql.= " AND p.finished = ".$finished; @@ -1780,6 +1821,10 @@ class Form if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$db->escape($prefix.$filterkey)."%'"; $sql.=')'; } + if (count($warehouseStatusArray)) + { + $sql.= ' GROUP BY'.$selectFields; + } $sql.= $db->order("p.ref"); $sql.= $db->plimit($limit); diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index c01f16293b6..beeecf9f511 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -184,7 +184,15 @@ else { if (empty($senderissupplier)) { - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); + if ($conf->global->ENTREPOT_EXTRA_STATUS) + { + // hide products in closed warehouse, but show products for internal transfer + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id, '1', 0, '', 0, 'warehouseopen,warehouseinternal'); + } + else + { + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); + } } else { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 27b87a1b6fe..f9320caddea 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -862,7 +862,7 @@ if ($action == 'create') if ($line->fk_product > 0) // If predefined product { $product->fetch($line->fk_product); - $product->load_stock(); + $product->load_stock('warehouseopen'); print ''; print ''; // ancre pour retourner sur la ligne diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 1ae5556a898..971a2189854 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -892,7 +892,7 @@ class Expedition extends CommonObject $result=$product->fetch($fk_product); if ($entrepot_id > 0) { - $product->load_stock(); + $product->load_stock('warehouseopen'); $product_stock = $product->stock_warehouse[$entrepot_id]->real; } else diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 887b5805533..3044a1beb10 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -766,7 +766,7 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $product->fetch($objp->fk_product); - $product->load_stock(); + $product->load_stock('warehouseopen'); } if ($objp->fk_product > 0 && $type == 0 && ! empty($conf->stock->enabled)) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 90ec9a6fb2c..c3f9c359dac 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -133,9 +133,7 @@ InventoryCodeShort=Inv./Mov. code NoPendingReceptionOnSupplierOrder=No pending reception due to open supplier order ThisSerialAlreadyExistWithDifferentDate=This lot/serial number (%s) already exists but with different eatby or sellby date (found %s but you enter %s). OpenAll=Open for all actions -OpenInternal=Open for internal actions -OpenShipping=Open for shippings -OpenDispatch=Open for dispatch +OpenInternal=Open only for internal actions UseDispatchStatus=Use a dispatch status (approve/refuse) for product lines on supplier order reception OptionMULTIPRICESIsOn=Option "several prices per segment" is on. It means a product has several selling price so value for sell can't be calculated ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index e6d2c6524b7..0510299fbd7 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -50,6 +50,7 @@ $id = GETPOST('id', 'int'); $price_by_qty_rowid = GETPOST('pbq', 'int'); $finished = GETPOST('finished', 'int'); $alsoproductwithnosupplierprice = GETPOST('alsoproductwithnosupplierprice', 'int'); +$warehouseStatus = GETPOST('warehousestatus', 'alpha'); /* @@ -185,7 +186,7 @@ else $form = new Form($db); if (empty($mode) || $mode == 1) { // mode=1: customer - $arrayresult = $form->select_produits_list("", $htmlname, $type, 0, $price_level, $searchkey, $status, $finished, $outjson, $socid); + $arrayresult = $form->select_produits_list("", $htmlname, $type, 0, $price_level, $searchkey, $status, $finished, $outjson, $socid, '1', 0, '', 0, $warehouseStatus); } elseif ($mode == 2) { // mode=2: supplier $arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson, 0, $alsoproductwithnosupplierprice); } diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 55e104990fc..dda92ea0c0f 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -21,6 +21,7 @@ * \brief Fichier de la classe des fonctions predefinie de composants html */ +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; /** * Class with static methods for building HTML components related to products @@ -54,18 +55,36 @@ class FormProduct * * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. * @param string $batch Add quantity of batch stock in label for product with batch name batch, batch name precedes batch_id. Nothing if ''. - * @param int $status additional filter on status other then 1 + * @param string $status warehouse status filter, following comma separated filter options can be used + * 'warehouseopen' = select products from open warehouses, + * 'warehouseclosed' = select products from closed warehouses, + * 'warehouseinternal' = select products from warehouses for internal correct/transfer only * @param boolean $sumStock sum total stock of a warehouse, default true * @param array $exclude warehouses ids to exclude * @return int Nb of loaded lines, 0 if already loaded, <0 if KO */ - function loadWarehouses($fk_product=0, $batch = '', $status=null, $sumStock = true, $exclude='') + function loadWarehouses($fk_product=0, $batch = '', $status='', $sumStock = true, $exclude='') { global $conf, $langs; if (empty($fk_product) && count($this->cache_warehouses)) return 0; // Cache already loaded and we do not want a list with information specific to a product if (is_array($exclude)) $excludeGroups = implode("','",$exclude); + + $warehouseStatus = array(); + + if (preg_match('/warehouseclosed/', $status)) + { + $warehouseStatus[] = Entrepot::STATUS_CLOSED; + } + if (preg_match('/warehouseopen/', $status)) + { + $warehouseStatus[] = Entrepot::STATUS_OPEN_ALL; + } + if (preg_match('/warehouseinternal/', $status)) + { + $warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL; + } $sql = "SELECT e.rowid, e.label, e.description, e.fk_parent"; if (!empty($fk_product)) @@ -94,9 +113,9 @@ class FormProduct } } $sql.= " WHERE e.entity IN (".getEntity('stock', 1).")"; - if (!empty($status)) + if (count($warehouseStatus)) { - $sql.= " AND e.statut IN (1, ".$status.")"; + $sql.= " AND e.statut IN (".implode(',',$warehouseStatus).")"; } else { @@ -168,7 +187,10 @@ class FormProduct * * @param int $selected Id of preselected warehouse ('' for no value, 'ifone'=select value if one value otherwise no value) * @param string $htmlname Name of html select html - * @param string $filtertype For filter, additional filter on status other then 1 + * @param string $filterstatus warehouse status filter, following comma separated filter options can be used + * 'warehouseopen' = select products from open warehouses, + * 'warehouseclosed' = select products from closed warehouses, + * 'warehouseinternal' = select products from warehouses for internal correct/transfer only * @param int $empty 1=Can be empty, 0 if not * @param int $disabled 1=Select is disabled * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. @@ -181,15 +203,15 @@ class FormProduct * @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse * @return string HTML select */ - function selectWarehouses($selected='',$htmlname='idwarehouse',$filtertype='',$empty=0,$disabled=0,$fk_product=0,$empty_label='', $showstock=0, $forcecombo=0, $events=array(), $morecss='minwidth200', $exclude='', $showfullpath=1) + function selectWarehouses($selected='',$htmlname='idwarehouse',$filterstatus='',$empty=0,$disabled=0,$fk_product=0,$empty_label='', $showstock=0, $forcecombo=0, $events=array(), $morecss='minwidth200', $exclude='', $showfullpath=1) { global $conf,$langs,$user; - dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filtertype, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss",LOG_DEBUG); + dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss",LOG_DEBUG); $out=''; - - $this->loadWarehouses($fk_product, '', + $filtertype, true, $exclude); // filter on numeric status + if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = ''; + $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude); $nbofwarehouses=count($this->cache_warehouses); if ($conf->use_javascript_ajax && ! $forcecombo) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 46da76a5f57..3df1393628a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -35,7 +35,7 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; - +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; /** * Class to manage products or services @@ -3471,16 +3471,39 @@ class Product extends CommonObject /** * 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 one for each product id. + * If ENTREPOT_EXTRA_STATUS set, filtering on warehouse status possible. * - * @param string $option '', 'nobatch' = Do not load batch information, 'novirtual' = Do not load virtual stock + * @param string $option '' = Load all stock info, also from closed and internal warehouses, + * 'nobatch' = Do not load batch information, + * 'novirtual' = Do not load virtual stock, + * 'warehouseopen' = Load stock from open warehouses, + * 'warehouseclosed' = Load stock from closed warehouses, + * 'warehouseinternal' = Load stock from warehouses for internal correct/transfer only * @return int < 0 if KO, > 0 if OK * @see load_virtual_stock, getBatchInfo */ function load_stock($option='') { + global $conf; + $this->stock_reel = 0; $this->stock_warehouse = array(); $this->stock_theorique = 0; + + $warehouseStatus = array(); + + if (preg_match('/warehouseclosed/', $option)) + { + $warehouseStatus[] = Entrepot::STATUS_CLOSED; + } + if (preg_match('/warehouseopen/', $option)) + { + $warehouseStatus[] = Entrepot::STATUS_OPEN_ALL; + } + if (preg_match('/warehouseinternal/', $option)) + { + $warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL; + } $sql = "SELECT ps.rowid, ps.reel, ps.fk_entrepot"; $sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps"; @@ -3488,6 +3511,7 @@ class Product extends CommonObject $sql.= " WHERE w.entity IN (".getEntity('stock', 1).")"; $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 (".implode(',',$warehouseStatus).")"; dol_syslog(get_class($this)."::load_stock", LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 1538e47a9d1..a9057ca34ba 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -50,18 +50,7 @@ class Entrepot extends CommonObject /** * Warehouse open and operations for stock transfers/corrections allowed (not for customer shipping and supplier dispatch). */ - const STATUS_OPEN_INTERNAL = 2; - - /** - * Warehouse open and operations for customer shipping and internal stock transfers/corrections allowed (not for supplier dispatch). - */ - const STATUS_OPEN_SHIPPING = 3; - - /** - * Warehouse open and operations for supplier dispatch internal stock transfers/corrections allowed (not for customer shipping). - */ - const STATUS_OPEN_DISPATCH = 4; - + const STATUS_OPEN_INTERNAL = 2; var $libelle; var $description; @@ -91,8 +80,6 @@ class Entrepot extends CommonObject { $this->statuts[self::STATUS_OPEN_ALL] = 'OpenAll'; $this->statuts[self::STATUS_OPEN_INTERNAL] = 'OpenInternal'; - $this->statuts[self::STATUS_OPEN_SHIPPING] = 'OpenShipping'; - $this->statuts[self::STATUS_OPEN_DISPATCH] = 'OpenDispatch'; } else { diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 0c96d1f7a04..ce585fb7587 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -383,11 +383,11 @@ if ($conf->productbatch->enabled) } // In warehouse print ''; -print $formproduct->selectWarehouses($id_sw, 'id_sw', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp'); +print $formproduct->selectWarehouses($id_sw, 'id_sw', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp'); print ''; // Out warehouse print ''; -print $formproduct->selectWarehouses($id_tw, 'id_tw', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp'); +print $formproduct->selectWarehouses($id_tw, 'id_tw', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp'); print ''; // Qty print ''; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index e2cb108f87d..3505247862b 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -791,7 +791,7 @@ if ($resql) { print ''; //print ''; - print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, '', 0, 0, null, 'maxwidth200'); + print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200'); print ''; } if (! empty($arrayfields['m.fk_user_author']['checked'])) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index bb755868f24..c050acc7663 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -552,7 +552,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) if (! empty($conf->global->STOCK_SUPPORTS_SERVICES) || $objp->fk_product_type == 0) { $prod->fetch($objp->rowid); - $prod->load_stock(); + $prod->load_stock('warehouseopen, warehouseinternal'); // Multilangs if (! empty($conf->global->MAIN_MULTILANGS)) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 0b48be2b0d5..ac37566457f 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -56,7 +56,7 @@ { print ''.$langs->trans("Warehouse").''; print ''; - print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', '', 1, 0, 0, '', 0, 0, null, 'minwidth100'); + print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); print ''; } if ($object->element == 'stock') diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index dfddd1e19f1..b38804c05b1 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -63,7 +63,7 @@ { print ''.$langs->trans("WarehouseSource").''; print ''; - print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')),'id_entrepot','',1); + print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', 'warehouseopen,warehouseinternal', 1); print ''; } if ($object->element == 'stock') @@ -75,7 +75,7 @@ } print ''.$langs->trans("WarehouseTarget").''; - print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'),'id_entrepot_destination','',1); + print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1); print ''; print ''.$langs->trans("NumberOfUnit").''; print '';