26 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.product.class.php';
36 public $next_prev_filter =
"te.fournisseur = 1";
49 $this->fournisseur = 1;
60 $sql =
"SELECT rowid";
61 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as cf";
62 $sql .=
" WHERE cf.fk_soc = ".$this->id;
73 $this->single_open_commande = $row[0];
88 $sql =
"SELECT count(pfp.rowid) as nb";
89 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product_fournisseur_price as pfp";
90 $sql .=
" WHERE pfp.entity = ".$conf->entity;
91 $sql .=
" AND pfp.fk_soc = ".$this->id;
96 $obj = $this->
db->fetch_object(
$resql);
117 $sql =
"SELECT count(s.rowid) as nb";
118 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
119 if (!$user->rights->societe->client->voir && !$user->socid)
121 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON s.rowid = sc.fk_soc";
122 $sql .=
" WHERE sc.fk_user = ".$user->id;
125 $sql .=
" ".$clause.
" s.fournisseur = 1";
126 $sql .=
" AND s.entity IN (".getEntity(
'societe').
")";
131 while ($obj = $this->
db->fetch_object(
$resql))
133 $this->nb[
"suppliers"] = $obj->nb;
139 $this->error = $this->
db->error();
155 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"categorie (label,visible,type)";
157 $sql .=
" ('".$this->db->escape($name).
"',1,1)";
159 dol_syslog(
"Fournisseur::CreateCategory", LOG_DEBUG);
163 dol_syslog(
"Fournisseur::CreateCategory : Success");
166 $this->error = $this->
db->lasterror();
167 dol_syslog(
"Fournisseur::CreateCategory : Failed (".$this->error.
")");
186 $sql =
"SELECT s.rowid, s.nom as name";
187 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
188 if (!$user->rights->societe->client->voir && !$user->socid) $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
189 $sql .=
" WHERE s.fournisseur = 1";
190 $sql .=
" AND s.entity IN (".getEntity(
'societe').
")";
191 if (!$user->rights->societe->client->voir && !$user->socid) $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
197 while ($obj = $this->
db->fetch_object(
$resql))
199 $arr[$obj->rowid] = $obj->name;
203 $this->error = $this->
db->lasterror();
nbOfProductRefs()
Returns number of ref prices (not number of products).
__construct($db)
Constructor.
Class to manage Dolibarr database access.
ListArray()
Return the suppliers list.
load_state_board()
Load statistics indicators.
$conf db
API class for accounts.
Class to manage suppliers.
getNbOfOrders()
Return nb of orders.
Class to manage third parties objects (customers, suppliers, prospects...)
static replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
Function used to replace a thirdparty id with another one.
static commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
Function used to replace a thirdparty id with another one.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
CreateCategory($user, $name)
Create a supplier category.
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...