38require
'../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
54$langs->loadLangs(array(
'compta',
'bills'));
55if (isModEnabled(
'order')) {
56 $langs->load(
"orders");
60$action =
GETPOST(
'action',
'aZ09');
65if ($user->socid > 0) {
67 $socid = $user->socid;
72$maxDraftCount = !
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
73$maxLatestEditCount = 5;
74$maxOpenCount = !
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
77$hookmanager->initHooks(array(
'invoiceindex'));
80$maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
98$thirdpartystatic =
new Societe($db);
100llxHeader(
"", $langs->trans(
"InvoicesArea"));
105print
'<div class="fichecenter">';
107print
'<div class="twocolumns">';
109print
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
112if (isModEnabled(
'invoice')) {
117if (isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) {
122if (isModEnabled(
'invoice')) {
127if (isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) {
133print
'</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
137if (isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
138 $langs->load(
"boxes");
139 $tmpinvoice =
new Facture($db);
141 $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";
142 $sql .=
", f.date_lim_reglement as datelimite";
143 $sql .=
", s.nom as name";
144 $sql .=
", s.rowid as socid";
145 $sql .=
", s.code_client, s.code_compta, s.email";
146 $sql .=
", cc.rowid as country_id, cc.code as country_code";
147 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiement_facture as pf WHERE pf.fk_facture = f.rowid) as am";
148 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
149 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = f.fk_soc";
150 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
151 $sql .=
" WHERE f.entity IN (".getEntity(
'invoice').
")";
153 $sql .=
" AND f.fk_soc = ".((int) $socid);
156 if (!$user->hasRight(
'societe',
'client',
'voir')) {
157 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $user->id).
")";
160 $parameters = array();
161 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerLastModified', $parameters);
162 $sql .= $hookmanager->resPrint;
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">';
176 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastCustomerBills", $max);
177 print
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
180 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
182 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
183 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
184 print
'<th width="16"> </th>';
187 $total_ttc = $totalam = $total_ht = 0;
188 while ($i < $num && $i < $conf->liste_limit) {
189 $obj = $db->fetch_object($resql);
194 $total_ht += $obj->total_ht;
195 $total_ttc += $obj->total_ttc;
199 $tmpinvoice->ref = $obj->ref;
200 $tmpinvoice->id = $obj->rowid;
201 $tmpinvoice->total_ht = $obj->total_ht;
202 $tmpinvoice->total_tva = $obj->total_tva;
203 $tmpinvoice->total_ttc = $obj->total_ttc;
204 $tmpinvoice->statut = $obj->status;
205 $tmpinvoice->status = $obj->status;
206 $tmpinvoice->paye = $obj->paye;
207 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
208 $tmpinvoice->type = $obj->type;
210 $thirdpartystatic->id = $obj->socid;
211 $thirdpartystatic->name = $obj->name;
212 $thirdpartystatic->email = $obj->email;
213 $thirdpartystatic->country_id = $obj->country_id;
214 $thirdpartystatic->country_code = $obj->country_code;
215 $thirdpartystatic->email = $obj->email;
216 $thirdpartystatic->client = 1;
217 $thirdpartystatic->code_client = $obj->code_client;
219 $thirdpartystatic->code_compta_client = $obj->code_compta;
222 print
'<tr class="oddeven">';
223 print
'<td class="nowrap">';
225 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
227 print
'<td class="nobordernopadding nowraponall">';
228 print $tmpinvoice->getNomUrl(1,
'');
230 if ($tmpinvoice->hasDelay()) {
231 print
'<td width="20" class="nobordernopadding nowrap">';
235 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
238 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
239 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
240 print
'</td></tr></table>';
244 print
'<td class="tdoverflowmax150">';
245 print $thirdpartystatic->getNomUrl(1,
'customer', 44);
248 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
250 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
252 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>';
254 print
'<td>'.$tmpinvoice->getLibStatut(3, $obj->am).
'</td>';
258 $total_ttc += $obj->total_ttc;
259 $total_ht += $obj->total_ht;
260 $totalam += $obj->am;
266 print
'<tr class="oddeven">';
267 print
'<td class="nowrap" colspan="5">';
268 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
277 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
279 print
'</table></div><br>';
288if ((isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"facture",
"lire")) || (isModEnabled(
'supplier_invoice') && $user->hasRight(
"supplier_invoice",
"lire"))) {
289 $langs->load(
"boxes");
292 $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";
293 $sql .=
", s.nom as name";
294 $sql .=
", s.rowid as socid";
295 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.email";
296 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am";
297 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
298 $sql .=
" WHERE s.rowid = ff.fk_soc";
299 $sql .=
" AND ff.entity IN (".getEntity(
'facture_fourn').
")";
301 $sql .=
" AND ff.fk_soc = ".((int) $socid);
304 if (!$user->hasRight(
'societe',
'client',
'voir')) {
305 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = ff.fk_soc AND sc.fk_user = ".((int) $user->id).
")";
308 $parameters = array();
309 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierLastModified', $parameters);
310 $sql .= $hookmanager->resPrint;
312 $sql .=
" ORDER BY ff.tms DESC";
313 $sql .= $db->plimit($max, 0);
315 $resql = $db->query($sql);
317 $num = $db->num_rows($resql);
319 print
'<div class="div-table-responsive-no-min">';
320 print
'<table class="noborder centpercent">';
321 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastSupplierBills", $max);
322 print
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
325 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
327 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
328 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
329 print
'<th width="16"> </th>';
333 $total_ht = $total_ttc = $totalam = 0;
337 $obj = $db->fetch_object($resql);
342 $total_ht += $obj->total_ht;
343 $total_ttc += $obj->total_ttc;
347 $facstatic->ref = $obj->ref;
348 $facstatic->id = $obj->rowid;
349 $facstatic->total_ht = $obj->total_ht;
350 $facstatic->total_tva = $obj->total_tva;
351 $facstatic->total_ttc = $obj->total_ttc;
352 $facstatic->statut = $obj->status;
353 $facstatic->status = $obj->status;
354 $facstatic->paye = $obj->paye;
355 $facstatic->paid = $obj->paye;
356 $facstatic->type = $obj->type;
357 $facstatic->ref_supplier = $obj->ref_supplier;
359 $thirdpartystatic->id = $obj->socid;
360 $thirdpartystatic->name = $obj->name;
361 $thirdpartystatic->email = $obj->email;
362 $thirdpartystatic->country_id = 0;
363 $thirdpartystatic->country_code =
'';
364 $thirdpartystatic->client = 0;
365 $thirdpartystatic->fournisseur = 1;
366 $thirdpartystatic->code_client =
'';
367 $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
368 $thirdpartystatic->code_compta_client =
'';
369 $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
371 print
'<tr class="oddeven nowraponall tdoverflowmax100"><td>';
372 print $facstatic->getNomUrl(1,
'');
374 print
'<td class="nowrap tdoverflowmax100">';
375 print $thirdpartystatic->getNomUrl(1,
'supplier');
378 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
380 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
381 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>';
382 $alreadypaid = $facstatic->getSommePaiement();
383 print
'<td>'.$facstatic->getLibStatut(3, $alreadypaid).
'</td>';
385 $total_ht += $obj->total_ht;
386 $total_ttc += $obj->total_ttc;
387 $totalam += $obj->am;
392 print
'<tr class="oddeven">';
393 print
'<td class="nowrap" colspan="5">';
394 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
403 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
405 print
'</table></div><br>';
414if (isModEnabled(
'don') && $user->hasRight(
'don',
'lire')) {
415 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
417 $langs->load(
"boxes");
418 $donationstatic =
new Don($db);
420 $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";
421 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
422 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
424 $parameters = array();
425 $reshook = $hookmanager->executeHooks(
'printFieldListWhereLastDonations', $parameters);
426 $sql .= $hookmanager->resPrint;
428 $sql .= $db->order(
"d.tms",
"DESC");
429 $sql .= $db->plimit($max, 0);
431 $result = $db->query($sql);
433 $num = $db->num_rows($result);
438 print
'<div class="div-table-responsive-no-min">';
439 print
'<table class="noborder centpercent">';
440 print
'<tr class="liste_titre">';
441 print
'<th colspan="2">'.$langs->trans(
"BoxTitleLastModifiedDonations", $max);
442 print
'<a href="'.DOL_URL_ROOT.
'/don/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
444 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
445 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
446 print
'<th width="16"> </th>';
450 $total_ttc = $totalam = $total_ht = 0;
452 while ($i < $num && $i < $max) {
453 $obj = $db->fetch_object($result);
458 $total_ht += $obj->total_ht;
459 $total_ttc += $obj->total_ttc;
463 $donationstatic->id = $obj->rowid;
464 $donationstatic->ref = $obj->rowid;
465 $donationstatic->lastname = $obj->lastname;
466 $donationstatic->firstname = $obj->firstname;
467 $donationstatic->date = $db->jdate($obj->date);
468 $donationstatic->statut = $obj->status;
469 $donationstatic->status = $obj->status;
471 $label = $donationstatic->getFullName($langs);
473 $label .= ($label ?
' - ' :
'').$obj->societe;
476 print
'<tr class="oddeven tdoverflowmax100">';
477 print
'<td>'.$donationstatic->getNomUrl(1).
'</td>';
478 print
'<td>'.$label.
'</td>';
479 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
480 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>';
481 print
'<td>'.$donationstatic->getLibStatut(3).
'</td>';
488 print
'<tr class="oddeven">';
489 print
'<td class="nowrap" colspan="5">';
490 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
495 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
497 print
'</table></div><br>';
506if (isModEnabled(
'tax') && $user->hasRight(
'tax',
'charges',
'lire')) {
510 $sql =
"SELECT c.rowid, c.amount, c.date_ech, c.paye,";
511 $sql .=
" cc.libelle as label,";
512 $sql .=
" SUM(pc.amount) as sumpaid";
513 $sql .=
" FROM (".MAIN_DB_PREFIX.
"c_chargesociales as cc, ".MAIN_DB_PREFIX.
"chargesociales as c)";
514 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = c.rowid";
515 $sql .=
" WHERE c.fk_type = cc.id";
516 $sql .=
" AND c.entity IN (".getEntity(
'tax').
')';
517 $sql .=
" AND c.paye = 0";
519 $parameters = array();
520 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSocialContributions', $parameters);
521 $sql .= $hookmanager->resPrint;
523 $sql .=
" GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
525 $resql = $db->query($sql);
527 $num = $db->num_rows($resql);
529 print
'<div class="div-table-responsive-no-min">';
530 print
'<table class="noborder centpercent">';
531 print
'<tr class="liste_titre">';
532 print
'<th>'.$langs->trans(
"ContributionsToPay").($num ?
'<a href="'.DOL_URL_ROOT.
'/compta/sociales/list.php?status=0"><span class="badge marginleftonly">'.$num.
'</span></a>' :
'').
'</th>';
533 print
'<th align="center">'.$langs->trans(
"DateDue").
'</th>';
534 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
535 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
536 print
'<th align="center" width="16"> </th>';
545 $obj = $db->fetch_object($resql);
549 $tot_ttc += $obj->amount;
550 $tot_paid += $obj->sumpaid;
555 $chargestatic->id = $obj->rowid;
556 $chargestatic->ref = $obj->rowid;
557 $chargestatic->label = $obj->label;
558 $chargestatic->paye = $obj->paye;
559 $chargestatic->status = $obj->paye;
561 print
'<tr class="oddeven">';
562 print
'<td class="nowraponall">'.$chargestatic->getNomUrl(1).
'</td>';
563 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
564 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
565 print
'<td class="nowrap right"><span class="amount">'.price($obj->sumpaid).
'</span></td>';
566 print
'<td class="center">'.$chargestatic->getLibStatut(3).
'</td>';
569 $tot_ttc += $obj->amount;
574 print
'<tr class="oddeven">';
575 print
'<td class="nowrap" colspan="5">';
576 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
581 print
'<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans(
"Total").
'</td>';
582 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
583 print
'<td class="nowrap right">'.price($tot_paid).
'</td>';
584 print
'<td class="right"> </td>';
587 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
589 print
"</table></div><br>";
600if (isModEnabled(
'invoice') && isModEnabled(
'order') && $user->hasRight(
"commande",
"lire") && !
getDolGlobalString(
'WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) {
601 $commandestatic =
new Commande($db);
602 $langs->load(
"orders");
604 $sql =
"SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc";
605 $sql .=
", s.nom as name, s.email";
606 $sql .=
", s.rowid as socid";
607 $sql .=
", s.code_client, s.code_compta";
608 $sql .=
", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,";
609 $sql .=
" cc.rowid as country_id, cc.code as country_code";
610 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
611 $sql .=
", ".MAIN_DB_PREFIX.
"commande as c";
612 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
613 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
614 $sql .=
" WHERE c.fk_soc = s.rowid";
615 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
617 $sql .=
" AND c.fk_soc = ".((int) $socid);
620 $sql .=
" AND c.facture = 0";
622 if (!$user->hasRight(
'societe',
'client',
'voir')) {
623 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = ".((int) $user->id).
")";
627 $parameters = array();
628 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerOrderToBill', $parameters);
629 $sql .= $hookmanager->resPrint;
631 $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";
633 $resql = $db->query($sql);
635 $num = $db->num_rows($resql);
641 print
'<div class="div-table-responsive-no-min">';
642 print
'<table class="noborder centpercent">';
644 print
'<tr class="liste_titre">';
645 print
'<th colspan="2">';
646 print $langs->trans(
"OrdersDeliveredToBill");
647 print
'<a href="'.DOL_URL_ROOT.
'/commande/list.php?search_status='.
Commande::STATUS_CLOSED.
'&search_billed=0">';
648 print
'<span class="badge marginleftonly">'.$num.
'</span>';
653 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
655 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
656 print
'<th class="right">'.$langs->trans(
"ToBill").
'</th>';
657 print
'<th align="center" width="16"> </th>';
660 $tot_ht = $tot_ttc = $tot_tobill = 0;
661 $societestatic =
new Societe($db);
663 $obj = $db->fetch_object($resql);
668 $total_ht += $obj->total_ht;
669 $total_ttc += $obj->total_ttc;
673 $societestatic->id = $obj->socid;
674 $societestatic->name = $obj->name;
675 $societestatic->email = $obj->email;
676 $societestatic->country_id = $obj->country_id;
677 $societestatic->country_code = $obj->country_code;
678 $societestatic->client = 1;
679 $societestatic->code_client = $obj->code_client;
681 $societestatic->code_compta_client = $obj->code_compta;
684 $commandestatic->id = $obj->rowid;
685 $commandestatic->ref = $obj->ref;
686 $commandestatic->statut = $obj->status;
687 $commandestatic->billed = $obj->facture;
689 print
'<tr class="oddeven">';
690 print
'<td class="nowrap">';
692 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
693 print
'<td class="nobordernopadding nowrap">';
694 print $commandestatic->getNomUrl(1);
696 print
'<td width="20" class="nobordernopadding nowrap">';
699 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
702 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
703 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
704 print
'</td></tr></table>';
708 print
'<td class="nowrap tdoverflowmax100">';
709 print $societestatic->getNomUrl(1,
'customer');
712 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
714 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
715 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc - $obj->tot_fttc).
'</span></td>';
716 print
'<td>'.$commandestatic->getLibStatut(3).
'</td>';
718 $tot_ht += $obj->total_ht;
719 $tot_ttc += $obj->total_ttc;
721 $tot_tobill += ($obj->total_ttc - $obj->tot_fttc);
726 print
'<tr class="oddeven">';
727 print
'<td class="nowrap" colspan="5">';
728 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
733 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToBill").
': '.
price($tot_tobill).
')</span> </td>';
735 print
'<td class="right">'.price($tot_ht).
'</td>';
737 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
738 print
'<td class="nowrap right">'.price($tot_tobill).
'</td>';
739 print
'<td> </td>';
741 print
'</table></div><br>';
753 print
'<div class="div-table-responsive-no-min">';
754 print
'<table class="noborder centpercent">';
755 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"TasksToDo").
'</th>';
758 $resql = $db->query($sql);
760 $num_rows = $db->num_rows($resql);
761 while ($i < $num_rows) {
762 $obj = $db->fetch_object($resql);
764 print
'<tr class="oddeven"><td>'.dol_print_date($db->jdate($obj->da),
"day").
'</td>';
765 print
'<td><a href="action/card.php">'.$obj->label.
'</a></td></tr>';
770 print
"</table></div><br>";
774print
'</div></div></div>';
776$parameters = array(
'user' => $user);
777$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.
Class for managing the social charges.
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($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.