dolibarr  13.0.2
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
6  * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
7  * Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
8  * Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
30 require '../main.inc.php';
31 
32 if (!$user->rights->societe->lire) accessforbidden();
33 
34 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
38 require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
39 require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
40 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
41 require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
42 require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
43 
44 // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
45 $hookmanager = new HookManager($db);
46 $hookmanager->initHooks(array('commercialindex'));
47 
48 // Load translation files required by the page
49 $langs->loadLangs(array("boxes", "commercial", "contracts", "orders", "propal", "supplier_proposal"));
50 
51 $action = GETPOST('action', 'aZ09');
52 $bid = GETPOST('bid', 'int');
53 
54 // Securite acces client
55 $socid = GETPOST('socid', 'int');
56 if (isset($user->socid) && $user->socid > 0) {
57  $action = '';
58  $socid = $user->socid;
59 }
60 
61 $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
62 $now = dol_now();
63 
64 /*
65  * Actions
66  */
67 
68 
69 /*
70  * View
71  */
72 
73 $form = new Form($db);
74 $formfile = new FormFile($db);
75 $companystatic = new Societe($db);
76 if (!empty($conf->propal->enabled)) $propalstatic = new Propal($db);
77 if (!empty($conf->supplier_proposal->enabled)) $supplierproposalstatic = new SupplierProposal($db);
78 if (!empty($conf->commande->enabled)) $orderstatic = new Commande($db);
79 if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) $supplierorderstatic = new CommandeFournisseur($db);
80 
81 llxHeader("", $langs->trans("CommercialArea"));
82 
83 print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial');
84 
85 print '<div class="fichecenter"><div class="fichethirdleft">';
86 
87 // This is useless due to the global search combo
88 if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) {
89  // Search proposal
90  if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
91  $listofsearchfields['search_proposal'] = array('text'=>'Proposal');
92  }
93  // Search customer order
94  if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
95  $listofsearchfields['search_customer_order'] = array('text'=>'CustomerOrder');
96  }
97  // Search supplier proposal
98  if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
99  $listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort');
100  }
101  // Search supplier order
102  if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
103  $listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder');
104  }
105  // Search intervention
106  if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
107  $listofsearchfields['search_intervention'] = array('text'=>'Intervention');
108  }
109  // Search contract
110  if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
111  $listofsearchfields['search_contract'] = array('text'=>'Contract');
112  }
113 
114  if (count($listofsearchfields)) {
115  print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
116  print '<input type="hidden" name="token" value="'.newToken().'">';
117  print '<div class="div-table-responsive-no-min">';
118  print '<table class="noborder nohover centpercent">';
119  $i = 0;
120  foreach ($listofsearchfields as $key => $value) {
121  if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
122  print '<tr '.$bc[false].'>';
123  print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
124  if ($i == 0) print '<td class="noborderbottom" rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button "></td>';
125  print '</tr>';
126  $i++;
127  }
128  print '</table>';
129  print '</div>';
130  print '</form>';
131  print '<br>';
132  }
133 }
134 
135 
136 /*
137  * Draft customer proposals
138  */
139 if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
140  $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status";
141  $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
142  $sql .= ", s.code_client, s.code_compta, s.client";
143  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
144  $sql .= ", s.logo, s.email, s.entity";
145  $sql .= ", s.canvas";
146  $sql .= " FROM ".MAIN_DB_PREFIX."propal as p,";
147  $sql .= " ".MAIN_DB_PREFIX."societe as s";
148  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
149  $sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")";
150  $sql .= " AND p.fk_soc = s.rowid";
151  $sql .= " AND p.fk_statut = ".Propal::STATUS_DRAFT;
152  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
153  if ($socid) $sql .= " AND s.rowid = ".$socid;
154 
155  $resql = $db->query($sql);
156  if ($resql) {
157  $total = 0;
158  $num = $db->num_rows($resql);
159  $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
160  startSimpleTable("ProposalsDraft", "comm/propal/list.php", "search_status=".Propal::STATUS_DRAFT, 2, $num);
161 
162  if ($num > 0) {
163  $i = 0;
164 
165  while ($i < $nbofloop) {
166  $obj = $db->fetch_object($resql);
167 
168  $propalstatic->id = $obj->rowid;
169  $propalstatic->ref = $obj->ref;
170  $propalstatic->ref_client = $obj->ref_client;
171  $propalstatic->total_ht = $obj->total_ht;
172  $propalstatic->total_tva = $obj->total_tva;
173  $propalstatic->total_ttc = $obj->total_ttc;
174  $propalstatic->statut = $obj->status;
175 
176  $companystatic->id = $obj->socid;
177  $companystatic->name = $obj->name;
178  $companystatic->name_alias = $obj->name_alias;
179  $companystatic->code_client = $obj->code_client;
180  $companystatic->code_compta = $obj->code_compta;
181  $companystatic->client = $obj->client;
182  $companystatic->code_fournisseur = $obj->code_fournisseur;
183  $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
184  $companystatic->fournisseur = $obj->fournisseur;
185  $companystatic->logo = $obj->logo;
186  $companystatic->email = $obj->email;
187  $companystatic->entity = $obj->entity;
188  $companystatic->canvas = $obj->canvas;
189 
190  print '<tr class="oddeven">';
191  print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
192  print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
193  print '<td class="nowrap right tdamount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
194  print '</tr>';
195 
196  $i++;
197  $total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
198  }
199  }
200 
201  addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
202  finishSimpleTable(true);
203 
204  $db->free($resql);
205  } else {
206  dol_print_error($db);
207  }
208 }
209 
210 
211 /*
212  * Draft supplier proposals
213  */
214 if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
215  $sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status";
216  $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
217  $sql .= ", s.code_client, s.code_compta, s.client";
218  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
219  $sql .= ", s.logo, s.email, s.entity";
220  $sql .= ", s.canvas";
221  $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p,";
222  $sql .= " ".MAIN_DB_PREFIX."societe as s";
223  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
224  $sql .= " WHERE p.entity IN (".getEntity($supplierproposalstatic->element).")";
225  $sql .= " AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT;
226  $sql .= " AND p.fk_soc = s.rowid";
227  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
228  if ($socid) $sql .= " AND s.rowid = ".$socid;
229 
230  $resql = $db->query($sql);
231  if ($resql) {
232  $total = 0;
233  $num = $db->num_rows($resql);
234  $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
235  startSimpleTable("SupplierProposalsDraft", "supplier_proposal/list.php", "search_status=".SupplierProposal::STATUS_DRAFT, 2, $num);
236 
237  if ($num > 0) {
238  $i = 0;
239 
240  while ($i < $nbofloop) {
241  $obj = $db->fetch_object($resql);
242 
243  $supplierproposalstatic->id = $obj->rowid;
244  $supplierproposalstatic->ref = $obj->ref;
245  $supplierproposalstatic->total_ht = $obj->total_ht;
246  $supplierproposalstatic->total_tva = $obj->total_tva;
247  $supplierproposalstatic->total_ttc = $obj->total_ttc;
248  $supplierproposalstatic->statut = $obj->status;
249 
250  $companystatic->id = $obj->socid;
251  $companystatic->name = $obj->name;
252  $companystatic->name_alias = $obj->name_alias;
253  $companystatic->code_client = $obj->code_client;
254  $companystatic->code_compta = $obj->code_compta;
255  $companystatic->client = $obj->client;
256  $companystatic->code_fournisseur = $obj->code_fournisseur;
257  $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
258  $companystatic->fournisseur = $obj->fournisseur;
259  $companystatic->logo = $obj->logo;
260  $companystatic->email = $obj->email;
261  $companystatic->entity = $obj->entity;
262  $companystatic->canvas = $obj->canvas;
263 
264  print '<tr class="oddeven">';
265  print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
266  print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
267  print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
268  print '</tr>';
269 
270  $i++;
271  $total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
272  }
273  }
274 
275  addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
276  finishSimpleTable(true);
277 
278  $db->free($resql);
279  } else {
280  dol_print_error($db);
281  }
282 }
283 
284 
285 /*
286  * Draft customer orders
287  */
288 if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
289  $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, c.fk_statut as status";
290  $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
291  $sql .= ", s.code_client, s.code_compta, s.client";
292  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
293  $sql .= ", s.logo, s.email, s.entity";
294  $sql .= ", s.canvas";
295  $sql .= " FROM ".MAIN_DB_PREFIX."commande as c,";
296  $sql .= " ".MAIN_DB_PREFIX."societe as s";
297  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
298  $sql .= " WHERE c.entity IN (".getEntity($orderstatic->element).")";
299  $sql .= " AND c.fk_statut = ".Commande::STATUS_DRAFT;
300  $sql .= " AND c.fk_soc = s.rowid";
301  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
302  if ($socid) $sql .= " AND c.fk_soc = ".$socid;
303 
304  $resql = $db->query($sql);
305  if ($resql) {
306  $total = 0;
307  $num = $db->num_rows($resql);
308  $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
309  startSimpleTable("DraftOrders", "commande/list.php", "search_status=".Commande::STATUS_DRAFT, 2, $num);
310 
311  if ($num > 0) {
312  $i = 0;
313 
314  while ($i < $nbofloop) {
315  $obj = $db->fetch_object($resql);
316 
317  $orderstatic->id = $obj->rowid;
318  $orderstatic->ref = $obj->ref;
319  $orderstatic->ref_client = $obj->ref_client;
320  $orderstatic->total_ht = $obj->total_ht;
321  $orderstatic->total_tva = $obj->total_tva;
322  $orderstatic->total_ttc = $obj->total_ttc;
323  $orderstatic->statut = $obj->status;
324 
325  $companystatic->id = $obj->socid;
326  $companystatic->name = $obj->name;
327  $companystatic->name_alias = $obj->name_alias;
328  $companystatic->code_client = $obj->code_client;
329  $companystatic->code_compta = $obj->code_compta;
330  $companystatic->client = $obj->client;
331  $companystatic->code_fournisseur = $obj->code_fournisseur;
332  $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
333  $companystatic->fournisseur = $obj->fournisseur;
334  $companystatic->logo = $obj->logo;
335  $companystatic->email = $obj->email;
336  $companystatic->entity = $obj->entity;
337  $companystatic->canvas = $obj->canvas;
338 
339  print '<tr class="oddeven">';
340  print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
341  print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
342  print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
343  print '</tr>';
344 
345  $i++;
346  $total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
347  }
348  }
349 
350  addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
351  finishSimpleTable(true);
352 
353  $db->free($resql);
354  } else {
355  dol_print_error($db);
356  }
357 }
358 
359 
360 /*
361  * Draft purchase orders
362  */
363 if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
364  $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status";
365  $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
366  $sql .= ", s.code_client, s.code_compta, s.client";
367  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
368  $sql .= ", s.logo, s.email, s.entity";
369  $sql .= ", s.canvas";
370  $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf,";
371  $sql .= " ".MAIN_DB_PREFIX."societe as s";
372  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
373  $sql .= " WHERE cf.entity IN (".getEntity($supplierorderstatic->element).")";
374  $sql .= " AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT;
375  $sql .= " AND cf.fk_soc = s.rowid";
376  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
377  if ($socid) $sql .= " AND cf.fk_soc = ".$socid;
378 
379  $resql = $db->query($sql);
380  if ($resql) {
381  $total = 0;
382  $num = $db->num_rows($resql);
383  $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
384  startSimpleTable("DraftSuppliersOrders", "fourn/commande/list.php", "search_status=".CommandeFournisseur::STATUS_DRAFT, 2, $num);
385 
386  if ($num > 0) {
387  $i = 0;
388 
389  while ($i < $nbofloop) {
390  $obj = $db->fetch_object($resql);
391 
392  $supplierorderstatic->id = $obj->rowid;
393  $supplierorderstatic->ref = $obj->ref;
394  $supplierorderstatic->ref_supplier = $obj->ref_suppliert;
395  $supplierorderstatic->total_ht = $obj->total_ht;
396  $supplierorderstatic->total_tva = $obj->total_tva;
397  $supplierorderstatic->total_ttc = $obj->total_ttc;
398  $supplierorderstatic->statut = $obj->status;
399 
400  $companystatic->id = $obj->socid;
401  $companystatic->name = $obj->name;
402  $companystatic->name_alias = $obj->name_alias;
403  $companystatic->code_client = $obj->code_client;
404  $companystatic->code_compta = $obj->code_compta;
405  $companystatic->client = $obj->client;
406  $companystatic->code_fournisseur = $obj->code_fournisseur;
407  $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
408  $companystatic->fournisseur = $obj->fournisseur;
409  $companystatic->logo = $obj->logo;
410  $companystatic->email = $obj->email;
411  $companystatic->entity = $obj->entity;
412  $companystatic->canvas = $obj->canvas;
413 
414  print '<tr class="oddeven">';
415  print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
416  print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
417  print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
418  print '</tr>';
419 
420  $i++;
421  $total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
422  }
423  }
424 
425  addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
426  finishSimpleTable(true);
427 
428  $db->free($resql);
429  } else {
430  dol_print_error($db);
431  }
432 }
433 
434 print '</div><div class="fichetwothirdright">';
435 print '<div class="ficheaddleft">';
436 
437 /*
438  * Last modified customers or prospects
439  */
440 if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
441  $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
442  $sql .= ", s.code_client, s.code_compta, s.client";
443  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
444  $sql .= ", s.logo, s.email, s.entity";
445  $sql .= ", s.canvas";
446  $sql .= ", s.datec, s.tms";
447  $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
448  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
449  $sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
450  $sql .= " AND s.client IN (".Societe::CUSTOMER.", ".Societe::PROSPECT.", ".Societe::CUSTOMER_AND_PROSPECT.")";
451  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
452  if ($socid) $sql .= " AND s.rowid = $socid";
453  $sql .= " ORDER BY s.tms DESC";
454  $sql .= $db->plimit($max, 0);
455 
456  $resql = $db->query($sql);
457  if ($resql) {
458  if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
459  $header = "BoxTitleLastCustomersOrProspects";
460  }
461  elseif (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
462  $header = "BoxTitleLastModifiedProspects";
463  }
464  else {
465  $header = "BoxTitleLastModifiedCustomers";
466  }
467 
468  $num = $db->num_rows($resql);
469  startSimpleTable($langs->trans($header, min($max, $num)), "societe/list.php", "type=p,c", 1);
470 
471  if ($num) {
472  $i = 0;
473 
474  while ($i < $num && $i < $max) {
475  $objp = $db->fetch_object($resql);
476 
477  $companystatic->id = $objp->socid;
478  $companystatic->name = $objp->name;
479  $companystatic->name_alias = $objp->name_alias;
480  $companystatic->code_client = $objp->code_client;
481  $companystatic->code_compta = $objp->code_compta;
482  $companystatic->client = $objp->client;
483  $companystatic->code_fournisseur = $objp->code_fournisseur;
484  $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
485  $companystatic->fournisseur = $objp->fournisseur;
486  $companystatic->logo = $objp->logo;
487  $companystatic->email = $objp->email;
488  $companystatic->entity = $objp->entity;
489  $companystatic->canvas = $objp->canvas;
490 
491  print '<tr class="oddeven">';
492  print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
493  print '<td class="nowrap">';
494  //print $companystatic->getLibCustProspStatut();
495 
496  $obj = $companystatic;
497  $s = '';
498  if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
499  {
500  $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>';
501  }
502  if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
503  {
504  $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>';
505  }
506  /*
507  if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur)
508  {
509  $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>';
510  }*/
511  print $s;
512 
513  print '</td>';
514  print '<td class="right nowrap tddate">'.dol_print_date($db->jdate($objp->tms), 'day').'</td>';
515  print '</tr>';
516 
517  $i++;
518  }
519  }
520 
521  addSummaryTableLine(3, $num);
522  finishSimpleTable(true);
523 
524  $db->free($resql);
525  } else {
526  dol_print_error($db);
527  }
528 }
529 
530 
531 /*
532  * Last suppliers
533  */
534 if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) {
535  $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
536  $sql .= ", s.code_client, s.code_compta, s.client";
537  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
538  $sql .= ", s.logo, s.email, s.entity";
539  $sql .= ", s.canvas";
540  $sql .= ", s.datec as dc, s.tms as dm";
541  $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
542  if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
543  $sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
544  $sql .= " AND s.fournisseur = ".Societe::SUPPLIER;
545  if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
546  if ($socid) $sql .= " AND s.rowid = ".$socid;
547  $sql .= " ORDER BY s.datec DESC";
548  $sql .= $db->plimit($max, 0);
549 
550  $resql = $db->query($sql);
551  if ($resql) {
552  $num = $db->num_rows($resql);
553  startSimpleTable($langs->trans("BoxTitleLastModifiedSuppliers", min($max, $num)), "societe/list.php", "type=f", 1);
554 
555  if ($num) {
556  $i = 0;
557  while ($i < $num && $i < $max) {
558  $objp = $db->fetch_object($resql);
559 
560  $companystatic->id = $objp->socid;
561  $companystatic->name = $objp->name;
562  $companystatic->name_alias = $objp->name_alias;
563  $companystatic->code_client = $objp->code_client;
564  $companystatic->code_compta = $objp->code_compta;
565  $companystatic->client = $objp->client;
566  $companystatic->code_fournisseur = $objp->code_fournisseur;
567  $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
568  $companystatic->fournisseur = $objp->fournisseur;
569  $companystatic->logo = $objp->logo;
570  $companystatic->email = $objp->email;
571  $companystatic->entity = $objp->entity;
572  $companystatic->canvas = $objp->canvas;
573 
574  print '<tr class="oddeven">';
575  print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
576  print '<td>';
577 
578  $obj = $companystatic;
579  $s = '';
580  /*if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
581  {
582  $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>';
583  }
584  if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
585  {
586  $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>';
587  }*/
588  if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur)
589  {
590  $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>';
591  }
592  print $s;
593 
594  print '</td>';
595  print '<td class="right tddate">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
596  print '</tr>';
597 
598  $i++;
599  }
600  }
601 
602  addSummaryTableLine(3, $num);
603  finishSimpleTable(true);
604 
605  $db->free($resql);
606  } else {
607  dol_print_error($db);
608  }
609 }
610 
611 
612 /*
613  * Last actions
614  */
615 if ($user->rights->agenda->myactions->read) {
617 }
618 
619 
620 /*
621  * Actions to do
622  */
623 if ($user->rights->agenda->myactions->read) {
625 }
626 
627 
628 /*
629  * Latest contracts
630  */
631 if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
632  $staticcontrat = new Contrat($db);
633 
634  $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
635  $sql .= ", s.code_client, s.code_compta, s.client";
636  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
637  $sql .= ", s.logo, s.email, s.entity";
638  $sql .= ", s.canvas";
639  $sql .= ", c.statut, c.rowid as contratid, p.ref, c.fin_validite as datefin, c.date_cloture as dateclo";
640  $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
641  $sql .= ", ".MAIN_DB_PREFIX."contrat as c";
642  $sql .= ", ".MAIN_DB_PREFIX."product as p";
643  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
644  $sql .= " WHERE c.entity IN (".getEntity($staticcontrat->element).")";
645  $sql .= " AND c.fk_soc = s.rowid";
646  $sql .= " AND c.fk_product = p.rowid";
647  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
648  if ($socid) $sql .= " AND s.rowid = ".$socid;
649  $sql .= " ORDER BY c.tms DESC";
650  $sql .= $db->plimit($max + 1, 0);
651 
652  $resql = $db->query($sql);
653  if ($resql) {
654  $num = $db->num_rows($resql);
655  startSimpleTable($langs->trans("LastContracts", $max), "", "", 2);
656 
657  if ($num > 0) {
658  $i = 0;
659 
660  while ($i < $num) {
661  $obj = $db->fetch_object($resql);
662 
663  $companystatic->id = $obj->socid;
664  $companystatic->name = $obj->name;
665  $companystatic->name_alias = $obj->name_alias;
666  $companystatic->code_client = $obj->code_client;
667  $companystatic->code_compta = $obj->code_compta;
668  $companystatic->client = $obj->client;
669  $companystatic->code_fournisseur = $obj->code_fournisseur;
670  $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
671  $companystatic->fournisseur = $obj->fournisseur;
672  $companystatic->logo = $obj->logo;
673  $companystatic->email = $obj->email;
674  $companystatic->entity = $obj->entity;
675  $companystatic->canvas = $obj->canvas;
676 
677  $staticcontrat->id = $obj->contratid;
678  $staticcontrat->ref = $obj->ref;
679 
680  print '<tr class="oddeven">';
681  print '<td>'.$staticcontrat->getNomUrl(1).'</td>';
682  print '<td>'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
683  print '<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).'</td>';
684  print '</tr>';
685 
686  $i++;
687  }
688  }
689 
690  addSummaryTableLine(2, $num);
691  finishSimpleTable(true);
692 
693  $db->free($resql);
694  } else {
695  dol_print_error($db);
696  }
697 }
698 
699 
700 /*
701  * Opened (validated) proposals
702  */
703 if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
704  $sql = "SELECT p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
705  $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
706  $sql .= ", s.code_client, s.code_compta, s.client";
707  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
708  $sql .= ", s.logo, s.email, s.entity";
709  $sql .= ", s.canvas";
710  $sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
711  $sql .= ", ".MAIN_DB_PREFIX."societe as s";
712  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
713  $sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")";
714  $sql .= " AND p.fk_soc = s.rowid";
715  $sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED;
716  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
717  if ($socid) $sql .= " AND s.rowid = ".$socid;
718  $sql .= " ORDER BY p.rowid DESC";
719 
720  $resql = $db->query($sql);
721  if ($resql) {
722  $total = $total_ttc = 0;
723  $num = $db->num_rows($resql);
724  $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
725  startSimpleTable("ProposalsOpened", "comm/propal/list.php", "search_status=1", 4, $num);
726 
727  if ($num > 0) {
728  $i = 0;
729  $othernb = 0;
730 
731  while ($i < $nbofloop) {
732  $obj = $db->fetch_object($resql);
733 
734  if ($i >= $max) {
735  $othernb += 1;
736  $i++;
737  $total += $obj->total_ht;
738  $total_ttc += $obj->total_ttc;
739  continue;
740  }
741 
742  $propalstatic->id = $obj->propalid;
743  $propalstatic->ref = $obj->ref;
744  $propalstatic->ref_client = $obj->ref_client;
745  $propalstatic->total_ht = $obj->total_ht;
746  $propalstatic->total_tva = $obj->total_tva;
747  $propalstatic->total_ttc = $obj->total_ttc;
748 
749  $companystatic->id = $obj->socid;
750  $companystatic->name = $obj->name;
751  $companystatic->name_alias = $obj->name_alias;
752  $companystatic->code_client = $obj->code_client;
753  $companystatic->code_compta = $obj->code_compta;
754  $companystatic->client = $obj->client;
755  $companystatic->code_fournisseur = $obj->code_fournisseur;
756  $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
757  $companystatic->fournisseur = $obj->fournisseur;
758  $companystatic->logo = $obj->logo;
759  $companystatic->email = $obj->email;
760  $companystatic->entity = $obj->entity;
761  $companystatic->canvas = $obj->canvas;
762 
763  $filename = dol_sanitizeFileName($obj->ref);
764  $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
765  $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
766  $warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
767 
768  print '<tr class="oddeven">';
769 
770  print '<td class="nowrap" width="140">';
771  print '<table class="nobordernopadding"><tr class="nocellnopadd">';
772  print '<td class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>';
773  print '<td width="18" class="nobordernopadding nowrap">'.$warning.'</td>';
774  print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>';
775  print '</tr>';
776  print '</table>';
777  print '</td>';
778 
779  print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
780  print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
781  print '<td class="right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
782  print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
783 
784  print '</tr>';
785 
786  $i++;
787  $total += $obj->total_ht;
788  $total_ttc += $obj->total_ttc;
789  }
790 
791  if ($othernb) {
792  print '<tr class="oddeven">';
793  print '<td class="nowrap" colspan="5">';
794  print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
795  print '</td>';
796  print "</tr>\n";
797  }
798  }
799 
800  addSummaryTableLine(5, $num, $nbofloop, empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $total_ttc : $total, "NoProposal", true);
801  finishSimpleTable(true);
802 
803  $db->free($resql);
804  } else {
805  dol_print_error($db);
806  }
807 }
808 
809 
810 /*
811  * Opened (validated) order
812  */
813 if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
814  $sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
815  $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
816  $sql .= ", s.code_client, s.code_compta, s.client";
817  $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
818  $sql .= ", s.logo, s.email, s.entity";
819  $sql .= ", s.canvas";
820  $sql .= " FROM ".MAIN_DB_PREFIX."commande as c";
821  $sql .= ", ".MAIN_DB_PREFIX."societe as s";
822  if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
823  $sql .= " WHERE c.entity IN (".getEntity($orderstatic->element).")";
824  $sql .= " AND c.fk_soc = s.rowid";
825  $sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_SHIPMENTONPROCESS.")";
826  if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
827  if ($socid) $sql .= " AND s.rowid = ".$socid;
828  $sql .= " ORDER BY c.rowid DESC";
829 
830  $resql = $db->query($sql);
831  if ($resql) {
832  $total = $total_ttc = 0;
833  $num = $db->num_rows($resql);
834  $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
835  startSimpleTable("OrdersOpened", "commande/list.php", "search_status=".Commande::STATUS_VALIDATED, 4, $num);
836 
837  if ($num > 0) {
838  $i = 0;
839  $othernb = 0;
840 
841  while ($i < $nbofloop) {
842  $obj = $db->fetch_object($resql);
843 
844  if ($i >= $max) {
845  $othernb += 1;
846  $i++;
847  $total += $obj->total_ht;
848  $total_ttc += $obj->total_ttc;
849  continue;
850  }
851 
852  $orderstatic->id = $obj->commandeid;
853  $orderstatic->ref = $obj->ref;
854  $orderstatic->ref_client = $obj->ref_client;
855  $orderstatic->total_ht = $obj->total_ht;
856  $orderstatic->total_tva = $obj->total_tva;
857  $orderstatic->total_ttc = $obj->total_ttc;
858 
859  $companystatic->id = $obj->socid;
860  $companystatic->name = $obj->name;
861  $companystatic->name_alias = $obj->name_alias;
862  $companystatic->code_client = $obj->code_client;
863  $companystatic->code_compta = $obj->code_compta;
864  $companystatic->client = $obj->client;
865  $companystatic->code_fournisseur = $obj->code_fournisseur;
866  $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
867  $companystatic->fournisseur = $obj->fournisseur;
868  $companystatic->logo = $obj->logo;
869  $companystatic->email = $obj->email;
870  $companystatic->entity = $obj->entity;
871  $companystatic->canvas = $obj->canvas;
872 
873  $filename = dol_sanitizeFileName($obj->ref);
874  $filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
875  $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
876  //$warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
877 
878  print '<tr class="oddeven">';
879 
880  print '<td class="nowrap" width="140">';
881  print '<table class="nobordernopadding"><tr class="nocellnopadd">';
882  print '<td class="nobordernopadding nowrap">'.$orderstatic->getNomUrl(1).'</td>';
883  print '<td width="18" class="nobordernopadding nowrap"></td>';
884  print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).'</td>';
885  print '</tr>';
886  print '</table>';
887  print '</td>';
888 
889  print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
890  print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
891  print '<td class="right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
892  print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>';
893 
894  print '</tr>';
895 
896  $i++;
897  $total += $obj->total_ht;
898  $total_ttc += $obj->total_ttc;
899  }
900 
901  if ($othernb) {
902  print '<tr class="oddeven">';
903  print '<td class="nowrap" colspan="5">';
904  print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
905  print '</td>';
906  print "</tr>\n";
907  }
908  }
909 
910  addSummaryTableLine(5, $num, $nbofloop, empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $total_ttc : $total, "None", true);
911  finishSimpleTable(true);
912 
913  $db->free($resql);
914  } else {
915  dol_print_error($db);
916  }
917 }
918 
919 print '</div>';
920 print '</div>';
921 print '</div>';
922 
923 $parameters = array('user' => $user);
924 $reshook = $hookmanager->executeHooks('dashboardCommercials', $parameters, $object); // Note that $action and $object may have been modified by hook
925 
926 // End of page
927 llxFooter();
928 $db->close();
const PROSPECT
Third party is a prospect.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_substr($string, $start, $length, $stringencoding= '', $trunconbytes=0)
Make a substring.
const STATUS_DRAFT
Draft status.
const CUSTOMER_AND_PROSPECT
Third party is a customer and a prospect.
dol_now($mode= 'auto')
Return date for now.
Class to manage contracts.
const STATUS_SHIPMENTONPROCESS
Shipment on process.
addSummaryTableLine($tableColumnCount, $num, $nbofloop=0, $total=0, $noneWord="None", $extraRightColumn=false)
Add a summary line to the current open table (&quot;None&quot;, &quot;XMoreLines&quot; or &quot;Total xxx&quot;) ...
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
finishSimpleTable($addLineBreak=false)
Add the correct HTML close tags for &quot;startSimpleTable(...)&quot; (use after the last table line) ...
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage hooks.
Class to manage generation of HTML components Only common components must be here.
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
Class to manage customers orders.
const STATUS_DRAFT
Draft status.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
show_array_last_actions_done($max=5)
Show last actions array.
Definition: agenda.lib.php:264
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
Class to manage predefined suppliers products.
Class to offer components to list and upload files.
print $_SERVER["PHP_SELF"]
Edit parameters.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated status.
print
Draft customers invoices.
Definition: index.php:89
const STATUS_DRAFT
Draft status.
Class to manage price ask supplier.
startSimpleTable($header, $link="", $arguments="", $emptyRows=0, $number=-1)
Start a table with headers and a optinal clickable number (don&#39;t forget to use &quot;finishSimpleTable()&quot; ...
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
show_array_actions_to_do($max=5)
Show actions to do array.
Definition: agenda.lib.php:158
llxFooter()
Empty footer.
Definition: wrapper.php:59
Class to manage proposals.