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 (empty($user->socid) && !$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 $totalallpayments = $tmpinvoice->getSommePaiement(0);
223 $totalallpayments += $tmpinvoice->getSumCreditNotesUsed(0);
224 $totalallpayments += $tmpinvoice->getSumDepositsUsed(0);
225 print
'<tr class="oddeven">';
226 print
'<td class="nowrap">';
228 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
230 print
'<td class="nobordernopadding nowraponall">';
231 print $tmpinvoice->getNomUrl(1,
'');
233 if ($tmpinvoice->hasDelay()) {
234 print
'<td width="20" class="nobordernopadding nowrap">';
238 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
241 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
242 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
243 print
'</td></tr></table>';
247 print
'<td class="tdoverflowmax150">';
248 print $thirdpartystatic->getNomUrl(1,
'customer', 44);
251 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
253 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
255 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>';
257 print
'<td>'.$tmpinvoice->getLibStatut(3, $totalallpayments).
'</td>';
261 $total_ttc += $obj->total_ttc;
262 $total_ht += $obj->total_ht;
263 $totalam += $obj->am;
269 print
'<tr class="oddeven">';
270 print
'<td class="nowrap" colspan="5">';
271 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
280 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
282 print
'</table></div><br>';
291if ((isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"facture",
"lire")) || (isModEnabled(
'supplier_invoice') && $user->hasRight(
"supplier_invoice",
"lire"))) {
292 $langs->load(
"boxes");
295 $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";
296 $sql .=
", s.nom as name";
297 $sql .=
", s.rowid as socid";
298 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.email";
299 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am";
300 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
301 $sql .=
" WHERE s.rowid = ff.fk_soc";
302 $sql .=
" AND ff.entity IN (".getEntity(
'facture_fourn').
")";
304 $sql .=
" AND ff.fk_soc = ".((int) $socid);
307 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
308 $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).
")";
311 $parameters = array();
312 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierLastModified', $parameters);
313 $sql .= $hookmanager->resPrint;
315 $sql .=
" ORDER BY ff.tms DESC";
316 $sql .= $db->plimit($max, 0);
318 $resql = $db->query($sql);
320 $num = $db->num_rows($resql);
322 print
'<div class="div-table-responsive-no-min">';
323 print
'<table class="noborder centpercent">';
324 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastSupplierBills", $max);
325 print
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
328 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
330 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
331 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
332 print
'<th width="16"> </th>';
336 $total_ht = $total_ttc = $totalam = 0;
340 $obj = $db->fetch_object($resql);
345 $total_ht += $obj->total_ht;
346 $total_ttc += $obj->total_ttc;
350 $facstatic->ref = $obj->ref;
351 $facstatic->id = $obj->rowid;
352 $facstatic->total_ht = $obj->total_ht;
353 $facstatic->total_tva = $obj->total_tva;
354 $facstatic->total_ttc = $obj->total_ttc;
355 $facstatic->statut = $obj->status;
356 $facstatic->status = $obj->status;
357 $facstatic->paye = $obj->paye;
358 $facstatic->paid = $obj->paye;
359 $facstatic->type = $obj->type;
360 $facstatic->ref_supplier = $obj->ref_supplier;
362 $thirdpartystatic->id = $obj->socid;
363 $thirdpartystatic->name = $obj->name;
364 $thirdpartystatic->email = $obj->email;
365 $thirdpartystatic->country_id = 0;
366 $thirdpartystatic->country_code =
'';
367 $thirdpartystatic->client = 0;
368 $thirdpartystatic->fournisseur = 1;
369 $thirdpartystatic->code_client =
'';
370 $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
371 $thirdpartystatic->code_compta_client =
'';
372 $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
374 print
'<tr class="oddeven nowraponall tdoverflowmax100"><td>';
375 print $facstatic->getNomUrl(1,
'');
377 print
'<td class="nowrap tdoverflowmax100">';
378 print $thirdpartystatic->getNomUrl(1,
'supplier');
381 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
383 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
384 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>';
385 $alreadypaid = $facstatic->getSommePaiement();
386 $alreadypaid += $facstatic->getSumCreditNotesUsed();
387 $alreadypaid += $facstatic->getSumDepositsUsed();
388 print
'<td>'.$facstatic->getLibStatut(3, $alreadypaid).
'</td>';
390 $total_ht += $obj->total_ht;
391 $total_ttc += $obj->total_ttc;
392 $totalam += $obj->am;
397 print
'<tr class="oddeven">';
398 print
'<td class="nowrap" colspan="5">';
399 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
408 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
410 print
'</table></div><br>';
419if (isModEnabled(
'don') && $user->hasRight(
'don',
'lire')) {
420 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
422 $langs->load(
"boxes");
423 $donationstatic =
new Don($db);
425 $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";
426 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
427 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
429 $parameters = array();
430 $reshook = $hookmanager->executeHooks(
'printFieldListWhereLastDonations', $parameters);
431 $sql .= $hookmanager->resPrint;
433 $sql .= $db->order(
"d.tms",
"DESC");
434 $sql .= $db->plimit($max, 0);
436 $result = $db->query($sql);
438 $num = $db->num_rows($result);
443 print
'<div class="div-table-responsive-no-min">';
444 print
'<table class="noborder centpercent">';
445 print
'<tr class="liste_titre">';
446 print
'<th colspan="2">'.$langs->trans(
"BoxTitleLastModifiedDonations", $max);
447 print
'<a href="'.DOL_URL_ROOT.
'/don/list.php?sortfield=d.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
449 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
450 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
451 print
'<th width="16"> </th>';
455 $total_ttc = $totalam = $total_ht = 0;
457 while ($i < $num && $i < $max) {
458 $obj = $db->fetch_object($result);
463 $total_ht += $obj->total_ht;
464 $total_ttc += $obj->total_ttc;
468 $donationstatic->id = $obj->rowid;
469 $donationstatic->ref = $obj->rowid;
470 $donationstatic->lastname = $obj->lastname;
471 $donationstatic->firstname = $obj->firstname;
472 $donationstatic->date = $db->jdate($obj->date);
473 $donationstatic->statut = $obj->status;
474 $donationstatic->status = $obj->status;
477 if (!empty($obj->socid)) {
478 $companystatic =
new Societe($db);
479 $ret = $companystatic->fetch($obj->socid);
481 $label = $companystatic->getNomUrl(1);
484 $label = $donationstatic->getFullName($langs);
486 $label .= ($label ?
' - ' :
'').$obj->societe;
490 print
'<tr class="oddeven tdoverflowmax100">';
491 print
'<td>'.$donationstatic->getNomUrl(1).
'</td>';
492 print
'<td>'.$label.
'</td>';
493 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
494 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>';
495 print
'<td>'.$donationstatic->getLibStatut(3).
'</td>';
502 print
'<tr class="oddeven">';
503 print
'<td class="nowrap" colspan="5">';
504 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
509 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
511 print
'</table></div><br>';
520if (isModEnabled(
'tax') && $user->hasRight(
'tax',
'charges',
'lire')) {
524 $sql =
"SELECT c.rowid, c.amount, c.date_ech, c.paye,";
525 $sql .=
" cc.libelle as label,";
526 $sql .=
" SUM(pc.amount) as sumpaid";
527 $sql .=
" FROM (".MAIN_DB_PREFIX.
"c_chargesociales as cc, ".MAIN_DB_PREFIX.
"chargesociales as c)";
528 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = c.rowid";
529 $sql .=
" WHERE c.fk_type = cc.id";
530 $sql .=
" AND c.entity IN (".getEntity(
'tax').
')';
531 $sql .=
" AND c.paye = 0";
533 $parameters = array();
534 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSocialContributions', $parameters);
535 $sql .= $hookmanager->resPrint;
537 $sql .=
" GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
539 $resql = $db->query($sql);
541 $num = $db->num_rows($resql);
543 print
'<div class="div-table-responsive-no-min">';
544 print
'<table class="noborder centpercent">';
545 print
'<tr class="liste_titre">';
546 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>';
547 print
'<th align="center">'.$langs->trans(
"DateDue").
'</th>';
548 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
549 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
550 print
'<th align="center" width="16"> </th>';
559 $obj = $db->fetch_object($resql);
563 $tot_ttc += $obj->amount;
564 $tot_paid += $obj->sumpaid;
569 $chargestatic->id = $obj->rowid;
570 $chargestatic->ref = $obj->rowid;
571 $chargestatic->label = $obj->label;
572 $chargestatic->paye = $obj->paye;
573 $chargestatic->status = $obj->paye;
575 print
'<tr class="oddeven">';
576 print
'<td class="nowraponall">'.$chargestatic->getNomUrl(1).
'</td>';
577 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
578 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
579 print
'<td class="nowrap right"><span class="amount">'.price($obj->sumpaid).
'</span></td>';
580 print
'<td class="center">'.$chargestatic->getLibStatut(3).
'</td>';
583 $tot_ttc += $obj->amount;
588 print
'<tr class="oddeven">';
589 print
'<td class="nowrap" colspan="5">';
590 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
595 print
'<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans(
"Total").
'</td>';
596 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
597 print
'<td class="nowrap right">'.price($tot_paid).
'</td>';
598 print
'<td class="right"> </td>';
601 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
603 print
"</table></div><br>";
614if (isModEnabled(
'invoice') && isModEnabled(
'order') && $user->hasRight(
"commande",
"lire") && !
getDolGlobalString(
'WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) {
615 $commandestatic =
new Commande($db);
616 $langs->load(
"orders");
618 $sql =
"SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc";
619 $sql .=
", s.nom as name, s.email";
620 $sql .=
", s.rowid as socid";
621 $sql .=
", s.code_client, s.code_compta";
622 $sql .=
", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,";
623 $sql .=
" cc.rowid as country_id, cc.code as country_code";
624 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
625 $sql .=
", ".MAIN_DB_PREFIX.
"commande as c";
626 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
627 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
628 $sql .=
" WHERE c.fk_soc = s.rowid";
629 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
631 $sql .=
" AND c.fk_soc = ".((int) $socid);
634 $sql .=
" AND c.facture = 0";
636 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
637 $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).
")";
641 $parameters = array();
642 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerOrderToBill', $parameters);
643 $sql .= $hookmanager->resPrint;
645 $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";
647 $resql = $db->query($sql);
649 $num = $db->num_rows($resql);
655 print
'<div class="div-table-responsive-no-min">';
656 print
'<table class="noborder centpercent">';
658 print
'<tr class="liste_titre">';
659 print
'<th colspan="2">';
660 print $langs->trans(
"OrdersDeliveredToBill");
661 print
'<a href="'.DOL_URL_ROOT.
'/commande/list.php?search_status='.
Commande::STATUS_CLOSED.
'&search_billed=0">';
662 print
'<span class="badge marginleftonly">'.$num.
'</span>';
667 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
669 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
670 print
'<th class="right">'.$langs->trans(
"ToBill").
'</th>';
671 print
'<th align="center" width="16"> </th>';
674 $tot_ht = $tot_ttc = $tot_tobill = 0;
675 $societestatic =
new Societe($db);
677 $obj = $db->fetch_object($resql);
682 $total_ht += $obj->total_ht;
683 $total_ttc += $obj->total_ttc;
687 $societestatic->id = $obj->socid;
688 $societestatic->name = $obj->name;
689 $societestatic->email = $obj->email;
690 $societestatic->country_id = $obj->country_id;
691 $societestatic->country_code = $obj->country_code;
692 $societestatic->client = 1;
693 $societestatic->code_client = $obj->code_client;
695 $societestatic->code_compta_client = $obj->code_compta;
698 $commandestatic->id = $obj->rowid;
699 $commandestatic->ref = $obj->ref;
700 $commandestatic->statut = $obj->status;
701 $commandestatic->billed = $obj->facture;
703 print
'<tr class="oddeven">';
704 print
'<td class="nowrap">';
706 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
707 print
'<td class="nobordernopadding nowrap">';
708 print $commandestatic->getNomUrl(1);
710 print
'<td width="20" class="nobordernopadding nowrap">';
713 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
716 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
717 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
718 print
'</td></tr></table>';
722 print
'<td class="nowrap tdoverflowmax100">';
723 print $societestatic->getNomUrl(1,
'customer');
726 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
728 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
729 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc - $obj->tot_fttc).
'</span></td>';
730 print
'<td>'.$commandestatic->getLibStatut(3).
'</td>';
732 $tot_ht += $obj->total_ht;
733 $tot_ttc += $obj->total_ttc;
735 $tot_tobill += ($obj->total_ttc - $obj->tot_fttc);
740 print
'<tr class="oddeven">';
741 print
'<td class="nowrap" colspan="5">';
742 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
747 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToBill").
': '.
price($tot_tobill).
')</span> </td>';
749 print
'<td class="right">'.price($tot_ht).
'</td>';
751 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
752 print
'<td class="nowrap right">'.price($tot_tobill).
'</td>';
753 print
'<td> </td>';
755 print
'</table></div><br>';
767 print
'<div class="div-table-responsive-no-min">';
768 print
'<table class="noborder centpercent">';
769 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"TasksToDo").
'</th>';
772 $resql = $db->query($sql);
774 $num_rows = $db->num_rows($resql);
775 while ($i < $num_rows) {
776 $obj = $db->fetch_object($resql);
778 print
'<tr class="oddeven"><td>'.dol_print_date($db->jdate($obj->da),
"day").
'</td>';
779 print
'<td><a href="action/card.php">'.$obj->label.
'</a></td></tr>';
784 print
"</table></div><br>";
788print
'</div></div></div>';
790$parameters = array(
'user' => $user);
791$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.