38require
'../main.inc.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
54require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
55require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
62$langs->loadLangs(array(
'compta',
'bills'));
64 $langs->load(
"orders");
68$action =
GETPOST(
'action',
'aZ09');
73if ($user->socid > 0) {
75 $socid = $user->socid;
81$maxLatestEditCount = 5;
87$hookmanager->initHooks(array(
'invoiceindex'));
96include DOL_DOCUMENT_ROOT.
'/core/actions_addbox.inc.php';
105$form =
new Form($db);
107$thirdpartystatic =
new Societe($db);
112llxHeader(
"", $langs->trans(
"InvoicesArea"));
114print
load_fiche_titre($langs->trans(
"InvoicesArea"), $resultboxes[
'selectboxlist'],
'bill');
117print
'<div class="fichecenter">';
119print
'<div class="twocolumns">';
121print
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
145print $resultboxes[
'boxlista'];
147print
'</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
151if (
isModEnabled(
'invoice') && $user->hasRight(
'facture',
'lire')) {
152 $langs->load(
"boxes");
153 $tmpinvoice =
new Facture($db);
155 $sql =
"SELECT f.rowid, f.ref, f.fk_statut as status, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms";
156 $sql .=
", f.date_lim_reglement as datelimite";
157 $sql .=
", s.nom as name";
158 $sql .=
", s.rowid as socid";
159 $sql .=
", s.code_client, s.code_compta as code_compta_client, s.email";
160 $sql .=
", cc.rowid as country_id, cc.code as country_code";
161 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiement_facture as pf WHERE pf.fk_facture = f.rowid) as am";
162 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f";
163 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = f.fk_soc";
164 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
165 $sql .=
" WHERE f.entity IN (".getEntity(
'invoice').
")";
167 $sql .=
" AND f.fk_soc = ".((int) $socid);
170 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
171 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $user->id).
")";
174 $parameters = array();
175 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerLastModified', $parameters);
176 $sql .= $hookmanager->resPrint;
178 $sql .=
" ORDER BY f.tms DESC";
179 $sql .= $db->plimit($max, 0);
181 $resql = $db->query($sql);
183 $num = $db->num_rows($resql);
187 print
'<div class="div-table-responsive-no-min">';
188 print
'<table class="noborder centpercent">';
190 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastCustomerBills", $max);
191 print
'<a href="'.DOL_URL_ROOT.
'/compta/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
194 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
196 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
197 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
198 print
'<th width="16"> </th>';
201 $total_ttc = $totalam = $total_ht = 0;
202 while ($i < $num && $i < $conf->liste_limit) {
203 $obj = $db->fetch_object($resql);
208 $total_ht += $obj->total_ht;
209 $total_ttc += $obj->total_ttc;
213 $tmpinvoice->ref = $obj->ref;
214 $tmpinvoice->id = $obj->rowid;
215 $tmpinvoice->total_ht = $obj->total_ht;
216 $tmpinvoice->total_tva = $obj->total_tva;
217 $tmpinvoice->total_ttc = $obj->total_ttc;
218 $tmpinvoice->statut = $obj->status;
219 $tmpinvoice->status = $obj->status;
220 $tmpinvoice->paye = $obj->paye;
221 $tmpinvoice->paid = $obj->paye;
222 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
223 $tmpinvoice->type = $obj->type;
225 $thirdpartystatic->id = $obj->socid;
226 $thirdpartystatic->name = $obj->name;
227 $thirdpartystatic->email = $obj->email;
228 $thirdpartystatic->country_id = $obj->country_id;
229 $thirdpartystatic->country_code = $obj->country_code;
230 $thirdpartystatic->email = $obj->email;
231 $thirdpartystatic->client = 1;
232 $thirdpartystatic->code_client = $obj->code_client;
234 $thirdpartystatic->code_compta_client = $obj->code_compta_client;
237 $totalallpayments = $tmpinvoice->getSommePaiement(0);
238 $totalallpayments += $tmpinvoice->getSumCreditNotesUsed(0);
239 $totalallpayments += $tmpinvoice->getSumDepositsUsed(0);
240 print
'<tr class="oddeven">';
241 print
'<td class="nowrap">';
243 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
245 print
'<td class="nobordernopadding nowraponall">';
246 print $tmpinvoice->getNomUrl(1,
'');
248 if ($tmpinvoice->hasDelay()) {
249 print
'<td width="20" class="nobordernopadding nowrap">';
250 print img_warning($langs->trans(
"Late"));
253 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
256 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
257 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
258 print
'</td></tr></table>';
262 print
'<td class="tdoverflowmax150">';
263 print $thirdpartystatic->getNomUrl(1,
'customer', 44);
266 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
268 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
270 print
'<td class="right" title="'.dol_escape_htmltag($langs->trans(
"DateModificationShort").
' : '.
dol_print_date($db->jdate($obj->tms),
'dayhour',
'tzuserrel')).
'">'.
dol_print_date($db->jdate($obj->tms),
'day',
'tzuserrel').
'</td>';
272 print
'<td>'.$tmpinvoice->getLibStatut(3, $totalallpayments).
'</td>';
276 $total_ttc += $obj->total_ttc;
277 $total_ht += $obj->total_ht;
278 $totalam += $obj->am;
284 print
'<tr class="oddeven">';
285 print
'<td class="nowrap" colspan="5">';
286 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
295 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
297 print
'</table></div><br>';
300 dol_print_error($db);
306if ((
isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
"fournisseur",
"facture",
"lire")) || (
isModEnabled(
'supplier_invoice') && $user->hasRight(
"supplier_invoice",
"lire"))) {
307 $langs->load(
"boxes");
310 $sql =
"SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier";
311 $sql .=
", s.nom as name";
312 $sql .=
", s.rowid as socid";
313 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.email";
314 $sql .=
", (SELECT SUM(pf.amount) FROM ".$db->prefix().
"paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am";
315 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
316 $sql .=
" WHERE s.rowid = ff.fk_soc";
317 $sql .=
" AND ff.entity IN (".getEntity(
'facture_fourn').
")";
319 $sql .=
" AND ff.fk_soc = ".((int) $socid);
322 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
323 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = ff.fk_soc AND sc.fk_user = ".((int) $user->id).
")";
326 $parameters = array();
327 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierLastModified', $parameters);
328 $sql .= $hookmanager->resPrint;
330 $sql .=
" ORDER BY ff.tms DESC";
331 $sql .= $db->plimit($max, 0);
333 $resql = $db->query($sql);
335 $num = $db->num_rows($resql);
337 print
'<div class="div-table-responsive-no-min">';
338 print
'<table class="noborder centpercent">';
339 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastSupplierBills", $max);
340 print
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/list.php?sortfield=f.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
343 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
345 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
346 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
347 print
'<th width="16"> </th>';
351 $total_ht = $total_ttc = $totalam = 0;
355 $obj = $db->fetch_object($resql);
360 $total_ht += $obj->total_ht;
361 $total_ttc += $obj->total_ttc;
365 $facstatic->ref = $obj->ref;
366 $facstatic->id = $obj->rowid;
367 $facstatic->total_ht = $obj->total_ht;
368 $facstatic->total_tva = $obj->total_tva;
369 $facstatic->total_ttc = $obj->total_ttc;
370 $facstatic->statut = $obj->status;
371 $facstatic->status = $obj->status;
372 $facstatic->paye = $obj->paye;
373 $facstatic->paid = $obj->paye;
374 $facstatic->type = $obj->type;
375 $facstatic->ref_supplier = $obj->ref_supplier;
377 $thirdpartystatic->id = $obj->socid;
378 $thirdpartystatic->name = $obj->name;
379 $thirdpartystatic->email = $obj->email;
380 $thirdpartystatic->country_id = 0;
381 $thirdpartystatic->country_code =
'';
382 $thirdpartystatic->client = 0;
383 $thirdpartystatic->fournisseur = 1;
384 $thirdpartystatic->code_client =
'';
385 $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
386 $thirdpartystatic->code_compta_client =
'';
387 $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
389 print
'<tr class="oddeven nowraponall tdoverflowmax100"><td>';
390 print $facstatic->getNomUrl(1,
'');
392 print
'<td class="nowrap tdoverflowmax100">';
393 print $thirdpartystatic->getNomUrl(1,
'supplier');
396 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
398 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
399 print
'<td class="right" title="'.dol_escape_htmltag($langs->trans(
"DateModificationShort").
' : '.
dol_print_date($db->jdate($obj->tms),
'dayhour',
'tzuserrel')).
'">'.
dol_print_date($db->jdate($obj->tms),
'day',
'tzuserrel').
'</td>';
401 $alreadypaid = $facstatic->getSommePaiement();
402 $alreadypaid += $facstatic->getSumCreditNotesUsed();
403 $alreadypaid += $facstatic->getSumDepositsUsed();
405 print
'<td>'.$facstatic->getLibStatut(3, $alreadypaid).
'</td>';
408 $total_ht += $obj->total_ht;
409 $total_ttc += $obj->total_ttc;
410 $totalam += $obj->am;
415 print
'<tr class="oddeven">';
416 print
'<td class="nowrap" colspan="5">';
417 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
426 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</span></td></tr>';
428 print
'</table></div><br>';
430 dol_print_error($db);
437if (
isModEnabled(
'don') && $user->hasRight(
'don',
'lire')) {
438 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
440 $langs->load(
"boxes");
441 $donationstatic =
new Don($db);
443 $sql =
"SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status, d.fk_soc as socid";
444 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
445 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
447 $parameters = array();
448 $reshook = $hookmanager->executeHooks(
'printFieldListWhereLastDonations', $parameters);
449 $sql .= $hookmanager->resPrint;
451 $sql .= $db->order(
"d.tms",
"DESC");
452 $sql .= $db->plimit($max, 0);
454 $result = $db->query($sql);
456 $num = $db->num_rows($result);
461 print
'<div class="div-table-responsive-no-min">';
462 print
'<table class="noborder centpercent">';
463 print
'<tr class="liste_titre">';
464 print
'<th colspan="2">'.$langs->trans(
"BoxTitleLastModifiedDonations", $max);
465 print
'<a href="'.DOL_URL_ROOT.
'/don/list.php?sortfield=d.tms&sortorder=desc"><span class="badge marginleftonly">...</span></a>';
467 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
468 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
469 print
'<th width="16"> </th>';
473 $total_ttc = $totalam = $total_ht = 0;
475 while ($i < $num && $i < $max) {
476 $obj = $db->fetch_object($result);
481 $total_ht += $obj->total_ht;
482 $total_ttc += $obj->total_ttc;
486 $donationstatic->id = $obj->rowid;
487 $donationstatic->ref = $obj->rowid;
488 $donationstatic->lastname = $obj->lastname;
489 $donationstatic->firstname = $obj->firstname;
490 $donationstatic->date = $db->jdate($obj->date);
491 $donationstatic->status = $obj->status;
494 if (!empty($obj->socid)) {
495 $companystatic =
new Societe($db);
496 $ret = $companystatic->fetch($obj->socid);
498 $label = $companystatic->getNomUrl(1);
501 $label = $donationstatic->getFullName($langs);
503 $label .= ($label ?
' - ' :
'').$obj->societe;
507 print
'<tr class="oddeven tdoverflowmax100">';
508 print
'<td>'.$donationstatic->getNomUrl(1).
'</td>';
509 print
'<td>'.$label.
'</td>';
510 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
511 print
'<td class="right" title="'.dol_escape_htmltag($langs->trans(
"DateModificationShort").
' : '.
dol_print_date($db->jdate($obj->dm),
'dayhour',
'tzuserrel')).
'">'.
dol_print_date($db->jdate($obj->dm),
'day',
'tzuserrel').
'</td>';
512 print
'<td>'.$donationstatic->getLibStatut(3).
'</td>';
519 print
'<tr class="oddeven">';
520 print
'<td class="nowrap" colspan="5">';
521 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
526 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
528 print
'</table></div><br>';
530 dol_print_error($db);
537if (
isModEnabled(
'tax') && $user->hasRight(
'tax',
'charges',
'lire')) {
541 $sql =
"SELECT c.rowid, c.amount, c.date_ech, c.paye,";
542 $sql .=
" cc.libelle as label,";
543 $sql .=
" SUM(pc.amount) as totalpaid";
544 $sql .=
" FROM (".MAIN_DB_PREFIX.
"c_chargesociales as cc, ".MAIN_DB_PREFIX.
"chargesociales as c)";
545 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = c.rowid";
546 $sql .=
" WHERE c.fk_type = cc.id";
547 $sql .=
" AND c.entity IN (".getEntity(
'tax').
')';
548 $sql .=
" AND c.paye = 0";
550 $parameters = array();
551 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSocialContributions', $parameters);
552 $sql .= $hookmanager->resPrint;
554 $sql .=
" GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
556 $resql = $db->query($sql);
558 $num = $db->num_rows($resql);
560 print
'<div class="div-table-responsive-no-min">';
561 print
'<table class="noborder centpercent">';
562 print
'<tr class="liste_titre">';
563 print
'<th>'.$langs->trans(
"ContributionsToPay").($num ?
'<a href="'.DOL_URL_ROOT.
'/compta/sociales/list.php?status=0"><span class="badge marginleftonly">'.$num.
'</span></a>' :
'').
'</th>';
564 print
'<th align="center">'.$langs->trans(
"DateDue").
'</th>';
565 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
566 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
567 print
'<th align="center" width="16"> </th>';
576 $obj = $db->fetch_object($resql);
580 $tot_ttc += $obj->amount;
581 $tot_paid += $obj->totalpaid;
586 $chargestatic->id = $obj->rowid;
587 $chargestatic->ref = $obj->rowid;
588 $chargestatic->label = $obj->label;
589 $chargestatic->paye = $obj->paye;
590 $chargestatic->status = $obj->paye;
592 print
'<tr class="oddeven">';
593 print
'<td class="nowraponall">'.$chargestatic->getNomUrl(1).
'</td>';
594 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
595 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
596 print
'<td class="nowrap right"><span class="amount">'.price($obj->totalpaid).
'</span></td>';
597 print
'<td class="center">'.$chargestatic->getLibStatut(3).
'</td>';
600 $tot_ttc += $obj->amount;
605 print
'<tr class="oddeven">';
606 print
'<td class="nowrap" colspan="5">';
607 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
612 print
'<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans(
"Total").
'</td>';
613 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
614 print
'<td class="nowrap right">'.price($tot_paid).
'</td>';
615 print
'<td class="right"> </td>';
618 print
'<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
620 print
"</table></div><br>";
623 dol_print_error($db);
632 $commandestatic =
new Commande($db);
633 $langs->load(
"orders");
635 $sql =
"SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc";
636 $sql .=
", s.nom as name, s.email";
637 $sql .=
", s.rowid as socid";
638 $sql .=
", s.code_client, s.code_compta as code_compta_client";
639 $sql .=
", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,";
640 $sql .=
" cc.rowid as country_id, cc.code as country_code";
641 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
642 $sql .=
", ".MAIN_DB_PREFIX.
"commande as c";
643 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
644 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
645 $sql .=
" WHERE c.fk_soc = s.rowid";
646 $sql .=
" AND c.entity IN (".getEntity(
'commande').
")";
648 $sql .=
" AND c.fk_soc = ".((int) $socid);
651 $sql .=
" AND c.facture = 0";
653 if (empty($user->socid) && !$user->hasRight(
'societe',
'client',
'voir')) {
654 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = ".((int) $user->id).
")";
658 $parameters = array();
659 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerOrderToBill', $parameters);
660 $sql .= $hookmanager->resPrint;
662 $sql .=
" GROUP BY s.nom, s.email, s.rowid, s.code_client, s.code_compta, c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_tva, c.total_ttc, cc.rowid, cc.code";
664 $resql = $db->query($sql);
666 $num = $db->num_rows($resql);
672 print
'<div class="div-table-responsive-no-min">';
673 print
'<table class="noborder centpercent">';
675 print
'<tr class="liste_titre">';
676 print
'<th colspan="2">';
677 print $langs->trans(
"OrdersDeliveredToBill");
678 print
'<a href="'.DOL_URL_ROOT.
'/commande/list.php?search_status='.
Commande::STATUS_CLOSED.
'&search_billed=0">';
679 print
'<span class="badge marginleftonly">'.$num.
'</span>';
684 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
686 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
687 print
'<th class="right">'.$langs->trans(
"ToBill").
'</th>';
688 print
'<th align="center" width="16"> </th>';
691 $tot_ht = $tot_ttc = $tot_tobill = 0;
692 $total_ht = $total_ttc = 0;
693 $societestatic =
new Societe($db);
695 $obj = $db->fetch_object($resql);
700 $total_ht += $obj->total_ht;
701 $total_ttc += $obj->total_ttc;
705 $societestatic->id = $obj->socid;
706 $societestatic->name = $obj->name;
707 $societestatic->email = $obj->email;
708 $societestatic->country_id = $obj->country_id;
709 $societestatic->country_code = $obj->country_code;
710 $societestatic->client = 1;
711 $societestatic->code_client = $obj->code_client;
713 $societestatic->code_compta_client = $obj->code_compta_client;
716 $commandestatic->id = $obj->rowid;
717 $commandestatic->ref = $obj->ref;
718 $commandestatic->statut = $obj->status;
719 $commandestatic->status = $obj->status;
720 $commandestatic->billed = $obj->facture;
722 print
'<tr class="oddeven">';
723 print
'<td class="nowrap">';
725 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
726 print
'<td class="nobordernopadding nowrap">';
727 print $commandestatic->getNomUrl(1);
729 print
'<td width="20" class="nobordernopadding nowrap">';
732 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
735 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
736 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
737 print
'</td></tr></table>';
741 print
'<td class="nowrap tdoverflowmax100">';
742 print $societestatic->getNomUrl(1,
'customer');
745 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
747 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
748 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc - $obj->tot_fttc).
'</span></td>';
749 print
'<td>'.$commandestatic->getLibStatut(3).
'</td>';
751 $tot_ht += $obj->total_ht;
752 $tot_ttc += $obj->total_ttc;
754 $tot_tobill += ($obj->total_ttc - $obj->tot_fttc);
759 print
'<tr class="oddeven">';
760 print
'<td class="nowrap" colspan="5">';
761 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
766 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToBill").
': '.
price($tot_tobill).
')</span> </td>';
768 print
'<td class="right">'.price($tot_ht).
'</td>';
770 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
771 print
'<td class="nowrap right">'.price($tot_tobill).
'</td>';
772 print
'<td> </td>';
774 print
'</table></div><br>';
778 dol_print_error($db);
786 $langs->load(
"projects");
787 print
'<div class="div-table-responsive-no-min">';
788 print
'<table class="noborder centpercent">';
789 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"TasksToDo").
'</th>';
792 $resql = $db->query($sql);
794 $num_rows = $db->num_rows($resql);
795 while ($i < $num_rows) {
796 $obj = $db->fetch_object($resql);
798 print
'<tr class="oddeven"><td>'.dol_print_date($db->jdate($obj->da),
"day").
'</td>';
799 print
'<td><a href="action/card.php">'.$obj->label.
'</a></td></tr>';
804 print
"</table></div><br>";
808print $resultboxes[
'boxlistb'];
810print
'</div></div></div>';
812$parameters = array(
'user' => $user);
814$reshook = $hookmanager->executeHooks(
'dashboardAccountancy', $parameters, $object, $action);
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class for managing the social charges.
Class to manage customers orders.
const STATUS_CLOSED
Closed (Sent, billed or not)
Class to manage donations.
Class to manage suppliers invoices.
Class to manage invoices.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_now($mode='gmt')
Return date for now.
getDolUserInt($key, $default=0, $tmpuser=null)
Return Dolibarr user constant int value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getNumberInvoicesPieChart($mode)
Return an HTML table that contains a pie chart of the number of customers or supplier invoices.
getCustomerInvoiceDraftTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.
getDraftSupplierTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.