36require
'../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
54$langs->loadLangs(array(
'compta',
'bills'));
55if (isModEnabled(
'commande')) {
56 $langs->load(
"orders");
60$action =
GETPOST(
'action',
'aZ09');
65if ($user->socid > 0) {
67 $socid = $user->socid;
73$maxDraftCount = !
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
74$maxLatestEditCount = 5;
75$maxOpenCount = !
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
78$hookmanager->initHooks(array(
'invoiceindex'));
81$maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
99$thirdpartystatic =
new Societe($db);
101llxHeader(
"", $langs->trans(
"InvoicesArea"));
106print
'<div class="fichecenter"><div class="fichethirdleft">';
108if (isModEnabled(
'facture')) {
113if (isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) {
118if (isModEnabled(
'facture')) {
123if (isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) {
128print
'</div><div class="fichetwothirdright">';
132if (isModEnabled(
'facture') && $user->hasRight(
'facture',
'lire')) {
133 $langs->load(
"boxes");
134 $tmpinvoice =
new Facture($db);
136 $sql =
"SELECT f.rowid, f.ref, f.fk_statut as status, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms";
137 $sql .=
", f.date_lim_reglement as datelimite";
138 $sql .=
", s.nom as name";
139 $sql .=
", s.rowid as socid";
140 $sql .=
", s.code_client, s.code_compta, s.email";
141 $sql .=
", cc.rowid as country_id, cc.code as country_code";
142 $sql .=
", sum(pf.amount) as am";
143 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays, ".MAIN_DB_PREFIX.
"facture as f";
144 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf on f.rowid=pf.fk_facture";
145 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
146 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
148 $sql .=
" WHERE s.rowid = f.fk_soc";
149 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
150 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
151 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
154 $sql .=
" AND f.fk_soc = ".((int) $socid);
157 $parameters = array();
158 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerLastModified', $parameters);
159 $sql .= $hookmanager->resPrint;
161 $sql .=
" GROUP BY f.rowid, f.ref, f.fk_statut, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
162 $sql .=
" s.nom, s.rowid, s.code_client, s.code_compta, s.email,";
163 $sql .=
" cc.rowid, cc.code";
164 $sql .=
" ORDER BY f.tms DESC";
165 $sql .= $db->plimit($max, 0);
167 $resql = $db->query($sql);
169 $num = $db->num_rows($resql);
173 print
'<div class="div-table-responsive-no-min">';
174 print
'<table class="noborder centpercent">';
175 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastCustomerBills", $max).
'</th>';
177 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
179 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
180 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
181 print
'<th width="16"> </th>';
184 $total_ttc = $totalam = $total_ht = 0;
185 while ($i < $num && $i < $conf->liste_limit) {
186 $obj = $db->fetch_object($resql);
191 $total_ht += $obj->total_ht;
192 $total_ttc += $obj->total_ttc;
196 $tmpinvoice->ref = $obj->ref;
197 $tmpinvoice->id = $obj->rowid;
198 $tmpinvoice->total_ht = $obj->total_ht;
199 $tmpinvoice->total_tva = $obj->total_tva;
200 $tmpinvoice->total_ttc = $obj->total_ttc;
201 $tmpinvoice->statut = $obj->status;
202 $tmpinvoice->paye = $obj->paye;
203 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
204 $tmpinvoice->type = $obj->type;
206 $thirdpartystatic->id = $obj->socid;
207 $thirdpartystatic->name = $obj->name;
208 $thirdpartystatic->email = $obj->email;
209 $thirdpartystatic->country_id = $obj->country_id;
210 $thirdpartystatic->country_code = $obj->country_code;
211 $thirdpartystatic->email = $obj->email;
212 $thirdpartystatic->client = 1;
213 $thirdpartystatic->code_client = $obj->code_client;
215 $thirdpartystatic->code_compta = $obj->code_compta;
218 print
'<tr class="oddeven">';
219 print
'<td class="nowrap">';
221 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
223 print
'<td class="nobordernopadding nowraponall">';
224 print $tmpinvoice->getNomUrl(1,
'');
226 if ($tmpinvoice->hasDelay()) {
227 print
'<td width="20" class="nobordernopadding nowrap">';
231 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
234 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
235 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
236 print
'</td></tr></table>';
240 print
'<td class="tdoverflowmax150">';
241 print $thirdpartystatic->getNomUrl(1,
'customer', 44);
244 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
246 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
248 print
'<td class="right" title="'.dol_escape_htmltag($langs->trans(
"DateModificationShort").
' : '.
dol_print_date($db->jdate($obj->tms),
'dayhour',
'tzuserrel')).
'">'.
dol_print_date($db->jdate($obj->tms),
'day',
'tzuserrel').
'</td>';
250 print
'<td>'.$tmpinvoice->getLibStatut(3, $obj->am).
'</td>';
254 $total_ttc += $obj->total_ttc;
255 $total_ht += $obj->total_ht;
256 $totalam += $obj->am;
262 print
'<tr class="oddeven">';
263 print
'<td class="nowrap" colspan="5">';
264 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
273 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
275 print
'</table></div><br>';
284if ((isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"facture",
"lire")) || (isModEnabled(
'supplier_invoice') && $user->hasRight(
"supplier_invoice",
"lire"))) {
285 $langs->load(
"boxes");
288 $sql =
"SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier";
289 $sql .=
", s.nom as name";
290 $sql .=
", s.rowid as socid";
291 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.email";
292 $sql .=
", SUM(pf.amount) as am";
293 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
294 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
295 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
296 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
298 $sql .=
" WHERE s.rowid = ff.fk_soc";
299 $sql .=
" AND ff.entity = ".$conf->entity;
300 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
301 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
304 $sql .=
" AND ff.fk_soc = ".((int) $socid);
307 $parameters = array();
308 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierLastModified', $parameters);
309 $sql .= $hookmanager->resPrint;
311 $sql .=
" GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.type, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier,";
312 $sql .=
" s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur, s.email";
313 $sql .=
" ORDER BY ff.tms DESC ";
314 $sql .= $db->plimit($max, 0);
316 $resql = $db->query($sql);
318 $num = $db->num_rows($resql);
320 print
'<div class="div-table-responsive-no-min">';
321 print
'<table class="noborder centpercent">';
322 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastSupplierBills", $max).
'</th>';
324 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
326 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
327 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
328 print
'<th width="16"> </th>';
332 $total_ht = $total_ttc = $totalam = 0;
336 $obj = $db->fetch_object($resql);
341 $total_ht += $obj->total_ht;
342 $total_ttc += $obj->total_ttc;
346 $facstatic->ref = $obj->ref;
347 $facstatic->id = $obj->rowid;
348 $facstatic->total_ht = $obj->total_ht;
349 $facstatic->total_tva = $obj->total_tva;
350 $facstatic->total_ttc = $obj->total_ttc;
351 $facstatic->statut = $obj->status;
352 $facstatic->paye = $obj->paye;
353 $facstatic->type = $obj->type;
354 $facstatic->ref_supplier = $obj->ref_supplier;
356 $thirdpartystatic->id = $obj->socid;
357 $thirdpartystatic->name = $obj->name;
358 $thirdpartystatic->email = $obj->email;
359 $thirdpartystatic->country_id = 0;
360 $thirdpartystatic->country_code =
'';
361 $thirdpartystatic->client = 0;
362 $thirdpartystatic->fournisseur = 1;
363 $thirdpartystatic->code_client =
'';
364 $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
365 $thirdpartystatic->code_compta =
'';
366 $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
368 print
'<tr class="oddeven nowraponall tdoverflowmax100"><td>';
369 print $facstatic->getNomUrl(1,
'');
371 print
'<td class="nowrap tdoverflowmax100">';
372 print $thirdpartystatic->getNomUrl(1,
'supplier');
375 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
377 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
378 print
'<td class="right" title="'.dol_escape_htmltag($langs->trans(
"DateModificationShort").
' : '.
dol_print_date($db->jdate($obj->tms),
'dayhour',
'tzuserrel')).
'">'.
dol_print_date($db->jdate($obj->tms),
'day',
'tzuserrel').
'</td>';
379 $alreadypaid = $facstatic->getSommePaiement();
380 print
'<td>'.$facstatic->getLibStatut(3, $alreadypaid).
'</td>';
382 $total_ht += $obj->total_ht;
383 $total_ttc += $obj->total_ttc;
384 $totalam += $obj->am;
389 print
'<tr class="oddeven">';
390 print
'<td class="nowrap" colspan="5">';
391 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
400 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
402 print
'</table></div><br>';
411if (isModEnabled(
'don') && $user->hasRight(
'don',
'lire')) {
412 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
414 $langs->load(
"boxes");
415 $donationstatic =
new Don($db);
417 $sql =
"SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status";
418 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
419 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
421 $parameters = array();
422 $reshook = $hookmanager->executeHooks(
'printFieldListWhereLastDonations', $parameters);
423 $sql .= $hookmanager->resPrint;
425 $sql .= $db->order(
"d.tms",
"DESC");
426 $sql .= $db->plimit($max, 0);
428 $result = $db->query($sql);
430 $num = $db->num_rows($result);
435 print
'<div class="div-table-responsive-no-min">';
436 print
'<table class="noborder centpercent">';
437 print
'<tr class="liste_titre">';
438 print
'<th>'.$langs->trans(
"BoxTitleLastModifiedDonations", $max).
'</th>';
440 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
441 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
442 print
'<th width="16"> </th>';
446 $total_ttc = $totalam = $total_ht = 0;
448 while ($i < $num && $i < $max) {
449 $obj = $db->fetch_object($result);
454 $total_ht += $obj->total_ht;
455 $total_ttc += $obj->total_ttc;
459 $donationstatic->id = $obj->rowid;
460 $donationstatic->ref = $obj->rowid;
461 $donationstatic->lastname = $obj->lastname;
462 $donationstatic->firstname = $obj->firstname;
463 $donationstatic->date = $db->jdate($obj->date);
464 $donationstatic->statut = $obj->status;
465 $donationstatic->status = $obj->status;
467 $label = $donationstatic->getFullName($langs);
469 $label .= ($label ?
' - ' :
'').$obj->societe;
472 print
'<tr class="oddeven tdoverflowmax100">';
473 print
'<td>'.$donationstatic->getNomUrl(1).
'</td>';
474 print
'<td>'.$label.
'</td>';
475 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
476 print
'<td class="right" title="'.dol_escape_htmltag($langs->trans(
"DateModificationShort").
' : '.
dol_print_date($db->jdate($obj->dm),
'dayhour',
'tzuserrel')).
'">'.
dol_print_date($db->jdate($obj->dm),
'day',
'tzuserrel').
'</td>';
477 print
'<td>'.$donationstatic->getLibStatut(3).
'</td>';
484 print
'<tr class="oddeven">';
485 print
'<td class="nowrap" colspan="5">';
486 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
491 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
493 print
'</table></div><br>';
502if (isModEnabled(
'tax') && $user->hasRight(
'tax',
'charges',
'lire')) {
506 $sql =
"SELECT c.rowid, c.amount, c.date_ech, c.paye,";
507 $sql .=
" cc.libelle as label,";
508 $sql .=
" SUM(pc.amount) as sumpaid";
509 $sql .=
" FROM (".MAIN_DB_PREFIX.
"c_chargesociales as cc, ".MAIN_DB_PREFIX.
"chargesociales as c)";
510 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = c.rowid";
511 $sql .=
" WHERE c.fk_type = cc.id";
512 $sql .=
" AND c.entity IN (".getEntity(
'tax').
')';
513 $sql .=
" AND c.paye = 0";
515 $parameters = array();
516 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSocialContributions', $parameters);
517 $sql .= $hookmanager->resPrint;
519 $sql .=
" GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
521 $resql = $db->query($sql);
523 $num = $db->num_rows($resql);
525 print
'<div class="div-table-responsive-no-min">';
526 print
'<table class="noborder centpercent">';
527 print
'<tr class="liste_titre">';
528 print
'<th>'.$langs->trans(
"ContributionsToPay").($num ?
' <a href="'.DOL_URL_ROOT.
'/compta/sociales/list.php?status=0"><span class="badge">'.$num.
'</span></a>' :
'').
'</th>';
529 print
'<th align="center">'.$langs->trans(
"DateDue").
'</th>';
530 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
531 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
532 print
'<th align="center" width="16"> </th>';
540 $obj = $db->fetch_object($resql);
544 $tot_ttc += $obj->amount;
549 $chargestatic->id = $obj->rowid;
550 $chargestatic->ref = $obj->rowid;
551 $chargestatic->label = $obj->label;
552 $chargestatic->paye = $obj->paye;
553 $chargestatic->status = $obj->paye;
555 print
'<tr class="oddeven">';
556 print
'<td class="nowraponall">'.$chargestatic->getNomUrl(1).
'</td>';
557 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
558 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
559 print
'<td class="nowrap right"><span class="amount">'.price($obj->sumpaid).
'</span></td>';
560 print
'<td class="center">'.$chargestatic->getLibStatut(3).
'</td>';
563 $tot_ttc += $obj->amount;
568 print
'<tr class="oddeven">';
569 print
'<td class="nowrap" colspan="5">';
570 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
575 print
'<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans(
"Total").
'</td>';
576 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
577 print
'<td class="right"></td>';
578 print
'<td class="right"> </td>';
581 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
583 print
"</table></div><br>";
594if (isModEnabled(
'facture') && isModEnabled(
'commande') && $user->hasRight(
"commande",
"lire") && !
getDolGlobalString(
'WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) {
595 $commandestatic =
new Commande($db);
596 $langs->load(
"orders");
598 $sql =
"SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc";
599 $sql .=
", s.nom as name, s.email";
600 $sql .=
", s.rowid as socid";
601 $sql .=
", s.code_client, s.code_compta";
602 $sql .=
", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,";
603 $sql .=
" cc.rowid as country_id, cc.code as country_code";
604 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
605 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
606 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
608 $sql .=
", ".MAIN_DB_PREFIX.
"commande as c";
609 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
610 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
611 $sql .=
" WHERE c.fk_soc = s.rowid";
612 $sql .=
" AND c.entity = ".$conf->entity;
613 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
614 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
617 $sql .=
" AND c.fk_soc = ".((int) $socid);
619 $sql .=
" AND c.fk_statut = ".Commande::STATUS_CLOSED;
620 $sql .=
" AND c.facture = 0";
622 $parameters = array();
623 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerOrderToBill', $parameters);
624 $sql .= $hookmanager->resPrint;
626 $sql .=
" GROUP BY s.nom, s.email, s.rowid, s.code_client, s.code_compta, c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_tva, c.total_ttc, cc.rowid, cc.code";
628 $resql = $db->query($sql);
630 $num = $db->num_rows($resql);
636 print
'<div class="div-table-responsive-no-min">';
637 print
'<table class="noborder centpercent">';
639 print
"<tr class=\"liste_titre\">";
640 print
'<th colspan="2">';
641 print $langs->trans(
"OrdersDeliveredToBill").
' ';
643 print
'<span class="badge">'.$num.
'</span>';
648 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
650 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
651 print
'<th class="right">'.$langs->trans(
"ToBill").
'</th>';
652 print
'<th align="center" width="16"> </th>';
655 $tot_ht = $tot_ttc = $tot_tobill = 0;
656 $societestatic =
new Societe($db);
658 $obj = $db->fetch_object($resql);
663 $total_ht += $obj->total_ht;
664 $total_ttc += $obj->total_ttc;
668 $societestatic->id = $obj->socid;
669 $societestatic->name = $obj->name;
670 $societestatic->email = $obj->email;
671 $societestatic->country_id = $obj->country_id;
672 $societestatic->country_code = $obj->country_code;
673 $societestatic->client = 1;
674 $societestatic->code_client = $obj->code_client;
676 $societestatic->code_compta = $obj->code_compta;
679 $commandestatic->id = $obj->rowid;
680 $commandestatic->ref = $obj->ref;
681 $commandestatic->statut = $obj->status;
682 $commandestatic->billed = $obj->facture;
684 print
'<tr class="oddeven">';
685 print
'<td class="nowrap">';
687 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
688 print
'<td class="nobordernopadding nowrap">';
689 print $commandestatic->getNomUrl(1);
691 print
'<td width="20" class="nobordernopadding nowrap">';
694 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
697 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
698 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
699 print
'</td></tr></table>';
703 print
'<td class="nowrap tdoverflowmax100">';
704 print $societestatic->getNomUrl(1,
'customer');
707 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
709 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
710 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc - $obj->tot_fttc).
'</span></td>';
711 print
'<td>'.$commandestatic->getLibStatut(3).
'</td>';
713 $tot_ht += $obj->total_ht;
714 $tot_ttc += $obj->total_ttc;
716 $tot_tobill += ($obj->total_ttc - $obj->tot_fttc);
721 print
'<tr class="oddeven">';
722 print
'<td class="nowrap" colspan="5">';
723 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
728 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToBill").
': '.
price($tot_tobill).
')</span> </td>';
730 print
'<td class="right">'.price($tot_ht).
'</td>';
732 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
733 print
'<td class="nowrap right">'.price($tot_tobill).
'</td>';
734 print
'<td> </td>';
736 print
'</table></div><br>';
748 print
'<div class="div-table-responsive-no-min">';
749 print
'<table class="noborder centpercent">';
750 print
'<tr class="liste_titre"><thcolspan="2">'.$langs->trans(
"TasksToDo").
'</th>';
753 $resql = $db->query($sql);
755 $num_rows = $db->num_rows($resql);
756 while ($i < $num_rows) {
757 $obj = $db->fetch_object($resql);
759 print
'<tr class="oddeven"><td>'.dol_print_date($db->jdate($obj->da),
"day").
'</td>';
760 print
'<td><a href="action/card.php">'.$obj->label.
'</a></td></tr>';
765 print
"</table></div><br>";
771$parameters = array(
'user' => $user);
772$reshook = $hookmanager->executeHooks(
'dashboardAccountancy', $parameters, $object);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
Class to manage customers orders.
const STATUS_CLOSED
Closed (Sent, billed or not)
Class to manage donations.
Class to manage suppliers invoices.
Class to manage invoices.
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.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
getNumberInvoicesPieChart($mode)
Return an HTML table that contains a pie chart of the number of customers or supplier invoices.
getCustomerInvoiceDraftTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.
getDraftSupplierTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.