@@ -109,7 +118,9 @@ class ThirdpartyApi extends DolibarrApi {
if((!DolibarrApiAccess::$user->rights->societe->client->voir&&!$socid)||$search_sale>0)$sql.=", ".MAIN_DB_PREFIX."societe_commerciaux as sc";// We need this table joined to the select in order to filter by sale
$sql.=", ".MAIN_DB_PREFIX."c_stcomm as st";
$sql.=" WHERE s.fk_stcomm = st.id";
//$sql.= " AND s.client IN (1, 3)";
if($only_customer)$sql.=" AND s.client IN (1, 3)";
if($only_prospect)$sql.=" AND s.client IN (2, 3)";
if($only_others)$sql.=" AND s.client IN (0)";
$sql.=' AND s.entity IN ('.getEntity('societe',1).')';
if((!DolibarrApiAccess::$user->rights->societe->client->voir&&!$socid)||$search_sale>0)$sql.=" AND s.rowid = sc.fk_soc";
if($socid)$sql.=" AND s.rowid = ".$socid;
...
...
@@ -151,6 +162,39 @@ class ThirdpartyApi extends DolibarrApi {
return$obj_ret;
}
/**
* Show customers
*
* @url GET /thirdparties/customers
*
* @return array List of customers
*/
functiongetListCustomers(){
return$this->getList(1);
}
/**
* Show prospects
*
* @url GET /thirdparties/prospects
*
* @return array List of prospects
*/
functiongetListProspects(){
return$this->getList('',1);
}
/**
* Show other
*
* @url GET /thirdparties/others
*
* @return array List of thirpdparties who are not customer neither prospect