NEW mode for list thirdparty API (add supplier)
add new mode for more universel use of the api and easy switch between customer's and supplier's modes
This commit is contained in:
parent
33cc0c017c
commit
0d69ae9e8c
@ -117,6 +117,7 @@ class Thirdparties extends DolibarrApi
|
||||
* @param int $mode Set to 1 to show only customers
|
||||
* Set to 2 to show only prospects
|
||||
* Set to 3 to show only those are not customer neither prospect
|
||||
* Set to 4 to show only suppliers
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.nom:like:'TheCompany%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of thirdparty objects
|
||||
*/
|
||||
@ -143,6 +144,7 @@ class Thirdparties extends DolibarrApi
|
||||
if ($mode == 1) $sql.= " AND t.client IN (1, 3)";
|
||||
if ($mode == 2) $sql.= " AND t.client IN (2, 3)";
|
||||
if ($mode == 3) $sql.= " AND t.client IN (0)";
|
||||
if ($mode == 4) $sql.= " AND t.fournisseur IN (1)";
|
||||
$sql.= ' AND t.entity IN ('.getEntity('societe').')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc";
|
||||
//if ($email != NULL) $sql.= " AND s.email = \"".$email."\"";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user