25 include_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
33 public $next_prev_filter =
"te.client in (1,2,3)";
35 public $cacheprospectstatus = array();
48 $this->fournisseur = 0;
62 $this->nb = array(
"prospects" => 0,
"customers" => 0);
65 $sql =
"SELECT count(s.rowid) as nb, s.client";
66 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
67 if (!$user->rights->societe->client->voir && !$user->socid)
69 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON s.rowid = sc.fk_soc";
70 $sql .=
" WHERE sc.fk_user = ".$user->id;
73 $sql .=
" ".$clause.
" s.client IN (1,2,3)";
74 $sql .=
' AND s.entity IN ('.getEntity($this->element).
')';
75 $sql .=
" GROUP BY s.client";
80 while ($obj = $this->
db->fetch_object(
$resql))
82 if ($obj->client == 1 || $obj->client == 3) $this->nb[
"customers"] += $obj->nb;
83 if ($obj->client == 2 || $obj->client == 3) $this->nb[
"prospects"] += $obj->nb;
89 $this->error = $this->
db->lasterror();
104 $sql =
"SELECT id, code, libelle as label, picto FROM ".MAIN_DB_PREFIX.
"c_stcomm";
105 if ($active >= 0) $sql .=
" WHERE active = ".$active;
110 $obj = $this->
db->fetch_object(
$resql);
111 $this->cacheprospectstatus[$obj->id] = array(
'id'=>$obj->id,
'code'=>$obj->code,
'label'=>($langs->trans(
"ST_".strtoupper($obj->code)) ==
"ST_".strtoupper($obj->code)) ? $obj->label : $langs->trans(
"ST_".strtoupper($obj->code)),
'picto'=>$obj->picto);
loadCacheOfProspStatus($active=1)
Load array of prospect status.
load_state_board()
Load indicators into this->nb for board.
Class to manage customers or prospects.
$conf db
API class for accounts.
Class to manage third parties objects (customers, suppliers, prospects...)
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
__construct($db)
Constructor.