dolibarr 25.0.0-alpha
cabyuser.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2026 Jose Martinez <jose.martinez@pichinov.com>
5 * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
6 * Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
7 * Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
9 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
30// Load Dolibarr environment
31require '../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
41require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
42require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
43
44// Load translation files required by the page
45$langs->load("accountancy");
46
47$socid = GETPOSTINT('socid');
48
49// Security check
50if ($user->socid > 0) {
51 $socid = $user->socid;
52}
53$hookmanager->initHooks(['cabyuserreportlist']);
54if (isModEnabled('comptabilite')) {
55 $result = restrictedArea($user, 'compta', '', '', 'resultat');
56}
57if (isModEnabled('accounting')) {
58 $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
59}
60// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
61$modecompta = getDolGlobalString('ACCOUNTING_MODE');
62if (GETPOST("modecompta")) {
63 $modecompta = GETPOST("modecompta");
64}
65
66$sortorder = GETPOST("sortorder", 'aZ09comma');
67$sortfield = GETPOST("sortfield", 'aZ09comma');
68if (!$sortorder) {
69 $sortorder = "asc";
70}
71if (!$sortfield) {
72 $sortfield = "name";
73}
74
75// Date range
76$year = GETPOSTINT("year");
77$month = GETPOSTINT("month");
78$date_startyear = GETPOSTINT("date_startyear");
79$date_startmonth = GETPOSTINT("date_startmonth");
80$date_startday = GETPOSTINT("date_startday");
81$date_endyear = GETPOSTINT("date_endyear");
82$date_endmonth = GETPOSTINT("date_endmonth");
83$date_endday = GETPOSTINT("date_endday");
84if (empty($year)) {
85 $year_current = dol_print_date(dol_now(), '%Y');
86 $month_current = dol_print_date(dol_now(), '%m');
87 $year_start = $year_current;
88} else {
89 $year_current = $year;
90 $month_current = dol_print_date(dol_now(), '%m');
91 $year_start = $year;
92}
93$date_start = dol_mktime(0, 0, 0, GETPOSTINT("date_startmonth"), GETPOSTINT("date_startday"), GETPOSTINT("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
94$date_end = dol_mktime(23, 59, 59, GETPOSTINT("date_endmonth"), GETPOSTINT("date_endday"), GETPOSTINT("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
95// Quarter
96if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
97 $q = GETPOST("q") ? GETPOST("q") : 0;
98 if ($q == 0) {
99 // We define date_start and date_end
100 $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
101 $year_end = $year_start;
102 $month_end = $month_start;
103 if (!GETPOST("month")) { // If month not forced
104 if (!GETPOST('year') && $month_start > $month_current) {
105 $year_start--;
106 $year_end--;
107 }
108 $month_end = $month_start - 1;
109 if ($month_end < 1) {
110 $month_end = 12;
111 } else {
112 $year_end++;
113 }
114 }
115 $date_start = dol_get_first_day($year_start, $month_start, false);
116 $date_end = dol_get_last_day($year_end, $month_end, false);
117 }
118 if ($q == 1) {
119 $date_start = dol_get_first_day($year_start, 1, false);
120 $date_end = dol_get_last_day($year_start, 3, false);
121 }
122 if ($q == 2) {
123 $date_start = dol_get_first_day($year_start, 4, false);
124 $date_end = dol_get_last_day($year_start, 6, false);
125 }
126 if ($q == 3) {
127 $date_start = dol_get_first_day($year_start, 7, false);
128 $date_end = dol_get_last_day($year_start, 9, false);
129 }
130 if ($q == 4) {
131 $date_start = dol_get_first_day($year_start, 10, false);
132 $date_end = dol_get_last_day($year_start, 12, false);
133 }
134} else {
135 // TODO We define q
136}
137// $date_start and $date_end are defined. We force $year_start and $nbofyear
138$tmps = dol_getdate($date_start);
139$year_start = $tmps['year'];
140$tmpe = dol_getdate($date_end);
141$year_end = $tmpe['year'];
142$nbofyear = ($year_end - $year_start) + 1;
143
144$commonparams = array();
145$commonparams['modecompta'] = $modecompta;
146$commonparams['sortorder'] = $sortorder;
147$commonparams['sortfield'] = $sortfield;
148
149$headerparams = array();
150if (!empty($date_startyear)) {
151 $headerparams['date_startyear'] = $date_startyear;
152}
153if (!empty($date_startmonth)) {
154 $headerparams['date_startmonth'] = $date_startmonth;
155}
156if (!empty($date_startday)) {
157 $headerparams['date_startday'] = $date_startday;
158}
159if (!empty($date_endyear)) {
160 $headerparams['date_endyear'] = $date_endyear;
161}
162if (!empty($date_endmonth)) {
163 $headerparams['date_endmonth'] = $date_endmonth;
164}
165if (!empty($date_endday)) {
166 $headerparams['date_endday'] = $date_endday;
167}
168if (!empty($q)) {
169 $headerparams['q'] = $q;
170}
171
172$tableparams = array();
173
174// Adding common parameters
175$allparams = array_merge($commonparams, $headerparams, $tableparams);
176$headerparams = array_merge($commonparams, $headerparams);
177$tableparams = array_merge($commonparams, $tableparams);
178
179$paramslink = "";
180foreach ($allparams as $key => $value) {
181 $paramslink .= '&'.$key.'='.$value;
182}
183
184/*
185 * View
186 */
187
188llxHeader();
189
190$form = new Form($db);
191
192if ($modecompta == "BOOKKEEPINGCOLLECTED") {
193 $modecompta = "RECETTES-DEPENSES";
194}
195
196$exportlink = "";
197$namelink = "";
198$builddate = 0;
199$calcmode = '';
200$name = '';
201$description = '';
202
203// Show report header
204if ($modecompta == "CREANCES-DETTES") {
205 $name = $langs->trans("Turnover").', '.$langs->trans("ByUserAuthorOfInvoice");
206 $calcmode = $langs->trans("CalcModeDebt");
207 //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
208 $description = $langs->trans("RulesCADue");
209 if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
210 $description .= $langs->trans("DepositsAreNotIncluded");
211 } else {
212 $description .= $langs->trans("DepositsAreIncluded");
213 }
214 $builddate = dol_now();
215 //$exportlink=$langs->trans("NotYetAvailable");
216} elseif ($modecompta == "RECETTES-DEPENSES") {
217 $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByUserAuthorOfInvoice");
218 $calcmode = $langs->trans("CalcModePayment");
219 //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
220 $description = $langs->trans("RulesCAIn");
221 $description .= $langs->trans("DepositsAreIncluded");
222 $builddate = dol_now();
223 //$exportlink=$langs->trans("NotYetAvailable");
224} elseif ($modecompta == "BOOKKEEPING") {
225 $name = $langs->trans("Turnover").', '.$langs->trans("ByUserAuthorOfInvoice");
226 $calcmode = $langs->trans("CalcModeBookkeeping");
227 $description = $langs->trans("RulesCADue");
228 $builddate = dol_now();
229} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
230 // TODO
231}
232$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
233$period .= ' - ';
234$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
235if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
236 $periodlink = '<a href="'.$_SERVER["PHP_SELF"].'?year='.($year_start - 1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year_start + 1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
237} else {
238 $periodlink = '';
239}
240
241$moreparam = array();
242if (!empty($modecompta)) {
243 $moreparam['modecompta'] = $modecompta;
244}
245
246report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
247
248if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
249 print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, '1');
250}
251
252
253$name = array();
254
255// Show array
256print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
257print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
258// Extra parameters management
259foreach ($headerparams as $key => $value) {
260 print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
261}
262
263$catotal = 0;
264$catotal_ht = 0;
265$sql = '';
266
267if ($modecompta == 'CREANCES-DETTES') {
268 $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
269 $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
270 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid";
271 $sql .= " WHERE f.fk_statut in (1,2)";
272 if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
273 $sql .= " AND f.type IN (0,1,2,5)";
274 } else {
275 $sql .= " AND f.type IN (0,1,2,3,5)";
276 }
277 // Add SQL restrictions from hooks (context turnoverreport), e.g. a deposit pivot date restricting deposits by their date
278 $hookmanager->initHooks(array('turnoverreport'));
279 $parameters = array('invoicealias' => 'f', 'issupplier' => 0, 'datefield' => 'datef');
280 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by some hooks
281 $sql .= $hookmanager->resPrint;
282 if ($date_start && $date_end) {
283 $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
284 }
285} elseif ($modecompta == "RECETTES-DEPENSES") {
286 /*
287 * List of payments (old payments are not seen by this query because on older versions,
288 * they were not linked via the table llx_paiement_facture. They are added later)
289 */
290 $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
291 $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
292 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid ";
293 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_facture = f.rowid";
294 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
295 $sql .= " WHERE 1=1";
296 if ($date_start && $date_end) {
297 $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
298 }
299} elseif ($modecompta == "BOOKKEEPING") {
300 // Turnover per invoice author computed from the accounting ledger. Each posting is linked back to
301 // its source invoice via fk_doc (reliable at invoice level, unlike fk_docdet which the transfer
302 // engine does not preserve when several lines share the same account). HT is the sum of postings
303 // on INCOME-type accounts; TTC is the amount posted on the customer subledger line of the invoice.
304 $charofaccountstring = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
305
306 $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname,";
307 $sql .= " SUM(CASE WHEN b.subledger_account IS NOT NULL AND b.subledger_account != '' THEN b.debit - b.credit ELSE 0 END) as amount_ttc,";
308 $sql .= " SUM(CASE WHEN aa.pcg_type = 'INCOME' THEN b.credit - b.debit ELSE 0 END) as amount";
309 $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
310 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = b.fk_doc AND b.doc_type = 'customer_invoice'";
311 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = f.fk_user_author";
312 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.account_number = b.numero_compte AND aa.entity = b.entity AND aa.fk_pcg_version = '".$db->escape($charofaccountstring)."'";
313 $sql .= " WHERE 1=1";
314 if ($date_start && $date_end) {
315 $sql .= " AND b.doc_date >= '".$db->idate($date_start)."' AND b.doc_date <= '".$db->idate($date_end)."'";
316 }
317} // elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
318// }
319if ($modecompta == 'BOOKKEEPING') {
320 $sql .= " AND b.entity = ".((int) $conf->entity);
321 if ($socid) {
322 $sql .= " AND f.fk_soc = ".((int) $socid);
323 }
324} else {
325 $sql .= " AND f.entity IN (".getEntity('invoice').")";
326 if ($socid) {
327 $sql .= " AND f.fk_soc = ".((int) $socid);
328 }
329}
330$sql .= " GROUP BY u.rowid, u.lastname, u.firstname";
331$sql .= " ORDER BY u.rowid";
332
333$amount = array();
334$amount_ht = array();
335
336dol_syslog("cabyuser", LOG_DEBUG);
337$result = $db->query($sql);
338if ($result) {
339 $num = $db->num_rows($result);
340 $i = 0;
341 while ($i < $num) {
342 $obj = $db->fetch_object($result);
343
344 $amount_ht[$obj->rowid] = (empty($obj->amount) ? 0 : $obj->amount);
345 $amount[$obj->rowid] = $obj->amount_ttc;
346 $name[$obj->rowid] = $obj->name.' '.$obj->firstname;
347
348 $catotal_ht += (empty($obj->amount) ? 0 : $obj->amount);
349 $catotal += $obj->amount_ttc;
350 $i++;
351 }
352} else {
353 dol_print_error($db);
354}
355
356// Adding old-version payments, non-bound by table llx_paiement_facture then without User
357if ($modecompta == 'RECETTES-DEPENSES') {
358 $sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc";
359 $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
360 $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
361 $sql .= ", ".MAIN_DB_PREFIX."paiement as p";
362 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
363 $sql .= " WHERE pf.rowid IS NULL";
364 $sql .= " AND p.fk_bank = b.rowid";
365 $sql .= " AND b.fk_account = ba.rowid";
366 $sql .= " AND ba.entity IN (".getEntity('bank_account').")";
367 if ($date_start && $date_end) {
368 $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
369 }
370 $sql .= " GROUP BY rowidx, name, firstname";
371 $sql .= " ORDER BY rowidx";
372
373 $result = $db->query($sql);
374 if ($result) {
375 $num = $db->num_rows($result);
376 $i = 0;
377 while ($i < $num) {
378 $obj = $db->fetch_object($result);
379 $amount[$obj->rowidx] = $obj->amount_ttc;
380 $name[$obj->rowidx] = $obj->name.' '.$obj->firstname;
381 $catotal += $obj->amount_ttc;
382 $i++;
383 }
384 } else {
385 dol_print_error($db);
386 }
387}
388
389$moreforfilter = '';
390
391print '<div class="div-table-responsive">';
392print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
393
394print "<tr class=\"liste_titre\">";
396 $langs->trans("User"),
397 $_SERVER["PHP_SELF"],
398 "name",
399 "",
400 $paramslink,
401 "",
402 $sortfield,
403 $sortorder
404);
405if ($modecompta == 'CREANCES-DETTES') {
407 $langs->trans('AmountHT'),
408 $_SERVER["PHP_SELF"],
409 "amount_ht",
410 "",
411 $paramslink,
412 'class="right"',
413 $sortfield,
414 $sortorder
415 );
416} else {
418}
420 $langs->trans("AmountTTC"),
421 $_SERVER["PHP_SELF"],
422 "amount_ttc",
423 "",
424 $paramslink,
425 'class="right"',
426 $sortfield,
427 $sortorder
428);
430 $langs->trans("Percentage"),
431 $_SERVER["PHP_SELF"],
432 "amount_ttc",
433 "",
434 $paramslink,
435 'class="right"',
436 $sortfield,
437 $sortorder
438);
440 $langs->trans("OtherStatistics"),
441 $_SERVER["PHP_SELF"],
442 "",
443 "",
444 "",
445 'align="center" width="20%"'
446);
447print "</tr>\n";
448
449if (count($amount)) {
450 $arrayforsort = $name;
451
452 // We define arrayforsort
453 if ($sortfield == 'name' && $sortorder == 'asc') {
454 asort($name);
455 $arrayforsort = $name;
456 }
457 if ($sortfield == 'name' && $sortorder == 'desc') {
458 arsort($name);
459 $arrayforsort = $name;
460 }
461 if ($sortfield == 'amount_ht' && $sortorder == 'asc') {
462 asort($amount_ht);
463 $arrayforsort = $amount_ht;
464 }
465 if ($sortfield == 'amount_ht' && $sortorder == 'desc') {
466 arsort($amount_ht);
467 $arrayforsort = $amount_ht;
468 }
469 if ($sortfield == 'amount_ttc' && $sortorder == 'asc') {
470 asort($amount);
471 $arrayforsort = $amount;
472 }
473 if ($sortfield == 'amount_ttc' && $sortorder == 'desc') {
474 arsort($amount);
475 $arrayforsort = $amount;
476 }
477
478 $i = 0;
479
480 foreach ($arrayforsort as $key => $value) {
481 print '<tr class="oddeven">';
482
483 // Third party
484 $fullname = $name[$key];
485 if ($key >= 0) {
486 $linkname = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$key.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$fullname.'</a>';
487 } else {
488 $linkname = $langs->trans("PaymentsNotLinkedToUser");
489 }
490 print "<td>".$linkname."</td>\n";
491
492 // Amount w/o VAT
493 print '<td class="right">';
494 if ($modecompta == 'RECETTES-DEPENSES') {
495 if ($key > 0) {
496 //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
497 } else {
498 //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
499 }
500 } elseif ($modecompta == 'CREANCES-DETTES' || $modecompta == 'BOOKKEEPING') {
501 if ($key > 0) {
502 print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
503 } else {
504 //print '<a href="#">';
505 }
506 print price($amount_ht[$key]);
507 if ($key > 0) {
508 print '</a>';
509 }
510 }
511 print '</td>';
512
513 // Amount with VAT
514 print '<td class="right">';
515 if ($modecompta == 'RECETTES-DEPENSES') {
516 if ($key > 0) {
517 //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
518 } else {
519 //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
520 }
521 } elseif ($modecompta == 'CREANCES-DETTES') {
522 if ($key > 0) {
523 print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
524 } else {
525 //print '<a href="#">';
526 }
527 }
528 print price($amount[$key]);
529 if ($modecompta == 'RECETTES-DEPENSES') {
530 if ($key > 0) {
531 //print '</a>';
532 } else {
533 //print '</a>';
534 }
535 } elseif ($modecompta == 'CREANCES-DETTES') {
536 if ($key > 0) {
537 print '</a>';
538 }
539 }
540 print '</td>';
541
542 // Percent
543 print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
544
545 // Other stats
546 print '<td class="center">';
547 if (isModEnabled("propal") && $key > 0) {
548 print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
549 }
550 if (isModEnabled('order') && $key > 0) {
551 print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
552 }
553 if (isModEnabled('invoice') && $key > 0) {
554 print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
555 }
556 print '</td>';
557 print "</tr>\n";
558 $i++;
559 }
560
561 // Total
562 print '<tr class="liste_total">';
563 print '<td>'.$langs->trans("Total").'</td>';
564 if ($modecompta == 'RECETTES-DEPENSES') {
565 print '<td></td>';
566 } else {
567 print '<td class="right">'.price($catotal_ht).'</td>';
568 }
569 print '<td class="right">'.price($catotal).'</td>';
570 print '<td>&nbsp;</td>';
571 print '<td>&nbsp;</td>';
572 print '</tr>';
573
574 $db->free($result);
575}
576
577print "</table>";
578print '</div>';
579print '</form>';
580
581// End of page
582llxFooter();
583$db->close();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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.
Definition wrapper.php:73
Class to manage generation of HTML components Only common components must be here.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:616
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition date.lib.php:126
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:635
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
$date_start
Variables from include:
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
img_previous($titlealt='default', $moreatt='')
Show previous logo.
img_next($titlealt='default', $moreatt='')
Show next logo.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.