39 global $db, $langs, $conf, $user;
44 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/card.php?id='.
$object->id;
45 $head[$h][1] = $langs->trans(
'CustomerInvoice');
46 $head[$h][2] =
'compta';
50 $nbContact = count(
$object->liste_contact(-1,
'internal')) + count(
$object->liste_contact(-1,
'external'));
51 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/contact.php?id='.urlencode((
string) (
$object->id));
52 $head[$h][1] = $langs->trans(
'ContactsAddresses');
54 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
56 $head[$h][2] =
'contact';
60 if (isModEnabled(
'prelevement')) {
61 $nbStandingOrders = 0;
62 $sql =
"SELECT COUNT(pfd.rowid) as nb";
63 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
64 $sql .=
" WHERE pfd.fk_facture = ".((int)
$object->id);
65 $sql .=
" AND type = 'ban'";
66 $resql = $db->query($sql);
68 $obj = $db->fetch_object($resql);
70 $nbStandingOrders = $obj->nb;
75 $langs->load(
"banks");
77 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/prelevement.php?id='.urlencode((
string) (
$object->id));
78 $head[$h][1] = $langs->trans(
'StandingOrders');
79 if ($nbStandingOrders > 0) {
80 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbStandingOrders.
'</span>';
82 $head[$h][2] =
'standingorders';
94 if (!empty(
$object->note_private)) {
97 if (!empty(
$object->note_public)) {
100 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/note.php?id='.
$object->id;
101 $head[$h][1] = $langs->trans(
'Notes');
103 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
105 $head[$h][2] =
'note';
109 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
110 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
112 if (!empty($conf->facture->multidir_output[
$object->entity])) {
115 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
117 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/document.php?id='.
$object->id;
118 $head[$h][1] = $langs->trans(
'Documents');
119 if (($nbFiles + $nbLinks) > 0) {
120 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
122 $head[$h][2] =
'documents';
125 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/agenda.php?id='.
$object->id;
126 $head[$h][1] = $langs->trans(
"Events");
127 if (isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
130 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
131 $cachekey =
'count_events_facture_'.$object->id;
133 if (!is_null($dataretrieved)) {
134 $nbEvent = $dataretrieved;
136 $sql =
"SELECT COUNT(id) as nb";
137 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
138 $sql .=
" WHERE fk_element = ".((int)
$object->id);
139 $sql .=
" AND elementtype = 'invoice'";
140 $resql = $db->query($sql);
142 $obj = $db->fetch_object($resql);
145 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
151 $head[$h][1] .= $langs->trans(
"Agenda");
153 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
156 $head[$h][2] =
'agenda';
173 global $langs, $conf, $user, $db;
176 $extrafields->fetch_name_optionals_label(
'facture');
177 $extrafields->fetch_name_optionals_label(
'facturedet');
178 $extrafields->fetch_name_optionals_label(
'facture_rec');
179 $extrafields->fetch_name_optionals_label(
'facturedet_rec');
184 $head[$h][0] = DOL_URL_ROOT.
'/admin/invoice.php';
185 $head[$h][1] = $langs->trans(
"Miscellaneous");
186 $head[$h][2] =
'general';
189 $head[$h][0] = DOL_URL_ROOT.
'/admin/payment.php';
190 $head[$h][1] = $langs->trans(
"Payments");
191 $head[$h][2] =
'payment';
200 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/invoice_cust_extrafields.php';
201 $head[$h][1] = $langs->trans(
"ExtraFieldsCustomerInvoices");
202 $nbExtrafields = $extrafields->attributes[
'facture'][
'count'];
203 if ($nbExtrafields > 0) {
204 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
206 $head[$h][2] =
'attributes';
209 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/invoicedet_cust_extrafields.php';
210 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
211 $nbExtrafields = $extrafields->attributes[
'facturedet'][
'count'];
212 if ($nbExtrafields > 0) {
213 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
215 $head[$h][2] =
'attributeslines';
218 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/invoice_rec_cust_extrafields.php';
219 $head[$h][1] = $langs->trans(
"ExtraFieldsCustomerInvoicesRec");
220 $nbExtrafields = $extrafields->attributes[
'facture_rec'][
'count'];
221 if ($nbExtrafields > 0) {
222 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
224 $head[$h][2] =
'attributesrec';
227 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/invoicedet_rec_cust_extrafields.php';
228 $head[$h][1] = $langs->trans(
"ExtraFieldsLinesRec");
229 $nbExtrafields = $extrafields->attributes[
'facturedet_rec'][
'count'];
230 if ($nbExtrafields > 0) {
231 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
233 $head[$h][2] =
'attributeslinesrec';
237 $head[$h][0] = DOL_URL_ROOT.
'/admin/invoice_situation.php';
238 $head[$h][1] = $langs->trans(
"InvoiceSituation");
239 $head[$h][2] =
'situation';
257 global $db, $langs, $conf, $user;
262 $head[$h][0] = DOL_URL_ROOT .
'/compta/facture/card-rec.php?id=' .
$object->id;
263 $head[$h][1] = $langs->trans(
"RepeatableInvoice");
264 $head[$h][2] =
'card';
267 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/agenda-rec.php?id='.
$object->id;
268 $head[$h][1] = $langs->trans(
"Events");
269 if (isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
272 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
273 $cachekey =
'count_events_facturerec_'.$object->id;
275 if (!is_null($dataretrieved)) {
276 $nbEvent = $dataretrieved;
278 $sql =
"SELECT COUNT(id) as nb";
279 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
280 $sql .=
" WHERE fk_element = ".((int)
$object->id);
281 $sql .=
" AND elementtype = 'invoicerec'";
282 $resql = $db->query($sql);
284 $obj = $db->fetch_object($resql);
287 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
293 $head[$h][1] .= $langs->trans(
"Agenda");
295 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
298 $head[$h][2] =
'agenda';
320 global $db, $langs, $conf;
325 $head[$h][0] = DOL_URL_ROOT .
'/fourn/facture/card-rec.php?id=' .
$object->id;
326 $head[$h][1] = $langs->trans(
"RepeatableSupplierInvoice");
327 $head[$h][2] =
'card';
349 global $conf, $db, $langs, $user;
351 if (($mode ==
'customers' && isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire'))
352 || ($mode ==
'suppliers' && (isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) && $user->hasRight(
'fournisseur',
'facture',
'lire'))
354 global $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus8, $badgeStatus11;
355 include DOL_DOCUMENT_ROOT.
'/theme/'.$conf->theme.
'/theme_vars.inc.php';
357 $now = date_create(date(
'Y-m-d',
dol_now()));
358 $datenowsub30 = date_create(date(
'Y-m-d',
dol_now()));
359 $datenowsub15 = date_create(date(
'Y-m-d',
dol_now()));
360 $datenowadd30 = date_create(date(
'Y-m-d',
dol_now()));
361 $datenowadd15 = date_create(date(
'Y-m-d',
dol_now()));
362 $interval30days = date_interval_create_from_date_string(
'30 days');
363 $interval15days = date_interval_create_from_date_string(
'15 days');
364 date_sub($datenowsub30, $interval30days);
365 date_sub($datenowsub15, $interval15days);
366 date_add($datenowadd30, $interval30days);
367 date_add($datenowadd15, $interval15days);
370 $sql .=
" sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($datenowsub30,
'Y-m-d').
"'", 1, 0).
") as nblate30";
371 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($datenowsub15,
'Y-m-d').
"'", 1, 0).
") as nblate15";
372 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($now,
'Y-m-d').
"'", 1, 0).
") as nblatenow";
373 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement >= '".date_format($now,
'Y-m-d').
"' OR f.date_lim_reglement IS NULL", 1, 0).
") as nbnotlatenow";
374 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement > '".date_format($datenowadd15,
'Y-m-d').
"'", 1, 0).
") as nbnotlate15";
375 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement > '".date_format($datenowadd30,
'Y-m-d').
"'", 1, 0).
") as nbnotlate30";
376 if ($mode ==
'customers') {
377 $element =
'invoice';
378 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
379 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
380 $element =
'supplier_invoice';
381 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as f";
385 $sql .=
" WHERE f.entity IN (".getEntity($element).
")";
386 $sql .=
" AND f.type <> 2";
387 $sql .=
" AND f.fk_statut = 1";
388 if (isset($user->socid) && $user->socid > 0) {
389 $sql .=
" AND f.fk_soc = ".((int) $user->socid);
392 $resql = $db->query($sql);
394 $num = $db->num_rows($resql);
397 $dataseries = array();
400 $obj = $db->fetch_object($resql);
409 $dataseries[$i] = array($langs->transnoentitiesnoconv(
'NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
412 if (!empty($dataseries[0])) {
413 foreach ($dataseries[0] as $key => $value) {
414 if (is_numeric($value)) {
420 $langs->trans(
'InvoiceLate30Days'),
421 $langs->trans(
'InvoiceLate15Days'),
422 $langs->trans(
'InvoiceLateMinus15Days'),
423 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate') : $langs->trans(
"InvoiceToPay"),
424 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate15Days') : $langs->trans(
"InvoiceToPay15Days"),
425 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate30Days') : $langs->trans(
"InvoiceToPay30Days"),
428 $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11,
'-'.$badgeStatus11);
430 $result =
'<div class="div-table-responsive-no-min">';
431 $result .=
'<table class="noborder nohover centpercent">';
432 $result .=
'<tr class="liste_titre">';
433 $result .=
'<td>'.$langs->trans(
"NbOfOpenInvoices").
' - ';
434 if ($mode ==
'customers') {
435 $result .= $langs->trans(
"CustomerInvoice");
436 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
437 $result .= $langs->trans(
"SupplierInvoice");
444 if ($conf->use_javascript_ajax) {
447 $dolgraph->SetData($dataseries);
449 $dolgraph->setLegend($legend);
451 $dolgraph->SetDataColor(array_values($colorseries));
452 $dolgraph->setShowLegend(2);
453 $dolgraph->setShowPercent(1);
454 $dolgraph->SetType(array(
'bars',
'bars',
'bars',
'bars',
'bars',
'bars'));
456 $dolgraph->setHeight(
'160');
457 $dolgraph->setWidth(
'450');
458 $dolgraph->setHideXValues(
true);
459 if ($mode ==
'customers') {
460 $dolgraph->draw(
'idgraphcustomerinvoices');
461 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
462 $dolgraph->draw(
'idgraphfourninvoices');
466 $result .=
'<tr maxwidth="255">';
467 $result .=
'<td class="center">'.$dolgraph->show($total ? 0 : $langs->trans(
"NoOpenInvoice")).
'</td>';
473 $result .=
'</table>';
493 global $conf, $db, $langs, $user, $hookmanager;
497 if (isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
498 if ($user->socid > 0) $socid = $user->socid;
499 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
501 $tmpinvoice =
new Facture($db);
503 $sql =
"SELECT f.rowid, f.ref, f.datef as date, f.total_ht, f.total_tva, f.total_ttc, f.ref_client";
504 $sql .=
", f.type, f.fk_statut as status, f.paye";
505 $sql .=
", s.nom as name";
506 $sql .=
", s.rowid as socid, s.email";
507 $sql .=
", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
508 $sql .=
", cc.rowid as country_id, cc.code as country_code";
509 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
510 $sql .=
", sc.fk_soc, sc.fk_user ";
512 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
513 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
514 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
516 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT;
517 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
518 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
519 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
523 $sql .=
" AND f.fk_soc = ".((int) $socid);
526 $parameters = array();
527 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerDraft', $parameters);
528 $sql .= $hookmanager->resPrint;
530 $sql .=
" GROUP BY f.rowid, f.ref, f.datef, f.total_ht, f.total_tva, f.total_ttc, f.ref_client, f.type, f.fk_statut, f.paye,";
531 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,";
532 $sql .=
" cc.rowid, cc.code";
533 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
534 $sql .=
", sc.fk_soc, sc.fk_user";
538 $parameters = array();
539 $reshook = $hookmanager->executeHooks(
'printFieldListGroupByCustomerDraft', $parameters);
540 $sql .= $hookmanager->resPrint;
542 $resql = $db->query($sql);
545 $num = $db->num_rows($resql);
546 $nbofloop = min($num, $maxofloop);
548 $result .=
'<div class="div-table-responsive-no-min">';
549 $result .=
'<table class="noborder centpercent">';
551 $result .=
'<tr class="liste_titre">';
552 $result .=
'<th colspan="3">';
553 $result .= $langs->trans(
"CustomersDraftInvoices");
554 $result .=
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?search_status='.
Facture::STATUS_DRAFT.
'">';
555 $result .=
'<span class="badge marginleftonly">'.$num.
'</span>';
561 $companystatic =
new Societe($db);
566 while ($i < $nbofloop) {
567 $obj = $db->fetch_object($resql);
569 if ($i >= $maxCount) {
572 $tot_ttc += $obj->total_ttc;
576 $tmpinvoice->id = $obj->rowid;
577 $tmpinvoice->ref = $obj->ref;
578 $tmpinvoice->date = $db->jdate($obj->date);
579 $tmpinvoice->type = $obj->type;
580 $tmpinvoice->total_ht = $obj->total_ht;
581 $tmpinvoice->total_tva = $obj->total_tva;
582 $tmpinvoice->total_ttc = $obj->total_ttc;
583 $tmpinvoice->ref_client = $obj->ref_client;
584 $tmpinvoice->statut = $obj->status;
585 $tmpinvoice->paye = $obj->paye;
587 $companystatic->id = $obj->socid;
588 $companystatic->name = $obj->name;
589 $companystatic->email = $obj->email;
590 $companystatic->country_id = $obj->country_id;
591 $companystatic->country_code = $obj->country_code;
592 $companystatic->client = 1;
593 $companystatic->code_client = $obj->code_client;
594 $companystatic->code_fournisseur = $obj->code_fournisseur;
595 $companystatic->code_compta = $obj->code_compta;
596 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
598 $result .=
'<tr class="oddeven">';
599 $result .=
'<td class="nowrap tdoverflowmax100">';
600 $result .= $tmpinvoice->getNomUrl(1,
'');
602 $result .=
'<td class="nowrap tdoverflowmax100">';
603 $result .= $companystatic->getNomUrl(1,
'customer');
605 $result .=
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
607 $tot_ttc += $obj->total_ttc;
612 $result .=
'<tr class="oddeven">';
613 $result .=
'<td class="nowrap" colspan="3">';
614 $result .=
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
616 $result .=
"</tr>\n";
619 $result .=
'<tr class="liste_total"><td class="left">'.$langs->trans(
"Total").
'</td>';
620 $result .=
'<td colspan="2" class="right">'.price($tot_ttc).
'</td>';
623 $result .=
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
625 $result .=
"</table></div>";
644 global $conf, $db, $langs, $user, $hookmanager;
648 if ((isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) && $user->hasRight(
'facture',
'lire')) {
649 if ($user->socid > 0) $socid = $user->socid;
650 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
654 $sql =
"SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier, f.fk_statut as status, f.paye";
655 $sql .=
", s.nom as name";
656 $sql .=
", s.rowid as socid, s.email";
657 $sql .=
", s.code_client, s.code_compta";
658 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
659 $sql .=
", cc.rowid as country_id, cc.code as country_code";
660 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as f, ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
661 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
662 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
664 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".FactureFournisseur::STATUS_DRAFT;
665 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
666 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
667 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
670 $sql .=
" AND f.fk_soc = ".((int) $socid);
673 $parameters = array();
674 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierDraft', $parameters);
675 $sql .= $hookmanager->resPrint;
676 $resql = $db->query($sql);
679 $num = $db->num_rows($resql);
680 $nbofloop = min($num, $maxofloop);
682 $result .=
'<div class="div-table-responsive-no-min">';
683 $result .=
'<table class="noborder centpercent">';
685 $result .=
'<tr class="liste_titre">';
686 $result .=
'<th colspan="3">';
687 $result .= $langs->trans(
"SuppliersDraftInvoices");
689 $result .=
'<span class="badge marginleftonly">'.$num.
'</span>';
695 $companystatic =
new Societe($db);
700 while ($i < $nbofloop) {
701 $obj = $db->fetch_object($resql);
703 if ($i >= $maxCount) {
706 $tot_ttc += $obj->total_ttc;
710 $facturesupplierstatic->ref = $obj->ref;
711 $facturesupplierstatic->id = $obj->rowid;
712 $facturesupplierstatic->total_ht = $obj->total_ht;
713 $facturesupplierstatic->total_tva = $obj->total_tva;
714 $facturesupplierstatic->total_ttc = $obj->total_ttc;
715 $facturesupplierstatic->ref_supplier = $obj->ref_supplier;
716 $facturesupplierstatic->type = $obj->type;
717 $facturesupplierstatic->statut = $obj->status;
718 $facturesupplierstatic->statusi = $obj->status;
719 $facturesupplierstatic->paye = $obj->paye;
720 $facturesupplierstatic->paid = $obj->paye;
722 $companystatic->id = $obj->socid;
723 $companystatic->name = $obj->name;
724 $companystatic->email = $obj->email;
725 $companystatic->country_id = $obj->country_id;
726 $companystatic->country_code = $obj->country_code;
727 $companystatic->fournisseur = 1;
728 $companystatic->code_client = $obj->code_client;
729 $companystatic->code_fournisseur = $obj->code_fournisseur;
730 $companystatic->code_compta = $obj->code_compta;
731 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
733 $result .=
'<tr class="oddeven">';
734 $result .=
'<td class="nowrap tdoverflowmax100">';
735 $result .= $facturesupplierstatic->getNomUrl(1,
'');
737 $result .=
'<td class="nowrap tdoverflowmax100">';
738 $result .= $companystatic->getNomUrl(1,
'supplier');
740 $result .=
'<td class="right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
742 $tot_ttc += $obj->total_ttc;
747 $result .=
'<tr class="oddeven">';
748 $result .=
'<td class="nowrap" colspan="3">';
749 $result .=
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
751 $result .=
"</tr>\n";
754 $result .=
'<tr class="liste_total"><td class="left">'.$langs->trans(
"Total").
'</td>';
755 $result .=
'<td colspan="2" class="right">'.price($tot_ttc).
'</td>';
758 $result .=
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
760 $result .=
"</table></div>";
780 global $conf, $db, $langs, $user;
781 if ($user->socid > 0) $socid = $user->socid;
782 $sql =
"SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, f.type, f.total_ht, f.total_tva, f.total_ttc, f.datec,";
783 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client";
784 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
785 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
786 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
787 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
789 $sql .=
" WHERE f.fk_soc = s.rowid";
790 $sql .=
" AND f.entity IN (".getEntity(
'facture').
")";
792 $sql .=
" AND f.fk_soc = ".((int) $socid);
794 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
795 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
797 $sql .=
" ORDER BY f.tms DESC";
798 $sql .= $db->plimit($maxCount, 0);
800 $resql = $db->query($sql);
805 $num = $db->num_rows($resql);
807 $result =
'<div class="div-table-responsive-no-min">';
808 $result .=
'<table class="noborder centpercent">';
810 $result .=
'<tr class="liste_titre">';
811 $result .=
'<th colspan="3">'.$langs->trans(
"LastCustomersBills", $maxCount).
'</th>';
812 $result .=
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
813 $result .=
'<th class="right"></th>';
817 $result .=
'</table>';
823 $objectstatic =
new Facture($db);
824 $companystatic =
new Societe($db);
828 $obj = $db->fetch_object($resql);
830 $objectstatic->id = $obj->rowid;
831 $objectstatic->ref = $obj->ref;
832 $objectstatic->paye = $obj->paye;
833 $objectstatic->statut = $obj->status;
834 $objectstatic->total_ht = $obj->total_ht;
835 $objectstatic->total_tva = $obj->total_tva;
836 $objectstatic->total_ttc = $obj->total_ttc;
837 $objectstatic->type = $obj->type;
839 $companystatic->id = $obj->socid;
840 $companystatic->name = $obj->socname;
841 $companystatic->client = $obj->client;
842 $companystatic->canvas = $obj->canvas;
845 $filedir = $conf->propal->multidir_output[$obj->entity].
'/'.$filename;
847 $result .=
'<tr class="nowrap">';
849 $result .=
'<td class="oddeven">';
850 $result .=
'<table class="nobordernopadding">';
851 $result .=
'<tr class="nocellnopadd">';
853 $result .=
'<td width="96" class="nobordernopadding nowrap">'.$objectstatic->getNomUrl(1).
'</td>';
854 $result .=
'<td width="16" class="nobordernopadding nowrap"> </td>';
855 $result .=
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).
'</td>';
858 $result .=
'</table>';
861 $result .=
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
862 $result .=
'<td>'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
863 $result .=
'<td class="right amount">'.price($obj->total_ttc).
'</td>';
866 $payment = $objectstatic->getSommePaiement();
867 $result .=
'<td class="right">'.$objectstatic->getLibStatut(5, $payment).
'</td>';
874 $result .=
'</table>';
888 global $conf, $db, $langs, $user;
889 if ($user->socid > 0) $socid = $user->socid;
890 $sql =
"SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier, f.datec,";
891 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client";
892 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as f";
893 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
894 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
895 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
897 $sql .=
" WHERE f.fk_soc = s.rowid";
898 $sql .=
" AND f.entity IN (".getEntity(
'facture_fourn').
")";
900 $sql .=
" AND f.fk_soc = ".((int) $socid);
902 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
903 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
905 $sql .=
" ORDER BY f.tms DESC";
906 $sql .= $db->plimit($maxCount, 0);
908 $resql = $db->query($sql);
914 $num = $db->num_rows($resql);
916 $result =
'<div class="div-table-responsive-no-min">';
917 $result .=
'<table class="noborder centpercent">';
918 $result .=
'<tr class="liste_titre">';
919 $result .=
'<th colspan="3">'.$langs->trans(
"BoxTitleLastSupplierBills", $maxCount).
' ';
920 $result .=
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?sortfield=f.tms&sortorder=DESC">';
921 $result .=
'<span class="badge">...</span>';
924 $result .=
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
925 $result .=
'<th class="right"></th>';
929 $result .=
'</table>';
935 $companystatic =
new Societe($db);
940 $obj = $db->fetch_object($resql);
942 $objectstatic->id = $obj->rowid;
943 $objectstatic->ref = $obj->ref;
944 $objectstatic->paye = $obj->paye;
945 $objectstatic->paid = $obj->paye;
946 $objectstatic->statut = $obj->status;
947 $objectstatic->status = $obj->status;
948 $objectstatic->total_ht = $obj->total_ht;
949 $objectstatic->total_tva = $obj->total_tva;
950 $objectstatic->total_ttc = $obj->total_ttc;
951 $objectstatic->type = $obj->type;
953 $companystatic->id = $obj->socid;
954 $companystatic->name = $obj->socname;
955 $companystatic->client = $obj->client;
956 $companystatic->canvas = $obj->canvas;
959 $filedir = $conf->propal->multidir_output[$obj->entity].
'/'.$filename;
961 $result .=
'<tr class="nowrap">';
963 $result .=
'<td class="oddeven">';
964 $result .=
'<table class="nobordernopadding">';
965 $result .=
'<tr class="nocellnopadd">';
967 $result .=
'<td width="96" class="nobordernopadding nowrap">'.$objectstatic->getNomUrl(1).
'</td>';
968 $result .=
'<td width="16" class="nobordernopadding nowrap"> </td>';
969 $result .=
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).
'</td>';
972 $result .=
'</table>';
975 $result .=
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
977 $result .=
'<td>'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
979 $result .=
'<td class="amount right">'.price($obj->total_ttc).
'</td>';
981 $result .=
'<td class="right">'.$objectstatic->getLibStatut(5).
'</td>';
988 $result .=
'</table>';
1002 global $conf, $db, $langs, $user, $hookmanager;
1006 if (isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
1007 if ($user->socid > 0) $socid = $user->socid;
1008 $tmpinvoice =
new Facture($db);
1010 $sql =
"SELECT f.rowid, f.ref, f.fk_statut as status, f.datef, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms";
1011 $sql .=
", f.date_lim_reglement as datelimite";
1012 $sql .=
", s.nom as name";
1013 $sql .=
", s.rowid as socid, s.email";
1014 $sql .=
", s.code_client, s.code_compta";
1015 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1016 $sql .=
", cc.rowid as country_id, cc.code as country_code";
1017 $sql .=
", sum(pf.amount) as am";
1018 $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";
1019 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf on f.rowid=pf.fk_facture";
1020 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
1021 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1023 $sql .=
" WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = ".Facture::STATUS_VALIDATED;
1024 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
1025 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
1026 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1029 $sql .=
" AND f.fk_soc = ".((int) $socid);
1032 $parameters = array();
1033 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerUnpaid', $parameters);
1034 $sql .= $hookmanager->resPrint;
1036 $sql .=
" GROUP BY f.rowid, f.ref, f.fk_statut, f.datef, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
1037 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, cc.rowid, cc.code";
1038 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1039 $sql .=
" ORDER BY f.datef ASC, f.ref ASC";
1041 $resql = $db->query($sql);
1043 $num = $db->num_rows($resql);
1049 print
'<div class="div-table-responsive-no-min">';
1050 print
'<table class="noborder centpercent">';
1052 print
'<tr class="liste_titre">';
1053 print
'<th colspan="2">';
1054 print $langs->trans(
"BillsCustomersUnpaid", $num).
' ';
1056 print
'<span class="badge">'.$num.
'</span>';
1060 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1062 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1064 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1065 print
'<th class="right">'.$langs->trans(
"Received").
'</th>';
1066 print
'<th width="16"> </th>';
1069 $societestatic =
new Societe($db);
1070 $total_ttc = $totalam = $total = 0;
1072 $obj = $db->fetch_object($resql);
1074 if ($i >= $maxCount) {
1077 $total += $obj->total_ht;
1078 $total_ttc += $obj->total_ttc;
1079 $totalam += $obj->am;
1083 $tmpinvoice->ref = $obj->ref;
1084 $tmpinvoice->id = $obj->rowid;
1085 $tmpinvoice->total_ht = $obj->total_ht;
1086 $tmpinvoice->total_tva = $obj->total_tva;
1087 $tmpinvoice->total_ttc = $obj->total_ttc;
1088 $tmpinvoice->type = $obj->type;
1089 $tmpinvoice->statut = $obj->status;
1090 $tmpinvoice->paye = $obj->paye;
1091 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
1093 $societestatic->id = $obj->socid;
1094 $societestatic->name = $obj->name;
1095 $societestatic->email = $obj->email;
1096 $societestatic->country_id = $obj->country_id;
1097 $societestatic->country_code = $obj->country_code;
1098 $societestatic->client = 1;
1099 $societestatic->code_client = $obj->code_client;
1100 $societestatic->code_fournisseur = $obj->code_fournisseur;
1101 $societestatic->code_compta = $obj->code_compta;
1102 $societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1104 print
'<tr class="oddeven">';
1105 print
'<td class="nowrap">';
1107 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1108 print
'<td class="nobordernopadding nowrap">';
1109 print $tmpinvoice->getNomUrl(1,
'');
1111 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
1114 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
1115 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
1116 print
'</td></tr></table>';
1119 print
'<td class="nowrap tdoverflowmax100">';
1120 print $societestatic->getNomUrl(1,
'customer');
1122 print
'<td class="right">';
1124 if ($tmpinvoice->hasDelay()) {
1129 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
1131 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
1132 print
'<td class="nowrap right"><span class="amount">'.price($obj->am).
'</span></td>';
1133 print
'<td>'.$tmpinvoice->getLibStatut(3, $obj->am).
'</td>';
1136 $total_ttc += $obj->total_ttc;
1137 $total += $obj->total_ht;
1138 $totalam += $obj->am;
1148 print
'<tr class="oddeven">';
1149 print
'<td class="nowrap" colspan="'.$colspan.
'">';
1150 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1155 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToTake").
': '.
price($total_ttc - $totalam).
')</span> </td>';
1156 print
'<td> </td>';
1158 print
'<td class="right"><span class="amount">'.price($total).
'</span></td>';
1160 print
'<td class="nowrap right"><span class="amount">'.price($total_ttc).
'</span></td>';
1161 print
'<td class="nowrap right"><span class="amount">'.price($totalam).
'</span></td>';
1162 print
'<td> </td>';
1169 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
1171 print
'</table></div><br>';
1191 global $conf, $db, $langs, $user, $hookmanager;
1195 if (isModEnabled(
"supplier_invoice") && ($user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'supplier_invoice',
'read'))) {
1196 if ($user->socid > 0) $socid = $user->socid;
1199 $sql =
"SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle as label, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye";
1200 $sql .=
", ff.date_lim_reglement";
1201 $sql .=
", s.nom as name";
1202 $sql .=
", s.rowid as socid, s.email";
1203 $sql .=
", s.code_client, s.code_compta";
1204 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1205 $sql .=
", sum(pf.amount) as am";
1206 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
1207 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
1208 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
1209 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1211 $sql .=
" WHERE s.rowid = ff.fk_soc";
1212 $sql .=
" AND ff.entity = ".$conf->entity;
1213 $sql .=
" AND ff.paye = 0";
1214 $sql .=
" AND ff.fk_statut = ".FactureFournisseur::STATUS_VALIDATED;
1215 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
1216 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1219 $sql .=
" AND ff.fk_soc = ".((int) $socid);
1222 $parameters = array();
1223 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierUnpaid', $parameters);
1224 $sql .= $hookmanager->resPrint;
1226 $sql .=
" GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.type, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye, ff.date_lim_reglement,";
1227 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
1228 $sql .=
" ORDER BY ff.date_lim_reglement ASC";
1230 $resql = $db->query($sql);
1232 $num = $db->num_rows($resql);
1237 print
'<div class="div-table-responsive-no-min">';
1238 print
'<table class="noborder centpercent">';
1240 print
'<tr class="liste_titre">';
1241 print
'<th colspan="2">';
1242 print $langs->trans(
"BillsSuppliersUnpaid", $num).
' ';
1244 print
'<span class="badge">'.$num.
'</span>';
1248 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1250 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1252 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1253 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
1254 print
'<th width="16"> </th>';
1256 $societestatic =
new Societe($db);
1259 $total = $total_ttc = $totalam = 0;
1261 $obj = $db->fetch_object($resql);
1263 if ($i >= $maxCount) {
1266 $total += $obj->total_ht;
1267 $total_ttc += $obj->total_ttc;
1271 $facstatic->ref = $obj->ref;
1272 $facstatic->id = $obj->rowid;
1273 $facstatic->type = $obj->type;
1274 $facstatic->total_ht = $obj->total_ht;
1275 $facstatic->total_tva = $obj->total_tva;
1276 $facstatic->total_ttc = $obj->total_ttc;
1277 $facstatic->statut = $obj->status;
1278 $facstatic->status = $obj->status;
1279 $facstatic->paid = $obj->paye;
1280 $facstatic->paye = $obj->paye;
1282 $societestatic->id = $obj->socid;
1283 $societestatic->name = $obj->name;
1284 $societestatic->email = $obj->email;
1285 $societestatic->client = 0;
1286 $societestatic->fournisseur = 1;
1287 $societestatic->code_client = $obj->code_client;
1288 $societestatic->code_fournisseur = $obj->code_fournisseur;
1289 $societestatic->code_compta = $obj->code_compta;
1290 $societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1292 print
'<tr class="oddeven">';
1293 print
'<td class="nowrap tdoverflowmax100">';
1294 print $facstatic->getNomUrl(1,
'');
1296 print
'<td class="nowrap tdoverflowmax100">'.$societestatic->getNomUrl(1,
'supplier').
'</td>';
1297 print
'<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement),
'day').
'</td>';
1299 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
1301 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
1302 print
'<td class="nowrap right"><span class="amount">'.price($obj->am).
'</span></td>';
1303 print
'<td>'.$facstatic->getLibStatut(3, $obj->am).
'</td>';
1305 $total += $obj->total_ht;
1306 $total_ttc += $obj->total_ttc;
1307 $totalam += $obj->am;
1316 print
'<tr class="oddeven">';
1317 print
'<td class="nowrap" colspan="'.$colspan.
'">';
1318 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1323 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToPay").
': '.
price($total_ttc - $totalam).
')</span> </td>';
1324 print
'<td> </td>';
1326 print
'<td class="right">'.price($total).
'</td>';
1328 print
'<td class="nowrap right">'.price($total_ttc).
'</td>';
1329 print
'<td class="nowrap right">'.price($totalam).
'</td>';
1330 print
'<td> </td>';
1337 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
1339 print
'</table></div><br>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage suppliers invoices.
const STATUS_VALIDATED
Validated (need to be paid)
Class to manage invoices.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated (need to be paid)
static count($dbs, $objecttype, $objectid)
Return nb of links.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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).
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...
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
getNumberInvoicesPieChart($mode)
Return an HTML table that contains a pie chart of the number of customers or supplier invoices.
invoice_admin_prepare_head()
Return array head with list of tabs to view object information.
getCustomerInvoiceLatestEditTable($maxCount=5, $socid=0)
Return a HTML table that contains a list with latest edited customer invoices.
invoice_rec_prepare_head($object)
Return array head with list of tabs to view object information.
getPurchaseInvoiceLatestEditTable($maxCount=5, $socid=0)
Return a HTML table that contains a list with latest edited supplier invoices.
getCustomerInvoiceDraftTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.
supplier_invoice_rec_prepare_head($object)
Return array head with list of tabs to view object information.
getDraftSupplierTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.
getCustomerInvoiceUnpaidOpenTable($maxCount=500, $socid=0)
Return a HTML table that contains of unpaid customers invoices.
facture_prepare_head($object)
Initialize the array of tabs for customer invoice.
getPurchaseInvoiceUnpaidOpenTable($maxCount=500, $socid=0)
Return a HTML table that contains of unpaid purchase invoices.
dol_setcache($memoryid, $data, $expire=0)
Save data into a memory area shared by all users, all sessions on server.
dol_getcache($memoryid)
Read a memory area shared by all users, all sessions on server.