Update api_thirdparties.class.php
This commit is contained in:
parent
ec84303e8c
commit
d56785e9dc
@ -143,9 +143,9 @@ class Thirdparties extends DolibarrApi
|
|||||||
|
|
||||||
// Select thirdparties of given category
|
// Select thirdparties of given category
|
||||||
if ($category > 0) {
|
if ($category > 0) {
|
||||||
if ($mode != 4) $sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid ";
|
if (!empty($mode) && $mode != 4) { $sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid "; }
|
||||||
elseif (!in_array($mode, array(1,2,3))) $sql .= " AND cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid ";
|
elseif (!empty($mode) && $mode == 4) { $sql .= " AND cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid "; }
|
||||||
else $sql .= " AND (c.fk_categorie = ".$db->escape($category)." OR cc.fk_categorie = ".$db->escape($category).") AND cc.fk_soc = t.rowid AND c.fk_soc = t.rowid ";
|
else { $sql .= " AND ((c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid) OR (cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid)) "; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= " AND t.rowid = sc.fk_soc";
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= " AND t.rowid = sc.fk_soc";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user