40 global $db, $langs, $conf, $user;
45 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/card.php?id='.
$object->id;
46 $head[$h][1] = $langs->trans(
'CustomerInvoice');
47 $head[$h][2] =
'compta';
51 $nbContact = count(
$object->liste_contact(-1,
'internal')) + count(
$object->liste_contact(-1,
'external'));
52 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/contact.php?id='.urlencode((
string) (
$object->id));
53 $head[$h][1] = $langs->trans(
'ContactsAddresses');
55 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
57 $head[$h][2] =
'contact';
61 if (isModEnabled(
'prelevement')) {
62 $nbStandingOrders = 0;
63 $sql =
"SELECT COUNT(pfd.rowid) as nb";
64 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
65 $sql .=
" WHERE pfd.fk_facture = ".((int)
$object->id);
66 $sql .=
" AND type = 'ban'";
67 $resql = $db->query($sql);
69 $obj = $db->fetch_object($resql);
71 $nbStandingOrders = $obj->nb;
76 $langs->load(
"banks");
78 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/prelevement.php?id='.urlencode((
string) (
$object->id));
79 $head[$h][1] = $langs->trans(
'StandingOrders');
80 if ($nbStandingOrders > 0) {
81 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbStandingOrders.
'</span>';
83 $head[$h][2] =
'standingorders';
95 if (!empty(
$object->note_private)) {
98 if (!empty(
$object->note_public)) {
101 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/note.php?id='.
$object->id;
102 $head[$h][1] = $langs->trans(
'Notes');
104 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
106 $head[$h][2] =
'note';
110 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
111 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
113 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
115 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/document.php?id='.
$object->id;
116 $head[$h][1] = $langs->trans(
'Documents');
117 if (($nbFiles + $nbLinks) > 0) {
118 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
120 $head[$h][2] =
'documents';
123 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/agenda.php?id='.
$object->id;
124 $head[$h][1] = $langs->trans(
"Events");
125 if (isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
128 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
129 $cachekey =
'count_events_facture_'.$object->id;
131 if (!is_null($dataretrieved)) {
132 $nbEvent = $dataretrieved;
134 $sql =
"SELECT COUNT(id) as nb";
135 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
136 $sql .=
" WHERE fk_element = ".((int)
$object->id);
137 $sql .=
" AND elementtype = 'invoice'";
138 $resql = $db->query($sql);
140 $obj = $db->fetch_object($resql);
143 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
149 $head[$h][1] .= $langs->trans(
"Agenda");
151 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
154 $head[$h][2] =
'agenda';
171 global $langs, $conf, $user, $db;
174 $extrafields->fetch_name_optionals_label(
'facture');
175 $extrafields->fetch_name_optionals_label(
'facturedet');
176 $extrafields->fetch_name_optionals_label(
'facture_rec');
177 $extrafields->fetch_name_optionals_label(
'facturedet_rec');
182 $head[$h][0] = DOL_URL_ROOT.
'/admin/invoice.php';
183 $head[$h][1] = $langs->trans(
"Miscellaneous");
184 $head[$h][2] =
'general';
187 $head[$h][0] = DOL_URL_ROOT.
'/admin/payment.php';
188 $head[$h][1] = $langs->trans(
"Payments");
189 $head[$h][2] =
'payment';
198 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/invoice_cust_extrafields.php';
199 $head[$h][1] = $langs->trans(
"ExtraFieldsCustomerInvoices");
200 $nbExtrafields = $extrafields->attributes[
'facture'][
'count'];
201 if ($nbExtrafields > 0) {
202 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
204 $head[$h][2] =
'attributes';
207 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/invoicedet_cust_extrafields.php';
208 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
209 $nbExtrafields = $extrafields->attributes[
'facturedet'][
'count'];
210 if ($nbExtrafields > 0) {
211 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
213 $head[$h][2] =
'attributeslines';
216 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/invoice_rec_cust_extrafields.php';
217 $head[$h][1] = $langs->trans(
"ExtraFieldsCustomerInvoicesRec");
218 $nbExtrafields = $extrafields->attributes[
'facture_rec'][
'count'];
219 if ($nbExtrafields > 0) {
220 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
222 $head[$h][2] =
'attributesrec';
225 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/invoicedet_rec_cust_extrafields.php';
226 $head[$h][1] = $langs->trans(
"ExtraFieldsLinesRec");
227 $nbExtrafields = $extrafields->attributes[
'facturedet_rec'][
'count'];
228 if ($nbExtrafields > 0) {
229 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
231 $head[$h][2] =
'attributeslinesrec';
235 $head[$h][0] = DOL_URL_ROOT.
'/admin/invoice_situation.php';
236 $head[$h][1] = $langs->trans(
"InvoiceSituation");
237 $head[$h][2] =
'situation';
255 global $db, $langs, $conf, $user;
260 $head[$h][0] = DOL_URL_ROOT .
'/compta/facture/card-rec.php?id=' .
$object->id;
261 $head[$h][1] = $langs->trans(
"RepeatableInvoice");
262 $head[$h][2] =
'card';
265 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/agenda-rec.php?id='.
$object->id;
266 $head[$h][1] = $langs->trans(
"Events");
267 if (isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
270 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
271 $cachekey =
'count_events_facturerec_'.$object->id;
273 if (!is_null($dataretrieved)) {
274 $nbEvent = $dataretrieved;
276 $sql =
"SELECT COUNT(id) as nb";
277 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
278 $sql .=
" WHERE fk_element = ".((int)
$object->id);
279 $sql .=
" AND elementtype = 'invoicerec'";
280 $resql = $db->query($sql);
282 $obj = $db->fetch_object($resql);
285 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
291 $head[$h][1] .= $langs->trans(
"Agenda");
293 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
296 $head[$h][2] =
'agenda';
318 global $db, $langs, $conf;
323 $head[$h][0] = DOL_URL_ROOT .
'/fourn/facture/card-rec.php?id=' .
$object->id;
324 $head[$h][1] = $langs->trans(
"RepeatableSupplierInvoice");
325 $head[$h][2] =
'card';
347 global $conf, $db, $langs, $user;
349 if (($mode ==
'customers' && isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire'))
350 || ($mode ==
'suppliers' && (isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) && $user->hasRight(
'fournisseur',
'facture',
'lire'))
352 global $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus8, $badgeStatus11;
353 include DOL_DOCUMENT_ROOT.
'/theme/'.$conf->theme.
'/theme_vars.inc.php';
355 $now = date_create(date(
'Y-m-d',
dol_now()));
356 $datenowsub30 = date_create(date(
'Y-m-d',
dol_now()));
357 $datenowsub15 = date_create(date(
'Y-m-d',
dol_now()));
358 $datenowadd30 = date_create(date(
'Y-m-d',
dol_now()));
359 $datenowadd15 = date_create(date(
'Y-m-d',
dol_now()));
360 $interval30days = date_interval_create_from_date_string(
'30 days');
361 $interval15days = date_interval_create_from_date_string(
'15 days');
362 date_sub($datenowsub30, $interval30days);
363 date_sub($datenowsub15, $interval15days);
364 date_add($datenowadd30, $interval30days);
365 date_add($datenowadd15, $interval15days);
370 $sql .=
" sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($datenowsub30,
'Y-m-d').
"'", $amount_mode ?
"f.total_ht" : 1, 0).
") as late30";
371 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($datenowsub15,
'Y-m-d').
"' AND f.date_lim_reglement >= '".date_format($datenowsub30,
'Y-m-d').
"'", $amount_mode ?
"f.total_ht" : 1, 0).
") as late15";
372 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($now,
'Y-m-d').
"' AND f.date_lim_reglement >= '".date_format($datenowsub15,
'Y-m-d').
"'", $amount_mode ?
"f.total_ht" : 1, 0).
") as latenow";
373 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement >= '".date_format($now,
'Y-m-d').
"' AND f.date_lim_reglement < '".date_format($datenowadd15,
'Y-m-d').
"'", $amount_mode ?
"f.total_ht" : 1, 0).
") as notlatenow";
374 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement >= '".date_format($datenowadd15,
'Y-m-d').
"' AND f.date_lim_reglement < '".date_format($datenowadd30,
'Y-m-d').
"'", $amount_mode ?
"f.total_ht" : 1, 0).
") as notlate15";
375 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement >= '".date_format($datenowadd30,
'Y-m-d').
"'", $amount_mode ?
"f.total_ht" : 1, 0).
") as notlate30";
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->late30, $obj->late15, $obj->latenow, $obj->notlatenow, $obj->notlate15, $obj->notlate30);
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 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
500 $tmpinvoice =
new Facture($db);
502 $sql =
"SELECT f.rowid, f.ref, f.datef as date, f.total_ht, f.total_tva, f.total_ttc, f.ref_client";
503 $sql .=
", f.type, f.fk_statut as status, f.paye";
504 $sql .=
", s.nom as name";
505 $sql .=
", s.rowid as socid, s.email";
506 $sql .=
", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
507 $sql .=
", cc.rowid as country_id, cc.code as country_code";
508 if (!$user->hasRight(
'societe',
'client',
'voir')) {
509 $sql .=
", sc.fk_soc, sc.fk_user ";
511 $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";
512 if (!$user->hasRight(
'societe',
'client',
'voir')) {
513 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
515 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT;
516 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
517 if (!$user->hasRight(
'societe',
'client',
'voir')) {
518 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
522 $sql .=
" AND f.fk_soc = ".((int) $socid);
525 $parameters = array();
526 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerDraft', $parameters);
527 $sql .= $hookmanager->resPrint;
529 $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,";
530 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,";
531 $sql .=
" cc.rowid, cc.code";
532 if (!$user->hasRight(
'societe',
'client',
'voir')) {
533 $sql .=
", sc.fk_soc, sc.fk_user";
537 $parameters = array();
538 $reshook = $hookmanager->executeHooks(
'printFieldListGroupByCustomerDraft', $parameters);
539 $sql .= $hookmanager->resPrint;
541 $resql = $db->query($sql);
544 $num = $db->num_rows($resql);
545 $nbofloop = min($num, $maxofloop);
547 $result .=
'<div class="div-table-responsive-no-min">';
548 $result .=
'<table class="noborder centpercent">';
550 $result .=
'<tr class="liste_titre">';
551 $result .=
'<th colspan="3">';
552 $result .= $langs->trans(
"CustomersDraftInvoices");
553 $result .=
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?search_status='.
Facture::STATUS_DRAFT.
'">';
554 $result .=
'<span class="badge marginleftonly">'.$num.
'</span>';
560 $companystatic =
new Societe($db);
565 while ($i < $nbofloop) {
566 $obj = $db->fetch_object($resql);
568 if ($i >= $maxCount) {
571 $tot_ttc += $obj->total_ttc;
575 $tmpinvoice->id = $obj->rowid;
576 $tmpinvoice->ref = $obj->ref;
577 $tmpinvoice->date = $db->jdate($obj->date);
578 $tmpinvoice->type = $obj->type;
579 $tmpinvoice->total_ht = $obj->total_ht;
580 $tmpinvoice->total_tva = $obj->total_tva;
581 $tmpinvoice->total_ttc = $obj->total_ttc;
582 $tmpinvoice->ref_client = $obj->ref_client;
583 $tmpinvoice->statut = $obj->status;
584 $tmpinvoice->paye = $obj->paye;
586 $companystatic->id = $obj->socid;
587 $companystatic->name = $obj->name;
588 $companystatic->email = $obj->email;
589 $companystatic->country_id = $obj->country_id;
590 $companystatic->country_code = $obj->country_code;
591 $companystatic->client = 1;
592 $companystatic->code_client = $obj->code_client;
593 $companystatic->code_fournisseur = $obj->code_fournisseur;
594 $companystatic->code_compta = $obj->code_compta;
595 $companystatic->code_compta_client = $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 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
653 $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";
654 $sql .=
", s.nom as name";
655 $sql .=
", s.rowid as socid, s.email";
656 $sql .=
", s.code_client, s.code_compta";
657 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
658 $sql .=
", cc.rowid as country_id, cc.code as country_code";
659 $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";
660 if (!$user->hasRight(
'societe',
'client',
'voir')) {
661 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
663 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".FactureFournisseur::STATUS_DRAFT;
664 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
665 if (!$user->hasRight(
'societe',
'client',
'voir')) {
666 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
669 $sql .=
" AND f.fk_soc = ".((int) $socid);
672 $parameters = array();
673 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierDraft', $parameters);
674 $sql .= $hookmanager->resPrint;
675 $resql = $db->query($sql);
678 $num = $db->num_rows($resql);
679 $nbofloop = min($num, $maxofloop);
681 $result .=
'<div class="div-table-responsive-no-min">';
682 $result .=
'<table class="noborder centpercent">';
684 $result .=
'<tr class="liste_titre">';
685 $result .=
'<th colspan="3">';
686 $result .= $langs->trans(
"SuppliersDraftInvoices");
688 $result .=
'<span class="badge marginleftonly">'.$num.
'</span>';
694 $companystatic =
new Societe($db);
699 while ($i < $nbofloop) {
700 $obj = $db->fetch_object($resql);
702 if ($i >= $maxCount) {
705 $tot_ttc += $obj->total_ttc;
709 $facturesupplierstatic->ref = $obj->ref;
710 $facturesupplierstatic->id = $obj->rowid;
711 $facturesupplierstatic->total_ht = $obj->total_ht;
712 $facturesupplierstatic->total_tva = $obj->total_tva;
713 $facturesupplierstatic->total_ttc = $obj->total_ttc;
714 $facturesupplierstatic->ref_supplier = $obj->ref_supplier;
715 $facturesupplierstatic->type = $obj->type;
716 $facturesupplierstatic->statut = $obj->status;
717 $facturesupplierstatic->status = $obj->status;
718 $facturesupplierstatic->paye = $obj->paye;
719 $facturesupplierstatic->paid = $obj->paye;
721 $companystatic->id = $obj->socid;
722 $companystatic->name = $obj->name;
723 $companystatic->email = $obj->email;
724 $companystatic->country_id = $obj->country_id;
725 $companystatic->country_code = $obj->country_code;
726 $companystatic->fournisseur = 1;
727 $companystatic->code_client = $obj->code_client;
728 $companystatic->code_fournisseur = $obj->code_fournisseur;
729 $companystatic->code_compta = $obj->code_compta;
730 $companystatic->code_compta_client = $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;
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 (!$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 (!$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;
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 (!$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 (!$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 $tmpinvoice =
new Facture($db);
1009 $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";
1010 $sql .=
", f.date_lim_reglement as datelimite";
1011 $sql .=
", s.nom as name";
1012 $sql .=
", s.rowid as socid, s.email";
1013 $sql .=
", s.code_client, s.code_compta";
1014 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1015 $sql .=
", cc.rowid as country_id, cc.code as country_code";
1016 $sql .=
", sum(pf.amount) as am";
1017 $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";
1018 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf on f.rowid=pf.fk_facture";
1019 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1020 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1022 $sql .=
" WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = ".Facture::STATUS_VALIDATED;
1023 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
1024 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1025 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1028 $sql .=
" AND f.fk_soc = ".((int) $socid);
1031 $parameters = array();
1032 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerUnpaid', $parameters);
1033 $sql .= $hookmanager->resPrint;
1035 $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,";
1036 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, cc.rowid, cc.code";
1037 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1038 $sql .=
" ORDER BY f.datef ASC, f.ref ASC";
1040 $resql = $db->query($sql);
1042 $num = $db->num_rows($resql);
1048 print
'<div class="div-table-responsive-no-min">';
1049 print
'<table class="noborder centpercent">';
1051 print
'<tr class="liste_titre">';
1052 print
'<th colspan="2">';
1053 print $langs->trans(
"BillsCustomersUnpaid", $num).
' ';
1055 print
'<span class="badge">'.$num.
'</span>';
1059 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1061 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1063 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1064 print
'<th class="right">'.$langs->trans(
"Received").
'</th>';
1065 print
'<th width="16"> </th>';
1068 $societestatic =
new Societe($db);
1069 $total_ttc = $totalam = $total = 0;
1071 $obj = $db->fetch_object($resql);
1073 if ($i >= $maxCount) {
1076 $total += $obj->total_ht;
1077 $total_ttc += $obj->total_ttc;
1078 $totalam += $obj->am;
1082 $tmpinvoice->ref = $obj->ref;
1083 $tmpinvoice->id = $obj->rowid;
1084 $tmpinvoice->total_ht = $obj->total_ht;
1085 $tmpinvoice->total_tva = $obj->total_tva;
1086 $tmpinvoice->total_ttc = $obj->total_ttc;
1087 $tmpinvoice->type = $obj->type;
1088 $tmpinvoice->statut = $obj->status;
1089 $tmpinvoice->paye = $obj->paye;
1090 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
1092 $societestatic->id = $obj->socid;
1093 $societestatic->name = $obj->name;
1094 $societestatic->email = $obj->email;
1095 $societestatic->country_id = $obj->country_id;
1096 $societestatic->country_code = $obj->country_code;
1097 $societestatic->client = 1;
1098 $societestatic->code_client = $obj->code_client;
1099 $societestatic->code_fournisseur = $obj->code_fournisseur;
1100 $societestatic->code_compta = $obj->code_compta;
1101 $societestatic->code_compta_client = $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'))) {
1198 $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";
1199 $sql .=
", ff.date_lim_reglement";
1200 $sql .=
", s.nom as name";
1201 $sql .=
", s.rowid as socid, s.email";
1202 $sql .=
", s.code_client, s.code_compta";
1203 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1204 $sql .=
", sum(pf.amount) as am";
1205 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
1206 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
1207 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1208 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1210 $sql .=
" WHERE s.rowid = ff.fk_soc";
1211 $sql .=
" AND ff.entity = ".$conf->entity;
1212 $sql .=
" AND ff.paye = 0";
1213 $sql .=
" AND ff.fk_statut = ".FactureFournisseur::STATUS_VALIDATED;
1214 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1215 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1218 $sql .=
" AND ff.fk_soc = ".((int) $socid);
1221 $parameters = array();
1222 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierUnpaid', $parameters);
1223 $sql .= $hookmanager->resPrint;
1225 $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,";
1226 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
1227 $sql .=
" ORDER BY ff.date_lim_reglement ASC";
1229 $resql = $db->query($sql);
1231 $num = $db->num_rows($resql);
1236 print
'<div class="div-table-responsive-no-min">';
1237 print
'<table class="noborder centpercent">';
1239 print
'<tr class="liste_titre">';
1240 print
'<th colspan="2">';
1241 print $langs->trans(
"BillsSuppliersUnpaid", $num).
' ';
1243 print
'<span class="badge">'.$num.
'</span>';
1247 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1249 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1251 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1252 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
1253 print
'<th width="16"> </th>';
1255 $societestatic =
new Societe($db);
1258 $total = $total_ttc = $totalam = 0;
1260 $obj = $db->fetch_object($resql);
1262 if ($i >= $maxCount) {
1265 $total += $obj->total_ht;
1266 $total_ttc += $obj->total_ttc;
1270 $facstatic->ref = $obj->ref;
1271 $facstatic->id = $obj->rowid;
1272 $facstatic->type = $obj->type;
1273 $facstatic->total_ht = $obj->total_ht;
1274 $facstatic->total_tva = $obj->total_tva;
1275 $facstatic->total_ttc = $obj->total_ttc;
1276 $facstatic->statut = $obj->status;
1277 $facstatic->status = $obj->status;
1278 $facstatic->paid = $obj->paye;
1279 $facstatic->paye = $obj->paye;
1281 $societestatic->id = $obj->socid;
1282 $societestatic->name = $obj->name;
1283 $societestatic->email = $obj->email;
1284 $societestatic->client = 0;
1285 $societestatic->fournisseur = 1;
1286 $societestatic->code_client = $obj->code_client;
1287 $societestatic->code_fournisseur = $obj->code_fournisseur;
1288 $societestatic->code_compta = $obj->code_compta;
1289 $societestatic->code_compta_client = $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 a 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.