dolibarr  7.0.0-beta
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-2013 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
5  * Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
6  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
7  * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
8  * Copyright (C) 2016 Marcos García <marcosgdf@gmail.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 <http://www.gnu.org/licenses/>.
22  */
23 
30 require '../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
34 if (! empty($conf->commande->enabled))
35  require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
36 if (! empty($conf->commande->enabled))
37  require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
38 if (! empty($conf->tax->enabled))
39  require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
40 
41 // L'espace compta/treso doit toujours etre actif car c'est un espace partage
42 // par de nombreux modules (banque, facture, commande a facturer, etc...) independamment
43 // de l'utilisation de la compta ou non. C'est au sein de cet espace que chaque sous fonction
44 // est protegee par le droit qui va bien du module concerne.
45 //if (!$user->rights->compta->general->lire)
46 // accessforbidden();
47 
48 $langs->load("compta");
49 $langs->load("bills");
50 if (! empty($conf->commande->enabled))
51  $langs->load("orders");
52 
53 $action=GETPOST('action', 'alpha');
54 $bid=GETPOST('bid', 'int');
55 
56 // Security check
57 $socid='';
58 if ($user->societe_id > 0)
59 {
60  $action = '';
61  $socid = $user->societe_id;
62 }
63 
64 $max=3;
65 
66 $hookmanager->initHooks(array('invoiceindex'));
67 
68 /*
69  * Actions
70  */
71 
72 
73 /*
74  * View
75  */
76 
77 $now=dol_now();
78 
79 $facturestatic=new Facture($db);
80 $facturesupplierstatic=new FactureFournisseur($db);
81 
82 $form = new Form($db);
83 $formfile = new FormFile($db);
84 $thirdpartystatic = new Societe($db);
85 
86 llxHeader("",$langs->trans("AccountancyTreasuryArea"));
87 
88 print load_fiche_titre($langs->trans("AccountancyTreasuryArea"),'','title_accountancy.png');
89 
90 
91 print '<div class="fichecenter"><div class="fichethirdleft">';
92 
93 
94 if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
95 {
96  // Search customer invoices
97  if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
98  {
99  $listofsearchfields['search_invoice']=array('text'=>'CustomerInvoice');
100  }
101  // Search supplier invoices
102  if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
103  {
104  $listofsearchfields['search_supplier_invoice']=array('text'=>'SupplierInvoice');
105  }
106  if (! empty($conf->don->enabled) && $user->rights->don->lire)
107  {
108  $langs->load("donations");
109  $listofsearchfields['search_donation']=array('text'=>'Donation');
110  }
111 
112  if (count($listofsearchfields))
113  {
114  print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
115  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
116  print '<table class="noborder nohover centpercent">';
117  $i=0;
118  foreach($listofsearchfields as $key => $value)
119  {
120  if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
121  print '<tr '.$bc[false].'>';
122  print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'"></td>';
123  if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
124  print '</tr>';
125  $i++;
126  }
127  print '</table>';
128  print '</form>';
129  print '<br>';
130  }
131 }
132 
133 
137 if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
138 {
139  $sql = "SELECT f.facnumber";
140  $sql.= ", f.rowid, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.ref_client";
141  $sql.= ", f.type";
142  $sql.= ", s.nom as name";
143  $sql.= ", s.rowid as socid";
144  $sql.= ",s.code_client";
145  if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
146  $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
147  if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
148  $sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0";
149  $sql.= " AND f.entity = ".$conf->entity;
150  if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
151 
152  if ($socid)
153  {
154  $sql .= " AND f.fk_soc = $socid";
155  }
156  // Add where from hooks
157  $parameters=array();
158  $reshook=$hookmanager->executeHooks('printFieldListWhereCustomerDraft',$parameters);
159  $sql.=$hookmanager->resPrint;
160 
161  $resql = $db->query($sql);
162 
163  if ( $resql )
164  {
165  $var = false;
166  $num = $db->num_rows($resql);
167 
168  print '<table class="noborder" width="100%">';
169  print '<tr class="liste_titre">';
170  print '<th colspan="3">'.$langs->trans("CustomersDraftInvoices").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
171  if ($num)
172  {
173  $companystatic=new Societe($db);
174 
175  $i = 0;
176  $tot_ttc = 0;
177  while ($i < $num)
178  {
179  $obj = $db->fetch_object($resql);
180  print '<tr class="oddeven"><td class="nowrap">';
181  $facturestatic->ref=$obj->facnumber;
182  $facturestatic->id=$obj->rowid;
183  $facturestatic->total_ht=$obj->total_ht;
184  $facturestatic->total_tva=$obj->total_tva;
185  $facturestatic->total_ttc=$obj->total_ttc;
186  $facturestatic->ref_client=$obj->ref_client;
187  $facturestatic->type=$obj->type;
188  print $facturestatic->getNomUrl(1,'');
189  print '</td>';
190  print '<td class="nowrap">';
191  $companystatic->id=$obj->socid;
192  $companystatic->name=$obj->name;
193  $companystatic->client = 1;
194  $companystatic->code_client = $obj->code_client;
195  $companystatic->code_fournisseur = $obj->code_fournisseur;
196  print $companystatic->getNomUrl(1,'',16);
197  print '</td>';
198  print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td>';
199  print '</tr>';
200  $tot_ttc+=$obj->total_ttc;
201  $i++;
202 
203  }
204 
205  print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>';
206  print '<td colspan="2" align="right">'.price($tot_ttc).'</td>';
207  print '</tr>';
208  }
209  else
210  {
211  print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
212  }
213  print "</table><br>";
214  $db->free($resql);
215  }
216  else
217  {
218  dol_print_error($db);
219  }
220 }
221 
225 if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
226 {
227  $sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier";
228  $sql.= ", s.nom as name";
229  $sql.= ", s.rowid as socid";
230  $sql.= ", s.code_fournisseur";
231  $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
232  if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
233  $sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0";
234  $sql.= " AND f.entity = ".$conf->entity;
235  if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
236  if ($socid) $sql.= " AND f.fk_soc = ".$socid;
237  // Add where from hooks
238  $parameters=array();
239  $reshook=$hookmanager->executeHooks('printFieldListWhereSupplierDraft',$parameters);
240  $sql.=$hookmanager->resPrint;
241  $resql = $db->query($sql);
242 
243  if ( $resql )
244  {
245  $num = $db->num_rows($resql);
246 
247  print '<table class="noborder" width="100%">';
248  print '<tr class="liste_titre">';
249  print '<th colspan="3">'.$langs->trans("SuppliersDraftInvoices").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
250  if ($num)
251  {
252  $companystatic=new Societe($db);
253 
254  $i = 0;
255  $tot_ttc = 0;
256  while ($i < $num)
257  {
258  $obj = $db->fetch_object($resql);
259  print '<tr class="oddeven"><td class="nowrap">';
260  $facturesupplierstatic->ref=$obj->ref;
261  $facturesupplierstatic->id=$obj->rowid;
262  $facturesupplierstatic->total_ht=$obj->total_ht;
263  $facturesupplierstatic->total_tva=$obj->total_tva;
264  $facturesupplierstatic->total_ttc=$obj->total_ttc;
265  $facturesupplierstatic->ref_supplier=$obj->ref_supplier;
266  $facturesupplierstatic->type=$obj->type;
267  print $facturesupplierstatic->getNomUrl(1,'',16);
268  print '</td>';
269  print '<td>';
270  $companystatic->id=$obj->socid;
271  $companystatic->name=$obj->name;
272  $companystatic->fournisseur = 1;
273  $companystatic->code_client = $obj->code_client;
274  $companystatic->code_fournisseur = $obj->code_fournisseur;
275  print $companystatic->getNomUrl(1,'supplier',16);
276  print '</td>';
277  print '<td align="right">'.price($obj->total_ttc).'</td>';
278  print '</tr>';
279  $tot_ttc+=$obj->total_ttc;
280  $i++;
281  }
282 
283  print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>';
284  print '<td colspan="2" align="right">'.price($tot_ttc).'</td>';
285  print '</tr>';
286  }
287  else
288  {
289  print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
290  }
291  print "</table><br>";
292  $db->free($resql);
293  }
294  else
295  {
296  dol_print_error($db);
297  }
298 }
299 
300 
301 print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
302 
303 
304 // Last modified customer invoices
305 if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
306 {
307  $langs->load("boxes");
308  $facstatic=new Facture($db);
309 
310  $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
311  $sql.= ", f.date_lim_reglement as datelimite";
312  $sql.= ", s.nom as name";
313  $sql.= ", s.rowid as socid";
314  $sql.= ", s.code_client";
315  $sql.= ", sum(pf.amount) as am";
316  $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
317  $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
318  if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
319  $sql.= " WHERE s.rowid = f.fk_soc";
320  $sql.= " AND f.entity = ".$conf->entity;
321  if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
322  if ($socid) $sql.= " AND f.fk_soc = ".$socid;
323  // Add where from hooks
324  $parameters=array();
325  $reshook=$hookmanager->executeHooks('printFieldListWhereCustomerLastModified',$parameters);
326  $sql.=$hookmanager->resPrint;
327 
328  $sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
329  $sql.= " ORDER BY f.tms DESC ";
330  $sql.= $db->plimit($max, 0);
331 
332  $resql = $db->query($sql);
333  if ($resql)
334  {
335  $var=false;
336  $num = $db->num_rows($resql);
337  $i = 0;
338 
339  print '<table class="noborder" width="100%">';
340  print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BoxTitleLastCustomerBills",$max).'</th>';
341  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>';
342  print '<th align="right">'.$langs->trans("AmountTTC").'</th>';
343  print '<th align="right">'.$langs->trans("DateModificationShort").'</th>';
344  print '<th width="16">&nbsp;</th>';
345  print '</tr>';
346  if ($num)
347  {
348  $total_ttc = $totalam = $total = 0;
349  while ($i < $num && $i < $conf->liste_limit)
350  {
351  $obj = $db->fetch_object($resql);
352 
353  print '<tr class="oddeven">';
354  print '<td class="nowrap">';
355 
356  print '<table class="nobordernopadding"><tr class="nocellnopadd">';
357  print '<td width="110" class="nobordernopadding nowrap">';
358  $facturestatic->ref=$obj->facnumber;
359  $facturestatic->id=$obj->rowid;
360  $facturestatic->total_ht=$obj->total_ht;
361  $facturestatic->total_tva=$obj->total_tva;
362  $facturestatic->total_ttc=$obj->total_ttc;
363  $facturestatic->statut = $obj->fk_statut;
364  $facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
365  $facturestatic->type=$obj->type;
366  print $facturestatic->getNomUrl(1,'');
367  print '</td>';
368  print '<td width="20" class="nobordernopadding nowrap">';
369  if ($facturestatic->hasDelay()) {
370  print img_warning($langs->trans("Late"));
371  }
372  print '</td>';
373  print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
374  $filename=dol_sanitizeFileName($obj->facnumber);
375  $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
376  $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
377  print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
378  print '</td></tr></table>';
379 
380  print '</td>';
381  print '<td align="left">';
382  $thirdpartystatic->id=$obj->socid;
383  $thirdpartystatic->name=$obj->name;
384  $thirdpartystatic->client=1;
385  $thirdpartystatic->code_client = $obj->code_client;
386  $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
387  print $thirdpartystatic->getNomUrl(1,'customer',44);
388  print '</td>';
389  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
390  print '<td align="right">'.price($obj->total_ttc).'</td>';
391  print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
392  print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
393  print '</tr>';
394 
395  $total_ttc += $obj->total_ttc;
396  $total += $obj->total_ht;
397  $totalam += $obj->am;
398 
399  $i++;
400  }
401  }
402  else
403  {
404  $colspan=5;
405  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
406  print '<tr class="oddeven"><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
407  }
408  print '</table><br>';
409  $db->free($resql);
410  }
411  else
412  {
413  dol_print_error($db);
414  }
415 }
416 
417 
418 
419 // Last modified supplier invoices
420 if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
421 {
422  $langs->load("boxes");
423  $facstatic=new FactureFournisseur($db);
424 
425  $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye";
426  $sql.= ", s.nom as name";
427  $sql.= ", s.rowid as socid";
428  $sql.= ", s.code_fournisseur";
429  $sql.= ", SUM(pf.amount) as am";
430  $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
431  $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
432  if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
433  $sql.= " WHERE s.rowid = ff.fk_soc";
434  $sql.= " AND ff.entity = ".$conf->entity;
435  if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
436  if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
437  // Add where from hooks
438  $parameters=array();
439  $reshook=$hookmanager->executeHooks('printFieldListWhereSupplierLastModified',$parameters);
440  $sql.=$hookmanager->resPrint;
441 
442  $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid, s.code_fournisseur";
443  $sql.= " ORDER BY ff.tms DESC ";
444  $sql.= $db->plimit($max, 0);
445 
446  $resql=$db->query($sql);
447  if ($resql)
448  {
449  $var=false;
450  $num = $db->num_rows($resql);
451 
452  print '<table class="noborder" width="100%">';
453  print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BoxTitleLastSupplierBills",$max).'</th>';
454  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>';
455  print '<th align="right">'.$langs->trans("AmountTTC").'</th>';
456  print '<th align="right">'.$langs->trans("DateModificationShort").'</th>';
457  print '<th width="16">&nbsp;</th>';
458  print "</tr>\n";
459  if ($num)
460  {
461  $i = 0;
462  $total = $total_ttc = $totalam = 0;
463  while ($i < $num)
464  {
465  $obj = $db->fetch_object($resql);
466  print '<tr class="oddeven"><td>';
467  $facstatic->ref=$obj->ref;
468  $facstatic->id = $obj->rowid;
469  $facstatic->total_ht = $obj->total_ht;
470  $facstatic->total_tva = $obj->total_tva;
471  $facstatic->total_ttc = $obj->total_ttc;
472  print $facstatic->getNomUrl(1,'');
473  print '</td>';
474  print '<td>';
475  $thirdpartystatic->id=$obj->socid;
476  $thirdpartystatic->name=$obj->name;
477  $thirdpartystatic->fournisseur=1;
478  $thirdpartystatic->code_client = $obj->code_client;
479  $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
480  print $thirdpartystatic->getNomUrl(1,'supplier',44);
481  print '</td>';
482  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
483  print '<td align="right">'.price($obj->total_ttc).'</td>';
484  print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
485  print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>';
486  print '</tr>';
487  $total += $obj->total_ht;
488  $total_ttc += $obj->total_ttc;
489  $totalam += $obj->am;
490  $i++;
491  $var = !$var;
492  }
493  }
494  else
495  {
496  $colspan=5;
497  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
498  print '<tr class="oddeven"><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
499  }
500  print '</table><br>';
501  }
502  else
503  {
504  dol_print_error($db);
505  }
506 }
507 
508 
509 
510 // Last donations
511 if (! empty($conf->don->enabled) && $user->rights->societe->lire)
512 {
513  include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
514 
515  $langs->load("boxes");
516  $donationstatic=new Don($db);
517 
518  $sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut";
519  $sql.= " FROM ".MAIN_DB_PREFIX."don as d";
520  $sql.= " WHERE d.entity IN (".getEntity('donation').")";
521  // Add where from hooks
522  $parameters=array();
523  $reshook=$hookmanager->executeHooks('printFieldListWhereLastDonations',$parameters);
524  $sql.=$hookmanager->resPrint;
525 
526  $sql.= $db->order("d.tms","DESC");
527  $sql.= $db->plimit($max, 0);
528 
529  $result = $db->query($sql);
530  if ($result)
531  {
532  $var=false;
533  $num = $db->num_rows($result);
534 
535  $i = 0;
536 
537  print '<table class="noborder" width="100%">';
538  print '<tr class="liste_titre">';
539  print '<th>'.$langs->trans("BoxTitleLastModifiedDonations",$max).'</th>';
540  print '<th></th>';
541  print '<th align="right">'.$langs->trans("AmountTTC").'</th>';
542  print '<th align="right">'.$langs->trans("DateModificationShort").'</th>';
543  print '<th width="16">&nbsp;</th>';
544  print '</tr>';
545  if ($num)
546  {
547  $var = true;
548  $total_ttc = $totalam = $total = 0;
549 
550  $var=true;
551  while ($i < $num && $i < $max)
552  {
553  $objp = $db->fetch_object($result);
554 
555  $donationstatic->id=$objp->rowid;
556  $donationstatic->ref=$objp->rowid;
557  $donationstatic->lastname=$objp->lastname;
558  $donationstatic->firstname=$objp->firstname;
559 
560  $label=$donationstatic->getFullName($langs);
561  if ($objp->societe) $label.=($label?' - ':'').$objp->societe;
562 
563  print '<tr class="oddeven">';
564  print '<td>'.$donationstatic->getNomUrl(1).'</td>';
565  print '<td>'.$label.'</td>';
566  print '<td align="right">'.price($objp->amount).'</td>';
567  print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>';
568  print '<td>'.$donationstatic->LibStatut($objp->fk_statut,3).'</td>';
569  print '</tr>';
570 
571  $i++;
572  }
573 
574  }
575  else
576  {
577  print '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
578  }
579  print '</table><br>';
580  }
581  else dol_print_error($db);
582 }
583 
587 if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
588 {
589  if (!$socid)
590  {
591  $chargestatic=new ChargeSociales($db);
592 
593  $sql = "SELECT c.rowid, c.amount, c.date_ech, c.paye,";
594  $sql.= " cc.libelle,";
595  $sql.= " SUM(pc.amount) as sumpaid";
596  $sql.= " FROM (".MAIN_DB_PREFIX."c_chargesociales as cc, ".MAIN_DB_PREFIX."chargesociales as c)";
597  $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = c.rowid";
598  $sql.= " WHERE c.fk_type = cc.id";
599  $sql.= " AND c.entity = ".$conf->entity;
600  $sql.= " AND c.paye = 0";
601  // Add where from hooks
602  $parameters=array();
603  $reshook=$hookmanager->executeHooks('printFieldListWhereSocialContributions',$parameters);
604  $sql.=$hookmanager->resPrint;
605 
606  $sql.= " GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
607 
608  $resql = $db->query($sql);
609  if ( $resql )
610  {
611  $var = false;
612  $num = $db->num_rows($resql);
613 
614  print '<table class="noborder" width="100%">';
615  print '<tr class="liste_titre">';
616  print '<th>'.$langs->trans("ContributionsToPay").($num?' <a href="'.DOL_URL_ROOT.'/compta/sociales/index.php?status=0"><span class="badge">'.$num.'</span></a>':'').'</th>';
617  print '<th align="center">'.$langs->trans("DateDue").'</th>';
618  print '<th align="right">'.$langs->trans("AmountTTC").'</th>';
619  print '<th align="right">'.$langs->trans("Paid").'</th>';
620  print '<th align="center" width="16">&nbsp;</th>';
621  print '</tr>';
622  if ($num)
623  {
624  $i = 0;
625  $tot_ttc=0;
626  while ($i < $num)
627  {
628  $obj = $db->fetch_object($resql);
629 
630  $chargestatic->id=$obj->rowid;
631  $chargestatic->ref=$obj->libelle;
632  $chargestatic->lib=$obj->libelle;
633  $chargestatic->paye=$obj->paye;
634 
635  print '<tr class="oddeven">';
636  print '<td>'.$chargestatic->getNomUrl(1).'</td>';
637  print '<td align="center">'.dol_print_date($db->jdate($obj->date_ech),'day').'</td>';
638  print '<td align="right">'.price($obj->amount).'</td>';
639  print '<td align="right">'.price($obj->sumpaid).'</td>';
640  print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>';
641  print '</tr>';
642  $tot_ttc+=$obj->amount;
643  $var = !$var;
644  $i++;
645  }
646 
647  print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("Total").'</td>';
648  print '<td align="right">'.price($tot_ttc).'</td>';
649  print '<td align="right"></td>';
650  print '<td align="right">&nbsp;</td>';
651  print '</tr>';
652  }
653  else
654  {
655  print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
656  }
657  print "</table><br>";
658  $db->free($resql);
659  }
660  else
661  {
662  dol_print_error($db);
663  }
664  }
665 }
666 
667 /*
668  * Customers orders to be billed
669  */
670 if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER))
671 {
672  $commandestatic=new Commande($db);
673  $langs->load("orders");
674 
675  $sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc";
676  $sql.= ", s.nom as name";
677  $sql.= ", s.rowid as socid";
678  $sql.= ", s.code_client";
679  $sql.= ", c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.tva as total_tva, c.total_ttc";
680  $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
681  if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
682  $sql.= ", ".MAIN_DB_PREFIX."commande as c";
683  $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
684  $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
685  $sql.= " WHERE c.fk_soc = s.rowid";
686  $sql.= " AND c.entity = ".$conf->entity;
687  if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
688  if ($socid) $sql.= " AND c.fk_soc = ".$socid;
689  $sql.= " AND c.fk_statut = 3";
690  $sql.= " AND c.facture = 0";
691  // Add where from hooks
692  $parameters=array();
693  $reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
694  $sql.=$hookmanager->resPrint;
695 
696  $sql.= " GROUP BY s.nom, s.rowid, s.code_client, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
697 
698  $resql = $db->query($sql);
699  if ( $resql )
700  {
701  $var=false;
702  $num = $db->num_rows($resql);
703 
704  if ($num)
705  {
706  $i = 0;
707  print '<table class="noborder" width="100%">';
708  print "<tr class=\"liste_titre\">";
709  print '<th colspan="2">'.$langs->trans("OrdersDeliveredToBill").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=3&amp;billed=0"><span class="badge">'.$num.'</span></a></th>';
710  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>';
711  print '<th align="right">'.$langs->trans("AmountTTC").'</th>';
712  print '<th align="right">'.$langs->trans("ToBill").'</th>';
713  print '<th align="center" width="16">&nbsp;</th>';
714  print '</tr>';
715  $tot_ht=$tot_ttc=$tot_tobill=0;
716  $societestatic = new Societe($db);
717  while ($i < $num)
718  {
719  $obj = $db->fetch_object($resql);
720 
721  print '<tr class="oddeven">';
722  print '<td class="nowrap">';
723 
724  $commandestatic->id=$obj->rowid;
725  $commandestatic->ref=$obj->ref;
726 
727  print '<table class="nobordernopadding"><tr class="nocellnopadd">';
728  print '<td width="110" class="nobordernopadding nowrap">';
729  print $commandestatic->getNomUrl(1);
730  print '</td>';
731  print '<td width="20" class="nobordernopadding nowrap">';
732  print '&nbsp;';
733  print '</td>';
734  print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
735  $filename=dol_sanitizeFileName($obj->ref);
736  $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
737  $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
738  print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
739  print '</td></tr></table>';
740 
741  print '</td>';
742 
743  print '<td align="left">';
744  $societestatic->id=$obj->socid;
745  $societestatic->name=$obj->name;
746  $societestatic->client=1;
747  $societestatic->code_client = $obj->code_client;
748  $societestatic->code_fournisseur = $obj->code_fournisseur;
749  print $societestatic->getNomUrl(1,'customer',44);
750  print '</td>';
751  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
752  print '<td align="right">'.price($obj->total_ttc).'</td>';
753  print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>';
754  print '<td>'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,3).'</td>';
755  print '</tr>';
756  $tot_ht += $obj->total_ht;
757  $tot_ttc += $obj->total_ttc;
758  //print "x".$tot_ttc."z".$obj->tot_fttc;
759  $tot_tobill += ($obj->total_ttc-$obj->tot_fttc);
760  $i++;
761 
762  }
763 
764  print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
765  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($tot_ht).'</td>';
766  print '<td align="right">'.price($tot_ttc).'</td>';
767  print '<td align="right">'.price($tot_tobill).'</td>';
768  print '<td>&nbsp;</td>';
769  print '</tr>';
770  print '</table><br>';
771  }
772  $db->free($resql);
773  }
774  else
775  {
776  dol_print_error($db);
777  }
778 }
779 
780 /*
781  * Unpaid customers invoices
782  */
783 if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
784 {
785  $facstatic=new Facture($db);
786 
787  $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
788  $sql.= ", f.date_lim_reglement as datelimite";
789  $sql.= ", s.nom as name";
790  $sql.= ", s.rowid as socid";
791  $sql.= ", s.code_client";
792  $sql.= ", sum(pf.amount) as am";
793  $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
794  $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
795  if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
796  $sql.= " WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = 1";
797  $sql.= " AND f.entity = ".$conf->entity;
798  if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
799  if ($socid) $sql.= " AND f.fk_soc = ".$socid;
800  // Add where from hooks
801  $parameters=array();
802  $reshook=$hookmanager->executeHooks('printFieldListWhereCustomerUnpaid',$parameters);
803  $sql.=$hookmanager->resPrint;
804 
805  $sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
806  $sql.= " ORDER BY f.datef ASC, f.facnumber ASC";
807 
808  $resql = $db->query($sql);
809  if ($resql)
810  {
811  $var=false;
812  $num = $db->num_rows($resql);
813  $i = 0;
814 
815  print '<div class="div-table-responsive-no-min">';
816  print '<table class="noborder" width="100%">';
817  print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BillsCustomersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?search_status=1"><span class="badge">'.$num.'</span></a></th>';
818  print '<th align="right">'.$langs->trans("DateDue").'</th>';
819  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>';
820  print '<th align="right">'.$langs->trans("AmountTTC").'</th>';
821  print '<th align="right">'.$langs->trans("Received").'</th>';
822  print '<th width="16">&nbsp;</th>';
823  print '</tr>';
824  if ($num)
825  {
826  $societestatic = new Societe($db);
827  $total_ttc = $totalam = $total = 0;
828  while ($i < $num && $i < $conf->liste_limit)
829  {
830  $obj = $db->fetch_object($resql);
831 
832  print '<tr class="oddeven">';
833  print '<td class="nowrap">';
834 
835  print '<table class="nobordernopadding"><tr class="nocellnopadd">';
836  print '<td width="110" class="nobordernopadding nowrap">';
837  $facturestatic->ref=$obj->facnumber;
838  $facturestatic->id=$obj->rowid;
839  $facturestatic->total_ht=$obj->total_ht;
840  $facturestatic->total_tva=$obj->total_tva;
841  $facturestatic->total_ttc=$obj->total_ttc;
842  $facturestatic->type=$obj->type;
843  $facturestatic->statut = $obj->fk_statut;
844  $facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
845  print $facturestatic->getNomUrl(1,'');
846  print '</td>';
847  print '<td width="20" class="nobordernopadding nowrap">';
848  if ($facturestatic->hasDelay()) {
849  print img_warning($langs->trans("Late"));
850  }
851  print '</td>';
852  print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
853  $filename=dol_sanitizeFileName($obj->facnumber);
854  $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
855  $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
856  print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
857  print '</td></tr></table>';
858 
859  print '</td>';
860  print '<td align="left">' ;
861  $societestatic->id=$obj->socid;
862  $societestatic->name=$obj->name;
863  $societestatic->client=1;
864  $societestatic->code_client = $obj->code_client;
865  $societestatic->code_fournisseur = $obj->code_fournisseur;
866  print $societestatic->getNomUrl(1,'customer',44);
867  print '</td>';
868  print '<td align="right">'.dol_print_date($db->jdate($obj->datelimite),'day').'</td>';
869  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
870  print '<td align="right">'.price($obj->total_ttc).'</td>';
871  print '<td align="right">'.price($obj->am).'</td>';
872  print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
873  print '</tr>';
874 
875  $total_ttc += $obj->total_ttc;
876  $total += $obj->total_ht;
877  $totalam += $obj->am;
878 
879  $i++;
880  }
881 
882  print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>';
883  print '<td>&nbsp;</td>';
884  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>';
885  print '<td align="right">'.price($total_ttc).'</td>';
886  print '<td align="right">'.price($totalam).'</td>';
887  print '<td>&nbsp;</td>';
888  print '</tr>';
889  }
890  else
891  {
892  $colspan=6;
893  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
894  print '<tr class="oddeven"><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
895  }
896  print '</table></div><br>';
897  $db->free($resql);
898  }
899  else
900  {
901  dol_print_error($db);
902  }
903 }
904 
905 /*
906  * Unpayed supplier invoices
907  */
908 if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
909 {
910  $facstatic=new FactureFournisseur($db);
911 
912  $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye";
913  $sql.= ", ff.date_lim_reglement";
914  $sql.= ", s.nom as name";
915  $sql.= ", s.rowid as socid";
916  $sql.= ", s.code_client";
917  $sql.= ", s.code_fournisseur";
918  $sql.= ", sum(pf.amount) as am";
919  $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
920  $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
921  if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
922  $sql.= " WHERE s.rowid = ff.fk_soc";
923  $sql.= " AND ff.entity = ".$conf->entity;
924  $sql.= " AND ff.paye = 0";
925  $sql.= " AND ff.fk_statut = 1";
926  if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
927  if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
928  // Add where from hooks
929  $parameters=array();
930  $reshook=$hookmanager->executeHooks('printFieldListWhereSupplierUnpaid',$parameters);
931  $sql.=$hookmanager->resPrint;
932 
933  $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,";
934  $sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur, ff.date_lim_reglement";
935  $sql.= " ORDER BY ff.date_lim_reglement ASC";
936 
937  $resql=$db->query($sql);
938  if ($resql)
939  {
940  $var=false;
941  $num = $db->num_rows($resql);
942 
943  print '<div class="div-table-responsive-no-min">';
944  print '<table class="noborder" width="100%">';
945  print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BillsSuppliersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php"><span class="badge">'.$num.'</span></a></th>';
946  print '<th align="right">'.$langs->trans("DateDue").'</th>';
947  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>';
948  print '<th align="right">'.$langs->trans("AmountTTC").'</th>';
949  print '<th align="right">'.$langs->trans("Paid").'</th>';
950  print '<th width="16">&nbsp;</th>';
951  print "</tr>\n";
952  $societestatic = new Societe($db);
953  if ($num)
954  {
955  $i = 0;
956  $total = $total_ttc = $totalam = 0;
957  while ($i < $num)
958  {
959  $obj = $db->fetch_object($resql);
960 
961  print '<tr class="oddeven"><td>';
962  $facstatic->ref=$obj->ref;
963  $facstatic->id = $obj->rowid;
964  $facstatic->total_ht = $obj->total_ht;
965  $facstatic->total_tva = $obj->total_tva;
966  $facstatic->total_ttc = $obj->total_ttc;
967  print $facstatic->getNomUrl(1,'');
968  print '</td>';
969  $societestatic->id=$obj->socid;
970  $societestatic->name=$obj->name;
971  $societestatic->client=0;
972  $societestatic->code_client = $obj->code_client;
973  $societestatic->code_fournisseur = $obj->code_fournisseur;
974  print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
975  print '<td align="right">'.dol_print_date($db->jdate($obj->date_lim_reglement),'day').'</td>';
976  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
977  print '<td align="right">'.price($obj->total_ttc).'</td>';
978  print '<td align="right">'.price($obj->am).'</td>';
979  print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>';
980  print '</tr>';
981  $total += $obj->total_ht;
982  $total_ttc += $obj->total_ttc;
983  $totalam += $obj->am;
984  $i++;
985  $var = !$var;
986  }
987 
988  print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>';
989  print '<td>&nbsp;</td>';
990  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>';
991  print '<td align="right">'.price($total_ttc).'</td>';
992  print '<td align="right">'.price($totalam).'</td>';
993  print '<td>&nbsp;</td>';
994  print '</tr>';
995  }
996  else
997  {
998  $colspan=6;
999  if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
1000  print '<tr class="oddeven"><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
1001  }
1002  print '</table></div><br>';
1003  }
1004  else
1005  {
1006  dol_print_error($db);
1007  }
1008 }
1009 
1010 
1011 
1012 // TODO Mettre ici recup des actions en rapport avec la compta
1014 if ($resql)
1015 {
1016  print '<table class="noborder" width="100%">';
1017  print '<tr class="liste_titre"><thcolspan="2">'.$langs->trans("TasksToDo").'</th>';
1018  print "</tr>\n";
1019  $var = true;
1020  $i = 0;
1021  while ($i < $db->num_rows($resql))
1022  {
1023  $obj = $db->fetch_object($resql);
1024 
1025 
1026  print "<tr ".$bc[$var]."><td>".dol_print_date($db->jdate($obj->da),"day")."</td>";
1027  print '<td><a href="action/card.php">'.$obj->libelle.' '.$obj->label.'</a></td></tr>';
1028  $i++;
1029  }
1030  $db->free($resql);
1031  print "</table><br>";
1032 }
1033 
1034 
1035 print '</div></div></div>';
1036 
1037 
1038 llxFooter();
1039 
1040 $db->close();
llxFooter()
Footer empty.
Definition: index.php:43
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
Class to manage suppliers invoices.
if(empty($reshook)) $form
View.
Definition: perms.php:103
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage generation of HTML components Only common components must be here.
Class to manage third parties objects (customers, suppliers, prospects...)
img_warning($titlealt= 'default', $moreatt= '')
Show warning logo.
llxHeader()
Header empty.
Definition: index.php:37
Class to manage customers orders.
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_now($mode='gmt')
Return date for now.
Class to offer components to list and upload files.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print
Draft customers invoices.
Definition: index.php:91
Class to manage donations.
Definition: don.class.php:35
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->societe->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)&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1013
Class to manage invoices.
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...