36 require
'../main.inc.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
44 require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
54 $langs->loadLangs(array(
'compta',
'bills'));
56 $langs->load(
"orders");
60 $action =
GETPOST(
'action',
'aZ09');
65 if ($user->socid > 0) {
67 $socid = $user->socid;
70 $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
73 $maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
74 $maxLatestEditCount = 5;
75 $maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
78 $hookmanager->initHooks(array(
'invoiceindex'));
81 $maxofloop = (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
99 $thirdpartystatic =
new Societe($db);
101 llxHeader(
"", $langs->trans(
"AccountancyTreasuryArea"));
103 print
load_fiche_titre($langs->trans(
"AccountancyTreasuryArea"),
'',
'bill');
106 print
'<div class="fichecenter"><div class="fichethirdleft">';
128 print
'</div><div class="fichetwothirdright">';
132 if (
isModEnabled(
'facture') && !empty($user->rights->facture->lire)) {
133 $langs->load(
"boxes");
134 $tmpinvoice =
new Facture($db);
136 $sql =
"SELECT f.rowid, f.ref, f.fk_statut as status, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms";
137 $sql .=
", f.date_lim_reglement as datelimite";
138 $sql .=
", s.nom as name";
139 $sql .=
", s.rowid as socid";
140 $sql .=
", s.code_client, s.code_compta, s.email";
141 $sql .=
", cc.rowid as country_id, cc.code as country_code";
142 $sql .=
", sum(pf.amount) as am";
143 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays, ".MAIN_DB_PREFIX.
"facture as f";
144 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf on f.rowid=pf.fk_facture";
145 if (empty($user->rights->societe->client->voir) && !$socid) {
146 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
148 $sql .=
" WHERE s.rowid = f.fk_soc";
149 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
150 if (empty($user->rights->societe->client->voir) && !$socid) {
151 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
154 $sql .=
" AND f.fk_soc = ".((int) $socid);
157 $parameters = array();
158 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerLastModified', $parameters);
159 $sql .= $hookmanager->resPrint;
161 $sql .=
" GROUP BY f.rowid, f.ref, f.fk_statut, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
162 $sql .=
" s.nom, s.rowid, s.code_client, s.code_compta, s.email,";
163 $sql .=
" cc.rowid, cc.code";
164 $sql .=
" ORDER BY f.tms DESC";
165 $sql .= $db->plimit($max, 0);
167 $resql = $db->query($sql);
169 $num = $db->num_rows(
$resql);
173 print
'<div class="div-table-responsive-no-min">';
174 print
'<table class="noborder centpercent">';
175 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastCustomerBills", $max).
'</th>';
176 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
177 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
179 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
180 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
181 print
'<th width="16"> </th>';
184 $total_ttc = $totalam = $total_ht = 0;
185 while ($i < $num && $i < $conf->liste_limit) {
186 $obj = $db->fetch_object(
$resql);
191 $total_ht += $obj->total_ht;
192 $total_ttc += $obj->total_ttc;
196 $tmpinvoice->ref = $obj->ref;
197 $tmpinvoice->id = $obj->rowid;
198 $tmpinvoice->total_ht = $obj->total_ht;
199 $tmpinvoice->total_tva = $obj->total_tva;
200 $tmpinvoice->total_ttc = $obj->total_ttc;
201 $tmpinvoice->statut = $obj->status;
202 $tmpinvoice->paye = $obj->paye;
203 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
204 $tmpinvoice->type = $obj->type;
206 $thirdpartystatic->id = $obj->socid;
207 $thirdpartystatic->name = $obj->name;
208 $thirdpartystatic->email = $obj->email;
209 $thirdpartystatic->country_id = $obj->country_id;
210 $thirdpartystatic->country_code = $obj->country_code;
211 $thirdpartystatic->email = $obj->email;
212 $thirdpartystatic->client = 1;
213 $thirdpartystatic->code_client = $obj->code_client;
215 $thirdpartystatic->code_compta = $obj->code_compta;
218 print
'<tr class="oddeven">';
219 print
'<td class="nowrap">';
221 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
223 print
'<td class="nobordernopadding nowraponall">';
224 print $tmpinvoice->getNomUrl(1,
'');
226 if ($tmpinvoice->hasDelay()) {
227 print
'<td width="20" class="nobordernopadding nowrap">';
231 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
234 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
235 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
236 print
'</td></tr></table>';
240 print
'<td class="tdoverflowmax150">';
241 print $thirdpartystatic->getNomUrl(1,
'customer', 44);
243 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
244 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
246 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
248 print
'<td class="right" title="'.dol_escape_htmltag($langs->trans(
"DateModificationShort").
' : '.
dol_print_date($db->jdate($obj->tms),
'dayhour',
'tzuserrel')).
'">'.
dol_print_date($db->jdate($obj->tms),
'day',
'tzuserrel').
'</td>';
250 print
'<td>'.$tmpinvoice->getLibStatut(3, $obj->am).
'</td>';
254 $total_ttc += $obj->total_ttc;
255 $total_ht += $obj->total_ht;
256 $totalam += $obj->am;
262 print
'<tr class="oddeven">';
263 print
'<td class="nowrap" colspan="5">';
264 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
270 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
273 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
275 print
'</table></div><br>';
284 if ((
isModEnabled(
'fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight(
"fournisseur",
"facture",
"lire")) || (
isModEnabled(
'supplier_invoice') && $user->hasRight(
"supplier_invoice",
"lire"))) {
285 $langs->load(
"boxes");
288 $sql =
"SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier";
289 $sql .=
", s.nom as name";
290 $sql .=
", s.rowid as socid";
291 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.email";
292 $sql .=
", SUM(pf.amount) as am";
293 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
294 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
295 if (empty($user->rights->societe->client->voir) && !$socid) {
296 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
298 $sql .=
" WHERE s.rowid = ff.fk_soc";
299 $sql .=
" AND ff.entity = ".$conf->entity;
300 if (empty($user->rights->societe->client->voir) && !$socid) {
301 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
304 $sql .=
" AND ff.fk_soc = ".((int) $socid);
307 $parameters = array();
308 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierLastModified', $parameters);
309 $sql .= $hookmanager->resPrint;
311 $sql .=
" GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.type, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier,";
312 $sql .=
" s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur, s.email";
313 $sql .=
" ORDER BY ff.tms DESC ";
314 $sql .= $db->plimit($max, 0);
316 $resql = $db->query($sql);
318 $num = $db->num_rows(
$resql);
320 print
'<div class="div-table-responsive-no-min">';
321 print
'<table class="noborder centpercent">';
322 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastSupplierBills", $max).
'</th>';
323 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
324 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
326 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
327 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
328 print
'<th width="16"> </th>';
332 $total_ht = $total_ttc = $totalam = 0;
336 $obj = $db->fetch_object(
$resql);
341 $total_ht += $obj->total_ht;
342 $total_ttc += $obj->total_ttc;
346 $facstatic->ref = $obj->ref;
347 $facstatic->id = $obj->rowid;
348 $facstatic->total_ht = $obj->total_ht;
349 $facstatic->total_tva = $obj->total_tva;
350 $facstatic->total_ttc = $obj->total_ttc;
351 $facstatic->statut = $obj->status;
352 $facstatic->paye = $obj->paye;
353 $facstatic->type = $obj->type;
354 $facstatic->ref_supplier = $obj->ref_supplier;
356 $thirdpartystatic->id = $obj->socid;
357 $thirdpartystatic->name = $obj->name;
358 $thirdpartystatic->email = $obj->email;
359 $thirdpartystatic->country_id = 0;
360 $thirdpartystatic->country_code =
'';
361 $thirdpartystatic->client = 0;
362 $thirdpartystatic->fournisseur = 1;
363 $thirdpartystatic->code_client =
'';
364 $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
365 $thirdpartystatic->code_compta =
'';
366 $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
368 print
'<tr class="oddeven nowraponall tdoverflowmax100"><td>';
369 print $facstatic->getNomUrl(1,
'');
371 print
'<td class="nowrap tdoverflowmax100">';
372 print $thirdpartystatic->getNomUrl(1,
'supplier');
374 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
375 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
377 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
378 print
'<td class="right" title="'.dol_escape_htmltag($langs->trans(
"DateModificationShort").
' : '.
dol_print_date($db->jdate($obj->tms),
'dayhour',
'tzuserrel')).
'">'.
dol_print_date($db->jdate($obj->tms),
'day',
'tzuserrel').
'</td>';
379 $alreadypaid = $facstatic->getSommePaiement();
380 print
'<td>'.$facstatic->getLibStatut(3, $alreadypaid).
'</td>';
382 $total_ht += $obj->total_ht;
383 $total_ttc += $obj->total_ttc;
384 $totalam += $obj->am;
389 print
'<tr class="oddeven">';
390 print
'<td class="nowrap" colspan="5">';
391 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
397 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
400 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
402 print
'</table></div><br>';
411 if (
isModEnabled(
'don') && !empty($user->rights->don->lire)) {
412 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
414 $langs->load(
"boxes");
415 $donationstatic =
new Don($db);
417 $sql =
"SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status";
418 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
419 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
421 $parameters = array();
422 $reshook = $hookmanager->executeHooks(
'printFieldListWhereLastDonations', $parameters);
423 $sql .= $hookmanager->resPrint;
425 $sql .= $db->order(
"d.tms",
"DESC");
426 $sql .= $db->plimit($max, 0);
428 $result = $db->query($sql);
430 $num = $db->num_rows($result);
435 print
'<div class="div-table-responsive-no-min">';
436 print
'<table class="noborder centpercent">';
437 print
'<tr class="liste_titre">';
438 print
'<th>'.$langs->trans(
"BoxTitleLastModifiedDonations", $max).
'</th>';
440 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
441 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
442 print
'<th width="16"> </th>';
445 $total_ttc = $totalam = $total_ht = 0;
447 while ($i < $num && $i < $max) {
448 $obj = $db->fetch_object($result);
453 $total_ht += $obj->total_ht;
454 $total_ttc += $obj->total_ttc;
458 $donationstatic->id = $obj->rowid;
459 $donationstatic->ref = $obj->rowid;
460 $donationstatic->lastname = $obj->lastname;
461 $donationstatic->firstname = $obj->firstname;
462 $donationstatic->date = $db->jdate($obj->date);
463 $donationstatic->statut = $obj->status;
464 $donationstatic->status = $obj->status;
466 $label = $donationstatic->getFullName($langs);
468 $label .= ($label ?
' - ' :
'').$obj->societe;
471 print
'<tr class="oddeven tdoverflowmax100">';
472 print
'<td>'.$donationstatic->getNomUrl(1).
'</td>';
473 print
'<td>'.$label.
'</td>';
474 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
475 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>';
476 print
'<td>'.$donationstatic->getLibStatut(3).
'</td>';
483 print
'<tr class="oddeven">';
484 print
'<td class="nowrap" colspan="5">';
485 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
490 print
'<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans(
"None").
'</td></tr>';
492 print
'</table></div><br>';
501 if (
isModEnabled(
'tax') && !empty($user->rights->tax->charges->lire)) {
505 $sql =
"SELECT c.rowid, c.amount, c.date_ech, c.paye,";
506 $sql .=
" cc.libelle as label,";
507 $sql .=
" SUM(pc.amount) as sumpaid";
508 $sql .=
" FROM (".MAIN_DB_PREFIX.
"c_chargesociales as cc, ".MAIN_DB_PREFIX.
"chargesociales as c)";
509 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = c.rowid";
510 $sql .=
" WHERE c.fk_type = cc.id";
511 $sql .=
" AND c.entity IN (".getEntity(
'tax').
')';
512 $sql .=
" AND c.paye = 0";
514 $parameters = array();
515 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSocialContributions', $parameters);
516 $sql .= $hookmanager->resPrint;
518 $sql .=
" GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
520 $resql = $db->query($sql);
522 $num = $db->num_rows(
$resql);
524 print
'<div class="div-table-responsive-no-min">';
525 print
'<table class="noborder centpercent">';
526 print
'<tr class="liste_titre">';
527 print
'<th>'.$langs->trans(
"ContributionsToPay").($num ?
' <a href="'.DOL_URL_ROOT.
'/compta/sociales/list.php?status=0"><span class="badge">'.$num.
'</span></a>' :
'').
'</th>';
528 print
'<th align="center">'.$langs->trans(
"DateDue").
'</th>';
529 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
530 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
531 print
'<th align="center" width="16"> </th>';
539 $obj = $db->fetch_object(
$resql);
543 $tot_ttc += $obj->amount;
548 $chargestatic->id = $obj->rowid;
549 $chargestatic->ref = $obj->rowid;
550 $chargestatic->label = $obj->label;
551 $chargestatic->paye = $obj->paye;
552 $chargestatic->status = $obj->paye;
554 print
'<tr class="oddeven">';
555 print
'<td class="nowraponall">'.$chargestatic->getNomUrl(1).
'</td>';
556 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
557 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
558 print
'<td class="nowrap right"><span class="amount">'.price($obj->sumpaid).
'</span></td>';
559 print
'<td class="center">'.$chargestatic->getLibStatut(3).
'</td>';
562 $tot_ttc += $obj->amount;
567 print
'<tr class="oddeven">';
568 print
'<td class="nowrap" colspan="5">';
569 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
574 print
'<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans(
"Total").
'</td>';
575 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
576 print
'<td class="right"></td>';
577 print
'<td class="right"> </td>';
580 print
'<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans(
"None").
'</td></tr>';
582 print
"</table></div><br>";
593 if (
isModEnabled(
'facture') &&
isModEnabled(
'commande') && $user->hasRight(
"commande",
"lire") && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
594 $commandestatic =
new Commande($db);
595 $langs->load(
"orders");
597 $sql =
"SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc";
598 $sql .=
", s.nom as name, s.email";
599 $sql .=
", s.rowid as socid";
600 $sql .=
", s.code_client, s.code_compta";
601 $sql .=
", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,";
602 $sql .=
" cc.rowid as country_id, cc.code as country_code";
603 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
604 if (empty($user->rights->societe->client->voir) && !$socid) {
605 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
607 $sql .=
", ".MAIN_DB_PREFIX.
"commande as c";
608 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
609 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
610 $sql .=
" WHERE c.fk_soc = s.rowid";
611 $sql .=
" AND c.entity = ".$conf->entity;
612 if (empty($user->rights->societe->client->voir) && !$socid) {
613 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
616 $sql .=
" AND c.fk_soc = ".((int) $socid);
618 $sql .=
" AND c.fk_statut = ".Commande::STATUS_CLOSED;
619 $sql .=
" AND c.facture = 0";
621 $parameters = array();
622 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerOrderToBill', $parameters);
623 $sql .= $hookmanager->resPrint;
625 $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";
627 $resql = $db->query($sql);
629 $num = $db->num_rows(
$resql);
635 print
'<div class="div-table-responsive-no-min">';
636 print
'<table class="noborder centpercent">';
638 print
"<tr class=\"liste_titre\">";
639 print
'<th colspan="2">';
640 print $langs->trans(
"OrdersDeliveredToBill").
' ';
642 print
'<span class="badge">'.$num.
'</span>';
646 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
647 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
649 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
650 print
'<th class="right">'.$langs->trans(
"ToBill").
'</th>';
651 print
'<th align="center" width="16"> </th>';
654 $tot_ht = $tot_ttc = $tot_tobill = 0;
655 $societestatic =
new Societe($db);
657 $obj = $db->fetch_object(
$resql);
662 $total_ht += $obj->total_ht;
663 $total_ttc += $obj->total_ttc;
667 $societestatic->id = $obj->socid;
668 $societestatic->name = $obj->name;
669 $societestatic->email = $obj->email;
670 $societestatic->country_id = $obj->country_id;
671 $societestatic->country_code = $obj->country_code;
672 $societestatic->client = 1;
673 $societestatic->code_client = $obj->code_client;
675 $societestatic->code_compta = $obj->code_compta;
678 $commandestatic->id = $obj->rowid;
679 $commandestatic->ref = $obj->ref;
680 $commandestatic->statut = $obj->status;
681 $commandestatic->billed = $obj->facture;
683 print
'<tr class="oddeven">';
684 print
'<td class="nowrap">';
686 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
687 print
'<td class="nobordernopadding nowrap">';
688 print $commandestatic->getNomUrl(1);
690 print
'<td width="20" class="nobordernopadding nowrap">';
693 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
696 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
697 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
698 print
'</td></tr></table>';
702 print
'<td class="nowrap tdoverflowmax100">';
703 print $societestatic->getNomUrl(1,
'customer');
705 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
706 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
708 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
709 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc - $obj->tot_fttc).
'</span></td>';
710 print
'<td>'.$commandestatic->getLibStatut(3).
'</td>';
712 $tot_ht += $obj->total_ht;
713 $tot_ttc += $obj->total_ttc;
715 $tot_tobill += ($obj->total_ttc - $obj->tot_fttc);
720 print
'<tr class="oddeven">';
721 print
'<td class="nowrap" colspan="5">';
722 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
727 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToBill").
': '.
price($tot_tobill).
')</span> </td>';
728 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
729 print
'<td class="right">'.price($tot_ht).
'</td>';
731 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
732 print
'<td class="nowrap right">'.price($tot_tobill).
'</td>';
733 print
'<td> </td>';
735 print
'</table></div><br>';
747 print
'<div class="div-table-responsive-no-min">';
748 print
'<table class="noborder centpercent">';
749 print
'<tr class="liste_titre"><thcolspan="2">'.$langs->trans(
"TasksToDo").
'</th>';
752 while ($i < $db->num_rows(
$resql)) {
753 $obj = $db->fetch_object(
$resql);
755 print
'<tr class="oddeven"><td>'.dol_print_date($db->jdate($obj->da),
"day").
'</td>';
756 print
'<td><a href="action/card.php">'.$obj->label.
'</a></td></tr>';
760 print
"</table></div><br>";
764 print
'</div></div>';
766 $parameters = array(
'user' => $user);
767 $reshook = $hookmanager->executeHooks(
'dashboardAccountancy', $parameters, $object);
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
Class to manage customers orders.
const STATUS_CLOSED
Closed (Sent, billed or not)
Class to manage donations.
Class to manage suppliers invoices.
Class to manage invoices.
Class to manage third parties objects (customers, suppliers, prospects...)
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
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.
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.
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.