38 global $db, $langs, $conf, $user;
43 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/card.php?id='.$object->id;
44 $head[$h][1] = $langs->trans(
'CustomerInvoice');
45 $head[$h][2] =
'compta';
49 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
50 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/contact.php?id='.urlencode($object->id);
51 $head[$h][1] = $langs->trans(
'ContactsAddresses');
53 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
55 $head[$h][2] =
'contact';
59 if (isModEnabled(
'prelevement')) {
60 $nbStandingOrders = 0;
61 $sql =
"SELECT COUNT(pfd.rowid) as nb";
62 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
63 $sql .=
" WHERE pfd.fk_facture = ".((int) $object->id);
64 $sql .=
" AND type = 'ban'";
65 $resql = $db->query($sql);
67 $obj = $db->fetch_object($resql);
69 $nbStandingOrders = $obj->nb;
74 $langs->load(
"banks");
76 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/prelevement.php?id='.urlencode($object->id);
77 $head[$h][1] = $langs->trans(
'StandingOrders');
78 if ($nbStandingOrders > 0) {
79 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbStandingOrders.
'</span>';
81 $head[$h][2] =
'standingorders';
93 if (!empty($object->note_private)) {
96 if (!empty($object->note_public)) {
99 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/note.php?id='.$object->id;
100 $head[$h][1] = $langs->trans(
'Notes');
102 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
104 $head[$h][2] =
'note';
108 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
109 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
111 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
112 $nbLinks =
Link::count($db, $object->element, $object->id);
113 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/document.php?id='.$object->id;
114 $head[$h][1] = $langs->trans(
'Documents');
115 if (($nbFiles + $nbLinks) > 0) {
116 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
118 $head[$h][2] =
'documents';
121 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/agenda.php?id='.$object->id;
122 $head[$h][1] = $langs->trans(
"Events");
123 if (isModEnabled(
'agenda')&& ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
126 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
127 $cachekey =
'count_events_facture_'.$object->id;
129 if (!is_null($dataretrieved)) {
130 $nbEvent = $dataretrieved;
132 $sql =
"SELECT COUNT(id) as nb";
133 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
134 $sql .=
" WHERE fk_element = ".((int) $object->id);
135 $sql .=
" AND elementtype = 'invoice'";
136 $resql = $db->query($sql);
138 $obj = $db->fetch_object($resql);
141 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
147 $head[$h][1] .= $langs->trans(
"Agenda");
149 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
152 $head[$h][2] =
'agenda';
169 global $langs, $conf, $user, $db;
172 $extrafields->fetch_name_optionals_label(
'facture');
173 $extrafields->fetch_name_optionals_label(
'facturedet');
174 $extrafields->fetch_name_optionals_label(
'facture_rec');
175 $extrafields->fetch_name_optionals_label(
'facturedet_rec');
180 $head[$h][0] = DOL_URL_ROOT.
'/admin/facture.php';
181 $head[$h][1] = $langs->trans(
"Miscellaneous");
182 $head[$h][2] =
'general';
185 $head[$h][0] = DOL_URL_ROOT.
'/admin/payment.php';
186 $head[$h][1] = $langs->trans(
"Payments");
187 $head[$h][2] =
'payment';
196 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/facture_cust_extrafields.php';
197 $head[$h][1] = $langs->trans(
"ExtraFieldsCustomerInvoices");
198 $nbExtrafields = $extrafields->attributes[
'facture'][
'count'];
199 if ($nbExtrafields > 0) {
200 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
202 $head[$h][2] =
'attributes';
205 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/facturedet_cust_extrafields.php';
206 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
207 $nbExtrafields = $extrafields->attributes[
'facturedet'][
'count'];
208 if ($nbExtrafields > 0) {
209 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
211 $head[$h][2] =
'attributeslines';
214 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/facture_rec_cust_extrafields.php';
215 $head[$h][1] = $langs->trans(
"ExtraFieldsCustomerInvoicesRec");
216 $nbExtrafields = $extrafields->attributes[
'facture_rec'][
'count'];
217 if ($nbExtrafields > 0) {
218 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
220 $head[$h][2] =
'attributesrec';
223 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
224 $head[$h][1] = $langs->trans(
"ExtraFieldsLinesRec");
225 $nbExtrafields = $extrafields->attributes[
'facturedet_rec'][
'count'];
226 if ($nbExtrafields > 0) {
227 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
229 $head[$h][2] =
'attributeslinesrec';
233 $head[$h][0] = DOL_URL_ROOT.
'/admin/facture_situation.php';
234 $head[$h][1] = $langs->trans(
"InvoiceSituation");
235 $head[$h][2] =
'situation';
253 global $db, $langs, $conf, $user;
258 $head[$h][0] = DOL_URL_ROOT .
'/compta/facture/card-rec.php?id=' . $object->id;
259 $head[$h][1] = $langs->trans(
"RepeatableInvoice");
260 $head[$h][2] =
'card';
263 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/agenda-rec.php?id='.$object->id;
264 $head[$h][1] = $langs->trans(
"Events");
265 if (isModEnabled(
'agenda')&& ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
268 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
269 $cachekey =
'count_events_facturerec_'.$object->id;
271 if (!is_null($dataretrieved)) {
272 $nbEvent = $dataretrieved;
274 $sql =
"SELECT COUNT(id) as nb";
275 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
276 $sql .=
" WHERE fk_element = ".((int) $object->id);
277 $sql .=
" AND elementtype = 'invoicerec'";
278 $resql = $db->query($sql);
280 $obj = $db->fetch_object($resql);
283 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
289 $head[$h][1] .= $langs->trans(
"Agenda");
291 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
294 $head[$h][2] =
'agenda';
316 global $db, $langs, $conf;
321 $head[$h][0] = DOL_URL_ROOT .
'/fourn/facture/card-rec.php?id=' . $object->id;
322 $head[$h][1] = $langs->trans(
"RepeatableSupplierInvoice");
323 $head[$h][2] =
'card';
345 global $conf, $db, $langs, $user;
347 if (($mode ==
'customers' && isModEnabled(
'facture') && $user->hasRight(
'facture',
'lire'))
348 || ($mode ==
'suppliers' && (isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) && $user->hasRight(
'fournisseur',
'facture',
'lire'))
350 global $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus8, $badgeStatus11;
351 include DOL_DOCUMENT_ROOT.
'/theme/'.$conf->theme.
'/theme_vars.inc.php';
353 $now = date_create(date(
'Y-m-d',
dol_now()));
354 $datenowsub30 = date_create(date(
'Y-m-d',
dol_now()));
355 $datenowsub15 = date_create(date(
'Y-m-d',
dol_now()));
356 $datenowadd30 = date_create(date(
'Y-m-d',
dol_now()));
357 $datenowadd15 = date_create(date(
'Y-m-d',
dol_now()));
358 $interval30days = date_interval_create_from_date_string(
'30 days');
359 $interval15days = date_interval_create_from_date_string(
'15 days');
360 date_sub($datenowsub30, $interval30days);
361 date_sub($datenowsub15, $interval15days);
362 date_add($datenowadd30, $interval30days);
363 date_add($datenowadd15, $interval15days);
366 $sql .=
" sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($datenowsub30,
'Y-m-d').
"'", 1, 0).
") as nblate30";
367 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($datenowsub15,
'Y-m-d').
"'", 1, 0).
") as nblate15";
368 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($now,
'Y-m-d').
"'", 1, 0).
") as nblatenow";
369 $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";
370 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement > '".date_format($datenowadd15,
'Y-m-d').
"'", 1, 0).
") as nbnotlate15";
371 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement > '".date_format($datenowadd30,
'Y-m-d').
"'", 1, 0).
") as nbnotlate30";
372 if ($mode ==
'customers') {
373 $element =
'invoice';
374 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
375 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
376 $element =
'supplier_invoice';
377 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as f";
381 $sql .=
" WHERE f.entity IN (".getEntity($element).
")";
382 $sql .=
" AND f.type <> 2";
383 $sql .=
" AND f.fk_statut = 1";
384 if (isset($user->socid) && $user->socid > 0) {
385 $sql .=
" AND f.fk_soc = ".((int) $user->socid);
388 $resql = $db->query($sql);
390 $num = $db->num_rows($resql);
393 $dataseries = array();
396 $obj = $db->fetch_object($resql);
405 $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);
408 if (!empty($dataseries[0])) {
409 foreach ($dataseries[0] as $key => $value) {
410 if (is_numeric($value)) {
416 $langs->trans(
'InvoiceLate30Days'),
417 $langs->trans(
'InvoiceLate15Days'),
418 $langs->trans(
'InvoiceLateMinus15Days'),
419 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate') : $langs->trans(
"InvoiceToPay"),
420 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate15Days') : $langs->trans(
"InvoiceToPay15Days"),
421 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate30Days') : $langs->trans(
"InvoiceToPay30Days"),
424 $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11,
'-'.$badgeStatus11);
426 $result =
'<div class="div-table-responsive-no-min">';
427 $result .=
'<table class="noborder nohover centpercent">';
428 $result .=
'<tr class="liste_titre">';
429 $result .=
'<td>'.$langs->trans(
"NbOfOpenInvoices").
' - ';
430 if ($mode ==
'customers') {
431 $result .= $langs->trans(
"CustomerInvoice");
432 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
433 $result .= $langs->trans(
"SupplierInvoice");
440 if ($conf->use_javascript_ajax) {
443 $dolgraph->SetData($dataseries);
445 $dolgraph->setLegend($legend);
447 $dolgraph->SetDataColor(array_values($colorseries));
448 $dolgraph->setShowLegend(2);
449 $dolgraph->setShowPercent(1);
450 $dolgraph->SetType(array(
'bars',
'bars',
'bars',
'bars',
'bars',
'bars'));
452 $dolgraph->setHeight(
'160');
453 $dolgraph->setWidth(
'450');
454 $dolgraph->setHideXValues(
true);
455 if ($mode ==
'customers') {
456 $dolgraph->draw(
'idgraphcustomerinvoices');
457 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
458 $dolgraph->draw(
'idgraphfourninvoices');
462 $result .=
'<tr maxwidth="255">';
463 $result .=
'<td class="center">'.$dolgraph->show($total ? 0 : $langs->trans(
"NoOpenInvoice")).
'</td>';
469 $result .=
'</table>';
489 global $conf, $db, $langs, $user, $hookmanager;
493 if (isModEnabled(
'facture') && $user->hasRight(
'facture',
'lire')) {
494 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
496 $tmpinvoice =
new Facture($db);
498 $sql =
"SELECT f.rowid, f.ref, f.datef as date, f.total_ht, f.total_tva, f.total_ttc, f.ref_client";
499 $sql .=
", f.type, f.fk_statut as status, f.paye";
500 $sql .=
", s.nom as name";
501 $sql .=
", s.rowid as socid, s.email";
502 $sql .=
", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
503 $sql .=
", cc.rowid as country_id, cc.code as country_code";
504 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
505 $sql .=
", sc.fk_soc, sc.fk_user ";
507 $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";
508 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
509 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
511 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT;
512 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
513 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
514 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
518 $sql .=
" AND f.fk_soc = ".((int) $socid);
521 $parameters = array();
522 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerDraft', $parameters);
523 $sql .= $hookmanager->resPrint;
525 $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,";
526 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,";
527 $sql .=
" cc.rowid, cc.code";
528 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
529 $sql .=
", sc.fk_soc, sc.fk_user";
533 $parameters = array();
534 $reshook = $hookmanager->executeHooks(
'printFieldListGroupByCustomerDraft', $parameters);
535 $sql .= $hookmanager->resPrint;
537 $resql = $db->query($sql);
540 $num = $db->num_rows($resql);
541 $nbofloop = min($num, $maxofloop);
543 $result .=
'<div class="div-table-responsive-no-min">';
544 $result .=
'<table class="noborder centpercent">';
546 $result .=
'<tr class="liste_titre">';
547 $result .=
'<th colspan="3">';
548 $result .= $langs->trans(
"CustomersDraftInvoices").
' ';
549 $result .=
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?search_status='.
Facture::STATUS_DRAFT.
'">';
550 $result .=
'<span class="badge marginleftonlyshort">'.$num.
'</span>';
556 $companystatic =
new Societe($db);
561 while ($i < $nbofloop) {
562 $obj = $db->fetch_object($resql);
564 if ($i >= $maxCount) {
567 $tot_ttc += $obj->total_ttc;
571 $tmpinvoice->id = $obj->rowid;
572 $tmpinvoice->ref = $obj->ref;
573 $tmpinvoice->date = $db->jdate($obj->date);
574 $tmpinvoice->type = $obj->type;
575 $tmpinvoice->total_ht = $obj->total_ht;
576 $tmpinvoice->total_tva = $obj->total_tva;
577 $tmpinvoice->total_ttc = $obj->total_ttc;
578 $tmpinvoice->ref_client = $obj->ref_client;
579 $tmpinvoice->statut = $obj->status;
580 $tmpinvoice->paye = $obj->paye;
582 $companystatic->id = $obj->socid;
583 $companystatic->name = $obj->name;
584 $companystatic->email = $obj->email;
585 $companystatic->country_id = $obj->country_id;
586 $companystatic->country_code = $obj->country_code;
587 $companystatic->client = 1;
588 $companystatic->code_client = $obj->code_client;
589 $companystatic->code_fournisseur = $obj->code_fournisseur;
590 $companystatic->code_compta = $obj->code_compta;
591 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
593 $result .=
'<tr class="oddeven">';
594 $result .=
'<td class="nowrap tdoverflowmax100">';
595 $result .= $tmpinvoice->getNomUrl(1,
'');
597 $result .=
'<td class="nowrap tdoverflowmax100">';
598 $result .= $companystatic->getNomUrl(1,
'customer');
600 $result .=
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
602 $tot_ttc += $obj->total_ttc;
607 $result .=
'<tr class="oddeven">';
608 $result .=
'<td class="nowrap" colspan="3">';
609 $result .=
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
611 $result .=
"</tr>\n";
614 $result .=
'<tr class="liste_total"><td class="left">'.$langs->trans(
"Total").
'</td>';
615 $result .=
'<td colspan="2" class="right">'.price($tot_ttc).
'</td>';
618 $result .=
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
620 $result .=
"</table></div>";
639 global $conf, $db, $langs, $user, $hookmanager;
643 if ((isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) && $user->hasRight(
'facture',
'lire')) {
644 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
648 $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";
649 $sql .=
", s.nom as name";
650 $sql .=
", s.rowid as socid, s.email";
651 $sql .=
", s.code_client, s.code_compta";
652 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
653 $sql .=
", cc.rowid as country_id, cc.code as country_code";
654 $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";
655 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
656 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
658 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".FactureFournisseur::STATUS_DRAFT;
659 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
660 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
661 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
664 $sql .=
" AND f.fk_soc = ".((int) $socid);
667 $parameters = array();
668 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierDraft', $parameters);
669 $sql .= $hookmanager->resPrint;
670 $resql = $db->query($sql);
673 $num = $db->num_rows($resql);
674 $nbofloop = min($num, $maxofloop);
676 $result .=
'<div class="div-table-responsive-no-min">';
677 $result .=
'<table class="noborder centpercent">';
679 $result .=
'<tr class="liste_titre">';
680 $result .=
'<th colspan="3">';
681 $result .= $langs->trans(
"SuppliersDraftInvoices").
' ';
683 $result .=
'<span class="badge marginleftonlyshort">'.$num.
'</span>';
689 $companystatic =
new Societe($db);
694 while ($i < $nbofloop) {
695 $obj = $db->fetch_object($resql);
697 if ($i >= $maxCount) {
700 $tot_ttc += $obj->total_ttc;
704 $facturesupplierstatic->ref = $obj->ref;
705 $facturesupplierstatic->id = $obj->rowid;
706 $facturesupplierstatic->total_ht = $obj->total_ht;
707 $facturesupplierstatic->total_tva = $obj->total_tva;
708 $facturesupplierstatic->total_ttc = $obj->total_ttc;
709 $facturesupplierstatic->ref_supplier = $obj->ref_supplier;
710 $facturesupplierstatic->type = $obj->type;
711 $facturesupplierstatic->statut = $obj->status;
712 $facturesupplierstatic->paye = $obj->paye;
714 $companystatic->id = $obj->socid;
715 $companystatic->name = $obj->name;
716 $companystatic->email = $obj->email;
717 $companystatic->country_id = $obj->country_id;
718 $companystatic->country_code = $obj->country_code;
719 $companystatic->fournisseur = 1;
720 $companystatic->code_client = $obj->code_client;
721 $companystatic->code_fournisseur = $obj->code_fournisseur;
722 $companystatic->code_compta = $obj->code_compta;
723 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
725 $result .=
'<tr class="oddeven">';
726 $result .=
'<td class="nowrap tdoverflowmax100">';
727 $result .= $facturesupplierstatic->getNomUrl(1,
'');
729 $result .=
'<td class="nowrap tdoverflowmax100">';
730 $result .= $companystatic->getNomUrl(1,
'supplier');
732 $result .=
'<td class="right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
734 $tot_ttc += $obj->total_ttc;
739 $result .=
'<tr class="oddeven">';
740 $result .=
'<td class="nowrap" colspan="3">';
741 $result .=
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
743 $result .=
"</tr>\n";
746 $result .=
'<tr class="liste_total"><td class="left">'.$langs->trans(
"Total").
'</td>';
747 $result .=
'<td colspan="2" class="right">'.price($tot_ttc).
'</td>';
750 $result .=
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
752 $result .=
"</table></div>";
772 global $conf, $db, $langs, $user;
774 $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,";
775 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client";
776 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
777 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
778 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
779 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
781 $sql .=
" WHERE f.fk_soc = s.rowid";
782 $sql .=
" AND f.entity IN (".getEntity(
'facture').
")";
784 $sql .=
" AND f.fk_soc = ".((int) $socid);
786 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
787 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
789 $sql .=
" ORDER BY f.tms DESC";
790 $sql .= $db->plimit($maxCount, 0);
792 $resql = $db->query($sql);
797 $num = $db->num_rows($resql);
799 $result =
'<div class="div-table-responsive-no-min">';
800 $result .=
'<table class="noborder centpercent">';
802 $result .=
'<tr class="liste_titre">';
803 $result .=
'<th colspan="3">'.$langs->trans(
"LastCustomersBills", $maxCount).
'</th>';
804 $result .=
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
805 $result .=
'<th class="right"></th>';
809 $result .=
'</table>';
815 $objectstatic =
new Facture($db);
816 $companystatic =
new Societe($db);
820 $obj = $db->fetch_object($resql);
822 $objectstatic->id = $obj->rowid;
823 $objectstatic->ref = $obj->ref;
824 $objectstatic->paye = $obj->paye;
825 $objectstatic->statut = $obj->status;
826 $objectstatic->total_ht = $obj->total_ht;
827 $objectstatic->total_tva = $obj->total_tva;
828 $objectstatic->total_ttc = $obj->total_ttc;
829 $objectstatic->type = $obj->type;
831 $companystatic->id = $obj->socid;
832 $companystatic->name = $obj->socname;
833 $companystatic->client = $obj->client;
834 $companystatic->canvas = $obj->canvas;
837 $filedir = $conf->propal->multidir_output[$obj->entity].
'/'.$filename;
839 $result .=
'<tr class="nowrap">';
841 $result .=
'<td class="oddeven">';
842 $result .=
'<table class="nobordernopadding">';
843 $result .=
'<tr class="nocellnopadd">';
845 $result .=
'<td width="96" class="nobordernopadding nowrap">'.$objectstatic->getNomUrl(1).
'</td>';
846 $result .=
'<td width="16" class="nobordernopadding nowrap"> </td>';
847 $result .=
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).
'</td>';
850 $result .=
'</table>';
853 $result .=
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
854 $result .=
'<td>'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
855 $result .=
'<td class="right amount">'.price($obj->total_ttc).
'</td>';
858 $payment = $objectstatic->getSommePaiement();
859 $result .=
'<td class="right">'.$objectstatic->getLibStatut(5, $payment).
'</td>';
866 $result .=
'</table>';
880 global $conf, $db, $langs, $user;
882 $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,";
883 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client";
884 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as f";
885 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
886 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
887 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
889 $sql .=
" WHERE f.fk_soc = s.rowid";
890 $sql .=
" AND f.entity IN (".getEntity(
'facture_fourn').
")";
892 $sql .=
" AND f.fk_soc = ".((int) $socid);
894 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
895 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
897 $sql .=
" ORDER BY f.tms DESC";
898 $sql .= $db->plimit($maxCount, 0);
900 $resql = $db->query($sql);
906 $num = $db->num_rows($resql);
908 $result =
'<div class="div-table-responsive-no-min">';
909 $result .=
'<table class="noborder centpercent">';
910 $result .=
'<tr class="liste_titre">';
911 $result .=
'<th colspan="3">'.$langs->trans(
"BoxTitleLastSupplierBills", $maxCount).
'</th>';
912 $result .=
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
913 $result .=
'<th class="right"></th>';
917 $result .=
'</table>';
923 $companystatic =
new Societe($db);
928 $obj = $db->fetch_object($resql);
930 $objectstatic->id = $obj->rowid;
931 $objectstatic->ref = $obj->ref;
932 $objectstatic->paye = $obj->paye;
933 $objectstatic->statut = $obj->status;
934 $objectstatic->total_ht = $obj->total_ht;
935 $objectstatic->total_tva = $obj->total_tva;
936 $objectstatic->total_ttc = $obj->total_ttc;
937 $objectstatic->type = $obj->type;
939 $companystatic->id = $obj->socid;
940 $companystatic->name = $obj->socname;
941 $companystatic->client = $obj->client;
942 $companystatic->canvas = $obj->canvas;
945 $filedir = $conf->propal->multidir_output[$obj->entity].
'/'.$filename;
947 $result .=
'<tr class="nowrap">';
949 $result .=
'<td class="oddeven">';
950 $result .=
'<table class="nobordernopadding">';
951 $result .=
'<tr class="nocellnopadd">';
953 $result .=
'<td width="96" class="nobordernopadding nowrap">'.$objectstatic->getNomUrl(1).
'</td>';
954 $result .=
'<td width="16" class="nobordernopadding nowrap"> </td>';
955 $result .=
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).
'</td>';
958 $result .=
'</table>';
961 $result .=
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
963 $result .=
'<td>'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
965 $result .=
'<td class="amount right">'.price($obj->total_ttc).
'</td>';
967 $result .=
'<td class="right">'.$objectstatic->getLibStatut(5).
'</td>';
974 $result .=
'</table>';
988 global $conf, $db, $langs, $user, $hookmanager;
992 if (isModEnabled(
'facture') && $user->hasRight(
'facture',
'lire')) {
993 $tmpinvoice =
new Facture($db);
995 $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";
996 $sql .=
", f.date_lim_reglement as datelimite";
997 $sql .=
", s.nom as name";
998 $sql .=
", s.rowid as socid, s.email";
999 $sql .=
", s.code_client, s.code_compta";
1000 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1001 $sql .=
", cc.rowid as country_id, cc.code as country_code";
1002 $sql .=
", sum(pf.amount) as am";
1003 $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";
1004 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf on f.rowid=pf.fk_facture";
1005 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
1006 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1008 $sql .=
" WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = ".Facture::STATUS_VALIDATED;
1009 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
1010 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
1011 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1014 $sql .=
" AND f.fk_soc = ".((int) $socid);
1017 $parameters = array();
1018 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerUnpaid', $parameters);
1019 $sql .= $hookmanager->resPrint;
1021 $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,";
1022 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, cc.rowid, cc.code";
1023 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1024 $sql .=
" ORDER BY f.datef ASC, f.ref ASC";
1026 $resql = $db->query($sql);
1028 $num = $db->num_rows($resql);
1034 print
'<div class="div-table-responsive-no-min">';
1035 print
'<table class="noborder centpercent">';
1037 print
'<tr class="liste_titre">';
1038 print
'<th colspan="2">';
1039 print $langs->trans(
"BillsCustomersUnpaid", $num).
' ';
1041 print
'<span class="badge">'.$num.
'</span>';
1045 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1047 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1049 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1050 print
'<th class="right">'.$langs->trans(
"Received").
'</th>';
1051 print
'<th width="16"> </th>';
1054 $societestatic =
new Societe($db);
1055 $total_ttc = $totalam = $total = 0;
1057 $obj = $db->fetch_object($resql);
1059 if ($i >= $maxCount) {
1062 $total += $obj->total_ht;
1063 $total_ttc += $obj->total_ttc;
1064 $totalam += $obj->am;
1068 $tmpinvoice->ref = $obj->ref;
1069 $tmpinvoice->id = $obj->rowid;
1070 $tmpinvoice->total_ht = $obj->total_ht;
1071 $tmpinvoice->total_tva = $obj->total_tva;
1072 $tmpinvoice->total_ttc = $obj->total_ttc;
1073 $tmpinvoice->type = $obj->type;
1074 $tmpinvoice->statut = $obj->status;
1075 $tmpinvoice->paye = $obj->paye;
1076 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
1078 $societestatic->id = $obj->socid;
1079 $societestatic->name = $obj->name;
1080 $societestatic->email = $obj->email;
1081 $societestatic->country_id = $obj->country_id;
1082 $societestatic->country_code = $obj->country_code;
1083 $societestatic->client = 1;
1084 $societestatic->code_client = $obj->code_client;
1085 $societestatic->code_fournisseur = $obj->code_fournisseur;
1086 $societestatic->code_compta = $obj->code_compta;
1087 $societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1089 print
'<tr class="oddeven">';
1090 print
'<td class="nowrap">';
1092 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1093 print
'<td class="nobordernopadding nowrap">';
1094 print $tmpinvoice->getNomUrl(1,
'');
1096 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
1099 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
1100 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
1101 print
'</td></tr></table>';
1104 print
'<td class="nowrap tdoverflowmax100">';
1105 print $societestatic->getNomUrl(1,
'customer');
1107 print
'<td class="right">';
1109 if ($tmpinvoice->hasDelay()) {
1114 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
1116 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
1117 print
'<td class="nowrap right"><span class="amount">'.price($obj->am).
'</span></td>';
1118 print
'<td>'.$tmpinvoice->getLibStatut(3, $obj->am).
'</td>';
1121 $total_ttc += $obj->total_ttc;
1122 $total += $obj->total_ht;
1123 $totalam += $obj->am;
1133 print
'<tr class="oddeven">';
1134 print
'<td class="nowrap" colspan="'.$colspan.
'">';
1135 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1140 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>';
1141 print
'<td> </td>';
1143 print
'<td class="right"><span class="amount">'.price($total).
'</span></td>';
1145 print
'<td class="nowrap right"><span class="amount">'.price($total_ttc).
'</span></td>';
1146 print
'<td class="nowrap right"><span class="amount">'.price($totalam).
'</span></td>';
1147 print
'<td> </td>';
1154 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
1156 print
'</table></div><br>';
1176 global $conf, $db, $langs, $user, $hookmanager;
1180 if (isModEnabled(
"supplier_invoice") && ($user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'supplier_invoice',
'read'))) {
1183 $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";
1184 $sql .=
", ff.date_lim_reglement";
1185 $sql .=
", s.nom as name";
1186 $sql .=
", s.rowid as socid, s.email";
1187 $sql .=
", s.code_client, s.code_compta";
1188 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1189 $sql .=
", sum(pf.amount) as am";
1190 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
1191 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
1192 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
1193 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1195 $sql .=
" WHERE s.rowid = ff.fk_soc";
1196 $sql .=
" AND ff.entity = ".$conf->entity;
1197 $sql .=
" AND ff.paye = 0";
1198 $sql .=
" AND ff.fk_statut = ".FactureFournisseur::STATUS_VALIDATED;
1199 if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
1200 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1203 $sql .=
" AND ff.fk_soc = ".((int) $socid);
1206 $parameters = array();
1207 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierUnpaid', $parameters);
1208 $sql .= $hookmanager->resPrint;
1210 $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,";
1211 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
1212 $sql .=
" ORDER BY ff.date_lim_reglement ASC";
1214 $resql = $db->query($sql);
1216 $num = $db->num_rows($resql);
1221 print
'<div class="div-table-responsive-no-min">';
1222 print
'<table class="noborder centpercent">';
1224 print
'<tr class="liste_titre">';
1225 print
'<th colspan="2">';
1226 print $langs->trans(
"BillsSuppliersUnpaid", $num).
' ';
1228 print
'<span class="badge">'.$num.
'</span>';
1232 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1234 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1236 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1237 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
1238 print
'<th width="16"> </th>';
1240 $societestatic =
new Societe($db);
1243 $total = $total_ttc = $totalam = 0;
1245 $obj = $db->fetch_object($resql);
1247 if ($i >= $maxCount) {
1250 $total += $obj->total_ht;
1251 $total_ttc += $obj->total_ttc;
1255 $facstatic->ref = $obj->ref;
1256 $facstatic->id = $obj->rowid;
1257 $facstatic->type = $obj->type;
1258 $facstatic->total_ht = $obj->total_ht;
1259 $facstatic->total_tva = $obj->total_tva;
1260 $facstatic->total_ttc = $obj->total_ttc;
1261 $facstatic->statut = $obj->status;
1262 $facstatic->paye = $obj->paye;
1264 $societestatic->id = $obj->socid;
1265 $societestatic->name = $obj->name;
1266 $societestatic->email = $obj->email;
1267 $societestatic->client = 0;
1268 $societestatic->fournisseur = 1;
1269 $societestatic->code_client = $obj->code_client;
1270 $societestatic->code_fournisseur = $obj->code_fournisseur;
1271 $societestatic->code_compta = $obj->code_compta;
1272 $societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1274 print
'<tr class="oddeven">';
1275 print
'<td class="nowrap tdoverflowmax100">';
1276 print $facstatic->getNomUrl(1,
'');
1278 print
'<td class="nowrap tdoverflowmax100">'.$societestatic->getNomUrl(1,
'supplier').
'</td>';
1279 print
'<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement),
'day').
'</td>';
1281 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
1283 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
1284 print
'<td class="nowrap right"><span class="amount">'.price($obj->am).
'</span></td>';
1285 print
'<td>'.$facstatic->getLibStatut(3, $obj->am).
'</td>';
1287 $total += $obj->total_ht;
1288 $total_ttc += $obj->total_ttc;
1289 $totalam += $obj->am;
1298 print
'<tr class="oddeven">';
1299 print
'<td class="nowrap" colspan="'.$colspan.
'">';
1300 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1305 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>';
1306 print
'<td> </td>';
1308 print
'<td class="right">'.price($total).
'</td>';
1310 print
'<td class="nowrap right">'.price($total_ttc).
'</td>';
1311 print
'<td class="nowrap right">'.price($totalam).
'</td>';
1312 print
'<td> </td>';
1319 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
1321 print
'</table></div><br>';
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($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.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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 informations.
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 informations.
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 informations.
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.