Merge pull request #4754 from defrance/patch-107
FIX : only enabled society is used for product select
This commit is contained in:
commit
2d1c56cfaa
@ -5,6 +5,9 @@
|
|||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
|
||||||
|
status
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -439,6 +442,7 @@ class ProductFournisseur extends Product
|
|||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= " WHERE pfp.entity IN (".getEntity('product', 1).")";
|
$sql.= " WHERE pfp.entity IN (".getEntity('product', 1).")";
|
||||||
$sql.= " AND pfp.fk_soc = s.rowid";
|
$sql.= " AND pfp.fk_soc = s.rowid";
|
||||||
|
$sql.= " AND s.status=1"; // only enabled company selected
|
||||||
$sql.= " AND pfp.fk_product = ".$prodid;
|
$sql.= " AND pfp.fk_product = ".$prodid;
|
||||||
if (empty($sortfield)) $sql.= " ORDER BY s.nom, pfp.quantity, pfp.price";
|
if (empty($sortfield)) $sql.= " ORDER BY s.nom, pfp.quantity, pfp.price";
|
||||||
else $sql.= $this->db->order($sortfield,$sortorder);
|
else $sql.= $this->db->order($sortfield,$sortorder);
|
||||||
@ -545,6 +549,7 @@ class ProductFournisseur extends Product
|
|||||||
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
|
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
|
||||||
$sql.= " AND pfp.fk_product = ".$prodid;
|
$sql.= " AND pfp.fk_product = ".$prodid;
|
||||||
$sql.= " AND pfp.fk_soc = s.rowid";
|
$sql.= " AND pfp.fk_soc = s.rowid";
|
||||||
|
$sql.= " AND s.status = 1"; // only enabled society
|
||||||
if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty;
|
if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG);
|
dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user