Update api_thirdparties.class.php

This commit is contained in:
ptibogxiv 2020-04-15 19:23:04 +02:00 committed by GitHub
parent ec84303e8c
commit d56785e9dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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";