only enabled society is used for product select
This commit is contained in:
parent
c007dcc966
commit
e455a2c9a8
@ -1,10 +1,13 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* 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
|
||||
* 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.= " WHERE pfp.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " AND pfp.fk_soc = s.rowid";
|
||||
$sql.= " AND s.status=1"; // only enabled company selected
|
||||
$sql.= " AND pfp.fk_product = ".$prodid;
|
||||
if (empty($sortfield)) $sql.= " ORDER BY s.nom, pfp.quantity, pfp.price";
|
||||
else $sql.= $this->db->order($sortfield,$sortorder);
|
||||
@ -545,6 +549,7 @@ class ProductFournisseur extends Product
|
||||
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
|
||||
$sql.= " AND pfp.fk_product = ".$prodid;
|
||||
$sql.= " AND pfp.fk_soc = s.rowid";
|
||||
$sql.= " AND s.status = 1"; // only enabled society
|
||||
if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty;
|
||||
|
||||
dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user