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/list.php?search_fk_fac_rec_source=' .
$object->id;
266 $head[$h][1] = $langs->trans(
'InvoicesGeneratedFromRec');
269 $sql =
"SELECT COUNT(rowid) as nb";
270 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture";
271 $sql .=
" WHERE fk_fac_rec_source = ".((int)
$object->id);
272 $resql = $db->query($sql);
274 $obj = $db->fetch_object($resql);
275 $nbFacture = $obj->nb;
277 dol_syslog(
'Failed to count invoices with invoice model '.$db->lasterror(), LOG_ERR);
279 if ($nbFacture > 0) {
280 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbFacture.
'</span>';
282 $head[$h][2] =
'generated';
287 if (!empty(
$object->note_private)) {
290 if (!empty(
$object->note_public)) {
293 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/note-rec.php?id='.
$object->id;
294 $head[$h][1] = $langs->trans(
'Notes');
296 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
298 $head[$h][2] =
'note';
302 $head[$h][0] = DOL_URL_ROOT.
'/compta/facture/agenda-rec.php?id='.
$object->id;
303 $head[$h][1] = $langs->trans(
"Events");
304 if (isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
307 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
308 $cachekey =
'count_events_facturerec_'.$object->id;
310 if (!is_null($dataretrieved)) {
311 $nbEvent = $dataretrieved;
313 $sql =
"SELECT COUNT(id) as nb";
314 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
315 $sql .=
" WHERE fk_element = ".((int)
$object->id);
316 $sql .=
" AND elementtype = 'invoicerec'";
317 $resql = $db->query($sql);
319 $obj = $db->fetch_object($resql);
322 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
328 $head[$h][1] .= $langs->trans(
"Agenda");
330 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
333 $head[$h][2] =
'agenda';
355 global $db, $langs, $conf;
360 $head[$h][0] = DOL_URL_ROOT .
'/fourn/facture/card-rec.php?id=' .
$object->id;
361 $head[$h][1] = $langs->trans(
"RepeatableSupplierInvoice");
362 $head[$h][2] =
'card';
367 if (!empty(
$object->note_private)) {
370 if (!empty(
$object->note_public)) {
373 $head[$h][0] = DOL_URL_ROOT.
'/fourn/facture/note-rec.php?id='.
$object->id;
374 $head[$h][1] = $langs->trans(
'Notes');
376 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
378 $head[$h][2] =
'note';
381 $head[$h][0] = DOL_URL_ROOT .
'/fourn/facture/list.php?search_fk_fac_rec_source=' .
$object->id;
382 $head[$h][1] = $langs->trans(
'InvoicesGeneratedFromRec');
386 $sql =
"SELECT COUNT(rowid) as nb";
387 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn";
388 $sql .=
" WHERE fk_fac_rec_source = ".((int)
$object->id);
389 $resql = $db->query($sql);
391 $obj = $db->fetch_object($resql);
392 $nbFactureFourn = $obj->nb;
394 dol_syslog(
'Failed to count invoices with supplier invoice model '.$db->lasterror(), LOG_ERR);
396 if ($nbFactureFourn > 0) {
397 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbFactureFourn.
'</span>';
399 $head[$h][2] =
'generated';
421 global $conf, $db, $langs, $user;
423 if (($mode ==
'customers' && isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire'))
424 || ($mode ==
'suppliers' && (isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) && $user->hasRight(
'fournisseur',
'facture',
'lire'))
426 global $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus8, $badgeStatus11;
427 include DOL_DOCUMENT_ROOT.
'/theme/'.$conf->theme.
'/theme_vars.inc.php';
429 $now = date_create(date(
'Y-m-d',
dol_now()));
430 $datenowsub30 = date_create(date(
'Y-m-d',
dol_now()));
431 $datenowsub15 = date_create(date(
'Y-m-d',
dol_now()));
432 $datenowadd30 = date_create(date(
'Y-m-d',
dol_now()));
433 $datenowadd15 = date_create(date(
'Y-m-d',
dol_now()));
434 $interval30days = date_interval_create_from_date_string(
'30 days');
435 $interval15days = date_interval_create_from_date_string(
'15 days');
436 date_sub($datenowsub30, $interval30days);
437 date_sub($datenowsub15, $interval15days);
438 date_add($datenowadd30, $interval30days);
439 date_add($datenowadd15, $interval15days);
444 $sql .=
" sum(".$db->ifsql(
"f.date_lim_reglement < '".date_format($datenowsub30,
'Y-m-d').
"'", $amount_mode ?
"f.total_ht" : 1, 0).
") as late30";
445 $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";
446 $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";
447 $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";
448 $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";
449 $sql .=
", sum(".$db->ifsql(
"f.date_lim_reglement >= '".date_format($datenowadd30,
'Y-m-d').
"'", $amount_mode ?
"f.total_ht" : 1, 0).
") as notlate30";
450 if ($mode ==
'customers') {
451 $element =
'invoice';
452 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
453 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
454 $element =
'supplier_invoice';
455 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as f";
459 $sql .=
" WHERE f.entity IN (".getEntity($element).
")";
460 $sql .=
" AND f.type <> 2";
461 $sql .=
" AND f.fk_statut = 1";
462 if (isset($user->socid) && $user->socid > 0) {
463 $sql .=
" AND f.fk_soc = ".((int) $user->socid);
466 $resql = $db->query($sql);
468 $num = $db->num_rows($resql);
471 $dataseries = array();
474 $obj = $db->fetch_object($resql);
483 $dataseries[$i] = array($langs->transnoentitiesnoconv(
'NbOfOpenInvoices'), $obj->late30, $obj->late15, $obj->latenow, $obj->notlatenow, $obj->notlate15, $obj->notlate30);
486 if (!empty($dataseries[0])) {
487 foreach ($dataseries[0] as $key => $value) {
488 if (is_numeric($value)) {
494 $langs->trans(
'InvoiceLate30Days'),
495 $langs->trans(
'InvoiceLate15Days'),
496 $langs->trans(
'InvoiceLateMinus15Days'),
497 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate') : $langs->trans(
"InvoiceToPay"),
498 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate15Days') : $langs->trans(
"InvoiceToPay15Days"),
499 $mode ==
'customers' ? $langs->trans(
'InvoiceNotLate30Days') : $langs->trans(
"InvoiceToPay30Days"),
502 $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11,
'-'.$badgeStatus11);
504 $result =
'<div class="div-table-responsive-no-min">';
505 $result .=
'<table class="noborder nohover centpercent">';
506 $result .=
'<tr class="liste_titre">';
507 $result .=
'<td>'.$langs->trans(
"NbOfOpenInvoices").
' - ';
508 if ($mode ==
'customers') {
509 $result .= $langs->trans(
"CustomerInvoice");
510 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
511 $result .= $langs->trans(
"SupplierInvoice");
518 if ($conf->use_javascript_ajax) {
521 $dolgraph->SetData($dataseries);
523 $dolgraph->setLegend($legend);
525 $dolgraph->SetDataColor(array_values($colorseries));
526 $dolgraph->setShowLegend(2);
527 $dolgraph->setShowPercent(1);
528 $dolgraph->SetType(array(
'bars',
'bars',
'bars',
'bars',
'bars',
'bars'));
530 $dolgraph->setHeight(
'160');
531 $dolgraph->setWidth(
'450');
532 $dolgraph->setHideXValues(
true);
533 if ($mode ==
'customers') {
534 $dolgraph->draw(
'idgraphcustomerinvoices');
535 } elseif ($mode ==
'fourn' || $mode ==
'suppliers') {
536 $dolgraph->draw(
'idgraphfourninvoices');
540 $result .=
'<tr maxwidth="255">';
541 $result .=
'<td class="center">'.$dolgraph->show($total ? 0 : $langs->trans(
"NoOpenInvoice")).
'</td>';
547 $result .=
'</table>';
567 global $conf, $db, $langs, $user, $hookmanager;
571 if (isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
572 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
574 $tmpinvoice =
new Facture($db);
576 $sql =
"SELECT f.rowid, f.ref, f.datef as date, f.total_ht, f.total_tva, f.total_ttc, f.ref_client";
577 $sql .=
", f.type, f.fk_statut as status, f.paye";
578 $sql .=
", s.nom as name";
579 $sql .=
", s.rowid as socid, s.email";
580 $sql .=
", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
581 $sql .=
", cc.rowid as country_id, cc.code as country_code";
582 if (!$user->hasRight(
'societe',
'client',
'voir')) {
583 $sql .=
", sc.fk_soc, sc.fk_user ";
585 $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";
586 if (!$user->hasRight(
'societe',
'client',
'voir')) {
587 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
589 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT;
590 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
591 if (!$user->hasRight(
'societe',
'client',
'voir')) {
592 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
596 $sql .=
" AND f.fk_soc = ".((int) $socid);
599 $parameters = array();
600 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerDraft', $parameters);
601 $sql .= $hookmanager->resPrint;
603 $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,";
604 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,";
605 $sql .=
" cc.rowid, cc.code";
606 if (!$user->hasRight(
'societe',
'client',
'voir')) {
607 $sql .=
", sc.fk_soc, sc.fk_user";
611 $parameters = array();
612 $reshook = $hookmanager->executeHooks(
'printFieldListGroupByCustomerDraft', $parameters);
613 $sql .= $hookmanager->resPrint;
615 $resql = $db->query($sql);
618 $num = $db->num_rows($resql);
619 $nbofloop = min($num, $maxofloop);
621 $result .=
'<div class="div-table-responsive-no-min">';
622 $result .=
'<table class="noborder centpercent">';
624 $result .=
'<tr class="liste_titre">';
625 $result .=
'<th colspan="3">';
626 $result .= $langs->trans(
"CustomersDraftInvoices");
627 $result .=
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?search_status='.
Facture::STATUS_DRAFT.
'">';
628 $result .=
'<span class="badge marginleftonly">'.$num.
'</span>';
634 $companystatic =
new Societe($db);
639 while ($i < $nbofloop) {
640 $obj = $db->fetch_object($resql);
642 if ($i >= $maxCount) {
645 $tot_ttc += $obj->total_ttc;
649 $tmpinvoice->id = $obj->rowid;
650 $tmpinvoice->ref = $obj->ref;
651 $tmpinvoice->date = $db->jdate($obj->date);
652 $tmpinvoice->type = $obj->type;
653 $tmpinvoice->total_ht = $obj->total_ht;
654 $tmpinvoice->total_tva = $obj->total_tva;
655 $tmpinvoice->total_ttc = $obj->total_ttc;
656 $tmpinvoice->ref_client = $obj->ref_client;
657 $tmpinvoice->statut = $obj->status;
658 $tmpinvoice->paye = $obj->paye;
660 $companystatic->id = $obj->socid;
661 $companystatic->name = $obj->name;
662 $companystatic->email = $obj->email;
663 $companystatic->country_id = $obj->country_id;
664 $companystatic->country_code = $obj->country_code;
665 $companystatic->client = 1;
666 $companystatic->code_client = $obj->code_client;
667 $companystatic->code_fournisseur = $obj->code_fournisseur;
668 $companystatic->code_compta = $obj->code_compta;
669 $companystatic->code_compta_client = $obj->code_compta;
670 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
672 $result .=
'<tr class="oddeven">';
673 $result .=
'<td class="nowrap tdoverflowmax100">';
674 $result .= $tmpinvoice->getNomUrl(1,
'');
676 $result .=
'<td class="nowrap tdoverflowmax100">';
677 $result .= $companystatic->getNomUrl(1,
'customer');
679 $result .=
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
681 $tot_ttc += $obj->total_ttc;
686 $result .=
'<tr class="oddeven">';
687 $result .=
'<td class="nowrap" colspan="3">';
688 $result .=
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
690 $result .=
"</tr>\n";
693 $result .=
'<tr class="liste_total"><td class="left">'.$langs->trans(
"Total").
'</td>';
694 $result .=
'<td colspan="2" class="right">'.price($tot_ttc).
'</td>';
697 $result .=
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
699 $result .=
"</table></div>";
718 global $conf, $db, $langs, $user, $hookmanager;
722 if ((isModEnabled(
'fournisseur') || isModEnabled(
'supplier_invoice')) && $user->hasRight(
'facture',
'lire')) {
723 $maxofloop = (!
getDolGlobalString(
'MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
727 $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";
728 $sql .=
", s.nom as name";
729 $sql .=
", s.rowid as socid, s.email";
730 $sql .=
", s.code_client, s.code_compta";
731 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
732 $sql .=
", cc.rowid as country_id, cc.code as country_code";
733 $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";
734 if (!$user->hasRight(
'societe',
'client',
'voir')) {
735 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
737 $sql .=
" WHERE s.rowid = f.fk_soc AND f.fk_statut = ".FactureFournisseur::STATUS_DRAFT;
738 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
739 if (!$user->hasRight(
'societe',
'client',
'voir')) {
740 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
743 $sql .=
" AND f.fk_soc = ".((int) $socid);
746 $parameters = array();
747 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierDraft', $parameters);
748 $sql .= $hookmanager->resPrint;
749 $resql = $db->query($sql);
752 $num = $db->num_rows($resql);
753 $nbofloop = min($num, $maxofloop);
755 $result .=
'<div class="div-table-responsive-no-min">';
756 $result .=
'<table class="noborder centpercent">';
758 $result .=
'<tr class="liste_titre">';
759 $result .=
'<th colspan="3">';
760 $result .= $langs->trans(
"SuppliersDraftInvoices");
762 $result .=
'<span class="badge marginleftonly">'.$num.
'</span>';
768 $companystatic =
new Societe($db);
773 while ($i < $nbofloop) {
774 $obj = $db->fetch_object($resql);
776 if ($i >= $maxCount) {
779 $tot_ttc += $obj->total_ttc;
783 $facturesupplierstatic->ref = $obj->ref;
784 $facturesupplierstatic->id = $obj->rowid;
785 $facturesupplierstatic->total_ht = $obj->total_ht;
786 $facturesupplierstatic->total_tva = $obj->total_tva;
787 $facturesupplierstatic->total_ttc = $obj->total_ttc;
788 $facturesupplierstatic->ref_supplier = $obj->ref_supplier;
789 $facturesupplierstatic->type = $obj->type;
790 $facturesupplierstatic->statut = $obj->status;
791 $facturesupplierstatic->status = $obj->status;
792 $facturesupplierstatic->paye = $obj->paye;
793 $facturesupplierstatic->paid = $obj->paye;
795 $companystatic->id = $obj->socid;
796 $companystatic->name = $obj->name;
797 $companystatic->email = $obj->email;
798 $companystatic->country_id = $obj->country_id;
799 $companystatic->country_code = $obj->country_code;
800 $companystatic->fournisseur = 1;
801 $companystatic->code_client = $obj->code_client;
802 $companystatic->code_fournisseur = $obj->code_fournisseur;
803 $companystatic->code_compta = $obj->code_compta;
804 $companystatic->code_compta_client = $obj->code_compta;
805 $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
807 $result .=
'<tr class="oddeven">';
808 $result .=
'<td class="nowrap tdoverflowmax100">';
809 $result .= $facturesupplierstatic->getNomUrl(1,
'');
811 $result .=
'<td class="nowrap tdoverflowmax100">';
812 $result .= $companystatic->getNomUrl(1,
'supplier');
814 $result .=
'<td class="right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
816 $tot_ttc += $obj->total_ttc;
821 $result .=
'<tr class="oddeven">';
822 $result .=
'<td class="nowrap" colspan="3">';
823 $result .=
'<span class="opacitymedium">'.$langs->trans(
"More").
'...'.($othernb < $maxofloop ?
' ('.$othernb.
')' :
'').
'</span>';
825 $result .=
"</tr>\n";
828 $result .=
'<tr class="liste_total"><td class="left">'.$langs->trans(
"Total").
'</td>';
829 $result .=
'<td colspan="2" class="right">'.price($tot_ttc).
'</td>';
832 $result .=
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
834 $result .=
"</table></div>";
854 global $conf, $db, $langs, $user;
856 $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,";
857 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client";
858 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
859 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
860 if (!$user->hasRight(
'societe',
'client',
'voir')) {
861 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
863 $sql .=
" WHERE f.fk_soc = s.rowid";
864 $sql .=
" AND f.entity IN (".getEntity(
'facture').
")";
866 $sql .=
" AND f.fk_soc = ".((int) $socid);
868 if (!$user->hasRight(
'societe',
'client',
'voir')) {
869 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
871 $sql .=
" ORDER BY f.tms DESC";
872 $sql .= $db->plimit($maxCount, 0);
874 $resql = $db->query($sql);
879 $num = $db->num_rows($resql);
881 $result =
'<div class="div-table-responsive-no-min">';
882 $result .=
'<table class="noborder centpercent">';
884 $result .=
'<tr class="liste_titre">';
885 $result .=
'<th colspan="3">'.$langs->trans(
"LastCustomersBills", $maxCount).
'</th>';
886 $result .=
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
887 $result .=
'<th class="right"></th>';
891 $result .=
'</table>';
897 $objectstatic =
new Facture($db);
898 $companystatic =
new Societe($db);
902 $obj = $db->fetch_object($resql);
904 $objectstatic->id = $obj->rowid;
905 $objectstatic->ref = $obj->ref;
906 $objectstatic->paye = $obj->paye;
907 $objectstatic->statut = $obj->status;
908 $objectstatic->total_ht = $obj->total_ht;
909 $objectstatic->total_tva = $obj->total_tva;
910 $objectstatic->total_ttc = $obj->total_ttc;
911 $objectstatic->type = $obj->type;
913 $companystatic->id = $obj->socid;
914 $companystatic->name = $obj->socname;
915 $companystatic->client = $obj->client;
916 $companystatic->canvas = $obj->canvas;
919 $filedir = $conf->propal->multidir_output[$obj->entity].
'/'.$filename;
921 $result .=
'<tr class="nowrap">';
923 $result .=
'<td class="oddeven">';
924 $result .=
'<table class="nobordernopadding">';
925 $result .=
'<tr class="nocellnopadd">';
927 $result .=
'<td width="96" class="nobordernopadding nowrap">'.$objectstatic->getNomUrl(1).
'</td>';
928 $result .=
'<td width="16" class="nobordernopadding nowrap"> </td>';
929 $result .=
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).
'</td>';
932 $result .=
'</table>';
935 $result .=
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'customer').
'</td>';
936 $result .=
'<td>'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
937 $result .=
'<td class="right amount">'.price($obj->total_ttc).
'</td>';
940 $payment = $objectstatic->getSommePaiement();
941 $result .=
'<td class="right">'.$objectstatic->getLibStatut(5, $payment).
'</td>';
948 $result .=
'</table>';
962 global $conf, $db, $langs, $user;
964 $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,";
965 $sql .=
" s.nom as socname, s.rowid as socid, s.canvas, s.client";
966 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture_fourn as f";
967 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
968 if (!$user->hasRight(
'societe',
'client',
'voir')) {
969 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
971 $sql .=
" WHERE f.fk_soc = s.rowid";
972 $sql .=
" AND f.entity IN (".getEntity(
'facture_fourn').
")";
974 $sql .=
" AND f.fk_soc = ".((int) $socid);
976 if (!$user->hasRight(
'societe',
'client',
'voir')) {
977 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
979 $sql .=
" ORDER BY f.tms DESC";
980 $sql .= $db->plimit($maxCount, 0);
982 $resql = $db->query($sql);
988 $num = $db->num_rows($resql);
990 $result =
'<div class="div-table-responsive-no-min">';
991 $result .=
'<table class="noborder centpercent">';
992 $result .=
'<tr class="liste_titre">';
993 $result .=
'<th colspan="3">'.$langs->trans(
"BoxTitleLastSupplierBills", $maxCount).
' ';
994 $result .=
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?sortfield=f.tms&sortorder=DESC">';
995 $result .=
'<span class="badge">...</span>';
998 $result .=
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
999 $result .=
'<th class="right"></th>';
1003 $result .=
'</table>';
1004 $result .=
'</div>';
1009 $companystatic =
new Societe($db);
1014 $obj = $db->fetch_object($resql);
1016 $objectstatic->id = $obj->rowid;
1017 $objectstatic->ref = $obj->ref;
1018 $objectstatic->paye = $obj->paye;
1019 $objectstatic->paid = $obj->paye;
1020 $objectstatic->statut = $obj->status;
1021 $objectstatic->status = $obj->status;
1022 $objectstatic->total_ht = $obj->total_ht;
1023 $objectstatic->total_tva = $obj->total_tva;
1024 $objectstatic->total_ttc = $obj->total_ttc;
1025 $objectstatic->type = $obj->type;
1027 $companystatic->id = $obj->socid;
1028 $companystatic->name = $obj->socname;
1029 $companystatic->client = $obj->client;
1030 $companystatic->canvas = $obj->canvas;
1033 $filedir = $conf->propal->multidir_output[$obj->entity].
'/'.$filename;
1035 $result .=
'<tr class="nowrap">';
1037 $result .=
'<td class="oddeven">';
1038 $result .=
'<table class="nobordernopadding">';
1039 $result .=
'<tr class="nocellnopadd">';
1041 $result .=
'<td width="96" class="nobordernopadding nowrap">'.$objectstatic->getNomUrl(1).
'</td>';
1042 $result .=
'<td width="16" class="nobordernopadding nowrap"> </td>';
1043 $result .=
'<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).
'</td>';
1046 $result .=
'</table>';
1049 $result .=
'<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1,
'supplier').
'</td>';
1051 $result .=
'<td>'.dol_print_date($db->jdate($obj->datec),
'day').
'</td>';
1053 $result .=
'<td class="amount right">'.price($obj->total_ttc).
'</td>';
1055 $result .=
'<td class="right">'.$objectstatic->getLibStatut(5).
'</td>';
1062 $result .=
'</table>';
1063 $result .=
'</div>';
1076 global $conf, $db, $langs, $user, $hookmanager;
1080 if (isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
1081 $tmpinvoice =
new Facture($db);
1083 $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";
1084 $sql .=
", f.date_lim_reglement as datelimite";
1085 $sql .=
", s.nom as name";
1086 $sql .=
", s.rowid as socid, s.email";
1087 $sql .=
", s.code_client, s.code_compta";
1088 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1089 $sql .=
", cc.rowid as country_id, cc.code as country_code";
1090 $sql .=
", sum(pf.amount) as am";
1091 $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";
1092 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf on f.rowid=pf.fk_facture";
1093 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1094 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1096 $sql .=
" WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = ".Facture::STATUS_VALIDATED;
1097 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
')';
1098 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1099 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1102 $sql .=
" AND f.fk_soc = ".((int) $socid);
1105 $parameters = array();
1106 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerUnpaid', $parameters);
1107 $sql .= $hookmanager->resPrint;
1109 $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,";
1110 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_compta, cc.rowid, cc.code";
1111 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1112 $sql .=
" ORDER BY f.datef ASC, f.ref ASC";
1114 $resql = $db->query($sql);
1116 $num = $db->num_rows($resql);
1122 print
'<div class="div-table-responsive-no-min">';
1123 print
'<table class="noborder centpercent">';
1125 print
'<tr class="liste_titre">';
1126 print
'<th colspan="2">';
1127 print $langs->trans(
"BillsCustomersUnpaid", $num).
' ';
1129 print
'<span class="badge">'.$num.
'</span>';
1133 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1135 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1137 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1138 print
'<th class="right">'.$langs->trans(
"Received").
'</th>';
1139 print
'<th width="16"> </th>';
1142 $societestatic =
new Societe($db);
1143 $total_ttc = $totalam = $total = 0;
1145 $obj = $db->fetch_object($resql);
1147 if ($i >= $maxCount) {
1150 $total += $obj->total_ht;
1151 $total_ttc += $obj->total_ttc;
1152 $totalam += $obj->am;
1156 $tmpinvoice->ref = $obj->ref;
1157 $tmpinvoice->id = $obj->rowid;
1158 $tmpinvoice->total_ht = $obj->total_ht;
1159 $tmpinvoice->total_tva = $obj->total_tva;
1160 $tmpinvoice->total_ttc = $obj->total_ttc;
1161 $tmpinvoice->type = $obj->type;
1162 $tmpinvoice->statut = $obj->status;
1163 $tmpinvoice->paye = $obj->paye;
1164 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
1166 $societestatic->id = $obj->socid;
1167 $societestatic->name = $obj->name;
1168 $societestatic->email = $obj->email;
1169 $societestatic->country_id = $obj->country_id;
1170 $societestatic->country_code = $obj->country_code;
1171 $societestatic->client = 1;
1172 $societestatic->code_client = $obj->code_client;
1173 $societestatic->code_fournisseur = $obj->code_fournisseur;
1174 $societestatic->code_compta = $obj->code_compta;
1175 $societestatic->code_compta_client = $obj->code_compta;
1176 $societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1178 print
'<tr class="oddeven">';
1179 print
'<td class="nowrap">';
1181 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
1182 print
'<td class="nobordernopadding nowrap">';
1183 print $tmpinvoice->getNomUrl(1,
'');
1185 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
1188 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
1189 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
1190 print
'</td></tr></table>';
1193 print
'<td class="nowrap tdoverflowmax100">';
1194 print $societestatic->getNomUrl(1,
'customer');
1196 print
'<td class="right">';
1198 if ($tmpinvoice->hasDelay()) {
1203 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
1205 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
1206 print
'<td class="nowrap right"><span class="amount">'.price($obj->am).
'</span></td>';
1207 print
'<td>'.$tmpinvoice->getLibStatut(3, $obj->am).
'</td>';
1210 $total_ttc += $obj->total_ttc;
1211 $total += $obj->total_ht;
1212 $totalam += $obj->am;
1222 print
'<tr class="oddeven">';
1223 print
'<td class="nowrap" colspan="'.$colspan.
'">';
1224 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1229 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>';
1230 print
'<td> </td>';
1232 print
'<td class="right"><span class="amount">'.price($total).
'</span></td>';
1234 print
'<td class="nowrap right"><span class="amount">'.price($total_ttc).
'</span></td>';
1235 print
'<td class="nowrap right"><span class="amount">'.price($totalam).
'</span></td>';
1236 print
'<td> </td>';
1243 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
1245 print
'</table></div><br>';
1265 global $conf, $db, $langs, $user, $hookmanager;
1269 if (isModEnabled(
"supplier_invoice") && ($user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'supplier_invoice',
'read'))) {
1272 $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";
1273 $sql .=
", ff.date_lim_reglement";
1274 $sql .=
", s.nom as name";
1275 $sql .=
", s.rowid as socid, s.email";
1276 $sql .=
", s.code_client, s.code_compta";
1277 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur";
1278 $sql .=
", sum(pf.amount) as am";
1279 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
1280 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
1281 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1282 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
1284 $sql .=
" WHERE s.rowid = ff.fk_soc";
1285 $sql .=
" AND ff.entity = ".$conf->entity;
1286 $sql .=
" AND ff.paye = 0";
1287 $sql .=
" AND ff.fk_statut = ".FactureFournisseur::STATUS_VALIDATED;
1288 if (!$user->hasRight(
'societe',
'client',
'voir')) {
1289 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1292 $sql .=
" AND ff.fk_soc = ".((int) $socid);
1295 $parameters = array();
1296 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierUnpaid', $parameters);
1297 $sql .= $hookmanager->resPrint;
1299 $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,";
1300 $sql .=
" s.nom, s.rowid, s.email, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
1301 $sql .=
" ORDER BY ff.date_lim_reglement ASC";
1303 $resql = $db->query($sql);
1305 $num = $db->num_rows($resql);
1310 print
'<div class="div-table-responsive-no-min">';
1311 print
'<table class="noborder centpercent">';
1313 print
'<tr class="liste_titre">';
1314 print
'<th colspan="2">';
1315 print $langs->trans(
"BillsSuppliersUnpaid", $num).
' ';
1317 print
'<span class="badge">'.$num.
'</span>';
1321 print
'<th class="right">'.$langs->trans(
"DateDue").
'</th>';
1323 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
1325 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
1326 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
1327 print
'<th width="16"> </th>';
1329 $societestatic =
new Societe($db);
1332 $total = $total_ttc = $totalam = 0;
1334 $obj = $db->fetch_object($resql);
1336 if ($i >= $maxCount) {
1339 $total += $obj->total_ht;
1340 $total_ttc += $obj->total_ttc;
1344 $facstatic->ref = $obj->ref;
1345 $facstatic->id = $obj->rowid;
1346 $facstatic->type = $obj->type;
1347 $facstatic->total_ht = $obj->total_ht;
1348 $facstatic->total_tva = $obj->total_tva;
1349 $facstatic->total_ttc = $obj->total_ttc;
1350 $facstatic->statut = $obj->status;
1351 $facstatic->status = $obj->status;
1352 $facstatic->paid = $obj->paye;
1353 $facstatic->paye = $obj->paye;
1355 $societestatic->id = $obj->socid;
1356 $societestatic->name = $obj->name;
1357 $societestatic->email = $obj->email;
1358 $societestatic->client = 0;
1359 $societestatic->fournisseur = 1;
1360 $societestatic->code_client = $obj->code_client;
1361 $societestatic->code_fournisseur = $obj->code_fournisseur;
1362 $societestatic->code_compta = $obj->code_compta;
1363 $societestatic->code_compta_client = $obj->code_compta;
1364 $societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
1366 print
'<tr class="oddeven">';
1367 print
'<td class="nowrap tdoverflowmax100">';
1368 print $facstatic->getNomUrl(1,
'');
1370 print
'<td class="nowrap tdoverflowmax100">'.$societestatic->getNomUrl(1,
'supplier').
'</td>';
1371 print
'<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement),
'day').
'</td>';
1373 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
1375 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
1376 print
'<td class="nowrap right"><span class="amount">'.price($obj->am).
'</span></td>';
1377 print
'<td>'.$facstatic->getLibStatut(3, $obj->am).
'</td>';
1379 $total += $obj->total_ht;
1380 $total_ttc += $obj->total_ttc;
1381 $totalam += $obj->am;
1390 print
'<tr class="oddeven">';
1391 print
'<td class="nowrap" colspan="'.$colspan.
'">';
1392 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
1397 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>';
1398 print
'<td> </td>';
1400 print
'<td class="right">'.price($total).
'</td>';
1402 print
'<td class="nowrap right">'.price($total_ttc).
'</td>';
1403 print
'<td class="nowrap right">'.price($totalam).
'</td>';
1404 print
'<td> </td>';
1411 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
1413 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.