31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/propal.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/order.lib.php';
42if (isModEnabled(
'contract')) {
43 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
45if (isModEnabled(
'intervention')) {
46 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
51$hookmanager->initHooks(array(
'commercialindex'));
54$langs->loadLangs(array(
"boxes",
"commercial",
"contracts",
"orders",
"propal",
"supplier_proposal"));
56$action =
GETPOST(
'action',
'aZ09');
61if (isset($user->socid) && $user->socid > 0) {
63 $socid = $user->socid;
68$maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
72if (!$user->hasRight(
'propal',
'read') && !$user->hasRight(
'supplier_proposal',
'read') && !$user->hasRight(
'commande',
'read') && !$user->hasRight(
'fournisseur',
'commande',
'read')
73 && !$user->hasRight(
'supplier_order',
'read') && !$user->hasRight(
'fichinter',
'read') && !$user->hasRight(
'contrat',
'read')) {
92$companystatic =
new Societe($db);
93if (isModEnabled(
"propal")) {
94 $propalstatic =
new Propal($db);
96if (isModEnabled(
'supplier_proposal')) {
99if (isModEnabled(
'order')) {
102if (isModEnabled(
"supplier_order")) {
106if (isModEnabled(
'intervention')) {
110llxHeader(
"", $langs->trans(
"CommercialArea"));
114print
'<div class="fichecenter">';
116print
'<div class="twocolumns">';
118print
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
134if (isModEnabled(
"propal") && $user->hasRight(
"propal",
"lire")) {
135 $sql =
"SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
136 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
137 $sql .=
", s.code_client, s.code_compta, s.client";
138 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
139 $sql .=
", s.logo, s.email, s.entity";
140 $sql .=
", s.canvas";
141 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as p,";
142 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
143 if (!$user->hasRight(
'societe',
'client',
'voir')) {
144 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
146 $sql .=
" WHERE p.entity IN (".getEntity($propalstatic->element).
")";
147 $sql .=
" AND p.fk_soc = s.rowid";
148 $sql .=
" AND p.fk_statut = ".Propal::STATUS_DRAFT;
149 if (!$user->hasRight(
'societe',
'client',
'voir')) {
150 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
153 $sql .=
" AND s.rowid = ".((int) $socid);
156 $resql = $db->query($sql);
159 $num = $db->num_rows($resql);
160 $nbofloop = min($num, $maxofloop);
167 while ($i < $nbofloop) {
168 $obj = $db->fetch_object($resql);
173 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
177 $propalstatic->id = $obj->rowid;
178 $propalstatic->ref = $obj->ref;
179 $propalstatic->ref_client = $obj->ref_client;
180 $propalstatic->total_ht = $obj->total_ht;
181 $propalstatic->total_tva = $obj->total_tva;
182 $propalstatic->total_ttc = $obj->total_ttc;
183 $propalstatic->statut = $obj->status;
184 $propalstatic->statut = $obj->status;
186 $companystatic->id = $obj->socid;
187 $companystatic->name = $obj->name;
188 $companystatic->name_alias = $obj->name_alias;
189 $companystatic->code_client = $obj->code_client;
190 $companystatic->code_compta = $obj->code_compta;
191 $companystatic->client = $obj->client;
192 $companystatic->code_fournisseur = $obj->code_fournisseur;
193 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
194 $companystatic->fournisseur = $obj->fournisseur;
195 $companystatic->logo = $obj->logo;
196 $companystatic->email = $obj->email;
197 $companystatic->entity = $obj->entity;
198 $companystatic->canvas = $obj->canvas;
200 print
'<tr class="oddeven">';
201 print
'<td class="nowraponall tdoverflowmax125">'.$propalstatic->getNomUrl(1).
'</td>';
202 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
203 print
'<td class="nowrap right tdamount amount">'.price((
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc)).
'</td>';
207 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
211 print
'<tr class="oddeven">';
212 print
'<td class="nowrap" colspan="5">';
213 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
233if (isModEnabled(
'supplier_proposal') && $user->hasRight(
"supplier_proposal",
"lire")) {
234 $sql =
"SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
235 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
236 $sql .=
", s.code_client, s.code_compta, s.client";
237 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
238 $sql .=
", s.logo, s.email, s.entity";
239 $sql .=
", s.canvas";
240 $sql .=
" FROM ".MAIN_DB_PREFIX.
"supplier_proposal as p,";
241 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
242 if (!$user->hasRight(
'societe',
'client',
'voir')) {
243 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
245 $sql .=
" WHERE p.entity IN (".getEntity($supplierproposalstatic->element).
")";
246 $sql .=
" AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT;
247 $sql .=
" AND p.fk_soc = s.rowid";
248 if (!$user->hasRight(
'societe',
'client',
'voir')) {
249 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
252 $sql .=
" AND s.rowid = ".((int) $socid);
255 $resql = $db->query($sql);
258 $num = $db->num_rows($resql);
259 $nbofloop = min($num, $maxofloop);
266 while ($i < $nbofloop) {
267 $obj = $db->fetch_object($resql);
272 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
276 $supplierproposalstatic->id = $obj->rowid;
277 $supplierproposalstatic->ref = $obj->ref;
278 $supplierproposalstatic->total_ht = $obj->total_ht;
279 $supplierproposalstatic->total_tva = $obj->total_tva;
280 $supplierproposalstatic->total_ttc = $obj->total_ttc;
281 $supplierproposalstatic->statut = $obj->status;
283 $companystatic->id = $obj->socid;
284 $companystatic->name = $obj->name;
285 $companystatic->name_alias = $obj->name_alias;
286 $companystatic->code_client = $obj->code_client;
287 $companystatic->code_compta = $obj->code_compta;
288 $companystatic->client = $obj->client;
289 $companystatic->code_fournisseur = $obj->code_fournisseur;
290 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
291 $companystatic->fournisseur = $obj->fournisseur;
292 $companystatic->logo = $obj->logo;
293 $companystatic->email = $obj->email;
294 $companystatic->entity = $obj->entity;
295 $companystatic->canvas = $obj->canvas;
297 print
'<tr class="oddeven">';
298 print
'<td class="nowraponall tdoverflowmax125">'.$supplierproposalstatic->getNomUrl(1).
'</td>';
299 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
300 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
304 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
308 print
'<tr class="oddeven">';
309 print
'<td class="nowrap" colspan="5">';
310 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
330if (isModEnabled(
'order') && $user->hasRight(
'commande',
'lire')) {
331 $sql =
"SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status";
332 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
333 $sql .=
", s.code_client, s.code_compta, s.client";
334 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
335 $sql .=
", s.logo, s.email, s.entity";
336 $sql .=
", s.canvas";
337 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
338 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
339 if (!$user->hasRight(
'societe',
'client',
'voir')) {
340 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
342 $sql .=
" WHERE c.entity IN (".getEntity($orderstatic->element).
")";
343 $sql .=
" AND c.fk_statut = ".Commande::STATUS_DRAFT;
344 $sql .=
" AND c.fk_soc = s.rowid";
345 if (!$user->hasRight(
'societe',
'client',
'voir')) {
346 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
349 $sql .=
" AND c.fk_soc = ".((int) $socid);
352 $resql = $db->query($sql);
355 $num = $db->num_rows($resql);
356 $nbofloop = min($num, $maxofloop);
363 while ($i < $nbofloop) {
364 $obj = $db->fetch_object($resql);
369 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
373 $orderstatic->id = $obj->rowid;
374 $orderstatic->ref = $obj->ref;
375 $orderstatic->ref_client = $obj->ref_client;
376 $orderstatic->total_ht = $obj->total_ht;
377 $orderstatic->total_tva = $obj->total_tva;
378 $orderstatic->total_ttc = $obj->total_ttc;
379 $orderstatic->statut = $obj->status;
381 $companystatic->id = $obj->socid;
382 $companystatic->name = $obj->name;
383 $companystatic->name_alias = $obj->name_alias;
384 $companystatic->code_client = $obj->code_client;
385 $companystatic->code_compta = $obj->code_compta;
386 $companystatic->client = $obj->client;
387 $companystatic->code_fournisseur = $obj->code_fournisseur;
388 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
389 $companystatic->fournisseur = $obj->fournisseur;
390 $companystatic->logo = $obj->logo;
391 $companystatic->email = $obj->email;
392 $companystatic->entity = $obj->entity;
393 $companystatic->canvas = $obj->canvas;
395 print
'<tr class="oddeven">';
396 print
'<td class="nowraponall tdoverflowmax125">'.$orderstatic->getNomUrl(1).
'</td>';
397 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
398 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
402 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
406 print
'<tr class="oddeven">';
407 print
'<td class="nowrap" colspan="5">';
408 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
428if ((isModEnabled(
"fournisseur") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"commande",
"lire")) || (isModEnabled(
"supplier_order") && $user->hasRight(
"supplier_order",
"lire"))) {
431 $sql =
"SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
432 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
433 $sql .=
", s.code_client, s.code_compta, s.client";
434 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
435 $sql .=
", s.logo, s.email, s.entity";
436 $sql .=
", s.canvas";
437 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as cf,";
438 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
439 if (!$user->hasRight(
'societe',
'client',
'voir')) {
440 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
442 $sql .=
" WHERE cf.entity IN (".getEntity($supplierorderstatic->element).
")";
443 $sql .=
" AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT;
444 $sql .=
" AND cf.fk_soc = s.rowid";
445 if (!$user->hasRight(
'societe',
'client',
'voir')) {
446 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
449 $sql .=
" AND cf.fk_soc = ".((int) $socid);
452 $resql = $db->query($sql);
455 $num = $db->num_rows($resql);
456 $nbofloop = min($num, $maxofloop);
463 while ($i < $nbofloop) {
464 $obj = $db->fetch_object($resql);
469 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
473 $supplierorderstatic->id = $obj->rowid;
474 $supplierorderstatic->ref = $obj->ref;
475 $supplierorderstatic->ref_supplier = $obj->ref_supplier;
476 $supplierorderstatic->total_ht = $obj->total_ht;
477 $supplierorderstatic->total_tva = $obj->total_tva;
478 $supplierorderstatic->total_ttc = $obj->total_ttc;
479 $supplierorderstatic->statut = $obj->status;
481 $companystatic->id = $obj->socid;
482 $companystatic->name = $obj->name;
483 $companystatic->name_alias = $obj->name_alias;
484 $companystatic->code_client = $obj->code_client;
485 $companystatic->code_compta = $obj->code_compta;
486 $companystatic->code_compta_client = $obj->code_compta;
487 $companystatic->client = $obj->client;
488 $companystatic->code_fournisseur = $obj->code_fournisseur;
489 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
490 $companystatic->fournisseur = $obj->fournisseur;
491 $companystatic->logo = $obj->logo;
492 $companystatic->email = $obj->email;
493 $companystatic->entity = $obj->entity;
494 $companystatic->canvas = $obj->canvas;
496 print
'<tr class="oddeven">';
497 print
'<td class="nowraponall tdoverflowmax125">'.$supplierorderstatic->getNomUrl(1).
'</td>';
498 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
499 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
503 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
507 print
'<tr class="oddeven">';
508 print
'<td class="nowrap" colspan="5">';
509 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
528if (isModEnabled(
'intervention')) {
529 $sql =
"SELECT f.rowid, f.ref, s.nom as name, f.fk_statut, f.duree as duration";
530 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
531 $sql .=
", s.code_client, s.code_compta, s.client";
532 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
533 $sql .=
", s.logo, s.email, s.entity";
534 $sql .=
", s.canvas";
535 $sql .=
" FROM ".MAIN_DB_PREFIX.
"fichinter as f";
536 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
537 if (!$user->hasRight(
'societe',
'client',
'voir')) {
538 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
540 $sql .=
" WHERE f.entity IN (".getEntity(
'intervention').
")";
541 $sql .=
" AND f.fk_soc = s.rowid";
542 $sql .=
" AND f.fk_statut = 0";
544 $sql .=
" AND f.fk_soc = ".((int) $socid);
546 if (!$user->hasRight(
'societe',
'client',
'voir')) {
547 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
551 $resql = $db->query($sql);
553 $num = $db->num_rows($resql);
554 $nbofloop = min($num, $maxofloop);
562 while ($i < $nbofloop) {
563 $obj = $db->fetch_object($resql);
565 $fichinterstatic->id=$obj->rowid;
566 $fichinterstatic->ref=$obj->ref;
567 $fichinterstatic->statut=$obj->fk_statut;
569 $companystatic->id = $obj->socid;
570 $companystatic->name = $obj->name;
571 $companystatic->name_alias = $obj->name_alias;
572 $companystatic->code_client = $obj->code_client;
573 $companystatic->code_compta = $obj->code_compta;
574 $companystatic->client = $obj->client;
575 $companystatic->code_fournisseur = $obj->code_fournisseur;
576 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
577 $companystatic->fournisseur = $obj->fournisseur;
578 $companystatic->logo = $obj->logo;
579 $companystatic->email = $obj->email;
580 $companystatic->entity = $obj->entity;
581 $companystatic->canvas = $obj->canvas;
583 print
'<tr class="oddeven">';
584 print
'<td class="tdoverflowmax125">';
585 print $fichinterstatic->getNomUrl(1);
587 print
'<td class="tdoverflowmax100">';
588 print $companystatic->getNomUrl(1,
'customer');
590 print
'<td class="nowraponall tdoverflowmax100 right">';
606print
'</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
612if (isModEnabled(
"societe") && $user->hasRight(
'societe',
'lire')) {
613 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
614 $sql .=
", s.code_client, s.code_compta, s.client";
615 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
616 $sql .=
", s.logo, s.email, s.entity";
617 $sql .=
", s.canvas";
618 $sql .=
", s.datec, s.tms";
619 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
620 if (!$user->hasRight(
'societe',
'client',
'voir')) {
621 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
623 $sql .=
" WHERE s.entity IN (".getEntity($companystatic->element).
")";
625 if (!$user->hasRight(
'societe',
'client',
'voir')) {
626 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
629 $parameters = array(
'socid' => $socid);
630 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $companystatic);
631 if (empty($reshook)) {
633 $sql .=
" AND s.rowid = ".((int) $socid);
636 $sql .= $hookmanager->resPrint;
637 $sql .=
" ORDER BY s.tms DESC";
638 $sql .= $db->plimit($max, 0);
640 $resql = $db->query($sql);
643 $header =
"BoxTitleLastCustomersOrProspects";
645 $header =
"BoxTitleLastModifiedProspects";
647 $header =
"BoxTitleLastModifiedCustomers";
650 $num = $db->num_rows($resql);
651 startSimpleTable($langs->trans($header, min($max, $num)),
"societe/list.php",
"type=p,c&sortfield=s.tms&sortorder=DESC", 1, -1,
'company');
656 while ($i < $num && $i < $max) {
657 $objp = $db->fetch_object($resql);
659 $companystatic->id = $objp->socid;
660 $companystatic->name = $objp->name;
661 $companystatic->name_alias = $objp->name_alias;
662 $companystatic->code_client = $objp->code_client;
663 $companystatic->code_compta = $objp->code_compta;
664 $companystatic->client = $objp->client;
665 $companystatic->code_fournisseur = $objp->code_fournisseur;
666 $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
667 $companystatic->fournisseur = $objp->fournisseur;
668 $companystatic->logo = $objp->logo;
669 $companystatic->email = $objp->email;
670 $companystatic->entity = $objp->entity;
671 $companystatic->canvas = $objp->canvas;
673 print
'<tr class="oddeven">';
674 print
'<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
675 print
'<td class="nowrap">';
678 $obj = $companystatic;
680 if (($obj->client == 2 || $obj->client == 3) && !
getDolGlobalString(
'SOCIETE_DISABLE_PROSPECTS')) {
681 $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>';
683 if (($obj->client == 1 || $obj->client == 3) && !
getDolGlobalString(
'SOCIETE_DISABLE_CUSTOMERS')) {
684 $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>';
695 $datem = $db->jdate($objp->tms);
696 print
'<td class="right nowrap tddate" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
719if (isModEnabled(
'propal')) {
720 $sql =
"SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.tms as datem,";
721 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
722 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as c,";
723 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
724 $sql .=
" WHERE c.entity IN (".getEntity($propalstatic->element).
")";
725 $sql .=
" AND c.fk_soc = s.rowid";
728 if (!$user->hasRight(
'societe',
'client',
'voir')) {
729 $search_sale = $user->id;
732 if ($search_sale && $search_sale !=
'-1') {
733 if ($search_sale == -2) {
734 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc)";
735 } elseif ($search_sale > 0) {
736 $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).
")";
741 $sql .=
" AND c.fk_soc = ".((int) $socid);
743 $sql .=
" ORDER BY c.tms DESC";
745 $sql .= $db->plimit($max, 0);
747 $resql = $db->query($sql);
749 $num = $db->num_rows($resql);
751 startSimpleTable($langs->trans(
"LastModifiedProposals", $max),
"comm/propal/list.php",
"sortfield=p.tms&sortorder=DESC", 2, -1,
'propal');
756 $obj = $db->fetch_object($resql);
758 $propalstatic->id = $obj->rowid;
759 $propalstatic->ref = $obj->ref;
760 $propalstatic->status = $obj->status;
762 $companystatic->id = $obj->socid;
763 $companystatic->name = $obj->socname;
764 $companystatic->client = $obj->client;
765 $companystatic->canvas = $obj->canvas;
766 $companystatic->email = $obj->email;
767 $companystatic->code_compta = $obj->code_compta;
768 $companystatic->code_compta_client = $obj->code_compta;
772 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
774 print
'<tr class="oddeven">';
776 print
'<td class="nowrap">';
777 print
'<table class="nobordernopadding">';
778 print
'<tr class="nocellnopadd">';
779 print
'<td width="96" class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).
'</td>';
780 print
'<td width="16" class="nobordernopadding nowrap"></td>';
781 print
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).
'</td>';
786 print
'<td class="tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
788 $datem = $db->jdate($obj->datem);
789 print
'<td class="center" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
793 print
'<td class="right">'.$propalstatic->LibStatut($obj->status, 3).
'</td>';
813if (isModEnabled(
'order')) {
814 $commandestatic =
new Commande($db);
816 $sql =
"SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,";
817 $sql .=
" s.nom as name, s.rowid as socid";
818 $sql .=
", s.client";
819 $sql .=
", s.code_client";
820 $sql .=
", s.canvas";
821 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
822 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
823 if (!$user->hasRight(
'societe',
'client',
'voir')) {
824 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
826 $sql .=
" WHERE c.fk_soc = s.rowid";
827 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
830 $sql .=
" AND c.fk_soc = ".((int) $socid);
832 if (!$user->hasRight(
'societe',
'client',
'voir')) {
833 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
835 $sql .=
" ORDER BY c.tms DESC";
836 $sql .= $db->plimit($max, 0);
838 $resql = $db->query($sql);
840 $num = $db->num_rows($resql);
842 startSimpleTable($langs->trans(
"LastModifiedOrders", $max),
"commande/list.php",
"sortfield=c.tms&sortorder=DESC", 2, -1,
'order');
847 $obj = $db->fetch_object($resql);
849 print
'<tr class="oddeven">';
850 print
'<td width="20%" class="nowrap">';
852 $commandestatic->id = $obj->rowid;
853 $commandestatic->ref = $obj->ref;
855 $companystatic->id = $obj->socid;
856 $companystatic->name = $obj->name;
857 $companystatic->client = $obj->client;
858 $companystatic->code_client = $obj->code_client;
859 $companystatic->canvas = $obj->canvas;
861 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
862 print
'<td width="96" class="nobordernopadding nowrap">';
863 print $commandestatic->getNomUrl(1);
866 print
'<td width="16" class="nobordernopadding nowrap">';
870 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
873 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
874 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
875 print
'</td></tr></table>';
879 print
'<td class="nowrap">';
880 print $companystatic->getNomUrl(1,
'company', 16);
883 $datem = $db->jdate($obj->datem);
884 print
'<td class="center" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
888 print
'<td class="right">'.$commandestatic->LibStatut($obj->status, $obj->facture, 3).
'</td>';
903if ((isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) && $user->hasRight(
'societe',
'lire')) {
904 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
905 $sql .=
", s.code_client, s.code_compta, s.client";
906 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
907 $sql .=
", s.logo, s.email, s.entity";
908 $sql .=
", s.canvas";
909 $sql .=
", s.datec as dc, s.tms as dm";
910 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
911 if (!$user->hasRight(
'societe',
'client',
'voir')) {
912 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
914 $sql .=
" WHERE s.entity IN (".getEntity($companystatic->element).
")";
915 $sql .=
" AND s.fournisseur = ".Societe::SUPPLIER;
916 if (!$user->hasRight(
'societe',
'client',
'voir')) {
917 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
920 $parameters = array(
'socid' => $socid);
921 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $companystatic);
922 if (empty($reshook)) {
924 $sql .=
" AND s.rowid = ".((int) $socid);
927 $sql .= $hookmanager->resPrint;
928 $sql .=
" ORDER BY s.datec DESC";
929 $sql .= $db->plimit($max, 0);
931 $resql = $db->query($sql);
933 $num = $db->num_rows($resql);
934 startSimpleTable($langs->trans(
"BoxTitleLastModifiedSuppliers", min($max, $num)),
"societe/list.php",
"type=f", 1, -1,
'company');
938 while ($i < $num && $i < $max) {
939 $objp = $db->fetch_object($resql);
941 $companystatic->id = $objp->socid;
942 $companystatic->name = $objp->name;
943 $companystatic->name_alias = $objp->name_alias;
944 $companystatic->code_client = $objp->code_client;
945 $companystatic->code_compta = $objp->code_compta;
946 $companystatic->client = $objp->client;
947 $companystatic->code_fournisseur = $objp->code_fournisseur;
948 $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
949 $companystatic->fournisseur = $objp->fournisseur;
950 $companystatic->logo = $objp->logo;
951 $companystatic->email = $objp->email;
952 $companystatic->entity = $objp->entity;
953 $companystatic->canvas = $objp->canvas;
955 print
'<tr class="oddeven">';
956 print
'<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
959 $obj = $companystatic;
968 if ((isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) && $obj->fournisseur) {
969 $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>';
975 $datem = $db->jdate($objp->dm);
976 print
'<td class="right tddate" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
1014if (isModEnabled(
'contract') && $user->hasRight(
"contrat",
"lire") && 0) {
1015 $staticcontrat =
new Contrat($db);
1017 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
1018 $sql .=
", s.code_client, s.code_compta, s.client";
1019 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1020 $sql .=
", s.logo, s.email, s.entity";
1021 $sql .=
", s.canvas";
1022 $sql .=
", c.statut, c.rowid as contratid, p.ref, c.fin_validite as datefin, c.date_cloture as dateclo";
1023 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
1024 $sql .=
", ".MAIN_DB_PREFIX.
"contrat as c";
1025 $sql .=
", ".MAIN_DB_PREFIX.
"product as p";
1026 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1027 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1029 $sql .=
" WHERE c.entity IN (".getEntity($staticcontrat->element).
")";
1030 $sql .=
" AND c.fk_soc = s.rowid";
1031 $sql .=
" AND c.fk_product = p.rowid";
1032 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1033 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1036 $sql .=
" AND s.rowid = ".((int) $socid);
1038 $sql .=
" ORDER BY c.tms DESC";
1039 $sql .= $db->plimit($max + 1, 0);
1041 $resql = $db->query($sql);
1043 $num = $db->num_rows($resql);
1050 $obj = $db->fetch_object($resql);
1052 $companystatic->id = $obj->socid;
1053 $companystatic->name = $obj->name;
1054 $companystatic->name_alias = $obj->name_alias;
1055 $companystatic->code_client = $obj->code_client;
1056 $companystatic->code_compta = $obj->code_compta;
1057 $companystatic->client = $obj->client;
1058 $companystatic->code_fournisseur = $obj->code_fournisseur;
1059 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1060 $companystatic->fournisseur = $obj->fournisseur;
1061 $companystatic->logo = $obj->logo;
1062 $companystatic->email = $obj->email;
1063 $companystatic->entity = $obj->entity;
1064 $companystatic->canvas = $obj->canvas;
1066 $staticcontrat->id = $obj->contratid;
1067 $staticcontrat->ref = $obj->ref;
1069 print
'<tr class="oddeven">';
1070 print
'<td class="nowraponall">'.$staticcontrat->getNomUrl(1).
'</td>';
1071 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1072 print
'<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).
'</td>';
1092if (isModEnabled(
"propal") && $user->hasRight(
"propal",
"lire")) {
1093 $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";
1094 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
1095 $sql .=
", s.code_client, s.code_compta, s.client";
1096 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1097 $sql .=
", s.logo, s.email, s.entity";
1098 $sql .=
", s.canvas";
1099 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as p";
1100 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
1101 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1102 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1104 $sql .=
" WHERE p.entity IN (".getEntity($propalstatic->element).
")";
1105 $sql .=
" AND p.fk_soc = s.rowid";
1106 $sql .=
" AND p.fk_statut = ".Propal::STATUS_VALIDATED;
1107 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1108 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1111 $sql .=
" AND s.rowid = ".((int) $socid);
1113 $sql .=
" ORDER BY p.rowid DESC";
1115 $resql = $db->query($sql);
1117 $total = $total_ttc = 0;
1118 $num = $db->num_rows($resql);
1119 $nbofloop = min($num, (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
1120 startSimpleTable(
"ProposalsOpened",
"comm/propal/list.php",
"search_status=1", 4, $num);
1126 while ($i < $nbofloop) {
1127 $obj = $db->fetch_object($resql);
1132 $total += $obj->total_ht;
1133 $total_ttc += $obj->total_ttc;
1137 $propalstatic->id = $obj->propalid;
1138 $propalstatic->ref = $obj->ref;
1139 $propalstatic->ref_client = $obj->ref_client;
1140 $propalstatic->total_ht = $obj->total_ht;
1141 $propalstatic->total_tva = $obj->total_tva;
1142 $propalstatic->total_ttc = $obj->total_ttc;
1144 $companystatic->id = $obj->socid;
1145 $companystatic->name = $obj->name;
1146 $companystatic->name_alias = $obj->name_alias;
1147 $companystatic->code_client = $obj->code_client;
1148 $companystatic->code_compta = $obj->code_compta;
1149 $companystatic->client = $obj->client;
1150 $companystatic->code_fournisseur = $obj->code_fournisseur;
1151 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1152 $companystatic->fournisseur = $obj->fournisseur;
1153 $companystatic->logo = $obj->logo;
1154 $companystatic->email = $obj->email;
1155 $companystatic->entity = $obj->entity;
1156 $companystatic->canvas = $obj->canvas;
1161 $warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ?
img_warning($langs->trans(
"Late")) :
'';
1163 print
'<tr class="oddeven">';
1165 print
'<td class="nowrap" width="140">';
1166 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1167 print
'<td class="nobordernopadding nowraponall">'.$propalstatic->getNomUrl(1).
'</td>';
1168 print
'<td width="18" class="nobordernopadding nowrap">'.$warning.
'</td>';
1169 print
'<td width="16" class="nobordernopadding center">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).
'</td>';
1174 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1175 $datem = $db->jdate($obj->dp);
1176 print
'<td class="center tddate" title="'.dol_escape_htmltag($langs->trans(
"Date").
': '.
dol_print_date($datem,
'day',
'tzserver')).
'">';
1179 print
'<td class="right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
1180 print
'<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).
'</td>';
1185 $total += $obj->total_ht;
1186 $total_ttc += $obj->total_ttc;
1190 print
'<tr class="oddeven">';
1191 print
'<td class="nowrap" colspan="5">';
1192 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1211if (isModEnabled(
'order') && $user->hasRight(
'commande',
'lire')) {
1212 $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";
1213 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
1214 $sql .=
", s.code_client, s.code_compta, s.client";
1215 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1216 $sql .=
", s.logo, s.email, s.entity";
1217 $sql .=
", s.canvas";
1218 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c";
1219 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
1220 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1221 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1223 $sql .=
" WHERE c.entity IN (".getEntity($orderstatic->element).
")";
1224 $sql .=
" AND c.fk_soc = s.rowid";
1226 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1227 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1230 $sql .=
" AND s.rowid = ".((int) $socid);
1232 $sql .=
" ORDER BY c.rowid DESC";
1234 $resql = $db->query($sql);
1236 $total = $total_ttc = 0;
1237 $num = $db->num_rows($resql);
1238 $nbofloop = min($num, (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
1245 while ($i < $nbofloop) {
1246 $obj = $db->fetch_object($resql);
1251 $total += $obj->total_ht;
1252 $total_ttc += $obj->total_ttc;
1256 $orderstatic->id = $obj->commandeid;
1257 $orderstatic->ref = $obj->ref;
1258 $orderstatic->ref_client = $obj->ref_client;
1259 $orderstatic->statut = $obj->fk_statut;
1260 $orderstatic->total_ht = $obj->total_ht;
1261 $orderstatic->total_tva = $obj->total_tva;
1262 $orderstatic->total_ttc = $obj->total_ttc;
1264 $companystatic->id = $obj->socid;
1265 $companystatic->name = $obj->name;
1266 $companystatic->name_alias = $obj->name_alias;
1267 $companystatic->code_client = $obj->code_client;
1268 $companystatic->code_compta = $obj->code_compta;
1269 $companystatic->client = $obj->client;
1270 $companystatic->code_fournisseur = $obj->code_fournisseur;
1271 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1272 $companystatic->fournisseur = $obj->fournisseur;
1273 $companystatic->logo = $obj->logo;
1274 $companystatic->email = $obj->email;
1275 $companystatic->entity = $obj->entity;
1276 $companystatic->canvas = $obj->canvas;
1283 print
'<tr class="oddeven">';
1285 print
'<td class="nowrap" width="140">';
1286 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1287 print
'<td class="nobordernopadding nowraponall">'.$orderstatic->getNomUrl(1).
'</td>';
1288 print
'<td width="18" class="nobordernopadding nowrap"></td>';
1289 print
'<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).
'</td>';
1294 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1295 $datem = $db->jdate($obj->dv);
1296 print
'<td class="center tddate" title="'.dol_escape_htmltag($langs->trans(
"DateValue").
': '.
dol_print_date($datem,
'day',
'tzserver')).
'">';
1300 print
'<td class="right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
1301 print
'<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).
'</td>';
1306 $total += $obj->total_ht;
1307 $total_ttc += $obj->total_ttc;
1311 print
'<tr class="oddeven">';
1312 print
'<td class="nowrap" colspan="5">';
1313 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1332$parameters = array(
'user' => $user);
1333$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()
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.
Class to manage contracts.
Class to manage interventions.
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 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.