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_fournisseur = $obj->code_compta_fournisseur;
597 $result .=
'<tr class="oddeven">';
598 $result .=
'<td class="nowrap tdoverflowmax100">';
599 $result .= $tmpinvoice->getNomUrl(1,
'');
601 $result .=
'<td class="nowrap tdoverflowmax100">';
602 $result .= $companystatic->getNomUrl(1,
'customer');
604 $result .=
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
606 $tot_ttc += $obj->total_ttc;
611 $result .=
'<tr class="oddeven">';
612 $result .=
'<td class="nowrap" colspan="3">';
613 $result .=
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
615 $result .=
"</tr>\n";
618 $result .=
'<tr class="liste_total"><td class="left">'.$langs->trans(
"Total").
'</td>';
619 $result .=
'<td colspan="2" class="right">'.price($tot_ttc).
'</td>';
622 $result .=
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
624 $result .=
"</table></div>";
643 global $conf, $db, $langs, $user, $hookmanager;
647 if ((isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) && $user->hasRight(
'facture',
'lire')) {
648 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
652 $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";
653 $sql .=
", s.nom as name";
654 $sql .=
", s.rowid as socid, s.email";
655 $sql .=
", s.code_client, s.code_compta";
656 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
657 $sql .=
", cc.rowid as country_id, cc.code as country_code";
658 $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";
659 if (!$user->hasRight(
'societe',
'client',
'voir')) {
660 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
662 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".FactureFournisseur::STATUS_DRAFT;
663 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
664 if (!$user->hasRight(
'societe',
'client',
'voir')) {
665 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
668 $sql .=
" AND f.fk_soc = ".((int) $socid);
671 $parameters = array();
672 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierDraft', $parameters);
673 $sql .= $hookmanager->resPrint;
674 $resql = $db->query($sql);
677 $num = $db->num_rows($resql);
678 $nbofloop = min($num, $maxofloop);
680 $result .=
'<div class="div-table-responsive-no-min">';
681 $result .=
'<table class="noborder centpercent">';
683 $result .=
'<tr class="liste_titre">';
684 $result .=
'<th colspan="3">';
685 $result .= $langs->trans(
"SuppliersDraftInvoices");
687 $result .=
'<span class="badge marginleftonly">'.$num.
'</span>';
693 $companystatic =
new Societe($db);
698 while ($i < $nbofloop) {
699 $obj = $db->fetch_object($resql);
701 if ($i >= $maxCount) {
704 $tot_ttc += $obj->total_ttc;
708 $facturesupplierstatic->ref = $obj->ref;
709 $facturesupplierstatic->id = $obj->rowid;
710 $facturesupplierstatic->total_ht = $obj->total_ht;
711 $facturesupplierstatic->total_tva = $obj->total_tva;
712 $facturesupplierstatic->total_ttc = $obj->total_ttc;
713 $facturesupplierstatic->ref_supplier = $obj->ref_supplier;
714 $facturesupplierstatic->type = $obj->type;
715 $facturesupplierstatic->statut = $obj->status;
716 $facturesupplierstatic->status = $obj->status;
717 $facturesupplierstatic->paye = $obj->paye;
718 $facturesupplierstatic->paid = $obj->paye;
720 $companystatic->id = $obj->socid;
721 $companystatic->name = $obj->name;
722 $companystatic->email = $obj->email;
723 $companystatic->country_id = $obj->country_id;
724 $companystatic->country_code = $obj->country_code;
725 $companystatic->fournisseur = 1;
726 $companystatic->code_client = $obj->code_client;
727 $companystatic->code_fournisseur = $obj->code_fournisseur;
728 $companystatic->code_compta = $obj->code_compta;
729 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
731 $result .=
'<tr class="oddeven">';
732 $result .=
'<td class="nowrap tdoverflowmax100">';
733 $result .= $facturesupplierstatic->getNomUrl(1,
'');
735 $result .=
'<td class="nowrap tdoverflowmax100">';
736 $result .= $companystatic->getNomUrl(1,
'supplier');
738 $result .=
'<td class="right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
740 $tot_ttc += $obj->total_ttc;
745 $result .=
'<tr class="oddeven">';
746 $result .=
'<td class="nowrap" colspan="3">';
747 $result .=
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
749 $result .=
"</tr>\n";
752 $result .=
'<tr class="liste_total"><td class="left">'.$langs->trans(
"Total").
'</td>';
753 $result .=
'<td colspan="2" class="right">'.price($tot_ttc).
'</td>';
756 $result .=
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
758 $result .=
"</table></div>";
778 global $conf, $db, $langs, $user;
780 $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,";
781 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client";
782 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
783 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
784 if (!$user->hasRight(
'societe',
'client',
'voir')) {
785 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
787 $sql .=
" WHERE f.fk_soc = s.rowid";
788 $sql .=
" AND f.entity IN (".getEntity(
'facture').
")";
790 $sql .=
" AND f.fk_soc = ".((int) $socid);
792 if (!$user->hasRight(
'societe',
'client',
'voir')) {
793 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
795 $sql .=
" ORDER BY f.tms DESC";
796 $sql .= $db->plimit($maxCount, 0);
798 $resql = $db->query($sql);
803 $num = $db->num_rows($resql);
805 $result =
'<div class="div-table-responsive-no-min">';
806 $result .=
'<table class="noborder centpercent">';
808 $result .=
'<tr class="liste_titre">';
809 $result .=
'<th colspan="3">'.$langs->trans(
"LastCustomersBills", $maxCount).
'</th>';
810 $result .=
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
811 $result .=
'<th class="right"></th>';
815 $result .=
'</table>';
821 $objectstatic =
new Facture($db);
822 $companystatic =
new Societe($db);
826 $obj = $db->fetch_object($resql);
828 $objectstatic->id = $obj->rowid;
829 $objectstatic->ref = $obj->ref;
830 $objectstatic->paye = $obj->paye;
831 $objectstatic->statut = $obj->status;
832 $objectstatic->total_ht = $obj->total_ht;
833 $objectstatic->total_tva = $obj->total_tva;
834 $objectstatic->total_ttc = $obj->total_ttc;
835 $objectstatic->type = $obj->type;
837 $companystatic->id = $obj->socid;
838 $companystatic->name = $obj->socname;
839 $companystatic->client = $obj->client;
840 $companystatic->canvas = $obj->canvas;
843 $filedir = $conf->propal->multidir_output[$obj->entity].
'/'.$filename;
845 $result .=
'<tr class="nowrap">';
847 $result .=
'<td class="oddeven">';
848 $result .=
'<table class="nobordernopadding">';
849 $result .=
'<tr class="nocellnopadd">';
851 $result .=
'<td width="96" class="nobordernopadding nowrap">'.$objectstatic->getNomUrl(1).
'</td>';
852 $result .=
'<td width="16" class="nobordernopadding nowrap"> </td>';
853 $result .=
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).
'</td>';
856 $result .=
'</table>';
859 $result .=
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
860 $result .=
'<td>'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
861 $result .=
'<td class="right amount">'.price($obj->total_ttc).
'</td>';
864 $payment = $objectstatic->getSommePaiement();
865 $result .=
'<td class="right">'.$objectstatic->getLibStatut(5, $payment).
'</td>';
872 $result .=
'</table>';
886 global $conf, $db, $langs, $user;
888 $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,";
889 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client";
890 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as f";
891 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
892 if (!$user->hasRight(
'societe',
'client',
'voir')) {
893 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
895 $sql .=
" WHERE f.fk_soc = s.rowid";
896 $sql .=
" AND f.entity IN (".getEntity(
'facture_fourn').
")";
898 $sql .=
" AND f.fk_soc = ".((int) $socid);
900 if (!$user->hasRight(
'societe',
'client',
'voir')) {
901 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
903 $sql .=
" ORDER BY f.tms DESC";
904 $sql .= $db->plimit($maxCount, 0);
906 $resql = $db->query($sql);
912 $num = $db->num_rows($resql);
914 $result =
'<div class="div-table-responsive-no-min">';
915 $result .=
'<table class="noborder centpercent">';
916 $result .=
'<tr class="liste_titre">';
917 $result .=
'<th colspan="3">'.$langs->trans(
"BoxTitleLastSupplierBills", $maxCount).
' ';
918 $result .=
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?sortfield=f.tms&sortorder=DESC">';
919 $result .=
'<span class="badge">...</span>';
922 $result .=
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
923 $result .=
'<th class="right"></th>';
927 $result .=
'</table>';
933 $companystatic =
new Societe($db);
938 $obj = $db->fetch_object($resql);
940 $objectstatic->id = $obj->rowid;
941 $objectstatic->ref = $obj->ref;
942 $objectstatic->paye = $obj->paye;
943 $objectstatic->paid = $obj->paye;
944 $objectstatic->statut = $obj->status;
945 $objectstatic->status = $obj->status;
946 $objectstatic->total_ht = $obj->total_ht;
947 $objectstatic->total_tva = $obj->total_tva;
948 $objectstatic->total_ttc = $obj->total_ttc;
949 $objectstatic->type = $obj->type;
951 $companystatic->id = $obj->socid;
952 $companystatic->name = $obj->socname;
953 $companystatic->client = $obj->client;
954 $companystatic->canvas = $obj->canvas;
957 $filedir = $conf->propal->multidir_output[$obj->entity].
'/'.$filename;
959 $result .=
'<tr class="nowrap">';
961 $result .=
'<td class="oddeven">';
962 $result .=
'<table class="nobordernopadding">';
963 $result .=
'<tr class="nocellnopadd">';
965 $result .=
'<td width="96" class="nobordernopadding nowrap">'.$objectstatic->getNomUrl(1).
'</td>';
966 $result .=
'<td width="16" class="nobordernopadding nowrap"> </td>';
967 $result .=
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).
'</td>';
970 $result .=
'</table>';
973 $result .=
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
975 $result .=
'<td>'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
977 $result .=
'<td class="amount right">'.price($obj->total_ttc).
'</td>';
979 $result .=
'<td class="right">'.$objectstatic->getLibStatut(5).
'</td>';
986 $result .=
'</table>';
1000 global $conf, $db, $langs, $user, $hookmanager;
1004 if (isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
1005 $tmpinvoice =
new Facture($db);
1007 $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";
1008 $sql .=
", f.date_lim_reglement as datelimite";
1009 $sql .=
", s.nom as name";
1010 $sql .=
", s.rowid as socid, s.email";
1011 $sql .=
", s.code_client, s.code_compta";
1012 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1013 $sql .=
", cc.rowid as country_id, cc.code as country_code";
1014 $sql .=
", sum(pf.amount) as am";
1015 $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";
1016 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf on f.rowid=pf.fk_facture";
1017 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1018 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1020 $sql .=
" WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = ".Facture::STATUS_VALIDATED;
1021 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
1022 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1023 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1026 $sql .=
" AND f.fk_soc = ".((int) $socid);
1029 $parameters = array();
1030 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerUnpaid', $parameters);
1031 $sql .= $hookmanager->resPrint;
1033 $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,";
1034 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, cc.rowid, cc.code";
1035 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1036 $sql .=
" ORDER BY f.datef ASC, f.ref ASC";
1038 $resql = $db->query($sql);
1040 $num = $db->num_rows($resql);
1046 print
'<div class="div-table-responsive-no-min">';
1047 print
'<table class="noborder centpercent">';
1049 print
'<tr class="liste_titre">';
1050 print
'<th colspan="2">';
1051 print $langs->trans(
"BillsCustomersUnpaid", $num).
' ';
1053 print
'<span class="badge">'.$num.
'</span>';
1057 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1059 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1061 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1062 print
'<th class="right">'.$langs->trans(
"Received").
'</th>';
1063 print
'<th width="16"> </th>';
1066 $societestatic =
new Societe($db);
1067 $total_ttc = $totalam = $total = 0;
1069 $obj = $db->fetch_object($resql);
1071 if ($i >= $maxCount) {
1074 $total += $obj->total_ht;
1075 $total_ttc += $obj->total_ttc;
1076 $totalam += $obj->am;
1080 $tmpinvoice->ref = $obj->ref;
1081 $tmpinvoice->id = $obj->rowid;
1082 $tmpinvoice->total_ht = $obj->total_ht;
1083 $tmpinvoice->total_tva = $obj->total_tva;
1084 $tmpinvoice->total_ttc = $obj->total_ttc;
1085 $tmpinvoice->type = $obj->type;
1086 $tmpinvoice->statut = $obj->status;
1087 $tmpinvoice->paye = $obj->paye;
1088 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
1090 $societestatic->id = $obj->socid;
1091 $societestatic->name = $obj->name;
1092 $societestatic->email = $obj->email;
1093 $societestatic->country_id = $obj->country_id;
1094 $societestatic->country_code = $obj->country_code;
1095 $societestatic->client = 1;
1096 $societestatic->code_client = $obj->code_client;
1097 $societestatic->code_fournisseur = $obj->code_fournisseur;
1098 $societestatic->code_compta = $obj->code_compta;
1099 $societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1101 print
'<tr class="oddeven">';
1102 print
'<td class="nowrap">';
1104 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1105 print
'<td class="nobordernopadding nowrap">';
1106 print $tmpinvoice->getNomUrl(1,
'');
1108 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
1111 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
1112 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
1113 print
'</td></tr></table>';
1116 print
'<td class="nowrap tdoverflowmax100">';
1117 print $societestatic->getNomUrl(1,
'customer');
1119 print
'<td class="right">';
1121 if ($tmpinvoice->hasDelay()) {
1126 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
1128 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
1129 print
'<td class="nowrap right"><span class="amount">'.price($obj->am).
'</span></td>';
1130 print
'<td>'.$tmpinvoice->getLibStatut(3, $obj->am).
'</td>';
1133 $total_ttc += $obj->total_ttc;
1134 $total += $obj->total_ht;
1135 $totalam += $obj->am;
1145 print
'<tr class="oddeven">';
1146 print
'<td class="nowrap" colspan="'.$colspan.
'">';
1147 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1152 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>';
1153 print
'<td> </td>';
1155 print
'<td class="right"><span class="amount">'.price($total).
'</span></td>';
1157 print
'<td class="nowrap right"><span class="amount">'.price($total_ttc).
'</span></td>';
1158 print
'<td class="nowrap right"><span class="amount">'.price($totalam).
'</span></td>';
1159 print
'<td> </td>';
1166 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
1168 print
'</table></div><br>';
1188 global $conf, $db, $langs, $user, $hookmanager;
1192 if (isModEnabled(
"supplier_invoice") && ($user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'supplier_invoice',
'read'))) {
1195 $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";
1196 $sql .=
", ff.date_lim_reglement";
1197 $sql .=
", s.nom as name";
1198 $sql .=
", s.rowid as socid, s.email";
1199 $sql .=
", s.code_client, s.code_compta";
1200 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1201 $sql .=
", sum(pf.amount) as am";
1202 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
1203 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
1204 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1205 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1207 $sql .=
" WHERE s.rowid = ff.fk_soc";
1208 $sql .=
" AND ff.entity = ".$conf->entity;
1209 $sql .=
" AND ff.paye = 0";
1210 $sql .=
" AND ff.fk_statut = ".FactureFournisseur::STATUS_VALIDATED;
1211 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1212 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1215 $sql .=
" AND ff.fk_soc = ".((int) $socid);
1218 $parameters = array();
1219 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierUnpaid', $parameters);
1220 $sql .= $hookmanager->resPrint;
1222 $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,";
1223 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
1224 $sql .=
" ORDER BY ff.date_lim_reglement ASC";
1226 $resql = $db->query($sql);
1228 $num = $db->num_rows($resql);
1233 print
'<div class="div-table-responsive-no-min">';
1234 print
'<table class="noborder centpercent">';
1236 print
'<tr class="liste_titre">';
1237 print
'<th colspan="2">';
1238 print $langs->trans(
"BillsSuppliersUnpaid", $num).
' ';
1240 print
'<span class="badge">'.$num.
'</span>';
1244 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1246 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1248 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1249 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
1250 print
'<th width="16"> </th>';
1252 $societestatic =
new Societe($db);
1255 $total = $total_ttc = $totalam = 0;
1257 $obj = $db->fetch_object($resql);
1259 if ($i >= $maxCount) {
1262 $total += $obj->total_ht;
1263 $total_ttc += $obj->total_ttc;
1267 $facstatic->ref = $obj->ref;
1268 $facstatic->id = $obj->rowid;
1269 $facstatic->type = $obj->type;
1270 $facstatic->total_ht = $obj->total_ht;
1271 $facstatic->total_tva = $obj->total_tva;
1272 $facstatic->total_ttc = $obj->total_ttc;
1273 $facstatic->statut = $obj->status;
1274 $facstatic->status = $obj->status;
1275 $facstatic->paid = $obj->paye;
1276 $facstatic->paye = $obj->paye;
1278 $societestatic->id = $obj->socid;
1279 $societestatic->name = $obj->name;
1280 $societestatic->email = $obj->email;
1281 $societestatic->client = 0;
1282 $societestatic->fournisseur = 1;
1283 $societestatic->code_client = $obj->code_client;
1284 $societestatic->code_fournisseur = $obj->code_fournisseur;
1285 $societestatic->code_compta = $obj->code_compta;
1286 $societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1288 print
'<tr class="oddeven">';
1289 print
'<td class="nowrap tdoverflowmax100">';
1290 print $facstatic->getNomUrl(1,
'');
1292 print
'<td class="nowrap tdoverflowmax100">'.$societestatic->getNomUrl(1,
'supplier').
'</td>';
1293 print
'<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement),
'day').
'</td>';
1295 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
1297 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
1298 print
'<td class="nowrap right"><span class="amount">'.price($obj->am).
'</span></td>';
1299 print
'<td>'.$facstatic->getLibStatut(3, $obj->am).
'</td>';
1301 $total += $obj->total_ht;
1302 $total_ttc += $obj->total_ttc;
1303 $totalam += $obj->am;
1312 print
'<tr class="oddeven">';
1313 print
'<td class="nowrap" colspan="'.$colspan.
'">';
1314 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1319 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>';
1320 print
'<td> </td>';
1322 print
'<td class="right">'.price($total).
'</td>';
1324 print
'<td class="nowrap right">'.price($total_ttc).
'</td>';
1325 print
'<td class="nowrap right">'.price($totalam).
'</td>';
1326 print
'<td> </td>';
1333 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
1335 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.