34 require
'../main.inc.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
52 $langs->loadLangs(array(
'compta',
'bills'));
54 $langs->load(
"orders");
57 $action =
GETPOST(
'action',
'aZ09');
62 if ($user->socid > 0) {
64 $socid = $user->socid;
67 $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
70 $maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
71 $maxLatestEditCount = 5;
72 $maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
75 $hookmanager->initHooks(array(
'invoiceindex'));
78 $maxofloop = (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
96 $thirdpartystatic =
new Societe($db);
98 llxHeader(
"", $langs->trans(
"AccountancyTreasuryArea"));
100 print
load_fiche_titre($langs->trans(
"AccountancyTreasuryArea"),
'',
'bill');
103 print
'<div class="fichecenter"><div class="fichethirdleft">';
125 print
'</div><div class="fichetwothirdright">';
129 if (
isModEnabled(
'facture') && !empty($user->rights->facture->lire)) {
130 $langs->load(
"boxes");
131 $tmpinvoice =
new Facture($db);
133 $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";
134 $sql .=
", f.date_lim_reglement as datelimite";
135 $sql .=
", s.nom as name";
136 $sql .=
", s.rowid as socid";
137 $sql .=
", s.code_client, s.code_compta, s.email";
138 $sql .=
", cc.rowid as country_id, cc.code as country_code";
139 $sql .=
", sum(pf.amount) as am";
140 $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";
141 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement_facture as pf on f.rowid=pf.fk_facture";
142 if (empty($user->rights->societe->client->voir) && !$socid) {
143 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
145 $sql .=
" WHERE s.rowid = f.fk_soc";
146 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
147 if (empty($user->rights->societe->client->voir) && !$socid) {
148 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
151 $sql .=
" AND f.fk_soc = ".((int) $socid);
154 $parameters = array();
155 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerLastModified', $parameters);
156 $sql .= $hookmanager->resPrint;
158 $sql .=
" GROUP BY f.rowid, f.ref, f.fk_statut, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
159 $sql .=
" s.nom, s.rowid, s.code_client, s.code_compta, s.email,";
160 $sql .=
" cc.rowid, cc.code";
161 $sql .=
" ORDER BY f.tms DESC";
162 $sql .= $db->plimit($max, 0);
164 $resql = $db->query($sql);
166 $num = $db->num_rows(
$resql);
170 print
'<div class="div-table-responsive-no-min">';
171 print
'<table class="noborder centpercent">';
172 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastCustomerBills", $max).
'</th>';
173 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
174 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
176 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
177 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
178 print
'<th width="16"> </th>';
181 $total_ttc = $totalam = $total_ht = 0;
182 while ($i < $num && $i < $conf->liste_limit) {
183 $obj = $db->fetch_object(
$resql);
188 $total_ht += $obj->total_ht;
189 $total_ttc += $obj->total_ttc;
193 $tmpinvoice->ref = $obj->ref;
194 $tmpinvoice->id = $obj->rowid;
195 $tmpinvoice->total_ht = $obj->total_ht;
196 $tmpinvoice->total_tva = $obj->total_tva;
197 $tmpinvoice->total_ttc = $obj->total_ttc;
198 $tmpinvoice->statut = $obj->status;
199 $tmpinvoice->paye = $obj->paye;
200 $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite);
201 $tmpinvoice->type = $obj->type;
203 $thirdpartystatic->id = $obj->socid;
204 $thirdpartystatic->name = $obj->name;
205 $thirdpartystatic->email = $obj->email;
206 $thirdpartystatic->country_id = $obj->country_id;
207 $thirdpartystatic->country_code = $obj->country_code;
208 $thirdpartystatic->email = $obj->email;
209 $thirdpartystatic->client = 1;
210 $thirdpartystatic->code_client = $obj->code_client;
212 $thirdpartystatic->code_compta = $obj->code_compta;
215 print
'<tr class="oddeven">';
216 print
'<td class="nowrap">';
218 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
220 print
'<td class="nobordernopadding nowraponall">';
221 print $tmpinvoice->getNomUrl(1,
'');
223 if ($tmpinvoice->hasDelay()) {
224 print
'<td width="20" class="nobordernopadding nowrap">';
228 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
231 $urlsource = $_SERVER[
'PHP_SELF'].
'?facid='.$obj->rowid;
232 print $formfile->getDocumentsLink($tmpinvoice->element, $filename, $filedir);
233 print
'</td></tr></table>';
237 print
'<td class="tdoverflowmax150">';
238 print $thirdpartystatic->getNomUrl(1,
'customer', 44);
240 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
241 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
243 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
245 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>';
247 print
'<td>'.$tmpinvoice->getLibStatut(3, $obj->am).
'</td>';
251 $total_ttc += $obj->total_ttc;
252 $total_ht += $obj->total_ht;
253 $totalam += $obj->am;
259 print
'<tr class="oddeven">';
260 print
'<td class="nowrap" colspan="5">';
261 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
267 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
270 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
272 print
'</table></div><br>';
281 if ((
isModEnabled(
'fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (
isModEnabled(
'supplier_invoice') && $user->rights->supplier_invoice->lire)) {
282 $langs->load(
"boxes");
285 $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";
286 $sql .=
", s.nom as name";
287 $sql .=
", s.rowid as socid";
288 $sql .=
", s.code_fournisseur, s.code_compta_fournisseur, s.email";
289 $sql .=
", SUM(pf.amount) as am";
290 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"facture_fourn as ff";
291 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
292 if (empty($user->rights->societe->client->voir) && !$socid) {
293 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
295 $sql .=
" WHERE s.rowid = ff.fk_soc";
296 $sql .=
" AND ff.entity = ".$conf->entity;
297 if (empty($user->rights->societe->client->voir) && !$socid) {
298 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
301 $sql .=
" AND ff.fk_soc = ".((int) $socid);
304 $parameters = array();
305 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSupplierLastModified', $parameters);
306 $sql .= $hookmanager->resPrint;
308 $sql .=
" GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.type, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier,";
309 $sql .=
" s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur, s.email";
310 $sql .=
" ORDER BY ff.tms DESC ";
311 $sql .= $db->plimit($max, 0);
313 $resql = $db->query($sql);
315 $num = $db->num_rows(
$resql);
317 print
'<div class="div-table-responsive-no-min">';
318 print
'<table class="noborder centpercent">';
319 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"BoxTitleLastSupplierBills", $max).
'</th>';
320 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
321 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
323 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
324 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
325 print
'<th width="16"> </th>';
329 $total_ht = $total_ttc = $totalam = 0;
333 $obj = $db->fetch_object(
$resql);
338 $total_ht += $obj->total_ht;
339 $total_ttc += $obj->total_ttc;
343 $facstatic->ref = $obj->ref;
344 $facstatic->id = $obj->rowid;
345 $facstatic->total_ht = $obj->total_ht;
346 $facstatic->total_tva = $obj->total_tva;
347 $facstatic->total_ttc = $obj->total_ttc;
348 $facstatic->statut = $obj->status;
349 $facstatic->paye = $obj->paye;
350 $facstatic->type = $obj->type;
351 $facstatic->ref_supplier = $obj->ref_supplier;
353 $thirdpartystatic->id = $obj->socid;
354 $thirdpartystatic->name = $obj->name;
355 $thirdpartystatic->email = $obj->email;
356 $thirdpartystatic->country_id = 0;
357 $thirdpartystatic->country_code =
'';
358 $thirdpartystatic->client = 0;
359 $thirdpartystatic->fournisseur = 1;
360 $thirdpartystatic->code_client =
'';
361 $thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
362 $thirdpartystatic->code_compta =
'';
363 $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
365 print
'<tr class="oddeven nowraponall tdoverflowmax100"><td>';
366 print $facstatic->getNomUrl(1,
'');
368 print
'<td class="nowrap tdoverflowmax100">';
369 print $thirdpartystatic->getNomUrl(1,
'supplier');
371 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
372 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
374 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
375 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>';
376 $alreadypaid = $facstatic->getSommePaiement();
377 print
'<td>'.$facstatic->getLibStatut(3, $alreadypaid).
'</td>';
379 $total_ht += $obj->total_ht;
380 $total_ttc += $obj->total_ttc;
381 $totalam += $obj->am;
386 print
'<tr class="oddeven">';
387 print
'<td class="nowrap" colspan="5">';
388 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
394 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
397 print
'<tr class="oddeven"><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoInvoice").
'</td></tr>';
399 print
'</table></div><br>';
408 if (
isModEnabled(
'don') && !empty($user->rights->don->lire)) {
409 include_once DOL_DOCUMENT_ROOT.
'/don/class/don.class.php';
411 $langs->load(
"boxes");
412 $donationstatic =
new Don($db);
414 $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";
415 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
416 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
418 $parameters = array();
419 $reshook = $hookmanager->executeHooks(
'printFieldListWhereLastDonations', $parameters);
420 $sql .= $hookmanager->resPrint;
422 $sql .= $db->order(
"d.tms",
"DESC");
423 $sql .= $db->plimit($max, 0);
425 $result = $db->query($sql);
427 $num = $db->num_rows($result);
432 print
'<div class="div-table-responsive-no-min">';
433 print
'<table class="noborder centpercent">';
434 print
'<tr class="liste_titre">';
435 print
'<th>'.$langs->trans(
"BoxTitleLastModifiedDonations", $max).
'</th>';
437 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
438 print
'<th class="right">'.$langs->trans(
"DateModificationShort").
'</th>';
439 print
'<th width="16"> </th>';
442 $total_ttc = $totalam = $total_ht = 0;
444 while ($i < $num && $i < $max) {
445 $obj = $db->fetch_object($result);
450 $total_ht += $obj->total_ht;
451 $total_ttc += $obj->total_ttc;
455 $donationstatic->id = $obj->rowid;
456 $donationstatic->ref = $obj->rowid;
457 $donationstatic->lastname = $obj->lastname;
458 $donationstatic->firstname = $obj->firstname;
459 $donationstatic->date = $obj->date;
460 $donationstatic->statut = $obj->status;
461 $donationstatic->status = $obj->status;
463 $label = $donationstatic->getFullName($langs);
465 $label .= ($label ?
' - ' :
'').$obj->societe;
468 print
'<tr class="oddeven tdoverflowmax100">';
469 print
'<td>'.$donationstatic->getNomUrl(1).
'</td>';
470 print
'<td>'.$label.
'</td>';
471 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
472 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>';
473 print
'<td>'.$donationstatic->getLibStatut(3).
'</td>';
480 print
'<tr class="oddeven">';
481 print
'<td class="nowrap" colspan="5">';
482 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
487 print
'<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans(
"None").
'</td></tr>';
489 print
'</table></div><br>';
498 if (
isModEnabled(
'tax') && !empty($user->rights->tax->charges->lire)) {
502 $sql =
"SELECT c.rowid, c.amount, c.date_ech, c.paye,";
503 $sql .=
" cc.libelle as label,";
504 $sql .=
" SUM(pc.amount) as sumpaid";
505 $sql .=
" FROM (".MAIN_DB_PREFIX.
"c_chargesociales as cc, ".MAIN_DB_PREFIX.
"chargesociales as c)";
506 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiementcharge as pc ON pc.fk_charge = c.rowid";
507 $sql .=
" WHERE c.fk_type = cc.id";
508 $sql .=
" AND c.entity IN (".getEntity(
'tax').
')';
509 $sql .=
" AND c.paye = 0";
511 $parameters = array();
512 $reshook = $hookmanager->executeHooks(
'printFieldListWhereSocialContributions', $parameters);
513 $sql .= $hookmanager->resPrint;
515 $sql .=
" GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
517 $resql = $db->query($sql);
519 $num = $db->num_rows(
$resql);
521 print
'<div class="div-table-responsive-no-min">';
522 print
'<table class="noborder centpercent">';
523 print
'<tr class="liste_titre">';
524 print
'<th>'.$langs->trans(
"ContributionsToPay").($num ?
' <a href="'.DOL_URL_ROOT.
'/compta/sociales/list.php?status=0"><span class="badge">'.$num.
'</span></a>' :
'').
'</th>';
525 print
'<th align="center">'.$langs->trans(
"DateDue").
'</th>';
526 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
527 print
'<th class="right">'.$langs->trans(
"Paid").
'</th>';
528 print
'<th align="center" width="16"> </th>';
536 $obj = $db->fetch_object(
$resql);
540 $tot_ttc += $obj->amount;
545 $chargestatic->id = $obj->rowid;
546 $chargestatic->ref = $obj->rowid;
547 $chargestatic->label = $obj->label;
548 $chargestatic->paye = $obj->paye;
549 $chargestatic->status = $obj->paye;
551 print
'<tr class="oddeven">';
552 print
'<td class="nowraponall">'.$chargestatic->getNomUrl(1).
'</td>';
553 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_ech),
'day').
'</td>';
554 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
555 print
'<td class="nowrap right"><span class="amount">'.price($obj->sumpaid).
'</span></td>';
556 print
'<td class="center">'.$chargestatic->getLibStatut(3).
'</td>';
559 $tot_ttc += $obj->amount;
564 print
'<tr class="oddeven">';
565 print
'<td class="nowrap" colspan="5">';
566 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
571 print
'<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans(
"Total").
'</td>';
572 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
573 print
'<td class="right"></td>';
574 print
'<td class="right"> </td>';
577 print
'<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans(
"None").
'</td></tr>';
579 print
"</table></div><br>";
590 if (
isModEnabled(
'facture') &&
isModEnabled(
'commande') && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
591 $commandestatic =
new Commande($db);
592 $langs->load(
"orders");
594 $sql =
"SELECT sum(f.total_ht) as tot_fht, sum(f.total_ttc) as tot_fttc";
595 $sql .=
", s.nom as name, s.email";
596 $sql .=
", s.rowid as socid";
597 $sql .=
", s.code_client, s.code_compta";
598 $sql .=
", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,";
599 $sql .=
" cc.rowid as country_id, cc.code as country_code";
600 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as cc ON cc.rowid = s.fk_pays";
601 if (empty($user->rights->societe->client->voir) && !$socid) {
602 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
604 $sql .=
", ".MAIN_DB_PREFIX.
"commande as c";
605 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
606 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
607 $sql .=
" WHERE c.fk_soc = s.rowid";
608 $sql .=
" AND c.entity = ".$conf->entity;
609 if (empty($user->rights->societe->client->voir) && !$socid) {
610 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
613 $sql .=
" AND c.fk_soc = ".((int) $socid);
615 $sql .=
" AND c.fk_statut = ".Commande::STATUS_CLOSED;
616 $sql .=
" AND c.facture = 0";
618 $parameters = array();
619 $reshook = $hookmanager->executeHooks(
'printFieldListWhereCustomerOrderToBill', $parameters);
620 $sql .= $hookmanager->resPrint;
622 $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";
624 $resql = $db->query($sql);
626 $num = $db->num_rows(
$resql);
632 print
'<div class="div-table-responsive-no-min">';
633 print
'<table class="noborder centpercent">';
635 print
"<tr class=\"liste_titre\">";
636 print
'<th colspan="2">';
637 print $langs->trans(
"OrdersDeliveredToBill").
' ';
639 print
'<span class="badge">'.$num.
'</span>';
643 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
644 print
'<th class="right">'.$langs->trans(
"AmountHT").
'</th>';
646 print
'<th class="right">'.$langs->trans(
"AmountTTC").
'</th>';
647 print
'<th class="right">'.$langs->trans(
"ToBill").
'</th>';
648 print
'<th align="center" width="16"> </th>';
651 $tot_ht = $tot_ttc = $tot_tobill = 0;
652 $societestatic =
new Societe($db);
654 $obj = $db->fetch_object(
$resql);
659 $total_ht += $obj->total_ht;
660 $total_ttc += $obj->total_ttc;
664 $societestatic->id = $obj->socid;
665 $societestatic->name = $obj->name;
666 $societestatic->email = $obj->email;
667 $societestatic->country_id = $obj->country_id;
668 $societestatic->country_code = $obj->country_code;
669 $societestatic->client = 1;
670 $societestatic->code_client = $obj->code_client;
672 $societestatic->code_compta = $obj->code_compta;
675 $commandestatic->id = $obj->rowid;
676 $commandestatic->ref = $obj->ref;
677 $commandestatic->statut = $obj->status;
678 $commandestatic->billed = $obj->facture;
680 print
'<tr class="oddeven">';
681 print
'<td class="nowrap">';
683 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
684 print
'<td class="nobordernopadding nowrap">';
685 print $commandestatic->getNomUrl(1);
687 print
'<td width="20" class="nobordernopadding nowrap">';
690 print
'<td width="16" class="nobordernopadding hideonsmartphone right">';
693 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
694 print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
695 print
'</td></tr></table>';
699 print
'<td class="nowrap tdoverflowmax100">';
700 print $societestatic->getNomUrl(1,
'customer');
702 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
703 print
'<td class="right"><span class="amount">'.price($obj->total_ht).
'</span></td>';
705 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).
'</span></td>';
706 print
'<td class="nowrap right"><span class="amount">'.price($obj->total_ttc - $obj->tot_fttc).
'</span></td>';
707 print
'<td>'.$commandestatic->getLibStatut(3).
'</td>';
709 $tot_ht += $obj->total_ht;
710 $tot_ttc += $obj->total_ttc;
712 $tot_tobill += ($obj->total_ttc - $obj->tot_fttc);
717 print
'<tr class="oddeven">';
718 print
'<td class="nowrap" colspan="5">';
719 print
'<span class="opacitymedium">'.$langs->trans(
"More").
'... ('.$othernb.
')</span>';
724 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
' <span style="font-weight: normal">('.$langs->trans(
"RemainderToBill").
': '.
price($tot_tobill).
')</span> </td>';
725 if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
726 print
'<td class="right">'.price($tot_ht).
'</td>';
728 print
'<td class="nowrap right">'.price($tot_ttc).
'</td>';
729 print
'<td class="nowrap right">'.price($tot_tobill).
'</td>';
730 print
'<td> </td>';
732 print
'</table></div><br>';
744 print
'<div class="div-table-responsive-no-min">';
745 print
'<table class="noborder centpercent">';
746 print
'<tr class="liste_titre"><thcolspan="2">'.$langs->trans(
"TasksToDo").
'</th>';
749 while ($i < $db->num_rows(
$resql)) {
750 $obj = $db->fetch_object(
$resql);
752 print
'<tr class="oddeven"><td>'.dol_print_date($db->jdate($obj->da),
"day").
'</td>';
753 print
'<td><a href="action/card.php">'.$obj->label.
'</a></td></tr>';
757 print
"</table></div><br>";
761 print
'</div></div>';
763 $parameters = array(
'user' => $user);
764 $reshook = $hookmanager->executeHooks(
'dashboardAccountancy', $parameters, $object);