33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/propal.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/order.lib.php';
44if (isModEnabled(
'contract')) {
45 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
47if (isModEnabled(
'intervention')) {
48 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
61$hookmanager->initHooks(array(
'commercialindex'));
64$langs->loadLangs(array(
"boxes",
"commercial",
"contracts",
"orders",
"propal",
"supplier_proposal"));
66$action =
GETPOST(
'action',
'aZ09');
71if (!empty($user->socid) && $user->socid > 0) {
73 $socid = $user->socid;
83if (!$user->hasRight(
'propal',
'read') && !$user->hasRight(
'supplier_proposal',
'read') && !$user->hasRight(
'commande',
'read') && !$user->hasRight(
'fournisseur',
'commande',
'read')
84 && !$user->hasRight(
'supplier_order',
'read') && !$user->hasRight(
'fichinter',
'read') && !$user->hasRight(
'contrat',
'read')) {
101$form =
new Form($db);
103$companystatic =
new Societe($db);
105$supplierproposalstatic =
null;
107$supplierorderstatic =
null;
108$fichinterstatic =
null;
109if (isModEnabled(
"propal")) {
110 $propalstatic =
new Propal($db);
112if (isModEnabled(
'supplier_proposal')) {
115if (isModEnabled(
'order')) {
118if (isModEnabled(
"supplier_order")) {
122if (isModEnabled(
'intervention')) {
126llxHeader(
"", $langs->trans(
"CommercialArea"));
130print
'<div class="fichecenter">';
132print
'<div class="twocolumns">';
134print
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
150if (isModEnabled(
"propal") && $user->hasRight(
"propal",
"lire") && is_object($propalstatic)) {
151 $sql =
"SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
152 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
153 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
154 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
155 $sql .=
", s.logo, s.email, s.entity";
156 $sql .=
", s.canvas";
157 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as p,";
158 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
159 if (!$user->hasRight(
'societe',
'client',
'voir')) {
160 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
162 $sql .=
" WHERE p.entity IN (".getEntity($propalstatic->element).
")";
163 $sql .=
" AND p.fk_soc = s.rowid";
164 $sql .=
" AND p.fk_statut = ".Propal::STATUS_DRAFT;
165 if (!$user->hasRight(
'societe',
'client',
'voir')) {
166 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
169 $sql .=
" AND s.rowid = ".((int) $socid);
172 $resql = $db->query($sql);
175 $num = $db->num_rows($resql);
176 $nbofloop = min($num, $maxofloop);
183 while ($i < $nbofloop) {
184 $obj = $db->fetch_object($resql);
189 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
193 $propalstatic->id = $obj->rowid;
194 $propalstatic->ref = $obj->ref;
195 $propalstatic->ref_client = $obj->ref_client;
196 $propalstatic->total_ht = $obj->total_ht;
197 $propalstatic->total_tva = $obj->total_tva;
198 $propalstatic->total_ttc = $obj->total_ttc;
199 $propalstatic->statut = $obj->status;
200 $propalstatic->status = $obj->status;
202 $companystatic->id = $obj->socid;
203 $companystatic->name = $obj->name;
204 $companystatic->name_alias = $obj->name_alias;
205 $companystatic->code_client = $obj->code_client;
206 $companystatic->code_compta = $obj->code_compta_client;
207 $companystatic->code_compta_client = $obj->code_compta_client;
208 $companystatic->client = $obj->client;
209 $companystatic->code_fournisseur = $obj->code_fournisseur;
210 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
211 $companystatic->fournisseur = $obj->fournisseur;
212 $companystatic->logo = $obj->logo;
213 $companystatic->email = $obj->email;
214 $companystatic->entity = $obj->entity;
215 $companystatic->canvas = $obj->canvas;
217 print
'<tr class="oddeven">';
218 print
'<td class="nowraponall tdoverflowmax125 minwidth75">'.$propalstatic->getNomUrl(1).
'</td>';
219 print
'<td class="nowrap tdoverflowmax250">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
220 print
'<td class="nowrap right tdamount amount">'.price((
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc)).
'</td>';
224 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
228 print
'<tr class="oddeven">';
229 print
'<td class="nowrap" colspan="5">';
230 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
250if (isModEnabled(
'supplier_proposal') && $user->hasRight(
"supplier_proposal",
"lire") && is_object($supplierproposalstatic)) {
251 $sql =
"SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
252 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
253 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
254 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
255 $sql .=
", s.logo, s.email, s.entity";
256 $sql .=
", s.canvas";
257 $sql .=
" FROM ".MAIN_DB_PREFIX.
"supplier_proposal as p,";
258 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
259 if (!$user->hasRight(
'societe',
'client',
'voir')) {
260 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
262 $sql .=
" WHERE p.entity IN (".getEntity($supplierproposalstatic->element).
")";
263 $sql .=
" AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT;
264 $sql .=
" AND p.fk_soc = s.rowid";
265 if (!$user->hasRight(
'societe',
'client',
'voir')) {
266 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
269 $sql .=
" AND s.rowid = ".((int) $socid);
272 $resql = $db->query($sql);
275 $num = $db->num_rows($resql);
276 $nbofloop = min($num, $maxofloop);
283 while ($i < $nbofloop) {
284 $obj = $db->fetch_object($resql);
289 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
293 $supplierproposalstatic->id = $obj->rowid;
294 $supplierproposalstatic->ref = $obj->ref;
295 $supplierproposalstatic->total_ht = $obj->total_ht;
296 $supplierproposalstatic->total_tva = $obj->total_tva;
297 $supplierproposalstatic->total_ttc = $obj->total_ttc;
298 $supplierproposalstatic->statut = $obj->status;
299 $supplierproposalstatic->status = $obj->status;
301 $companystatic->id = $obj->socid;
302 $companystatic->name = $obj->name;
303 $companystatic->name_alias = $obj->name_alias;
304 $companystatic->code_client = $obj->code_client;
305 $companystatic->code_compta = $obj->code_compta;
306 $companystatic->code_compta_client = $obj->code_compta_client;
307 $companystatic->client = $obj->client;
308 $companystatic->code_fournisseur = $obj->code_fournisseur;
309 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
310 $companystatic->fournisseur = $obj->fournisseur;
311 $companystatic->logo = $obj->logo;
312 $companystatic->email = $obj->email;
313 $companystatic->entity = $obj->entity;
314 $companystatic->canvas = $obj->canvas;
316 print
'<tr class="oddeven">';
317 print
'<td class="nowraponall tdoverflowmax125 minwidth75">'.$supplierproposalstatic->getNomUrl(1).
'</td>';
318 print
'<td class="nowrap tdoverflowmax250">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
319 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
323 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
327 print
'<tr class="oddeven">';
328 print
'<td class="nowrap" colspan="5">';
329 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
349if (isModEnabled(
'order') && $user->hasRight(
'commande',
'lire') && is_object($orderstatic)) {
350 $sql =
"SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status";
351 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
352 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
353 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
354 $sql .=
", s.logo, s.email, s.entity";
355 $sql .=
", s.canvas";
356 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
357 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
358 if (!$user->hasRight(
'societe',
'client',
'voir')) {
359 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
361 $sql .=
" WHERE c.entity IN (".getEntity($orderstatic->element).
")";
362 $sql .=
" AND c.fk_statut = ".Commande::STATUS_DRAFT;
363 $sql .=
" AND c.fk_soc = s.rowid";
364 if (!$user->hasRight(
'societe',
'client',
'voir')) {
365 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
368 $sql .=
" AND c.fk_soc = ".((int) $socid);
371 $resql = $db->query($sql);
374 $num = $db->num_rows($resql);
375 $nbofloop = min($num, $maxofloop);
382 while ($i < $nbofloop) {
383 $obj = $db->fetch_object($resql);
388 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
392 $orderstatic->id = $obj->rowid;
393 $orderstatic->ref = $obj->ref;
394 $orderstatic->ref_client = $obj->ref_client;
395 $orderstatic->total_ht = $obj->total_ht;
396 $orderstatic->total_tva = $obj->total_tva;
397 $orderstatic->total_ttc = $obj->total_ttc;
398 $orderstatic->statut = $obj->status;
399 $orderstatic->status = $obj->status;
401 $companystatic->id = $obj->socid;
402 $companystatic->name = $obj->name;
403 $companystatic->name_alias = $obj->name_alias;
404 $companystatic->code_client = $obj->code_client;
405 $companystatic->code_compta = $obj->code_compta_client;
406 $companystatic->code_compta_client = $obj->code_compta_client;
407 $companystatic->client = $obj->client;
408 $companystatic->code_fournisseur = $obj->code_fournisseur;
409 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
410 $companystatic->fournisseur = $obj->fournisseur;
411 $companystatic->logo = $obj->logo;
412 $companystatic->email = $obj->email;
413 $companystatic->entity = $obj->entity;
414 $companystatic->canvas = $obj->canvas;
416 print
'<tr class="oddeven">';
417 print
'<td class="nowraponall tdoverflowmax125 minwidth75">'.$orderstatic->getNomUrl(1).
'</td>';
418 print
'<td class="nowrap tdoverflowmax250">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
419 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
423 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
427 print
'<tr class="oddeven">';
428 print
'<td class="nowrap" colspan="5">';
429 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
449if ((isModEnabled(
"fournisseur") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"commande",
"lire")) || (isModEnabled(
"supplier_order") && $user->hasRight(
"supplier_order",
"lire"))) {
452 $sql =
"SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
453 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
454 $sql .=
", s.code_client, s.code_compta, s.client";
455 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
456 $sql .=
", s.logo, s.email, s.entity";
457 $sql .=
", s.canvas";
458 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as cf,";
459 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
460 if (!$user->hasRight(
'societe',
'client',
'voir')) {
461 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
463 $sql .=
" WHERE cf.entity IN (".getEntity($supplierorderstatic->element).
")";
464 $sql .=
" AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT;
465 $sql .=
" AND cf.fk_soc = s.rowid";
466 if (!$user->hasRight(
'societe',
'client',
'voir')) {
467 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
470 $sql .=
" AND cf.fk_soc = ".((int) $socid);
473 $resql = $db->query($sql);
476 $num = $db->num_rows($resql);
477 $nbofloop = min($num, $maxofloop);
484 while ($i < $nbofloop) {
485 $obj = $db->fetch_object($resql);
490 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
494 $supplierorderstatic->id = $obj->rowid;
495 $supplierorderstatic->ref = $obj->ref;
496 $supplierorderstatic->ref_supplier = $obj->ref_supplier;
497 $supplierorderstatic->total_ht = $obj->total_ht;
498 $supplierorderstatic->total_tva = $obj->total_tva;
499 $supplierorderstatic->total_ttc = $obj->total_ttc;
500 $supplierorderstatic->statut = $obj->status;
501 $supplierorderstatic->status = $obj->status;
503 $companystatic->id = $obj->socid;
504 $companystatic->name = $obj->name;
505 $companystatic->name_alias = $obj->name_alias;
506 $companystatic->code_client = $obj->code_client;
507 $companystatic->code_compta = $obj->code_compta;
508 $companystatic->code_compta_client = $obj->code_compta;
509 $companystatic->client = $obj->client;
510 $companystatic->code_fournisseur = $obj->code_fournisseur;
511 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
512 $companystatic->fournisseur = $obj->fournisseur;
513 $companystatic->logo = $obj->logo;
514 $companystatic->email = $obj->email;
515 $companystatic->entity = $obj->entity;
516 $companystatic->canvas = $obj->canvas;
518 print
'<tr class="oddeven">';
519 print
'<td class="nowraponall tdoverflowmax125 minwidth75">'.$supplierorderstatic->getNomUrl(1).
'</td>';
520 print
'<td class="nowrap tdoverflowmax250">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
521 print
'<td class="nowrap right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
525 $total += (
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc);
529 print
'<tr class="oddeven">';
530 print
'<td class="nowrap" colspan="5">';
531 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
550if (isModEnabled(
'intervention') && is_object($fichinterstatic)) {
551 $sql =
"SELECT f.rowid, f.ref, s.nom as name, f.fk_statut, f.duree as duration";
552 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
553 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
554 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
555 $sql .=
", s.logo, s.email, s.entity";
556 $sql .=
", s.canvas";
557 $sql .=
" FROM ".MAIN_DB_PREFIX.
"fichinter as f";
558 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
559 if (!$user->hasRight(
'societe',
'client',
'voir')) {
560 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
562 $sql .=
" WHERE f.entity IN (".getEntity(
'intervention').
")";
563 $sql .=
" AND f.fk_soc = s.rowid";
564 $sql .=
" AND f.fk_statut = 0";
566 $sql .=
" AND f.fk_soc = ".((int) $socid);
568 if (!$user->hasRight(
'societe',
'client',
'voir')) {
569 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
573 $resql = $db->query($sql);
575 $num = $db->num_rows($resql);
576 $nbofloop = min($num, $maxofloop);
584 while ($i < $nbofloop) {
585 $obj = $db->fetch_object($resql);
587 $fichinterstatic->id = $obj->rowid;
588 $fichinterstatic->ref = $obj->ref;
589 $fichinterstatic->statut = $obj->fk_statut;
590 $fichinterstatic->status = $obj->fk_statut;
592 $companystatic->id = $obj->socid;
593 $companystatic->name = $obj->name;
594 $companystatic->name_alias = $obj->name_alias;
595 $companystatic->code_client = $obj->code_client;
596 $companystatic->code_compta = $obj->code_compta_client;
597 $companystatic->code_compta_client = $obj->code_compta_client;
598 $companystatic->client = $obj->client;
599 $companystatic->code_fournisseur = $obj->code_fournisseur;
600 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
601 $companystatic->fournisseur = $obj->fournisseur;
602 $companystatic->logo = $obj->logo;
603 $companystatic->email = $obj->email;
604 $companystatic->entity = $obj->entity;
605 $companystatic->canvas = $obj->canvas;
607 print
'<tr class="oddeven">';
608 print
'<td class="tdoverflowmax125 minwidth75">';
609 print $fichinterstatic->getNomUrl(1);
611 print
'<td class="tdoverflowmax250 minwidth100">';
612 print $companystatic->getNomUrl(1,
'customer');
614 print
'<td class="nowraponall tdoverflowmax100 right">';
630print
'</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
636if (isModEnabled(
"societe") && $user->hasRight(
'societe',
'lire')) {
637 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
638 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
639 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
640 $sql .=
", s.logo, s.email, s.entity";
641 $sql .=
", s.canvas";
642 $sql .=
", s.datec, s.tms";
643 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
644 if (!$user->hasRight(
'societe',
'client',
'voir')) {
645 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
647 $sql .=
" WHERE s.entity IN (".getEntity($companystatic->element).
")";
649 if (!$user->hasRight(
'societe',
'client',
'voir')) {
650 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
653 $parameters = array(
'socid' => $socid);
654 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $companystatic);
655 if (empty($reshook)) {
657 $sql .=
" AND s.rowid = ".((int) $socid);
660 $sql .= $hookmanager->resPrint;
661 $sql .=
" ORDER BY s.tms DESC";
662 $sql .= $db->plimit($max, 0);
664 $resql = $db->query($sql);
667 $header =
"BoxTitleLastCustomersOrProspects";
669 $header =
"BoxTitleLastModifiedProspects";
671 $header =
"BoxTitleLastModifiedCustomers";
674 $num = $db->num_rows($resql);
675 startSimpleTable($langs->trans($header, min($max, $num)),
"societe/list.php",
"type=p,c&sortfield=s.tms&sortorder=DESC", 1, -1,
'company');
680 while ($i < $num && $i < $max) {
681 $objp = $db->fetch_object($resql);
683 $companystatic->id = $objp->socid;
684 $companystatic->name = $objp->name;
685 $companystatic->name_alias = $objp->name_alias;
686 $companystatic->code_client = $objp->code_client;
687 $companystatic->code_compta = $objp->code_compta_client;
688 $companystatic->code_compta_client = $objp->code_compta_client;
689 $companystatic->client = $objp->client;
690 $companystatic->code_fournisseur = $objp->code_fournisseur;
691 $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
692 $companystatic->fournisseur = $objp->fournisseur;
693 $companystatic->logo = $objp->logo;
694 $companystatic->email = $objp->email;
695 $companystatic->entity = $objp->entity;
696 $companystatic->canvas = $objp->canvas;
698 print
'<tr class="oddeven">';
699 print
'<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
700 print
'<td class="nowrap">';
703 $obj = $companystatic;
705 if (($obj->client == 2 || $obj->client == 3) && !
getDolGlobalString(
'SOCIETE_DISABLE_PROSPECTS')) {
706 $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>';
708 if (($obj->client == 1 || $obj->client == 3) && !
getDolGlobalString(
'SOCIETE_DISABLE_CUSTOMERS')) {
709 $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>';
720 $datem = $db->jdate($objp->tms);
721 print
'<td class="right nowrap tddate" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
744if (isModEnabled(
'propal') && is_object($propalstatic)) {
745 $sql =
"SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.tms as datem,";
746 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client";
747 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as c,";
748 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
749 $sql .=
" WHERE c.entity IN (".getEntity($propalstatic->element).
")";
750 $sql .=
" AND c.fk_soc = s.rowid";
753 if (!$user->hasRight(
'societe',
'client',
'voir')) {
754 $search_sale = $user->id;
757 if ($search_sale && $search_sale !=
'-1') {
758 if ($search_sale == -2) {
759 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc)";
760 } elseif ($search_sale > 0) {
761 $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).
")";
766 $sql .=
" AND c.fk_soc = ".((int) $socid);
768 $sql .=
" ORDER BY c.tms DESC";
770 $sql .= $db->plimit($max, 0);
772 $resql = $db->query($sql);
774 $num = $db->num_rows($resql);
776 startSimpleTable($langs->trans(
"LastModifiedProposals", $max),
"comm/propal/list.php",
"sortfield=p.tms&sortorder=DESC", 2, -1,
'propal');
781 $obj = $db->fetch_object($resql);
783 $propalstatic->id = $obj->rowid;
784 $propalstatic->ref = $obj->ref;
785 $propalstatic->status = $obj->status;
787 $companystatic->id = $obj->socid;
788 $companystatic->name = $obj->socname;
789 $companystatic->client = $obj->client;
790 $companystatic->canvas = $obj->canvas;
791 $companystatic->email = $obj->email;
792 $companystatic->code_compta = $obj->code_compta_client;
793 $companystatic->code_compta_client = $obj->code_compta_client;
797 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
799 print
'<tr class="oddeven">';
801 print
'<td class="nowrap">';
802 print
'<table class="nobordernopadding">';
803 print
'<tr class="nocellnopadd">';
804 print
'<td width="96" class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).
'</td>';
805 print
'<td width="16" class="nobordernopadding nowrap"></td>';
806 print
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).
'</td>';
811 print
'<td class="tdoverflowmax100">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
813 $datem = $db->jdate($obj->datem);
814 print
'<td class="center" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
818 print
'<td class="right">'.$propalstatic->LibStatut($obj->status, 3).
'</td>';
838if (isModEnabled(
'order')) {
839 $commandestatic =
new Commande($db);
841 $sql =
"SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,";
842 $sql .=
" s.nom as name, s.rowid as socid";
843 $sql .=
", s.client";
844 $sql .=
", s.code_client";
845 $sql .=
", s.canvas";
846 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
847 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
848 if (!$user->hasRight(
'societe',
'client',
'voir')) {
849 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
851 $sql .=
" WHERE c.fk_soc = s.rowid";
852 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
855 $sql .=
" AND c.fk_soc = ".((int) $socid);
857 if (!$user->hasRight(
'societe',
'client',
'voir')) {
858 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
860 $sql .=
" ORDER BY c.tms DESC";
861 $sql .= $db->plimit($max, 0);
863 $resql = $db->query($sql);
865 $num = $db->num_rows($resql);
867 startSimpleTable($langs->trans(
"LastModifiedOrders", $max),
"commande/list.php",
"sortfield=c.tms&sortorder=DESC", 2, -1,
'order');
872 $obj = $db->fetch_object($resql);
874 print
'<tr class="oddeven">';
875 print
'<td width="20%" class="nowrap">';
877 $commandestatic->id = $obj->rowid;
878 $commandestatic->ref = $obj->ref;
880 $companystatic->id = $obj->socid;
881 $companystatic->name = $obj->name;
882 $companystatic->client = $obj->client;
883 $companystatic->code_client = $obj->code_client;
884 $companystatic->canvas = $obj->canvas;
886 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
887 print
'<td width="96" class="nobordernopadding nowrap">';
888 print $commandestatic->getNomUrl(1);
891 print
'<td width="16" class="nobordernopadding nowrap">';
895 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
898 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
899 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
900 print
'</td></tr></table>';
904 print
'<td class="nowrap">';
905 print $companystatic->getNomUrl(1,
'company', 16);
908 $datem = $db->jdate($obj->datem);
909 print
'<td class="center" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
913 print
'<td class="right">'.$commandestatic->LibStatut($obj->status, $obj->facture, 3).
'</td>';
928if ((isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) && $user->hasRight(
'societe',
'lire')) {
929 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
930 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
931 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
932 $sql .=
", s.logo, s.email, s.entity";
933 $sql .=
", s.canvas";
934 $sql .=
", s.datec as dc, s.tms as dm";
935 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
936 if (!$user->hasRight(
'societe',
'client',
'voir')) {
937 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
939 $sql .=
" WHERE s.entity IN (".getEntity($companystatic->element).
")";
940 $sql .=
" AND s.fournisseur = ".Societe::SUPPLIER;
941 if (!$user->hasRight(
'societe',
'client',
'voir')) {
942 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
945 $parameters = array(
'socid' => $socid);
946 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $companystatic);
947 if (empty($reshook)) {
949 $sql .=
" AND s.rowid = ".((int) $socid);
952 $sql .= $hookmanager->resPrint;
953 $sql .=
" ORDER BY s.datec DESC";
954 $sql .= $db->plimit($max, 0);
956 $resql = $db->query($sql);
958 $num = $db->num_rows($resql);
959 startSimpleTable($langs->trans(
"BoxTitleLastModifiedSuppliers", min($max, $num)),
"societe/list.php",
"type=f", 1, -1,
'company');
963 while ($i < $num && $i < $max) {
964 $objp = $db->fetch_object($resql);
966 $companystatic->id = $objp->socid;
967 $companystatic->name = $objp->name;
968 $companystatic->name_alias = $objp->name_alias;
969 $companystatic->code_client = $objp->code_client;
970 $companystatic->code_compta = $objp->code_compta_client;
971 $companystatic->code_compta_client = $objp->code_compta_client;
972 $companystatic->client = $objp->client;
973 $companystatic->code_fournisseur = $objp->code_fournisseur;
974 $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
975 $companystatic->fournisseur = $objp->fournisseur;
976 $companystatic->logo = $objp->logo;
977 $companystatic->email = $objp->email;
978 $companystatic->entity = $objp->entity;
979 $companystatic->canvas = $objp->canvas;
981 print
'<tr class="oddeven">';
982 print
'<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
985 $obj = $companystatic;
994 if ((isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) && $obj->fournisseur) {
995 $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>';
1001 $datem = $db->jdate($objp->dm);
1002 print
'<td class="right tddate" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
1040if (isModEnabled(
'contract') && $user->hasRight(
"contrat",
"lire") && 0) {
1041 $staticcontrat =
new Contrat($db);
1043 $sql =
"SELECT s.rowid as socid, s.nom as name, s.name_alias";
1044 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1045 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1046 $sql .=
", s.logo, s.email, s.entity";
1047 $sql .=
", s.canvas";
1048 $sql .=
", c.statut, c.rowid as contratid, p.ref, c.fin_validite as datefin, c.date_cloture as dateclo";
1049 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
1050 $sql .=
", ".MAIN_DB_PREFIX.
"contrat as c";
1051 $sql .=
", ".MAIN_DB_PREFIX.
"product as p";
1052 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1053 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1055 $sql .=
" WHERE c.entity IN (".getEntity($staticcontrat->element).
")";
1056 $sql .=
" AND c.fk_soc = s.rowid";
1057 $sql .=
" AND c.fk_product = p.rowid";
1058 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1059 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1062 $sql .=
" AND s.rowid = ".((int) $socid);
1064 $sql .=
" ORDER BY c.tms DESC";
1065 $sql .= $db->plimit($max + 1, 0);
1067 $resql = $db->query($sql);
1069 $num = $db->num_rows($resql);
1076 $obj = $db->fetch_object($resql);
1078 $companystatic->id = $obj->socid;
1079 $companystatic->name = $obj->name;
1080 $companystatic->name_alias = $obj->name_alias;
1081 $companystatic->code_client = $obj->code_client;
1082 $companystatic->code_compta = $obj->code_compta_client;
1083 $companystatic->code_compta_client = $obj->code_compta_client;
1084 $companystatic->client = $obj->client;
1085 $companystatic->code_fournisseur = $obj->code_fournisseur;
1086 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1087 $companystatic->fournisseur = $obj->fournisseur;
1088 $companystatic->logo = $obj->logo;
1089 $companystatic->email = $obj->email;
1090 $companystatic->entity = $obj->entity;
1091 $companystatic->canvas = $obj->canvas;
1093 $staticcontrat->id = $obj->contratid;
1094 $staticcontrat->ref = $obj->ref;
1096 print
'<tr class="oddeven">';
1097 print
'<td class="nowraponall">'.$staticcontrat->getNomUrl(1).
'</td>';
1098 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1099 print
'<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).
'</td>';
1119if (isModEnabled(
"propal") && $user->hasRight(
"propal",
"lire")) {
1120 $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";
1121 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
1122 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1123 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1124 $sql .=
", s.logo, s.email, s.entity";
1125 $sql .=
", s.canvas";
1126 $sql .=
" FROM ".MAIN_DB_PREFIX.
"propal as p";
1127 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
1128 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1129 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1131 $sql .=
" WHERE p.entity IN (".getEntity($propalstatic->element).
")";
1132 $sql .=
" AND p.fk_soc = s.rowid";
1133 $sql .=
" AND p.fk_statut = ".Propal::STATUS_VALIDATED;
1134 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1135 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1138 $sql .=
" AND s.rowid = ".((int) $socid);
1140 $sql .=
" ORDER BY p.rowid DESC";
1142 $resql = $db->query($sql);
1144 $total = $total_ttc = 0;
1145 $num = $db->num_rows($resql);
1146 $nbofloop = min($num, (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 :
$conf->global->MAIN_MAXLIST_OVERLOAD));
1147 startSimpleTable(
"ProposalsOpened",
"comm/propal/list.php",
"search_status=1", 4, $num);
1153 while ($i < $nbofloop) {
1154 $obj = $db->fetch_object($resql);
1159 $total += $obj->total_ht;
1160 $total_ttc += $obj->total_ttc;
1164 $propalstatic->id = $obj->propalid;
1165 $propalstatic->ref = $obj->ref;
1166 $propalstatic->ref_client = $obj->ref_client;
1167 $propalstatic->total_ht = $obj->total_ht;
1168 $propalstatic->total_tva = $obj->total_tva;
1169 $propalstatic->total_ttc = $obj->total_ttc;
1171 $companystatic->id = $obj->socid;
1172 $companystatic->name = $obj->name;
1173 $companystatic->name_alias = $obj->name_alias;
1174 $companystatic->code_client = $obj->code_client;
1175 $companystatic->code_compta = $obj->code_compta_client;
1176 $companystatic->code_compta_client = $obj->code_compta_client;
1177 $companystatic->client = $obj->client;
1178 $companystatic->code_fournisseur = $obj->code_fournisseur;
1179 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1180 $companystatic->fournisseur = $obj->fournisseur;
1181 $companystatic->logo = $obj->logo;
1182 $companystatic->email = $obj->email;
1183 $companystatic->entity = $obj->entity;
1184 $companystatic->canvas = $obj->canvas;
1189 $warning = ($db->jdate($obj->dfv) < ($now -
$conf->propal->cloture->warning_delay)) ?
img_warning($langs->trans(
"Late")) :
'';
1191 print
'<tr class="oddeven">';
1193 print
'<td class="nowrap" width="140">';
1194 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1195 print
'<td class="nobordernopadding nowraponall">'.$propalstatic->getNomUrl(1).
'</td>';
1196 print
'<td width="18" class="nobordernopadding nowrap">'.$warning.
'</td>';
1197 print
'<td width="16" class="nobordernopadding center">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).
'</td>';
1202 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1203 $datem = $db->jdate($obj->dp);
1204 print
'<td class="center tddate" title="'.dol_escape_htmltag($langs->trans(
"Date").
': '.
dol_print_date($datem,
'day',
'tzserver')).
'">';
1207 print
'<td class="right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
1208 print
'<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).
'</td>';
1213 $total += $obj->total_ht;
1214 $total_ttc += $obj->total_ttc;
1218 print
'<tr class="oddeven">';
1219 print
'<td class="nowrap" colspan="5">';
1220 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1239if (isModEnabled(
'order') && $user->hasRight(
'commande',
'lire') && is_object($orderstatic)) {
1240 $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";
1241 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
1242 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.client";
1243 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
1244 $sql .=
", s.logo, s.email, s.entity";
1245 $sql .=
", s.canvas";
1246 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c";
1247 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
1248 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1249 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1251 $sql .=
" WHERE c.entity IN (".getEntity($orderstatic->element).
")";
1252 $sql .=
" AND c.fk_soc = s.rowid";
1254 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1255 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1258 $sql .=
" AND s.rowid = ".((int) $socid);
1260 $sql .=
" ORDER BY c.rowid DESC";
1262 $resql = $db->query($sql);
1264 $total = $total_ttc = 0;
1265 $num = $db->num_rows($resql);
1266 $nbofloop = min($num, (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 :
$conf->global->MAIN_MAXLIST_OVERLOAD));
1273 while ($i < $nbofloop) {
1274 $obj = $db->fetch_object($resql);
1279 $total += $obj->total_ht;
1280 $total_ttc += $obj->total_ttc;
1284 $orderstatic->id = $obj->commandeid;
1285 $orderstatic->ref = $obj->ref;
1286 $orderstatic->ref_client = $obj->ref_client;
1287 $orderstatic->statut = $obj->fk_statut;
1288 $orderstatic->total_ht = $obj->total_ht;
1289 $orderstatic->total_tva = $obj->total_tva;
1290 $orderstatic->total_ttc = $obj->total_ttc;
1292 $companystatic->id = $obj->socid;
1293 $companystatic->name = $obj->name;
1294 $companystatic->name_alias = $obj->name_alias;
1295 $companystatic->code_client = $obj->code_client;
1296 $companystatic->code_compta = $obj->code_compta_client;
1297 $companystatic->code_compta_client = $obj->code_compta_client;
1298 $companystatic->client = $obj->client;
1299 $companystatic->code_fournisseur = $obj->code_fournisseur;
1300 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1301 $companystatic->fournisseur = $obj->fournisseur;
1302 $companystatic->logo = $obj->logo;
1303 $companystatic->email = $obj->email;
1304 $companystatic->entity = $obj->entity;
1305 $companystatic->canvas = $obj->canvas;
1312 print
'<tr class="oddeven">';
1314 print
'<td class="nowrap" width="140">';
1315 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1316 print
'<td class="nobordernopadding nowraponall">'.$orderstatic->getNomUrl(1).
'</td>';
1317 print
'<td width="18" class="nobordernopadding nowrap"></td>';
1318 print
'<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).
'</td>';
1323 print
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
1324 $datem = $db->jdate($obj->dv);
1325 print
'<td class="center tddate" title="'.dol_escape_htmltag($langs->trans(
"DateValue").
': '.
dol_print_date($datem,
'day',
'tzserver')).
'">';
1329 print
'<td class="right tdamount amount">'.price(
getDolGlobalString(
'MAIN_DASHBOARD_USE_TOTAL_HT') ? $obj->total_ht : $obj->total_ttc).
'</td>';
1330 print
'<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).
'</td>';
1335 $total += $obj->total_ht;
1336 $total_ttc += $obj->total_ttc;
1340 print
'<tr class="oddeven">';
1341 print
'<td class="nowrap" colspan="5">';
1342 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1361$parameters = array(
'user' => $user);
1362$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()"...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.