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';
62$langs->loadLangs(array(
'compta',
'bills'));
64 $langs->load(
"orders");
68$action =
GETPOST(
'action',
'aZ09');
73if ($user->socid > 0) {
75 $socid = $user->socid;
80$maxDraftCount = !
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
81$maxLatestEditCount = 5;
82$maxOpenCount = !
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
85$hookmanager->initHooks(array(
'invoiceindex'));
104$form =
new Form($db);
106$thirdpartystatic =
new Societe($db);
108llxHeader(
"", $langs->trans(
"InvoicesArea"));
113print
'<div class="fichecenter">';
115print
'<div class="twocolumns">';
117print
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
141print
'</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
145if (
isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
146 $langs->load(
"boxes");
147 $tmpinvoice =
new Facture($db);
149 $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";
150 $sql .=
", f.date_lim_reglement as datelimite";
151 $sql .=
", s.nom as name";
152 $sql .=
", s.rowid as socid";
153 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.email";
154 $sql .=
", cc.rowid as country_id, cc.code as country_code";
155 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiement_facture as pf WHERE pf.fk_facture = f.rowid) as am";
156 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
157 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = f.fk_soc";
158 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
159 $sql .=
" WHERE f.entity IN (".getEntity(
'invoice').
")";
161 $sql .=
" AND f.fk_soc = ".((int) $socid);
164 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
165 $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).
")";
168 $parameters = array();
169 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerLastModified', $parameters);
170 $sql .= $hookmanager->resPrint;
172 $sql .=
" ORDER BY f.tms DESC";
173 $sql .= $db->plimit($max, 0);
175 $resql = $db->query($sql);
177 $num = $db->num_rows($resql);
181 print
'<div class="div-table-responsive-no-min">';
182 print
'<table class="noborder centpercent">';
184 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastCustomerBills", $max);
185 print
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
188 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
190 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
191 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
192 print
'<th width="16"> </th>';
195 $total_ttc = $totalam = $total_ht = 0;
196 while ($i < $num && $i < $conf->liste_limit) {
197 $obj = $db->fetch_object($resql);
202 $total_ht += $obj->total_ht;
203 $total_ttc += $obj->total_ttc;
207 $tmpinvoice->ref = $obj->ref;
208 $tmpinvoice->id = $obj->rowid;
209 $tmpinvoice->total_ht = $obj->total_ht;
210 $tmpinvoice->total_tva = $obj->total_tva;
211 $tmpinvoice->total_ttc = $obj->total_ttc;
212 $tmpinvoice->statut = $obj->status;
213 $tmpinvoice->status = $obj->status;
214 $tmpinvoice->paye = $obj->paye;
215 $tmpinvoice->paid = $obj->paye;
216 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
217 $tmpinvoice->type = $obj->type;
219 $thirdpartystatic->id = $obj->socid;
220 $thirdpartystatic->name = $obj->name;
221 $thirdpartystatic->email = $obj->email;
222 $thirdpartystatic->country_id = $obj->country_id;
223 $thirdpartystatic->country_code = $obj->country_code;
224 $thirdpartystatic->email = $obj->email;
225 $thirdpartystatic->client = 1;
226 $thirdpartystatic->code_client = $obj->code_client;
228 $thirdpartystatic->code_compta_client = $obj->code_compta_client;
231 $totalallpayments = $tmpinvoice->getSommePaiement(0);
232 $totalallpayments += $tmpinvoice->getSumCreditNotesUsed(0);
233 $totalallpayments += $tmpinvoice->getSumDepositsUsed(0);
234 print
'<tr class="oddeven">';
235 print
'<td class="nowrap">';
237 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
239 print
'<td class="nobordernopadding nowraponall">';
240 print $tmpinvoice->getNomUrl(1,
'');
242 if ($tmpinvoice->hasDelay()) {
243 print
'<td width="20" class="nobordernopadding nowrap">';
247 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
250 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
251 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
252 print
'</td></tr></table>';
256 print
'<td class="tdoverflowmax150">';
257 print $thirdpartystatic->getNomUrl(1,
'customer', 44);
260 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
262 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
264 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>';
266 print
'<td>'.$tmpinvoice->getLibStatut(3, $totalallpayments).
'</td>';
270 $total_ttc += $obj->total_ttc;
271 $total_ht += $obj->total_ht;
272 $totalam += $obj->am;
278 print
'<tr class="oddeven">';
279 print
'<td class="nowrap" colspan="5">';
280 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
289 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
291 print
'</table></div><br>';
300if ((
isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"facture",
"lire")) || (
isModEnabled(
'supplier_invoice') && $user->hasRight(
"supplier_invoice",
"lire"))) {
301 $langs->load(
"boxes");
304 $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";
305 $sql .=
", s.nom as name";
306 $sql .=
", s.rowid as socid";
307 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.email";
308 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am";
309 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
310 $sql .=
" WHERE s.rowid = ff.fk_soc";
311 $sql .=
" AND ff.entity IN (".getEntity(
'facture_fourn').
")";
313 $sql .=
" AND ff.fk_soc = ".((int) $socid);
316 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
317 $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).
")";
320 $parameters = array();
321 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierLastModified', $parameters);
322 $sql .= $hookmanager->resPrint;
324 $sql .=
" ORDER BY ff.tms DESC";
325 $sql .= $db->plimit($max, 0);
327 $resql = $db->query($sql);
329 $num = $db->num_rows($resql);
331 print
'<div class="div-table-responsive-no-min">';
332 print
'<table class="noborder centpercent">';
333 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastSupplierBills", $max);
334 print
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
337 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
339 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
340 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
341 print
'<th width="16"> </th>';
345 $total_ht = $total_ttc = $totalam = 0;
349 $obj = $db->fetch_object($resql);
354 $total_ht += $obj->total_ht;
355 $total_ttc += $obj->total_ttc;
359 $facstatic->ref = $obj->ref;
360 $facstatic->id = $obj->rowid;
361 $facstatic->total_ht = $obj->total_ht;
362 $facstatic->total_tva = $obj->total_tva;
363 $facstatic->total_ttc = $obj->total_ttc;
364 $facstatic->statut = $obj->status;
365 $facstatic->status = $obj->status;
366 $facstatic->paye = $obj->paye;
367 $facstatic->paid = $obj->paye;
368 $facstatic->type = $obj->type;
369 $facstatic->ref_supplier = $obj->ref_supplier;
371 $thirdpartystatic->id = $obj->socid;
372 $thirdpartystatic->name = $obj->name;
373 $thirdpartystatic->email = $obj->email;
374 $thirdpartystatic->country_id = 0;
375 $thirdpartystatic->country_code =
'';
376 $thirdpartystatic->client = 0;
377 $thirdpartystatic->fournisseur = 1;
378 $thirdpartystatic->code_client =
'';
379 $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
380 $thirdpartystatic->code_compta_client =
'';
381 $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
383 print
'<tr class="oddeven nowraponall tdoverflowmax100"><td>';
384 print $facstatic->getNomUrl(1,
'');
386 print
'<td class="nowrap tdoverflowmax100">';
387 print $thirdpartystatic->getNomUrl(1,
'supplier');
390 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
392 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
393 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>';
395 $alreadypaid = $facstatic->getSommePaiement();
396 $alreadypaid += $facstatic->getSumCreditNotesUsed();
397 $alreadypaid += $facstatic->getSumDepositsUsed();
399 print
'<td>'.$facstatic->getLibStatut(3, $alreadypaid).
'</td>';
402 $total_ht += $obj->total_ht;
403 $total_ttc += $obj->total_ttc;
404 $totalam += $obj->am;
409 print
'<tr class="oddeven">';
410 print
'<td class="nowrap" colspan="5">';
411 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
420 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
422 print
'</table></div><br>';
431if (
isModEnabled(
'don') && $user->hasRight(
'don',
'lire')) {
432 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
434 $langs->load(
"boxes");
435 $donationstatic =
new Don($db);
437 $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, d.fk_soc as socid";
438 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
439 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
441 $parameters = array();
442 $reshook = $hookmanager->executeHooks(
'printFieldListWhereLastDonations', $parameters);
443 $sql .= $hookmanager->resPrint;
445 $sql .= $db->order(
"d.tms",
"DESC");
446 $sql .= $db->plimit($max, 0);
448 $result = $db->query($sql);
450 $num = $db->num_rows($result);
455 print
'<div class="div-table-responsive-no-min">';
456 print
'<table class="noborder centpercent">';
457 print
'<tr class="liste_titre">';
458 print
'<th colspan="2">'.$langs->trans(
"BoxTitleLastModifiedDonations", $max);
459 print
'<a href="'.DOL_URL_ROOT.
'/don/list.php?sortfield=d.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
461 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
462 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
463 print
'<th width="16"> </th>';
467 $total_ttc = $totalam = $total_ht = 0;
469 while ($i < $num && $i < $max) {
470 $obj = $db->fetch_object($result);
475 $total_ht += $obj->total_ht;
476 $total_ttc += $obj->total_ttc;
480 $donationstatic->id = $obj->rowid;
481 $donationstatic->ref = $obj->rowid;
482 $donationstatic->lastname = $obj->lastname;
483 $donationstatic->firstname = $obj->firstname;
484 $donationstatic->date = $db->jdate($obj->date);
485 $donationstatic->status = $obj->status;
488 if (!empty($obj->socid)) {
489 $companystatic =
new Societe($db);
490 $ret = $companystatic->fetch($obj->socid);
492 $label = $companystatic->getNomUrl(1);
495 $label = $donationstatic->getFullName($langs);
497 $label .= ($label ?
' - ' :
'').$obj->societe;
501 print
'<tr class="oddeven tdoverflowmax100">';
502 print
'<td>'.$donationstatic->getNomUrl(1).
'</td>';
503 print
'<td>'.$label.
'</td>';
504 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
505 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>';
506 print
'<td>'.$donationstatic->getLibStatut(3).
'</td>';
513 print
'<tr class="oddeven">';
514 print
'<td class="nowrap" colspan="5">';
515 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
520 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
522 print
'</table></div><br>';
531if (
isModEnabled(
'tax') && $user->hasRight(
'tax',
'charges',
'lire')) {
535 $sql =
"SELECT c.rowid, c.amount, c.date_ech, c.paye,";
536 $sql .=
" cc.libelle as label,";
537 $sql .=
" SUM(pc.amount) as totalpaid";
538 $sql .=
" FROM (".MAIN_DB_PREFIX.
"c_chargesociales as cc, ".MAIN_DB_PREFIX.
"chargesociales as c)";
539 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = c.rowid";
540 $sql .=
" WHERE c.fk_type = cc.id";
541 $sql .=
" AND c.entity IN (".getEntity(
'tax').
')';
542 $sql .=
" AND c.paye = 0";
544 $parameters = array();
545 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSocialContributions', $parameters);
546 $sql .= $hookmanager->resPrint;
548 $sql .=
" GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
550 $resql = $db->query($sql);
552 $num = $db->num_rows($resql);
554 print
'<div class="div-table-responsive-no-min">';
555 print
'<table class="noborder centpercent">';
556 print
'<tr class="liste_titre">';
557 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>';
558 print
'<th align="center">'.$langs->trans(
"DateDue").
'</th>';
559 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
560 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
561 print
'<th align="center" width="16"> </th>';
570 $obj = $db->fetch_object($resql);
574 $tot_ttc += $obj->amount;
575 $tot_paid += $obj->totalpaid;
580 $chargestatic->id = $obj->rowid;
581 $chargestatic->ref = $obj->rowid;
582 $chargestatic->label = $obj->label;
583 $chargestatic->paye = $obj->paye;
584 $chargestatic->status = $obj->paye;
586 print
'<tr class="oddeven">';
587 print
'<td class="nowraponall">'.$chargestatic->getNomUrl(1).
'</td>';
588 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
589 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
590 print
'<td class="nowrap right"><span class="amount">'.price($obj->totalpaid).
'</span></td>';
591 print
'<td class="center">'.$chargestatic->getLibStatut(3).
'</td>';
594 $tot_ttc += $obj->amount;
599 print
'<tr class="oddeven">';
600 print
'<td class="nowrap" colspan="5">';
601 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
606 print
'<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans(
"Total").
'</td>';
607 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
608 print
'<td class="nowrap right">'.price($tot_paid).
'</td>';
609 print
'<td class="right"> </td>';
612 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
614 print
"</table></div><br>";
626 $commandestatic =
new Commande($db);
627 $langs->load(
"orders");
629 $sql =
"SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc";
630 $sql .=
", s.nom as name, s.email";
631 $sql .=
", s.rowid as socid";
632 $sql .=
", s.code_client, s.code_compta as code_compta_client";
633 $sql .=
", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,";
634 $sql .=
" cc.rowid as country_id, cc.code as country_code";
635 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
636 $sql .=
", ".MAIN_DB_PREFIX.
"commande as c";
637 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
638 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
639 $sql .=
" WHERE c.fk_soc = s.rowid";
640 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
642 $sql .=
" AND c.fk_soc = ".((int) $socid);
645 $sql .=
" AND c.facture = 0";
647 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
648 $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).
")";
652 $parameters = array();
653 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerOrderToBill', $parameters);
654 $sql .= $hookmanager->resPrint;
656 $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";
658 $resql = $db->query($sql);
660 $num = $db->num_rows($resql);
666 print
'<div class="div-table-responsive-no-min">';
667 print
'<table class="noborder centpercent">';
669 print
'<tr class="liste_titre">';
670 print
'<th colspan="2">';
671 print $langs->trans(
"OrdersDeliveredToBill");
672 print
'<a href="'.DOL_URL_ROOT.
'/commande/list.php?search_status='.
Commande::STATUS_CLOSED.
'&search_billed=0">';
673 print
'<span class="badge marginleftonly">'.$num.
'</span>';
678 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
680 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
681 print
'<th class="right">'.$langs->trans(
"ToBill").
'</th>';
682 print
'<th align="center" width="16"> </th>';
685 $tot_ht = $tot_ttc = $tot_tobill = 0;
686 $societestatic =
new Societe($db);
688 $obj = $db->fetch_object($resql);
693 $total_ht += $obj->total_ht;
694 $total_ttc += $obj->total_ttc;
698 $societestatic->id = $obj->socid;
699 $societestatic->name = $obj->name;
700 $societestatic->email = $obj->email;
701 $societestatic->country_id = $obj->country_id;
702 $societestatic->country_code = $obj->country_code;
703 $societestatic->client = 1;
704 $societestatic->code_client = $obj->code_client;
706 $societestatic->code_compta_client = $obj->code_compta_client;
709 $commandestatic->id = $obj->rowid;
710 $commandestatic->ref = $obj->ref;
711 $commandestatic->statut = $obj->status;
712 $commandestatic->status = $obj->status;
713 $commandestatic->billed = $obj->facture;
715 print
'<tr class="oddeven">';
716 print
'<td class="nowrap">';
718 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
719 print
'<td class="nobordernopadding nowrap">';
720 print $commandestatic->getNomUrl(1);
722 print
'<td width="20" class="nobordernopadding nowrap">';
725 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
728 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
729 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
730 print
'</td></tr></table>';
734 print
'<td class="nowrap tdoverflowmax100">';
735 print $societestatic->getNomUrl(1,
'customer');
738 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
740 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
741 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc - $obj->tot_fttc).
'</span></td>';
742 print
'<td>'.$commandestatic->getLibStatut(3).
'</td>';
744 $tot_ht += $obj->total_ht;
745 $tot_ttc += $obj->total_ttc;
747 $tot_tobill += ($obj->total_ttc - $obj->tot_fttc);
752 print
'<tr class="oddeven">';
753 print
'<td class="nowrap" colspan="5">';
754 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
759 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToBill").
': '.
price($tot_tobill).
')</span> </td>';
761 print
'<td class="right">'.price($tot_ht).
'</td>';
763 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
764 print
'<td class="nowrap right">'.price($tot_tobill).
'</td>';
765 print
'<td> </td>';
767 print
'</table></div><br>';
779 $langs->load(
"projects");
780 print
'<div class="div-table-responsive-no-min">';
781 print
'<table class="noborder centpercent">';
782 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"TasksToDo").
'</th>';
785 $resql = $db->query($sql);
787 $num_rows = $db->num_rows($resql);
788 while ($i < $num_rows) {
789 $obj = $db->fetch_object($resql);
791 print
'<tr class="oddeven"><td>'.dol_print_date($db->jdate($obj->da),
"day").
'</td>';
792 print
'<td><a href="action/card.php">'.$obj->label.
'</a></td></tr>';
797 print
"</table></div><br>";
801print
'</div></div></div>';
803$parameters = array(
'user' => $user);
805$reshook = $hookmanager->executeHooks(
'dashboardAccountancy', $parameters, $object, $action);
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class 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...)
dol_now($mode='gmt')
Return date for now.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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.
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_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.