38require
'../main.inc.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
55require_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;
81$maxLatestEditCount = 5;
87$hookmanager->initHooks(array(
'invoiceindex'));
97 require_once DOL_DOCUMENT_ROOT.
'/core/class/infobox.class.php';
100 $boxorder =
GETPOST(
'boxorder',
'aZ09');
101 $boxorder .=
GETPOST(
'boxcombo',
'aZ09');
122llxHeader(
"", $langs->trans(
"InvoicesArea"));
124print
load_fiche_titre($langs->trans(
"InvoicesArea"), $resultboxes[
'selectboxlist'],
'bill');
127print
'<div class="fichecenter">';
129print
'<div class="twocolumns">';
131print
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
155print $resultboxes[
'boxlista'];
157print
'</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
161if (
isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
162 $langs->load(
"boxes");
165 $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";
166 $sql .=
", f.date_lim_reglement as datelimite";
167 $sql .=
", s.nom as name";
168 $sql .=
", s.rowid as socid";
169 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.email";
170 $sql .=
", cc.rowid as country_id, cc.code as country_code";
171 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiement_facture as pf WHERE pf.fk_facture = f.rowid) as am";
172 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
173 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = f.fk_soc";
174 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
175 $sql .=
" WHERE f.entity IN (".getEntity(
'invoice').
")";
177 $sql .=
" AND f.fk_soc = ".((int) $socid);
180 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
181 $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).
")";
184 $parameters = array();
185 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerLastModified', $parameters);
186 $sql .= $hookmanager->resPrint;
188 $sql .=
" ORDER BY f.tms DESC";
189 $sql .=
$db->plimit($max, 0);
191 $resql =
$db->query($sql);
193 $num =
$db->num_rows($resql);
197 print
'<div class="div-table-responsive-no-min">';
198 print
'<table class="noborder centpercent">';
200 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastCustomerBills", $max);
201 print
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
204 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
206 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
207 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
208 print
'<th width="16"> </th>';
211 $total_ttc = $totalam = $total_ht = 0;
212 while ($i < $num && $i < $conf->liste_limit) {
213 $obj =
$db->fetch_object($resql);
218 $total_ht += $obj->total_ht;
219 $total_ttc += $obj->total_ttc;
223 $tmpinvoice->ref = $obj->ref;
224 $tmpinvoice->id = $obj->rowid;
225 $tmpinvoice->total_ht = $obj->total_ht;
226 $tmpinvoice->total_tva = $obj->total_tva;
227 $tmpinvoice->total_ttc = $obj->total_ttc;
228 $tmpinvoice->statut = $obj->status;
229 $tmpinvoice->status = $obj->status;
230 $tmpinvoice->paye = $obj->paye;
231 $tmpinvoice->paid = $obj->paye;
232 $tmpinvoice->date_lim_reglement =
$db->jdate($obj->datelimite);
233 $tmpinvoice->type = $obj->type;
235 $thirdpartystatic->id = $obj->socid;
236 $thirdpartystatic->name = $obj->name;
237 $thirdpartystatic->email = $obj->email;
238 $thirdpartystatic->country_id = $obj->country_id;
239 $thirdpartystatic->country_code = $obj->country_code;
240 $thirdpartystatic->email = $obj->email;
241 $thirdpartystatic->client = 1;
242 $thirdpartystatic->code_client = $obj->code_client;
244 $thirdpartystatic->code_compta_client = $obj->code_compta_client;
247 $totalallpayments = $tmpinvoice->getSommePaiement(0);
248 $totalallpayments += $tmpinvoice->getSumCreditNotesUsed(0);
249 $totalallpayments += $tmpinvoice->getSumDepositsUsed(0);
250 print
'<tr class="oddeven">';
251 print
'<td class="nowrap">';
253 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
255 print
'<td class="nobordernopadding nowraponall">';
256 print $tmpinvoice->getNomUrl(1,
'');
258 if ($tmpinvoice->hasDelay()) {
259 print
'<td width="20" class="nobordernopadding nowrap">';
263 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
266 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
267 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
268 print
'</td></tr></table>';
272 print
'<td class="tdoverflowmax150">';
273 print $thirdpartystatic->getNomUrl(1,
'customer', 44);
276 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
278 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
280 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>';
282 print
'<td>'.$tmpinvoice->getLibStatut(3, $totalallpayments).
'</td>';
286 $total_ttc += $obj->total_ttc;
287 $total_ht += $obj->total_ht;
288 $totalam += $obj->am;
294 print
'<tr class="oddeven">';
295 print
'<td class="nowrap" colspan="5">';
296 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
305 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
307 print
'</table></div><br>';
316if ((
isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"facture",
"lire")) || (
isModEnabled(
'supplier_invoice') && $user->hasRight(
"supplier_invoice",
"lire"))) {
317 $langs->load(
"boxes");
320 $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";
321 $sql .=
", s.nom as name";
322 $sql .=
", s.rowid as socid";
323 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.email";
324 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am";
325 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
326 $sql .=
" WHERE s.rowid = ff.fk_soc";
327 $sql .=
" AND ff.entity IN (".getEntity(
'facture_fourn').
")";
329 $sql .=
" AND ff.fk_soc = ".((int) $socid);
332 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
333 $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).
")";
336 $parameters = array();
337 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierLastModified', $parameters);
338 $sql .= $hookmanager->resPrint;
340 $sql .=
" ORDER BY ff.tms DESC";
341 $sql .=
$db->plimit($max, 0);
343 $resql =
$db->query($sql);
345 $num =
$db->num_rows($resql);
347 print
'<div class="div-table-responsive-no-min">';
348 print
'<table class="noborder centpercent">';
349 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastSupplierBills", $max);
350 print
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
353 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
355 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
356 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
357 print
'<th width="16"> </th>';
361 $total_ht = $total_ttc = $totalam = 0;
365 $obj =
$db->fetch_object($resql);
370 $total_ht += $obj->total_ht;
371 $total_ttc += $obj->total_ttc;
375 $facstatic->ref = $obj->ref;
376 $facstatic->id = $obj->rowid;
377 $facstatic->total_ht = $obj->total_ht;
378 $facstatic->total_tva = $obj->total_tva;
379 $facstatic->total_ttc = $obj->total_ttc;
380 $facstatic->statut = $obj->status;
381 $facstatic->status = $obj->status;
382 $facstatic->paye = $obj->paye;
383 $facstatic->paid = $obj->paye;
384 $facstatic->type = $obj->type;
385 $facstatic->ref_supplier = $obj->ref_supplier;
387 $thirdpartystatic->id = $obj->socid;
388 $thirdpartystatic->name = $obj->name;
389 $thirdpartystatic->email = $obj->email;
390 $thirdpartystatic->country_id = 0;
391 $thirdpartystatic->country_code =
'';
392 $thirdpartystatic->client = 0;
393 $thirdpartystatic->fournisseur = 1;
394 $thirdpartystatic->code_client =
'';
395 $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
396 $thirdpartystatic->code_compta_client =
'';
397 $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
399 print
'<tr class="oddeven nowraponall tdoverflowmax100"><td>';
400 print $facstatic->getNomUrl(1,
'');
402 print
'<td class="nowrap tdoverflowmax100">';
403 print $thirdpartystatic->getNomUrl(1,
'supplier');
406 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
408 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
409 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>';
411 $alreadypaid = $facstatic->getSommePaiement();
412 $alreadypaid += $facstatic->getSumCreditNotesUsed();
413 $alreadypaid += $facstatic->getSumDepositsUsed();
415 print
'<td>'.$facstatic->getLibStatut(3, $alreadypaid).
'</td>';
418 $total_ht += $obj->total_ht;
419 $total_ttc += $obj->total_ttc;
420 $totalam += $obj->am;
425 print
'<tr class="oddeven">';
426 print
'<td class="nowrap" colspan="5">';
427 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
436 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
438 print
'</table></div><br>';
447if (
isModEnabled(
'don') && $user->hasRight(
'don',
'lire')) {
448 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
450 $langs->load(
"boxes");
451 $donationstatic =
new Don(
$db);
453 $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";
454 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
455 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
457 $parameters = array();
458 $reshook = $hookmanager->executeHooks(
'printFieldListWhereLastDonations', $parameters);
459 $sql .= $hookmanager->resPrint;
461 $sql .=
$db->order(
"d.tms",
"DESC");
462 $sql .=
$db->plimit($max, 0);
464 $result =
$db->query($sql);
466 $num =
$db->num_rows($result);
471 print
'<div class="div-table-responsive-no-min">';
472 print
'<table class="noborder centpercent">';
473 print
'<tr class="liste_titre">';
474 print
'<th colspan="2">'.$langs->trans(
"BoxTitleLastModifiedDonations", $max);
475 print
'<a href="'.DOL_URL_ROOT.
'/don/list.php?sortfield=d.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
477 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
478 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
479 print
'<th width="16"> </th>';
483 $total_ttc = $totalam = $total_ht = 0;
485 while ($i < $num && $i < $max) {
486 $obj =
$db->fetch_object($result);
491 $total_ht += $obj->total_ht;
492 $total_ttc += $obj->total_ttc;
496 $donationstatic->id = $obj->rowid;
497 $donationstatic->ref = $obj->rowid;
498 $donationstatic->lastname = $obj->lastname;
499 $donationstatic->firstname = $obj->firstname;
500 $donationstatic->date =
$db->jdate($obj->date);
501 $donationstatic->status = $obj->status;
504 if (!empty($obj->socid)) {
506 $ret = $companystatic->fetch($obj->socid);
508 $label = $companystatic->getNomUrl(1);
511 $label = $donationstatic->getFullName($langs);
513 $label .= ($label ?
' - ' :
'').$obj->societe;
517 print
'<tr class="oddeven tdoverflowmax100">';
518 print
'<td>'.$donationstatic->getNomUrl(1).
'</td>';
519 print
'<td>'.$label.
'</td>';
520 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
521 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>';
522 print
'<td>'.$donationstatic->getLibStatut(3).
'</td>';
529 print
'<tr class="oddeven">';
530 print
'<td class="nowrap" colspan="5">';
531 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
536 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
538 print
'</table></div><br>';
547if (
isModEnabled(
'tax') && $user->hasRight(
'tax',
'charges',
'lire')) {
551 $sql =
"SELECT c.rowid, c.amount, c.date_ech, c.paye,";
552 $sql .=
" cc.libelle as label,";
553 $sql .=
" SUM(pc.amount) as totalpaid";
554 $sql .=
" FROM (".MAIN_DB_PREFIX.
"c_chargesociales as cc, ".MAIN_DB_PREFIX.
"chargesociales as c)";
555 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = c.rowid";
556 $sql .=
" WHERE c.fk_type = cc.id";
557 $sql .=
" AND c.entity IN (".getEntity(
'tax').
')';
558 $sql .=
" AND c.paye = 0";
560 $parameters = array();
561 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSocialContributions', $parameters);
562 $sql .= $hookmanager->resPrint;
564 $sql .=
" GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
566 $resql =
$db->query($sql);
568 $num =
$db->num_rows($resql);
570 print
'<div class="div-table-responsive-no-min">';
571 print
'<table class="noborder centpercent">';
572 print
'<tr class="liste_titre">';
573 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>';
574 print
'<th align="center">'.$langs->trans(
"DateDue").
'</th>';
575 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
576 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
577 print
'<th align="center" width="16"> </th>';
586 $obj =
$db->fetch_object($resql);
590 $tot_ttc += $obj->amount;
591 $tot_paid += $obj->totalpaid;
596 $chargestatic->id = $obj->rowid;
597 $chargestatic->ref = $obj->rowid;
598 $chargestatic->label = $obj->label;
599 $chargestatic->paye = $obj->paye;
600 $chargestatic->status = $obj->paye;
602 print
'<tr class="oddeven">';
603 print
'<td class="nowraponall">'.$chargestatic->getNomUrl(1).
'</td>';
604 print
'<td class="center">'.dol_print_date(
$db->jdate($obj->date_ech),
'day').
'</td>';
605 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
606 print
'<td class="nowrap right"><span class="amount">'.price($obj->totalpaid).
'</span></td>';
607 print
'<td class="center">'.$chargestatic->getLibStatut(3).
'</td>';
610 $tot_ttc += $obj->amount;
615 print
'<tr class="oddeven">';
616 print
'<td class="nowrap" colspan="5">';
617 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
622 print
'<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans(
"Total").
'</td>';
623 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
624 print
'<td class="nowrap right">'.price($tot_paid).
'</td>';
625 print
'<td class="right"> </td>';
628 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
630 print
"</table></div><br>";
643 $langs->load(
"orders");
645 $sql =
"SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc";
646 $sql .=
", s.nom as name, s.email";
647 $sql .=
", s.rowid as socid";
648 $sql .=
", s.code_client, s.code_compta as code_compta_client";
649 $sql .=
", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,";
650 $sql .=
" cc.rowid as country_id, cc.code as country_code";
651 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
652 $sql .=
", ".MAIN_DB_PREFIX.
"commande as c";
653 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
654 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
655 $sql .=
" WHERE c.fk_soc = s.rowid";
656 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
658 $sql .=
" AND c.fk_soc = ".((int) $socid);
661 $sql .=
" AND c.facture = 0";
663 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
664 $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).
")";
668 $parameters = array();
669 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerOrderToBill', $parameters);
670 $sql .= $hookmanager->resPrint;
672 $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";
674 $resql =
$db->query($sql);
676 $num =
$db->num_rows($resql);
682 print
'<div class="div-table-responsive-no-min">';
683 print
'<table class="noborder centpercent">';
685 print
'<tr class="liste_titre">';
686 print
'<th colspan="2">';
687 print $langs->trans(
"OrdersDeliveredToBill");
688 print
'<a href="'.DOL_URL_ROOT.
'/commande/list.php?search_status='.
Commande::STATUS_CLOSED.
'&search_billed=0">';
689 print
'<span class="badge marginleftonly">'.$num.
'</span>';
694 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
696 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
697 print
'<th class="right">'.$langs->trans(
"ToBill").
'</th>';
698 print
'<th align="center" width="16"> </th>';
701 $tot_ht = $tot_ttc = $tot_tobill = 0;
702 $total_ht = $total_ttc = 0;
705 $obj =
$db->fetch_object($resql);
710 $total_ht += $obj->total_ht;
711 $total_ttc += $obj->total_ttc;
715 $societestatic->id = $obj->socid;
716 $societestatic->name = $obj->name;
717 $societestatic->email = $obj->email;
718 $societestatic->country_id = $obj->country_id;
719 $societestatic->country_code = $obj->country_code;
720 $societestatic->client = 1;
721 $societestatic->code_client = $obj->code_client;
723 $societestatic->code_compta_client = $obj->code_compta_client;
726 $commandestatic->id = $obj->rowid;
727 $commandestatic->ref = $obj->ref;
728 $commandestatic->statut = $obj->status;
729 $commandestatic->status = $obj->status;
730 $commandestatic->billed = $obj->facture;
732 print
'<tr class="oddeven">';
733 print
'<td class="nowrap">';
735 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
736 print
'<td class="nobordernopadding nowrap">';
737 print $commandestatic->getNomUrl(1);
739 print
'<td width="20" class="nobordernopadding nowrap">';
742 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
745 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
746 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
747 print
'</td></tr></table>';
751 print
'<td class="nowrap tdoverflowmax100">';
752 print $societestatic->getNomUrl(1,
'customer');
755 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
757 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
758 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc - $obj->tot_fttc).
'</span></td>';
759 print
'<td>'.$commandestatic->getLibStatut(3).
'</td>';
761 $tot_ht += $obj->total_ht;
762 $tot_ttc += $obj->total_ttc;
764 $tot_tobill += ($obj->total_ttc - $obj->tot_fttc);
769 print
'<tr class="oddeven">';
770 print
'<td class="nowrap" colspan="5">';
771 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
776 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToBill").
': '.
price($tot_tobill).
')</span> </td>';
778 print
'<td class="right">'.price($tot_ht).
'</td>';
780 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
781 print
'<td class="nowrap right">'.price($tot_tobill).
'</td>';
782 print
'<td> </td>';
784 print
'</table></div><br>';
796 $langs->load(
"projects");
797 print
'<div class="div-table-responsive-no-min">';
798 print
'<table class="noborder centpercent">';
799 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"TasksToDo").
'</th>';
802 $resql =
$db->query($sql);
804 $num_rows =
$db->num_rows($resql);
805 while ($i < $num_rows) {
806 $obj =
$db->fetch_object($resql);
808 print
'<tr class="oddeven"><td>'.dol_print_date(
$db->jdate($obj->da),
"day").
'</td>';
809 print
'<td><a href="action/card.php">'.$obj->label.
'</a></td></tr>';
814 print
"</table></div><br>";
818print $resultboxes[
'boxlistb'];
820print
'</div></div></div>';
822$parameters = array(
'user' => $user);
824$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.
static saveboxorder($dbs, $zone, $boxorder, $userid=0)
Save order of boxes for area and user.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_now($mode='gmt')
Return date for now.
getDolUserInt($key, $default=0, $tmpuser=null)
Return Dolibarr user constant int value.
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
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.