Fix add missing filter on entity on stock listing for product combo

This commit is contained in:
Laurent Destailleur 2019-08-26 22:42:04 +02:00
parent 952e395943
commit b6db04a727

View File

@ -2082,7 +2082,7 @@ class Form
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";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
$sql.= ' AND e.statut IN ('.$this->db->escape(implode(',',$warehouseStatusArray)).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0.
}