32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/propal.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/order.lib.php';
43if (isModEnabled(
'contract')) {
44 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
46if (isModEnabled(
'intervention')) {
47 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
52$hookmanager->initHooks(array(
'commercialindex'));
55$langs->loadLangs(array(
"boxes",
"commercial",
"contracts",
"orders",
"propal",
"supplier_proposal"));
57$action =
GETPOST(
'action',
'aZ09');
62if (isset($user->socid) && $user->socid > 0) {
64 $socid = $user->socid;
70$maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
74if (!$user->hasRight(
'propal',
'read') && !$user->hasRight(
'supplier_proposal',
'read') && !$user->hasRight(
'commande',
'read') && !$user->hasRight(
'fournisseur',
'commande',
'read')
75 && !$user->hasRight(
'supplier_order',
'read') && !$user->hasRight(
'fichinter',
'read') && !$user->hasRight(
'contrat',
'read')) {
94$companystatic =
new Societe($db);
96$supplierproposalstatic =
null;
98$supplierorderstatic =
null;
99$fichinterstatic =
null;
100if (isModEnabled(
"propal")) {
101 $propalstatic =
new Propal($db);
103if (isModEnabled(
'supplier_proposal')) {
106if (isModEnabled(
'order')) {
109if (isModEnabled(
"supplier_order")) {
113if (isModEnabled(
'intervention')) {
117llxHeader(
"", $langs->trans(
"CommercialArea"));
121print
'<div class="fichecenter">';
123print
'<div class="twocolumns">';
125print
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
141if (isModEnabled(
"propal") && $user->hasRight(
"propal",
"lire") && is_object($propalstatic)) {
142 $sql =
"SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
143 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
144 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
145 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
146 $sql .=
", s.logo, s.email, s.entity";
147 $sql .=
", s.canvas";
148 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as p,";
149 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
150 if (!$user->hasRight(
'societe',
'client',
'voir')) {
151 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
153 $sql .=
" WHERE p.entity IN (".getEntity($propalstatic->element).
")";
154 $sql .=
" AND p.fk_soc = s.rowid";
155 $sql .=
" AND p.fk_statut = ".Propal::STATUS_DRAFT;
156 if (!$user->hasRight(
'societe',
'client',
'voir')) {
157 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
160 $sql .=
" AND s.rowid = ".((int) $socid);
163 $resql = $db->query($sql);
166 $num = $db->num_rows($resql);
167 $nbofloop = min($num, $maxofloop);
174 while ($i < $nbofloop) {
175 $obj = $db->fetch_object($resql);
180 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
184 $propalstatic->id = $obj->rowid;
185 $propalstatic->ref = $obj->ref;
186 $propalstatic->ref_client = $obj->ref_client;
187 $propalstatic->total_ht = $obj->total_ht;
188 $propalstatic->total_tva = $obj->total_tva;
189 $propalstatic->total_ttc = $obj->total_ttc;
190 $propalstatic->statut = $obj->status;
191 $propalstatic->statut = $obj->status;
193 $companystatic->id = $obj->socid;
194 $companystatic->name = $obj->name;
195 $companystatic->name_alias = $obj->name_alias;
196 $companystatic->code_client = $obj->code_client;
197 $companystatic->code_compta = $obj->code_compta_client;
198 $companystatic->code_compta_client = $obj->code_compta_client;
199 $companystatic->client = $obj->client;
200 $companystatic->code_fournisseur = $obj->code_fournisseur;
201 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
202 $companystatic->fournisseur = $obj->fournisseur;
203 $companystatic->logo = $obj->logo;
204 $companystatic->email = $obj->email;
205 $companystatic->entity = $obj->entity;
206 $companystatic->canvas = $obj->canvas;
208 print
'<tr class="oddeven">';
209 print
'<td class="nowraponall tdoverflowmax125">'.$propalstatic->getNomUrl(1).
'</td>';
210 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
211 print
'<td class="nowrap right tdamount amount">'.price((
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc)).
'</td>';
215 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
219 print
'<tr class="oddeven">';
220 print
'<td class="nowrap" colspan="5">';
221 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
241if (isModEnabled(
'supplier_proposal') && $user->hasRight(
"supplier_proposal",
"lire") && is_object($supplierproposalstatic)) {
242 $sql =
"SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
243 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
244 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
245 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
246 $sql .=
", s.logo, s.email, s.entity";
247 $sql .=
", s.canvas";
248 $sql .=
" FROM ".MAIN_DB_PREFIX.
"supplier_proposal as p,";
249 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
250 if (!$user->hasRight(
'societe',
'client',
'voir')) {
251 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
253 $sql .=
" WHERE p.entity IN (".getEntity($supplierproposalstatic->element).
")";
254 $sql .=
" AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT;
255 $sql .=
" AND p.fk_soc = s.rowid";
256 if (!$user->hasRight(
'societe',
'client',
'voir')) {
257 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
260 $sql .=
" AND s.rowid = ".((int) $socid);
263 $resql = $db->query($sql);
266 $num = $db->num_rows($resql);
267 $nbofloop = min($num, $maxofloop);
274 while ($i < $nbofloop) {
275 $obj = $db->fetch_object($resql);
280 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
284 $supplierproposalstatic->id = $obj->rowid;
285 $supplierproposalstatic->ref = $obj->ref;
286 $supplierproposalstatic->total_ht = $obj->total_ht;
287 $supplierproposalstatic->total_tva = $obj->total_tva;
288 $supplierproposalstatic->total_ttc = $obj->total_ttc;
289 $supplierproposalstatic->statut = $obj->status;
291 $companystatic->id = $obj->socid;
292 $companystatic->name = $obj->name;
293 $companystatic->name_alias = $obj->name_alias;
294 $companystatic->code_client = $obj->code_client;
295 $companystatic->code_compta = $obj->code_compta;
296 $companystatic->code_compta_client = $obj->code_compta_client;
297 $companystatic->client = $obj->client;
298 $companystatic->code_fournisseur = $obj->code_fournisseur;
299 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
300 $companystatic->fournisseur = $obj->fournisseur;
301 $companystatic->logo = $obj->logo;
302 $companystatic->email = $obj->email;
303 $companystatic->entity = $obj->entity;
304 $companystatic->canvas = $obj->canvas;
306 print
'<tr class="oddeven">';
307 print
'<td class="nowraponall tdoverflowmax125">'.$supplierproposalstatic->getNomUrl(1).
'</td>';
308 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
309 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
313 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
317 print
'<tr class="oddeven">';
318 print
'<td class="nowrap" colspan="5">';
319 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
339if (isModEnabled(
'order') && $user->hasRight(
'commande',
'lire') && is_object($orderstatic)) {
340 $sql =
"SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status";
341 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
342 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
343 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
344 $sql .=
", s.logo, s.email, s.entity";
345 $sql .=
", s.canvas";
346 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
347 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
348 if (!$user->hasRight(
'societe',
'client',
'voir')) {
349 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
351 $sql .=
" WHERE c.entity IN (".getEntity($orderstatic->element).
")";
352 $sql .=
" AND c.fk_statut = ".Commande::STATUS_DRAFT;
353 $sql .=
" AND c.fk_soc = s.rowid";
354 if (!$user->hasRight(
'societe',
'client',
'voir')) {
355 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
358 $sql .=
" AND c.fk_soc = ".((int) $socid);
361 $resql = $db->query($sql);
364 $num = $db->num_rows($resql);
365 $nbofloop = min($num, $maxofloop);
372 while ($i < $nbofloop) {
373 $obj = $db->fetch_object($resql);
378 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
382 $orderstatic->id = $obj->rowid;
383 $orderstatic->ref = $obj->ref;
384 $orderstatic->ref_client = $obj->ref_client;
385 $orderstatic->total_ht = $obj->total_ht;
386 $orderstatic->total_tva = $obj->total_tva;
387 $orderstatic->total_ttc = $obj->total_ttc;
388 $orderstatic->statut = $obj->status;
390 $companystatic->id = $obj->socid;
391 $companystatic->name = $obj->name;
392 $companystatic->name_alias = $obj->name_alias;
393 $companystatic->code_client = $obj->code_client;
394 $companystatic->code_compta = $obj->code_compta_client;
395 $companystatic->code_compta_client = $obj->code_compta_client;
396 $companystatic->client = $obj->client;
397 $companystatic->code_fournisseur = $obj->code_fournisseur;
398 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
399 $companystatic->fournisseur = $obj->fournisseur;
400 $companystatic->logo = $obj->logo;
401 $companystatic->email = $obj->email;
402 $companystatic->entity = $obj->entity;
403 $companystatic->canvas = $obj->canvas;
405 print
'<tr class="oddeven">';
406 print
'<td class="nowraponall tdoverflowmax125">'.$orderstatic->getNomUrl(1).
'</td>';
407 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
408 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
412 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
416 print
'<tr class="oddeven">';
417 print
'<td class="nowrap" colspan="5">';
418 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
438if ((isModEnabled(
"fournisseur") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"commande",
"lire")) || (isModEnabled(
"supplier_order") && $user->hasRight(
"supplier_order",
"lire"))) {
441 $sql =
"SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
442 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
443 $sql .=
", s.code_client, s.code_compta, s.client";
444 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
445 $sql .=
", s.logo, s.email, s.entity";
446 $sql .=
", s.canvas";
447 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as cf,";
448 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
449 if (!$user->hasRight(
'societe',
'client',
'voir')) {
450 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
452 $sql .=
" WHERE cf.entity IN (".getEntity($supplierorderstatic->element).
")";
453 $sql .=
" AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT;
454 $sql .=
" AND cf.fk_soc = s.rowid";
455 if (!$user->hasRight(
'societe',
'client',
'voir')) {
456 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
459 $sql .=
" AND cf.fk_soc = ".((int) $socid);
462 $resql = $db->query($sql);
465 $num = $db->num_rows($resql);
466 $nbofloop = min($num, $maxofloop);
473 while ($i < $nbofloop) {
474 $obj = $db->fetch_object($resql);
479 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
483 $supplierorderstatic->id = $obj->rowid;
484 $supplierorderstatic->ref = $obj->ref;
485 $supplierorderstatic->ref_supplier = $obj->ref_supplier;
486 $supplierorderstatic->total_ht = $obj->total_ht;
487 $supplierorderstatic->total_tva = $obj->total_tva;
488 $supplierorderstatic->total_ttc = $obj->total_ttc;
489 $supplierorderstatic->statut = $obj->status;
491 $companystatic->id = $obj->socid;
492 $companystatic->name = $obj->name;
493 $companystatic->name_alias = $obj->name_alias;
494 $companystatic->code_client = $obj->code_client;
495 $companystatic->code_compta = $obj->code_compta;
496 $companystatic->code_compta_client = $obj->code_compta;
497 $companystatic->client = $obj->client;
498 $companystatic->code_fournisseur = $obj->code_fournisseur;
499 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
500 $companystatic->fournisseur = $obj->fournisseur;
501 $companystatic->logo = $obj->logo;
502 $companystatic->email = $obj->email;
503 $companystatic->entity = $obj->entity;
504 $companystatic->canvas = $obj->canvas;
506 print
'<tr class="oddeven">';
507 print
'<td class="nowraponall tdoverflowmax125">'.$supplierorderstatic->getNomUrl(1).
'</td>';
508 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
509 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
513 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
517 print
'<tr class="oddeven">';
518 print
'<td class="nowrap" colspan="5">';
519 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
538if (isModEnabled(
'intervention') && is_object($fichinterstatic)) {
539 $sql =
"SELECT f.rowid, f.ref, s.nom as name, f.fk_statut, f.duree as duration";
540 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
541 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
542 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
543 $sql .=
", s.logo, s.email, s.entity";
544 $sql .=
", s.canvas";
545 $sql .=
" FROM ".MAIN_DB_PREFIX.
"fichinter as f";
546 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
547 if (!$user->hasRight(
'societe',
'client',
'voir')) {
548 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
550 $sql .=
" WHERE f.entity IN (".getEntity(
'intervention').
")";
551 $sql .=
" AND f.fk_soc = s.rowid";
552 $sql .=
" AND f.fk_statut = 0";
554 $sql .=
" AND f.fk_soc = ".((int) $socid);
556 if (!$user->hasRight(
'societe',
'client',
'voir')) {
557 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
561 $resql = $db->query($sql);
563 $num = $db->num_rows($resql);
564 $nbofloop = min($num, $maxofloop);
572 while ($i < $nbofloop) {
573 $obj = $db->fetch_object($resql);
575 $fichinterstatic->id = $obj->rowid;
576 $fichinterstatic->ref = $obj->ref;
577 $fichinterstatic->statut = $obj->fk_statut;
579 $companystatic->id = $obj->socid;
580 $companystatic->name = $obj->name;
581 $companystatic->name_alias = $obj->name_alias;
582 $companystatic->code_client = $obj->code_client;
583 $companystatic->code_compta = $obj->code_compta_client;
584 $companystatic->code_compta_client = $obj->code_compta_client;
585 $companystatic->client = $obj->client;
586 $companystatic->code_fournisseur = $obj->code_fournisseur;
587 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
588 $companystatic->fournisseur = $obj->fournisseur;
589 $companystatic->logo = $obj->logo;
590 $companystatic->email = $obj->email;
591 $companystatic->entity = $obj->entity;
592 $companystatic->canvas = $obj->canvas;
594 print
'<tr class="oddeven">';
595 print
'<td class="tdoverflowmax125">';
596 print $fichinterstatic->getNomUrl(1);
598 print
'<td class="tdoverflowmax100">';
599 print $companystatic->getNomUrl(1,
'customer');
601 print
'<td class="nowraponall tdoverflowmax100 right">';
617print
'</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
623if (isModEnabled(
"societe") && $user->hasRight(
'societe',
'lire')) {
624 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
625 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
626 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
627 $sql .=
", s.logo, s.email, s.entity";
628 $sql .=
", s.canvas";
629 $sql .=
", s.datec, s.tms";
630 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
631 if (!$user->hasRight(
'societe',
'client',
'voir')) {
632 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
634 $sql .=
" WHERE s.entity IN (".getEntity($companystatic->element).
")";
636 if (!$user->hasRight(
'societe',
'client',
'voir')) {
637 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
640 $parameters = array(
'socid' => $socid);
641 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $companystatic);
642 if (empty($reshook)) {
644 $sql .=
" AND s.rowid = ".((int) $socid);
647 $sql .= $hookmanager->resPrint;
648 $sql .=
" ORDER BY s.tms DESC";
649 $sql .= $db->plimit($max, 0);
651 $resql = $db->query($sql);
654 $header =
"BoxTitleLastCustomersOrProspects";
656 $header =
"BoxTitleLastModifiedProspects";
658 $header =
"BoxTitleLastModifiedCustomers";
661 $num = $db->num_rows($resql);
662 startSimpleTable($langs->trans($header, min($max, $num)),
"societe/list.php",
"type=p,c&sortfield=s.tms&sortorder=DESC", 1, -1,
'company');
667 while ($i < $num && $i < $max) {
668 $objp = $db->fetch_object($resql);
670 $companystatic->id = $objp->socid;
671 $companystatic->name = $objp->name;
672 $companystatic->name_alias = $objp->name_alias;
673 $companystatic->code_client = $objp->code_client;
674 $companystatic->code_compta = $objp->code_compta_client;
675 $companystatic->code_compta_client = $objp->code_compta_client;
676 $companystatic->client = $objp->client;
677 $companystatic->code_fournisseur = $objp->code_fournisseur;
678 $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
679 $companystatic->fournisseur = $objp->fournisseur;
680 $companystatic->logo = $objp->logo;
681 $companystatic->email = $objp->email;
682 $companystatic->entity = $objp->entity;
683 $companystatic->canvas = $objp->canvas;
685 print
'<tr class="oddeven">';
686 print
'<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
687 print
'<td class="nowrap">';
690 $obj = $companystatic;
692 if (($obj->client == 2 || $obj->client == 3) && !
getDolGlobalString(
'SOCIETE_DISABLE_PROSPECTS')) {
693 $s .=
'<a class="customer-back opacitymedium" title="'.$langs->trans(
"Prospect").
'" href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$companystatic->id.
'">'.
dol_substr($langs->trans(
"Prospect"), 0, 1).
'</a>';
695 if (($obj->client == 1 || $obj->client == 3) && !
getDolGlobalString(
'SOCIETE_DISABLE_CUSTOMERS')) {
696 $s .=
'<a class="customer-back" title="'.$langs->trans(
"Customer").
'" href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$companystatic->id.
'">'.
dol_substr($langs->trans(
"Customer"), 0, 1).
'</a>';
707 $datem = $db->jdate($objp->tms);
708 print
'<td class="right nowrap tddate" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
731if (isModEnabled(
'propal') && is_object($propalstatic)) {
732 $sql =
"SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.tms as datem,";
733 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client";
734 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as c,";
735 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
736 $sql .=
" WHERE c.entity IN (".getEntity($propalstatic->element).
")";
737 $sql .=
" AND c.fk_soc = s.rowid";
740 if (!$user->hasRight(
'societe',
'client',
'voir')) {
741 $search_sale = $user->id;
744 if ($search_sale && $search_sale !=
'-1') {
745 if ($search_sale == -2) {
746 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc)";
747 } elseif ($search_sale > 0) {
748 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
753 $sql .=
" AND c.fk_soc = ".((int) $socid);
755 $sql .=
" ORDER BY c.tms DESC";
757 $sql .= $db->plimit($max, 0);
759 $resql = $db->query($sql);
761 $num = $db->num_rows($resql);
763 startSimpleTable($langs->trans(
"LastModifiedProposals", $max),
"comm/propal/list.php",
"sortfield=p.tms&sortorder=DESC", 2, -1,
'propal');
768 $obj = $db->fetch_object($resql);
770 $propalstatic->id = $obj->rowid;
771 $propalstatic->ref = $obj->ref;
772 $propalstatic->status = $obj->status;
774 $companystatic->id = $obj->socid;
775 $companystatic->name = $obj->socname;
776 $companystatic->client = $obj->client;
777 $companystatic->canvas = $obj->canvas;
778 $companystatic->email = $obj->email;
779 $companystatic->code_compta = $obj->code_compta_client;
780 $companystatic->code_compta_client = $obj->code_compta_client;
784 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
786 print
'<tr class="oddeven">';
788 print
'<td class="nowrap">';
789 print
'<table class="nobordernopadding">';
790 print
'<tr class="nocellnopadd">';
791 print
'<td width="96" class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).
'</td>';
792 print
'<td width="16" class="nobordernopadding nowrap"></td>';
793 print
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).
'</td>';
798 print
'<td class="tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
800 $datem = $db->jdate($obj->datem);
801 print
'<td class="center" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
805 print
'<td class="right">'.$propalstatic->LibStatut($obj->status, 3).
'</td>';
825if (isModEnabled(
'order')) {
826 $commandestatic =
new Commande($db);
828 $sql =
"SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,";
829 $sql .=
" s.nom as name, s.rowid as socid";
830 $sql .=
", s.client";
831 $sql .=
", s.code_client";
832 $sql .=
", s.canvas";
833 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
834 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
835 if (!$user->hasRight(
'societe',
'client',
'voir')) {
836 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
838 $sql .=
" WHERE c.fk_soc = s.rowid";
839 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
842 $sql .=
" AND c.fk_soc = ".((int) $socid);
844 if (!$user->hasRight(
'societe',
'client',
'voir')) {
845 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
847 $sql .=
" ORDER BY c.tms DESC";
848 $sql .= $db->plimit($max, 0);
850 $resql = $db->query($sql);
852 $num = $db->num_rows($resql);
854 startSimpleTable($langs->trans(
"LastModifiedOrders", $max),
"commande/list.php",
"sortfield=c.tms&sortorder=DESC", 2, -1,
'order');
859 $obj = $db->fetch_object($resql);
861 print
'<tr class="oddeven">';
862 print
'<td width="20%" class="nowrap">';
864 $commandestatic->id = $obj->rowid;
865 $commandestatic->ref = $obj->ref;
867 $companystatic->id = $obj->socid;
868 $companystatic->name = $obj->name;
869 $companystatic->client = $obj->client;
870 $companystatic->code_client = $obj->code_client;
871 $companystatic->canvas = $obj->canvas;
873 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
874 print
'<td width="96" class="nobordernopadding nowrap">';
875 print $commandestatic->getNomUrl(1);
878 print
'<td width="16" class="nobordernopadding nowrap">';
882 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
885 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
886 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
887 print
'</td></tr></table>';
891 print
'<td class="nowrap">';
892 print $companystatic->getNomUrl(1,
'company', 16);
895 $datem = $db->jdate($obj->datem);
896 print
'<td class="center" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
900 print
'<td class="right">'.$commandestatic->LibStatut($obj->status, $obj->facture, 3).
'</td>';
915if ((isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) && $user->hasRight(
'societe',
'lire')) {
916 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
917 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
918 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
919 $sql .=
", s.logo, s.email, s.entity";
920 $sql .=
", s.canvas";
921 $sql .=
", s.datec as dc, s.tms as dm";
922 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
923 if (!$user->hasRight(
'societe',
'client',
'voir')) {
924 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
926 $sql .=
" WHERE s.entity IN (".getEntity($companystatic->element).
")";
927 $sql .=
" AND s.fournisseur = ".Societe::SUPPLIER;
928 if (!$user->hasRight(
'societe',
'client',
'voir')) {
929 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
932 $parameters = array(
'socid' => $socid);
933 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $companystatic);
934 if (empty($reshook)) {
936 $sql .=
" AND s.rowid = ".((int) $socid);
939 $sql .= $hookmanager->resPrint;
940 $sql .=
" ORDER BY s.datec DESC";
941 $sql .= $db->plimit($max, 0);
943 $resql = $db->query($sql);
945 $num = $db->num_rows($resql);
946 startSimpleTable($langs->trans(
"BoxTitleLastModifiedSuppliers", min($max, $num)),
"societe/list.php",
"type=f", 1, -1,
'company');
950 while ($i < $num && $i < $max) {
951 $objp = $db->fetch_object($resql);
953 $companystatic->id = $objp->socid;
954 $companystatic->name = $objp->name;
955 $companystatic->name_alias = $objp->name_alias;
956 $companystatic->code_client = $objp->code_client;
957 $companystatic->code_compta = $objp->code_compta_client;
958 $companystatic->code_compta_client = $objp->code_compta_client;
959 $companystatic->client = $objp->client;
960 $companystatic->code_fournisseur = $objp->code_fournisseur;
961 $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
962 $companystatic->fournisseur = $objp->fournisseur;
963 $companystatic->logo = $objp->logo;
964 $companystatic->email = $objp->email;
965 $companystatic->entity = $objp->entity;
966 $companystatic->canvas = $objp->canvas;
968 print
'<tr class="oddeven">';
969 print
'<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
972 $obj = $companystatic;
981 if ((isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) && $obj->fournisseur) {
982 $s .=
'<a class="vendor-back" title="'.$langs->trans(
"Supplier").
'" href="'.DOL_URL_ROOT.
'/fourn/card.php?socid='.$companystatic->id.
'">'.
dol_substr($langs->trans(
"Supplier"), 0, 1).
'</a>';
988 $datem = $db->jdate($objp->dm);
989 print
'<td class="right tddate" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
1027if (isModEnabled(
'contract') && $user->hasRight(
"contrat",
"lire") && 0) {
1028 $staticcontrat =
new Contrat($db);
1030 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
1031 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1032 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1033 $sql .=
", s.logo, s.email, s.entity";
1034 $sql .=
", s.canvas";
1035 $sql .=
", c.statut, c.rowid as contratid, p.ref, c.fin_validite as datefin, c.date_cloture as dateclo";
1036 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
1037 $sql .=
", ".MAIN_DB_PREFIX.
"contrat as c";
1038 $sql .=
", ".MAIN_DB_PREFIX.
"product as p";
1039 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1040 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1042 $sql .=
" WHERE c.entity IN (".getEntity($staticcontrat->element).
")";
1043 $sql .=
" AND c.fk_soc = s.rowid";
1044 $sql .=
" AND c.fk_product = p.rowid";
1045 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1046 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1049 $sql .=
" AND s.rowid = ".((int) $socid);
1051 $sql .=
" ORDER BY c.tms DESC";
1052 $sql .= $db->plimit($max + 1, 0);
1054 $resql = $db->query($sql);
1056 $num = $db->num_rows($resql);
1063 $obj = $db->fetch_object($resql);
1065 $companystatic->id = $obj->socid;
1066 $companystatic->name = $obj->name;
1067 $companystatic->name_alias = $obj->name_alias;
1068 $companystatic->code_client = $obj->code_client;
1069 $companystatic->code_compta = $obj->code_compta_client;
1070 $companystatic->code_compta_client = $obj->code_compta_client;
1071 $companystatic->client = $obj->client;
1072 $companystatic->code_fournisseur = $obj->code_fournisseur;
1073 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1074 $companystatic->fournisseur = $obj->fournisseur;
1075 $companystatic->logo = $obj->logo;
1076 $companystatic->email = $obj->email;
1077 $companystatic->entity = $obj->entity;
1078 $companystatic->canvas = $obj->canvas;
1080 $staticcontrat->id = $obj->contratid;
1081 $staticcontrat->ref = $obj->ref;
1083 print
'<tr class="oddeven">';
1084 print
'<td class="nowraponall">'.$staticcontrat->getNomUrl(1).
'</td>';
1085 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1086 print
'<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).
'</td>';
1106if (isModEnabled(
"propal") && $user->hasRight(
"propal",
"lire")) {
1107 $sql =
"SELECT p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
1108 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
1109 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1110 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1111 $sql .=
", s.logo, s.email, s.entity";
1112 $sql .=
", s.canvas";
1113 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as p";
1114 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
1115 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1116 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1118 $sql .=
" WHERE p.entity IN (".getEntity($propalstatic->element).
")";
1119 $sql .=
" AND p.fk_soc = s.rowid";
1120 $sql .=
" AND p.fk_statut = ".Propal::STATUS_VALIDATED;
1121 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1122 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1125 $sql .=
" AND s.rowid = ".((int) $socid);
1127 $sql .=
" ORDER BY p.rowid DESC";
1129 $resql = $db->query($sql);
1131 $total = $total_ttc = 0;
1132 $num = $db->num_rows($resql);
1133 $nbofloop = min($num, (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
1134 startSimpleTable(
"ProposalsOpened",
"comm/propal/list.php",
"search_status=1", 4, $num);
1140 while ($i < $nbofloop) {
1141 $obj = $db->fetch_object($resql);
1146 $total += $obj->total_ht;
1147 $total_ttc += $obj->total_ttc;
1151 $propalstatic->id = $obj->propalid;
1152 $propalstatic->ref = $obj->ref;
1153 $propalstatic->ref_client = $obj->ref_client;
1154 $propalstatic->total_ht = $obj->total_ht;
1155 $propalstatic->total_tva = $obj->total_tva;
1156 $propalstatic->total_ttc = $obj->total_ttc;
1158 $companystatic->id = $obj->socid;
1159 $companystatic->name = $obj->name;
1160 $companystatic->name_alias = $obj->name_alias;
1161 $companystatic->code_client = $obj->code_client;
1162 $companystatic->code_compta = $obj->code_compta_client;
1163 $companystatic->code_compta_client = $obj->code_compta_client;
1164 $companystatic->client = $obj->client;
1165 $companystatic->code_fournisseur = $obj->code_fournisseur;
1166 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1167 $companystatic->fournisseur = $obj->fournisseur;
1168 $companystatic->logo = $obj->logo;
1169 $companystatic->email = $obj->email;
1170 $companystatic->entity = $obj->entity;
1171 $companystatic->canvas = $obj->canvas;
1176 $warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ?
img_warning($langs->trans(
"Late")) :
'';
1178 print
'<tr class="oddeven">';
1180 print
'<td class="nowrap" width="140">';
1181 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1182 print
'<td class="nobordernopadding nowraponall">'.$propalstatic->getNomUrl(1).
'</td>';
1183 print
'<td width="18" class="nobordernopadding nowrap">'.$warning.
'</td>';
1184 print
'<td width="16" class="nobordernopadding center">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).
'</td>';
1189 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1190 $datem = $db->jdate($obj->dp);
1191 print
'<td class="center tddate" title="'.dol_escape_htmltag($langs->trans(
"Date").
': '.
dol_print_date($datem,
'day',
'tzserver')).
'">';
1194 print
'<td class="right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
1195 print
'<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).
'</td>';
1200 $total += $obj->total_ht;
1201 $total_ttc += $obj->total_ttc;
1205 print
'<tr class="oddeven">';
1206 print
'<td class="nowrap" colspan="5">';
1207 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1226if (isModEnabled(
'order') && $user->hasRight(
'commande',
'lire') && is_object($orderstatic)) {
1227 $sql =
"SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
1228 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
1229 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1230 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1231 $sql .=
", s.logo, s.email, s.entity";
1232 $sql .=
", s.canvas";
1233 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c";
1234 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
1235 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1236 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1238 $sql .=
" WHERE c.entity IN (".getEntity($orderstatic->element).
")";
1239 $sql .=
" AND c.fk_soc = s.rowid";
1241 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1242 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1245 $sql .=
" AND s.rowid = ".((int) $socid);
1247 $sql .=
" ORDER BY c.rowid DESC";
1249 $resql = $db->query($sql);
1251 $total = $total_ttc = 0;
1252 $num = $db->num_rows($resql);
1253 $nbofloop = min($num, (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
1260 while ($i < $nbofloop) {
1261 $obj = $db->fetch_object($resql);
1266 $total += $obj->total_ht;
1267 $total_ttc += $obj->total_ttc;
1271 $orderstatic->id = $obj->commandeid;
1272 $orderstatic->ref = $obj->ref;
1273 $orderstatic->ref_client = $obj->ref_client;
1274 $orderstatic->statut = $obj->fk_statut;
1275 $orderstatic->total_ht = $obj->total_ht;
1276 $orderstatic->total_tva = $obj->total_tva;
1277 $orderstatic->total_ttc = $obj->total_ttc;
1279 $companystatic->id = $obj->socid;
1280 $companystatic->name = $obj->name;
1281 $companystatic->name_alias = $obj->name_alias;
1282 $companystatic->code_client = $obj->code_client;
1283 $companystatic->code_compta = $obj->code_compta_client;
1284 $companystatic->code_compta_client = $obj->code_compta_client;
1285 $companystatic->client = $obj->client;
1286 $companystatic->code_fournisseur = $obj->code_fournisseur;
1287 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1288 $companystatic->fournisseur = $obj->fournisseur;
1289 $companystatic->logo = $obj->logo;
1290 $companystatic->email = $obj->email;
1291 $companystatic->entity = $obj->entity;
1292 $companystatic->canvas = $obj->canvas;
1299 print
'<tr class="oddeven">';
1301 print
'<td class="nowrap" width="140">';
1302 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1303 print
'<td class="nobordernopadding nowraponall">'.$orderstatic->getNomUrl(1).
'</td>';
1304 print
'<td width="18" class="nobordernopadding nowrap"></td>';
1305 print
'<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).
'</td>';
1310 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1311 $datem = $db->jdate($obj->dv);
1312 print
'<td class="center tddate" title="'.dol_escape_htmltag($langs->trans(
"DateValue").
': '.
dol_print_date($datem,
'day',
'tzserver')).
'">';
1316 print
'<td class="right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
1317 print
'<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).
'</td>';
1322 $total += $obj->total_ht;
1323 $total_ttc += $obj->total_ttc;
1327 print
'<tr class="oddeven">';
1328 print
'<td class="nowrap" colspan="5">';
1329 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1348$parameters = array(
'user' => $user);
1349$reshook = $hookmanager->executeHooks(
'dashboardCommercials', $parameters, $object);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage predefined suppliers products.
const STATUS_DRAFT
Draft status.
Class to manage customers orders.
const STATUS_SHIPMENTONPROCESS
Shipment on process.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated status.
const STATUS_DRAFT
Draft status.
Class to manage proposals.
const STATUS_DRAFT
Draft status.
Class to manage third parties objects (customers, suppliers, prospects...)
const PROSPECT
Third party type is a prospect.
const CUSTOMER_AND_PROSPECT
Third party type is a customer and a prospect.
Class to manage price ask supplier.
const STATUS_DRAFT
Draft status.
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
finishSimpleTable($addLineBreak=false)
Add the correct HTML close tags for "startSimpleTable(...)" (use after the last table line)
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
addSummaryTableLine($tableColumnCount, $num, $nbofloop=0, $total=0, $noneWord="None", $extraRightColumn=false)
Add a summary line to the current open table ("None", "XMoreLines" or "Total xxx")
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
startSimpleTable($header, $link="", $arguments="", $emptyColumns=0, $number=-1, $pictofulllist='')
Start a table with headers and a optional clickable number (don't forget to use "finishSimpleTable()"...
getCustomerOrderPieChart($socid=0)
Return a HTML table that contains a pie chart of sales orders.
getCustomerProposalPieChart($socid=0)
Return a HTML table that contains a pie chart of customer proposals.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.