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 as code_compta_client, 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_client;
191 $companystatic->code_compta_client = $obj->code_compta_client;
192 $companystatic->client = $obj->client;
193 $companystatic->code_fournisseur = $obj->code_fournisseur;
194 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
195 $companystatic->fournisseur = $obj->fournisseur;
196 $companystatic->logo = $obj->logo;
197 $companystatic->email = $obj->email;
198 $companystatic->entity = $obj->entity;
199 $companystatic->canvas = $obj->canvas;
201 print
'<tr class="oddeven">';
202 print
'<td class="nowraponall tdoverflowmax125">'.$propalstatic->getNomUrl(1).
'</td>';
203 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
204 print
'<td class="nowrap right tdamount amount">'.price((
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc)).
'</td>';
208 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
212 print
'<tr class="oddeven">';
213 print
'<td class="nowrap" colspan="5">';
214 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
234if (isModEnabled(
'supplier_proposal') && $user->hasRight(
"supplier_proposal",
"lire")) {
235 $sql =
"SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
236 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
237 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
238 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
239 $sql .=
", s.logo, s.email, s.entity";
240 $sql .=
", s.canvas";
241 $sql .=
" FROM ".MAIN_DB_PREFIX.
"supplier_proposal as p,";
242 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
243 if (!$user->hasRight(
'societe',
'client',
'voir')) {
244 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
246 $sql .=
" WHERE p.entity IN (".getEntity($supplierproposalstatic->element).
")";
247 $sql .=
" AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT;
248 $sql .=
" AND p.fk_soc = s.rowid";
249 if (!$user->hasRight(
'societe',
'client',
'voir')) {
250 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
253 $sql .=
" AND s.rowid = ".((int) $socid);
256 $resql = $db->query($sql);
259 $num = $db->num_rows($resql);
260 $nbofloop = min($num, $maxofloop);
267 while ($i < $nbofloop) {
268 $obj = $db->fetch_object($resql);
273 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
277 $supplierproposalstatic->id = $obj->rowid;
278 $supplierproposalstatic->ref = $obj->ref;
279 $supplierproposalstatic->total_ht = $obj->total_ht;
280 $supplierproposalstatic->total_tva = $obj->total_tva;
281 $supplierproposalstatic->total_ttc = $obj->total_ttc;
282 $supplierproposalstatic->statut = $obj->status;
284 $companystatic->id = $obj->socid;
285 $companystatic->name = $obj->name;
286 $companystatic->name_alias = $obj->name_alias;
287 $companystatic->code_client = $obj->code_client;
288 $companystatic->code_compta = $obj->code_compta;
289 $companystatic->code_compta_client = $obj->code_compta_client;
290 $companystatic->client = $obj->client;
291 $companystatic->code_fournisseur = $obj->code_fournisseur;
292 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
293 $companystatic->fournisseur = $obj->fournisseur;
294 $companystatic->logo = $obj->logo;
295 $companystatic->email = $obj->email;
296 $companystatic->entity = $obj->entity;
297 $companystatic->canvas = $obj->canvas;
299 print
'<tr class="oddeven">';
300 print
'<td class="nowraponall tdoverflowmax125">'.$supplierproposalstatic->getNomUrl(1).
'</td>';
301 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
302 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
306 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
310 print
'<tr class="oddeven">';
311 print
'<td class="nowrap" colspan="5">';
312 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
332if (isModEnabled(
'order') && $user->hasRight(
'commande',
'lire')) {
333 $sql =
"SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status";
334 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
335 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
336 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
337 $sql .=
", s.logo, s.email, s.entity";
338 $sql .=
", s.canvas";
339 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
340 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
341 if (!$user->hasRight(
'societe',
'client',
'voir')) {
342 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
344 $sql .=
" WHERE c.entity IN (".getEntity($orderstatic->element).
")";
345 $sql .=
" AND c.fk_statut = ".Commande::STATUS_DRAFT;
346 $sql .=
" AND c.fk_soc = s.rowid";
347 if (!$user->hasRight(
'societe',
'client',
'voir')) {
348 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
351 $sql .=
" AND c.fk_soc = ".((int) $socid);
354 $resql = $db->query($sql);
357 $num = $db->num_rows($resql);
358 $nbofloop = min($num, $maxofloop);
365 while ($i < $nbofloop) {
366 $obj = $db->fetch_object($resql);
371 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
375 $orderstatic->id = $obj->rowid;
376 $orderstatic->ref = $obj->ref;
377 $orderstatic->ref_client = $obj->ref_client;
378 $orderstatic->total_ht = $obj->total_ht;
379 $orderstatic->total_tva = $obj->total_tva;
380 $orderstatic->total_ttc = $obj->total_ttc;
381 $orderstatic->statut = $obj->status;
383 $companystatic->id = $obj->socid;
384 $companystatic->name = $obj->name;
385 $companystatic->name_alias = $obj->name_alias;
386 $companystatic->code_client = $obj->code_client;
387 $companystatic->code_compta = $obj->code_compta_client;
388 $companystatic->code_compta_client = $obj->code_compta_client;
389 $companystatic->client = $obj->client;
390 $companystatic->code_fournisseur = $obj->code_fournisseur;
391 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
392 $companystatic->fournisseur = $obj->fournisseur;
393 $companystatic->logo = $obj->logo;
394 $companystatic->email = $obj->email;
395 $companystatic->entity = $obj->entity;
396 $companystatic->canvas = $obj->canvas;
398 print
'<tr class="oddeven">';
399 print
'<td class="nowraponall tdoverflowmax125">'.$orderstatic->getNomUrl(1).
'</td>';
400 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
401 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
405 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
409 print
'<tr class="oddeven">';
410 print
'<td class="nowrap" colspan="5">';
411 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
431if ((isModEnabled(
"fournisseur") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"commande",
"lire")) || (isModEnabled(
"supplier_order") && $user->hasRight(
"supplier_order",
"lire"))) {
434 $sql =
"SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
435 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
436 $sql .=
", s.code_client, s.code_compta, s.client";
437 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
438 $sql .=
", s.logo, s.email, s.entity";
439 $sql .=
", s.canvas";
440 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as cf,";
441 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
442 if (!$user->hasRight(
'societe',
'client',
'voir')) {
443 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
445 $sql .=
" WHERE cf.entity IN (".getEntity($supplierorderstatic->element).
")";
446 $sql .=
" AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT;
447 $sql .=
" AND cf.fk_soc = s.rowid";
448 if (!$user->hasRight(
'societe',
'client',
'voir')) {
449 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
452 $sql .=
" AND cf.fk_soc = ".((int) $socid);
455 $resql = $db->query($sql);
458 $num = $db->num_rows($resql);
459 $nbofloop = min($num, $maxofloop);
466 while ($i < $nbofloop) {
467 $obj = $db->fetch_object($resql);
472 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
476 $supplierorderstatic->id = $obj->rowid;
477 $supplierorderstatic->ref = $obj->ref;
478 $supplierorderstatic->ref_supplier = $obj->ref_supplier;
479 $supplierorderstatic->total_ht = $obj->total_ht;
480 $supplierorderstatic->total_tva = $obj->total_tva;
481 $supplierorderstatic->total_ttc = $obj->total_ttc;
482 $supplierorderstatic->statut = $obj->status;
484 $companystatic->id = $obj->socid;
485 $companystatic->name = $obj->name;
486 $companystatic->name_alias = $obj->name_alias;
487 $companystatic->code_client = $obj->code_client;
488 $companystatic->code_compta = $obj->code_compta;
489 $companystatic->code_compta_client = $obj->code_compta;
490 $companystatic->client = $obj->client;
491 $companystatic->code_fournisseur = $obj->code_fournisseur;
492 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
493 $companystatic->fournisseur = $obj->fournisseur;
494 $companystatic->logo = $obj->logo;
495 $companystatic->email = $obj->email;
496 $companystatic->entity = $obj->entity;
497 $companystatic->canvas = $obj->canvas;
499 print
'<tr class="oddeven">';
500 print
'<td class="nowraponall tdoverflowmax125">'.$supplierorderstatic->getNomUrl(1).
'</td>';
501 print
'<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
502 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
506 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
510 print
'<tr class="oddeven">';
511 print
'<td class="nowrap" colspan="5">';
512 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
531if (isModEnabled(
'intervention')) {
532 $sql =
"SELECT f.rowid, f.ref, s.nom as name, f.fk_statut, f.duree as duration";
533 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
534 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
535 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
536 $sql .=
", s.logo, s.email, s.entity";
537 $sql .=
", s.canvas";
538 $sql .=
" FROM ".MAIN_DB_PREFIX.
"fichinter as f";
539 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
540 if (!$user->hasRight(
'societe',
'client',
'voir')) {
541 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
543 $sql .=
" WHERE f.entity IN (".getEntity(
'intervention').
")";
544 $sql .=
" AND f.fk_soc = s.rowid";
545 $sql .=
" AND f.fk_statut = 0";
547 $sql .=
" AND f.fk_soc = ".((int) $socid);
549 if (!$user->hasRight(
'societe',
'client',
'voir')) {
550 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
554 $resql = $db->query($sql);
556 $num = $db->num_rows($resql);
557 $nbofloop = min($num, $maxofloop);
565 while ($i < $nbofloop) {
566 $obj = $db->fetch_object($resql);
568 $fichinterstatic->id=$obj->rowid;
569 $fichinterstatic->ref=$obj->ref;
570 $fichinterstatic->statut=$obj->fk_statut;
572 $companystatic->id = $obj->socid;
573 $companystatic->name = $obj->name;
574 $companystatic->name_alias = $obj->name_alias;
575 $companystatic->code_client = $obj->code_client;
576 $companystatic->code_compta = $obj->code_compta_client;
577 $companystatic->code_compta_client = $obj->code_compta_client;
578 $companystatic->client = $obj->client;
579 $companystatic->code_fournisseur = $obj->code_fournisseur;
580 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
581 $companystatic->fournisseur = $obj->fournisseur;
582 $companystatic->logo = $obj->logo;
583 $companystatic->email = $obj->email;
584 $companystatic->entity = $obj->entity;
585 $companystatic->canvas = $obj->canvas;
587 print
'<tr class="oddeven">';
588 print
'<td class="tdoverflowmax125">';
589 print $fichinterstatic->getNomUrl(1);
591 print
'<td class="tdoverflowmax100">';
592 print $companystatic->getNomUrl(1,
'customer');
594 print
'<td class="nowraponall tdoverflowmax100 right">';
610print
'</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
616if (isModEnabled(
"societe") && $user->hasRight(
'societe',
'lire')) {
617 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
618 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
619 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
620 $sql .=
", s.logo, s.email, s.entity";
621 $sql .=
", s.canvas";
622 $sql .=
", s.datec, s.tms";
623 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
624 if (!$user->hasRight(
'societe',
'client',
'voir')) {
625 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
627 $sql .=
" WHERE s.entity IN (".getEntity($companystatic->element).
")";
629 if (!$user->hasRight(
'societe',
'client',
'voir')) {
630 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
633 $parameters = array(
'socid' => $socid);
634 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $companystatic);
635 if (empty($reshook)) {
637 $sql .=
" AND s.rowid = ".((int) $socid);
640 $sql .= $hookmanager->resPrint;
641 $sql .=
" ORDER BY s.tms DESC";
642 $sql .= $db->plimit($max, 0);
644 $resql = $db->query($sql);
647 $header =
"BoxTitleLastCustomersOrProspects";
649 $header =
"BoxTitleLastModifiedProspects";
651 $header =
"BoxTitleLastModifiedCustomers";
654 $num = $db->num_rows($resql);
655 startSimpleTable($langs->trans($header, min($max, $num)),
"societe/list.php",
"type=p,c&sortfield=s.tms&sortorder=DESC", 1, -1,
'company');
660 while ($i < $num && $i < $max) {
661 $objp = $db->fetch_object($resql);
663 $companystatic->id = $objp->socid;
664 $companystatic->name = $objp->name;
665 $companystatic->name_alias = $objp->name_alias;
666 $companystatic->code_client = $objp->code_client;
667 $companystatic->code_compta = $objp->code_compta_client;
668 $companystatic->code_compta_client = $objp->code_compta_client;
669 $companystatic->client = $objp->client;
670 $companystatic->code_fournisseur = $objp->code_fournisseur;
671 $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
672 $companystatic->fournisseur = $objp->fournisseur;
673 $companystatic->logo = $objp->logo;
674 $companystatic->email = $objp->email;
675 $companystatic->entity = $objp->entity;
676 $companystatic->canvas = $objp->canvas;
678 print
'<tr class="oddeven">';
679 print
'<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
680 print
'<td class="nowrap">';
683 $obj = $companystatic;
685 if (($obj->client == 2 || $obj->client == 3) && !
getDolGlobalString(
'SOCIETE_DISABLE_PROSPECTS')) {
686 $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>';
688 if (($obj->client == 1 || $obj->client == 3) && !
getDolGlobalString(
'SOCIETE_DISABLE_CUSTOMERS')) {
689 $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>';
700 $datem = $db->jdate($objp->tms);
701 print
'<td class="right nowrap tddate" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
724if (isModEnabled(
'propal')) {
725 $sql =
"SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.tms as datem,";
726 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client";
727 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as c,";
728 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
729 $sql .=
" WHERE c.entity IN (".getEntity($propalstatic->element).
")";
730 $sql .=
" AND c.fk_soc = s.rowid";
733 if (!$user->hasRight(
'societe',
'client',
'voir')) {
734 $search_sale = $user->id;
737 if ($search_sale && $search_sale !=
'-1') {
738 if ($search_sale == -2) {
739 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc)";
740 } elseif ($search_sale > 0) {
741 $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).
")";
746 $sql .=
" AND c.fk_soc = ".((int) $socid);
748 $sql .=
" ORDER BY c.tms DESC";
750 $sql .= $db->plimit($max, 0);
752 $resql = $db->query($sql);
754 $num = $db->num_rows($resql);
756 startSimpleTable($langs->trans(
"LastModifiedProposals", $max),
"comm/propal/list.php",
"sortfield=p.tms&sortorder=DESC", 2, -1,
'propal');
761 $obj = $db->fetch_object($resql);
763 $propalstatic->id = $obj->rowid;
764 $propalstatic->ref = $obj->ref;
765 $propalstatic->status = $obj->status;
767 $companystatic->id = $obj->socid;
768 $companystatic->name = $obj->socname;
769 $companystatic->client = $obj->client;
770 $companystatic->canvas = $obj->canvas;
771 $companystatic->email = $obj->email;
772 $companystatic->code_compta = $obj->code_compta_client;
773 $companystatic->code_compta_client = $obj->code_compta_client;
777 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
779 print
'<tr class="oddeven">';
781 print
'<td class="nowrap">';
782 print
'<table class="nobordernopadding">';
783 print
'<tr class="nocellnopadd">';
784 print
'<td width="96" class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).
'</td>';
785 print
'<td width="16" class="nobordernopadding nowrap"></td>';
786 print
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).
'</td>';
791 print
'<td class="tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
793 $datem = $db->jdate($obj->datem);
794 print
'<td class="center" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
798 print
'<td class="right">'.$propalstatic->LibStatut($obj->status, 3).
'</td>';
818if (isModEnabled(
'order')) {
819 $commandestatic =
new Commande($db);
821 $sql =
"SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,";
822 $sql .=
" s.nom as name, s.rowid as socid";
823 $sql .=
", s.client";
824 $sql .=
", s.code_client";
825 $sql .=
", s.canvas";
826 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
827 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
828 if (!$user->hasRight(
'societe',
'client',
'voir')) {
829 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
831 $sql .=
" WHERE c.fk_soc = s.rowid";
832 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
835 $sql .=
" AND c.fk_soc = ".((int) $socid);
837 if (!$user->hasRight(
'societe',
'client',
'voir')) {
838 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
840 $sql .=
" ORDER BY c.tms DESC";
841 $sql .= $db->plimit($max, 0);
843 $resql = $db->query($sql);
845 $num = $db->num_rows($resql);
847 startSimpleTable($langs->trans(
"LastModifiedOrders", $max),
"commande/list.php",
"sortfield=c.tms&sortorder=DESC", 2, -1,
'order');
852 $obj = $db->fetch_object($resql);
854 print
'<tr class="oddeven">';
855 print
'<td width="20%" class="nowrap">';
857 $commandestatic->id = $obj->rowid;
858 $commandestatic->ref = $obj->ref;
860 $companystatic->id = $obj->socid;
861 $companystatic->name = $obj->name;
862 $companystatic->client = $obj->client;
863 $companystatic->code_client = $obj->code_client;
864 $companystatic->canvas = $obj->canvas;
866 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
867 print
'<td width="96" class="nobordernopadding nowrap">';
868 print $commandestatic->getNomUrl(1);
871 print
'<td width="16" class="nobordernopadding nowrap">';
875 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
878 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
879 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
880 print
'</td></tr></table>';
884 print
'<td class="nowrap">';
885 print $companystatic->getNomUrl(1,
'company', 16);
888 $datem = $db->jdate($obj->datem);
889 print
'<td class="center" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
893 print
'<td class="right">'.$commandestatic->LibStatut($obj->status, $obj->facture, 3).
'</td>';
908if ((isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) && $user->hasRight(
'societe',
'lire')) {
909 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
910 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
911 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
912 $sql .=
", s.logo, s.email, s.entity";
913 $sql .=
", s.canvas";
914 $sql .=
", s.datec as dc, s.tms as dm";
915 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
916 if (!$user->hasRight(
'societe',
'client',
'voir')) {
917 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
919 $sql .=
" WHERE s.entity IN (".getEntity($companystatic->element).
")";
920 $sql .=
" AND s.fournisseur = ".Societe::SUPPLIER;
921 if (!$user->hasRight(
'societe',
'client',
'voir')) {
922 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
925 $parameters = array(
'socid' => $socid);
926 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $companystatic);
927 if (empty($reshook)) {
929 $sql .=
" AND s.rowid = ".((int) $socid);
932 $sql .= $hookmanager->resPrint;
933 $sql .=
" ORDER BY s.datec DESC";
934 $sql .= $db->plimit($max, 0);
936 $resql = $db->query($sql);
938 $num = $db->num_rows($resql);
939 startSimpleTable($langs->trans(
"BoxTitleLastModifiedSuppliers", min($max, $num)),
"societe/list.php",
"type=f", 1, -1,
'company');
943 while ($i < $num && $i < $max) {
944 $objp = $db->fetch_object($resql);
946 $companystatic->id = $objp->socid;
947 $companystatic->name = $objp->name;
948 $companystatic->name_alias = $objp->name_alias;
949 $companystatic->code_client = $objp->code_client;
950 $companystatic->code_compta = $objp->code_compta_client;
951 $companystatic->code_compta_client = $objp->code_compta_client;
952 $companystatic->client = $objp->client;
953 $companystatic->code_fournisseur = $objp->code_fournisseur;
954 $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
955 $companystatic->fournisseur = $objp->fournisseur;
956 $companystatic->logo = $objp->logo;
957 $companystatic->email = $objp->email;
958 $companystatic->entity = $objp->entity;
959 $companystatic->canvas = $objp->canvas;
961 print
'<tr class="oddeven">';
962 print
'<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
965 $obj = $companystatic;
974 if ((isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) && $obj->fournisseur) {
975 $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>';
981 $datem = $db->jdate($objp->dm);
982 print
'<td class="right tddate" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
1020if (isModEnabled(
'contract') && $user->hasRight(
"contrat",
"lire") && 0) {
1021 $staticcontrat =
new Contrat($db);
1023 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
1024 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1025 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1026 $sql .=
", s.logo, s.email, s.entity";
1027 $sql .=
", s.canvas";
1028 $sql .=
", c.statut, c.rowid as contratid, p.ref, c.fin_validite as datefin, c.date_cloture as dateclo";
1029 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
1030 $sql .=
", ".MAIN_DB_PREFIX.
"contrat as c";
1031 $sql .=
", ".MAIN_DB_PREFIX.
"product as p";
1032 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1033 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1035 $sql .=
" WHERE c.entity IN (".getEntity($staticcontrat->element).
")";
1036 $sql .=
" AND c.fk_soc = s.rowid";
1037 $sql .=
" AND c.fk_product = p.rowid";
1038 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1039 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1042 $sql .=
" AND s.rowid = ".((int) $socid);
1044 $sql .=
" ORDER BY c.tms DESC";
1045 $sql .= $db->plimit($max + 1, 0);
1047 $resql = $db->query($sql);
1049 $num = $db->num_rows($resql);
1056 $obj = $db->fetch_object($resql);
1058 $companystatic->id = $obj->socid;
1059 $companystatic->name = $obj->name;
1060 $companystatic->name_alias = $obj->name_alias;
1061 $companystatic->code_client = $obj->code_client;
1062 $companystatic->code_compta = $obj->code_compta_client;
1063 $companystatic->code_compta_client = $obj->code_compta_client;
1064 $companystatic->client = $obj->client;
1065 $companystatic->code_fournisseur = $obj->code_fournisseur;
1066 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1067 $companystatic->fournisseur = $obj->fournisseur;
1068 $companystatic->logo = $obj->logo;
1069 $companystatic->email = $obj->email;
1070 $companystatic->entity = $obj->entity;
1071 $companystatic->canvas = $obj->canvas;
1073 $staticcontrat->id = $obj->contratid;
1074 $staticcontrat->ref = $obj->ref;
1076 print
'<tr class="oddeven">';
1077 print
'<td class="nowraponall">'.$staticcontrat->getNomUrl(1).
'</td>';
1078 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1079 print
'<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).
'</td>';
1099if (isModEnabled(
"propal") && $user->hasRight(
"propal",
"lire")) {
1100 $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";
1101 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
1102 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1103 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1104 $sql .=
", s.logo, s.email, s.entity";
1105 $sql .=
", s.canvas";
1106 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as p";
1107 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
1108 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1109 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1111 $sql .=
" WHERE p.entity IN (".getEntity($propalstatic->element).
")";
1112 $sql .=
" AND p.fk_soc = s.rowid";
1113 $sql .=
" AND p.fk_statut = ".Propal::STATUS_VALIDATED;
1114 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1115 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1118 $sql .=
" AND s.rowid = ".((int) $socid);
1120 $sql .=
" ORDER BY p.rowid DESC";
1122 $resql = $db->query($sql);
1124 $total = $total_ttc = 0;
1125 $num = $db->num_rows($resql);
1126 $nbofloop = min($num, (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
1127 startSimpleTable(
"ProposalsOpened",
"comm/propal/list.php",
"search_status=1", 4, $num);
1133 while ($i < $nbofloop) {
1134 $obj = $db->fetch_object($resql);
1139 $total += $obj->total_ht;
1140 $total_ttc += $obj->total_ttc;
1144 $propalstatic->id = $obj->propalid;
1145 $propalstatic->ref = $obj->ref;
1146 $propalstatic->ref_client = $obj->ref_client;
1147 $propalstatic->total_ht = $obj->total_ht;
1148 $propalstatic->total_tva = $obj->total_tva;
1149 $propalstatic->total_ttc = $obj->total_ttc;
1151 $companystatic->id = $obj->socid;
1152 $companystatic->name = $obj->name;
1153 $companystatic->name_alias = $obj->name_alias;
1154 $companystatic->code_client = $obj->code_client;
1155 $companystatic->code_compta = $obj->code_compta_client;
1156 $companystatic->code_compta_client = $obj->code_compta_client;
1157 $companystatic->client = $obj->client;
1158 $companystatic->code_fournisseur = $obj->code_fournisseur;
1159 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1160 $companystatic->fournisseur = $obj->fournisseur;
1161 $companystatic->logo = $obj->logo;
1162 $companystatic->email = $obj->email;
1163 $companystatic->entity = $obj->entity;
1164 $companystatic->canvas = $obj->canvas;
1169 $warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ?
img_warning($langs->trans(
"Late")) :
'';
1171 print
'<tr class="oddeven">';
1173 print
'<td class="nowrap" width="140">';
1174 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1175 print
'<td class="nobordernopadding nowraponall">'.$propalstatic->getNomUrl(1).
'</td>';
1176 print
'<td width="18" class="nobordernopadding nowrap">'.$warning.
'</td>';
1177 print
'<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).
'</td>';
1182 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1183 $datem = $db->jdate($obj->dp);
1184 print
'<td class="center tddate" title="'.dol_escape_htmltag($langs->trans(
"Date").
': '.
dol_print_date($datem,
'day',
'tzserver')).
'">';
1187 print
'<td class="right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
1188 print
'<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).
'</td>';
1193 $total += $obj->total_ht;
1194 $total_ttc += $obj->total_ttc;
1198 print
'<tr class="oddeven">';
1199 print
'<td class="nowrap" colspan="5">';
1200 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1219if (isModEnabled(
'order') && $user->hasRight(
'commande',
'lire')) {
1220 $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";
1221 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
1222 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1223 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1224 $sql .=
", s.logo, s.email, s.entity";
1225 $sql .=
", s.canvas";
1226 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c";
1227 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
1228 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1229 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1231 $sql .=
" WHERE c.entity IN (".getEntity($orderstatic->element).
")";
1232 $sql .=
" AND c.fk_soc = s.rowid";
1234 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1235 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1238 $sql .=
" AND s.rowid = ".((int) $socid);
1240 $sql .=
" ORDER BY c.rowid DESC";
1242 $resql = $db->query($sql);
1244 $total = $total_ttc = 0;
1245 $num = $db->num_rows($resql);
1246 $nbofloop = min($num, (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
1253 while ($i < $nbofloop) {
1254 $obj = $db->fetch_object($resql);
1259 $total += $obj->total_ht;
1260 $total_ttc += $obj->total_ttc;
1264 $orderstatic->id = $obj->commandeid;
1265 $orderstatic->ref = $obj->ref;
1266 $orderstatic->ref_client = $obj->ref_client;
1267 $orderstatic->statut = $obj->fk_statut;
1268 $orderstatic->total_ht = $obj->total_ht;
1269 $orderstatic->total_tva = $obj->total_tva;
1270 $orderstatic->total_ttc = $obj->total_ttc;
1272 $companystatic->id = $obj->socid;
1273 $companystatic->name = $obj->name;
1274 $companystatic->name_alias = $obj->name_alias;
1275 $companystatic->code_client = $obj->code_client;
1276 $companystatic->code_compta = $obj->code_compta_client;
1277 $companystatic->code_compta_client = $obj->code_compta_client;
1278 $companystatic->client = $obj->client;
1279 $companystatic->code_fournisseur = $obj->code_fournisseur;
1280 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1281 $companystatic->fournisseur = $obj->fournisseur;
1282 $companystatic->logo = $obj->logo;
1283 $companystatic->email = $obj->email;
1284 $companystatic->entity = $obj->entity;
1285 $companystatic->canvas = $obj->canvas;
1292 print
'<tr class="oddeven">';
1294 print
'<td class="nowrap" width="140">';
1295 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1296 print
'<td class="nobordernopadding nowraponall">'.$orderstatic->getNomUrl(1).
'</td>';
1297 print
'<td width="18" class="nobordernopadding nowrap"></td>';
1298 print
'<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).
'</td>';
1303 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1304 $datem = $db->jdate($obj->dv);
1305 print
'<td class="center tddate" title="'.dol_escape_htmltag($langs->trans(
"DateValue").
': '.
dol_print_date($datem,
'day',
'tzserver')).
'">';
1309 print
'<td class="right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
1310 print
'<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).
'</td>';
1315 $total += $obj->total_ht;
1316 $total_ttc += $obj->total_ttc;
1320 print
'<tr class="oddeven">';
1321 print
'<td class="nowrap" colspan="5">';
1322 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1341$parameters = array(
'user' => $user);
1342$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.
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 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.