dolibarr 25.0.0-alpha
index.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) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
6 * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
7 * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
8 * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
9 * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
10 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
11 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
12 * Copyright (C) 2026 Nick Fragoulis
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program. If not, see <https://www.gnu.org/licenses/>.
26 */
27
34// Load Dolibarr environment
35require '../../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
45require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
46require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
47require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
48require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
49require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
50require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
51
52// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
53$hookmanager->initHooks(array('specialexpensesindex'));
54
55// Load translation files required by the page
56$langs->loadLangs(array('compta', 'bills'));
57
58$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
59$contextpage = GETPOST('contextpage', 'aZ');
60
61$mode = GETPOST("mode", 'alpha');
62$year = GETPOSTINT("year");
63$filtre = GETPOST("filtre", 'alpha');
64if (!$year) {
65 $year = (int) dol_print_date(dol_now(), "%Y");
66}
67
68$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
69$sortfield = GETPOST('sortfield', 'aZ09comma');
70$sortorder = GETPOST('sortorder', 'aZ09comma');
71$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
72if (empty($page) || $page == -1) {
73 $page = 0;
74} // If $page is not defined, or '' or -1
75$offset = $limit * $page;
76$pageprev = $page - 1;
77$pagenext = $page + 1;
78if (!$sortfield) {
79 $sortfield = "cs.date_ech";
80}
81if (!$sortorder) {
82 $sortorder = "DESC";
83}
84
85// Security check
86if ($user->socid) {
87 $socid = $user->socid;
88}
89$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|');
90
91
92/*
93 * View
94 */
95
96$tva_static = new Tva($db);
97$ptva_static = new PaymentVAT($db);
98$socialcontrib = new ChargeSociales($db);
99$payment_sc_static = new PaymentSocialContribution($db);
100$sal_static = new Salary($db);
101$accountstatic = new Account($db);
102
103llxHeader('', $langs->trans("SpecialExpensesArea"));
104
105$title = $langs->trans("SpecialExpensesArea");
106
107$param = '';
108if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
109 $param .= '&contextpage='.$contextpage;
110}
111if ($limit > 0 && $limit != $conf->liste_limit) {
112 $param .= '&limit='.$limit;
113}
114if ($sortfield) {
115 $param .= '&sortfield='.$sortfield;
116}
117if ($sortorder) {
118 $param .= '&sortorder='.$sortorder;
119}
120
121$totalnboflines = '';
122$num = 0;
123
124print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
125if ($optioncss != '') {
126 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
127}
128print '<input type="hidden" name="token" value="'.newToken().'">';
129print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
130print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
131print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
132print '<input type="hidden" name="page" value="'.$page.'">';
133print '<input type="hidden" name="mode" value="'.$mode.'">';
134
135$nav = ($year ? '<a href="index.php?year='.($year - 1).$param.'">'.img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a> ".$langs->trans("Year").' '.$year.' <a href="index.php?year='.($year + 1).$param.'">'.img_next($langs->trans("Next"), 'class="valignbottom"')."</a>" : "");
136
137print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 1);
138
139if ($year) {
140 $param .= '&year='.$year;
141}
142
143print '<div class="info">'.$langs->trans("DescTaxAndDividendsArea").'</div>';
144print "<br>";
145
146if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
147 $sql = "SELECT c.id, c.libelle as type_label,";
148 $sql .= " cs.rowid, cs.libelle as label, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total,";
149 $sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
150 $sql .= " pct.code as payment_code,";
151 $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
152 $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
153 $sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
154 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
155 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
156 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
157 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
158 $sql .= " WHERE cs.fk_type = c.id";
159 $sql .= " AND cs.entity IN (".getEntity("tax").")";
160 if ($year > 0) {
161 $sql .= " AND (";
162 // If period defined, we use it as date criteria, if not we use date echeance,
163 // so we are compatible when period is not mandatory
164 $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
165 $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
166 $sql .= ")";
167 }
168 if (preg_match('/^(cs?|pct?)\./', (string) $sortfield)) {
169 $sql .= $db->order((string) $sortfield, (string) $sortorder);
170 }
171 //$sql.= $db->plimit($limit+1,$offset);
172 //print $sql;
173
174 dol_syslog("compta/charges/index.php: select payment", LOG_DEBUG);
175 $resql = $db->query($sql);
176 if ($resql) {
177 $num = $db->num_rows($resql);
178
179 // Social contributions only
180 //print_barre_liste($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, $nav, '', $limit, 1);
181 print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
182
183 print '<table class="noborder centpercent">';
184 print '<tr class="liste_titre">';
185 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall ');
186 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "cs.libelle", "", $param, '', $sortfield, $sortorder);
187 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder);
188 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder);
189 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
190 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
191 print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
192 if (isModEnabled("bank")) {
193 print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
194 }
195 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
196 print "</tr>\n";
197
198
199 $total = 0;
200 $totalpaid = 0;
201
202 $i = 0;
203 //$imaxinloop = ($limit ? min($num, $limit) : $num);
204 $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown)
205 while ($i < $imaxinloop) {
206 $obj = $db->fetch_object($resql);
207
208 print '<tr class="oddeven">';
209 // Date
210 $date = $obj->period;
211 if (empty($date)) {
212 $date = $obj->date_ech;
213 }
214 print '<td>'.dol_print_date($date, 'day').'</td>';
215 // Label
216 print '<td>';
217 $socialcontrib->id = $obj->rowid;
218 $socialcontrib->ref = $obj->label;
219 $socialcontrib->label = $obj->label;
220 print $socialcontrib->getNomUrl(1, '20');
221 print '</td>';
222 // Type
223 print '<td class="tdoverflowmax200"><a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->type_label.'</a></td>';
224 // Expected to pay
225 print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
226 // Ref payment
227 $payment_sc_static->id = $obj->pid;
228 $payment_sc_static->ref = $obj->pid;
229 print '<td>'.$payment_sc_static->getNomUrl(1)."</td>\n";
230 // Date payment
231 print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day').'</td>';
232
233 // Payment mode
234 $s = '';
235 if ($obj->payment_code) {
236 $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
237 }
238 $s .= $obj->num_payment;
239 print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($s).'">';
240 print $s;
241 print '</td>';
242
243 // Account
244 if (isModEnabled("bank")) {
245 print '<td>';
246 if ($obj->fk_bank > 0) {
247 //$accountstatic->fetch($obj->fk_bank);
248 $accountstatic->id = $obj->bid;
249 $accountstatic->ref = $obj->bref;
250 $accountstatic->number = $obj->bnumber;
251 $accountstatic->account_number = $obj->account_number;
252 $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal;
253 $accountstatic->label = $obj->blabel;
254
255 print $accountstatic->getNomUrl(1);
256 } else {
257 print '&nbsp;';
258 }
259 print '</td>';
260 }
261 // Paid
262 print '<td class="right">';
263 if ($obj->totalpaid) {
264 print price($obj->totalpaid);
265 }
266 print '</td>';
267 print '</tr>';
268
269 $total += $obj->total;
270 $totalpaid += $obj->totalpaid;
271 $i++;
272 }
273 print '<tr class="liste_total">';
274
275 print '<td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
276
277 // Total here makes no sense because we can have the same line several times.
278 //print '<td class="liste_total right">'.price($total).'</td>';
279 print '<td class="liste_total right"></td>';
280
281 print '<td class="liste_total center">&nbsp;</td>';
282 print '<td class="liste_total center">&nbsp;</td>';
283 print '<td class="liste_total center">&nbsp;</td>';
284 if (isModEnabled("bank")) {
285 print '<td class="liste_total center"></td>';
286 }
287 print '<td class="liste_total right">'.price($totalpaid)."</td>";
288
289 print "</tr>";
290 } else {
291 dol_print_error($db);
292 }
293 print '</table>';
294}
295
296// VAT
297if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
298 $sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank, ptva.num_paiement as num_payment,";
299 $sql .= " pct.code as payment_code,";
300 $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
301 $sql .= " FROM ".MAIN_DB_PREFIX."tva as pv";
302 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_vat as ptva ON ptva.fk_tva = pv.rowid";
303 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON (ptva.fk_bank = b.rowid)";
304 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
305 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ptva.fk_typepaiement = pct.id";
306 $sql .= " WHERE pv.entity IN (".getEntity("tax").")";
307 if ($year > 0) {
308 // If period defined, we use it as date criteria, if not we use date echeance,
309 // so we are compatible when period is not mandatory
310 $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
311 }
312 if (preg_match('/^(pv|ptva)\./', (string) $sortfield)) {
313 $sql .= $db->order((string) $sortfield, (string) $sortorder);
314 }
315
316 $result = $db->query($sql);
317 if ($result) {
318 $num = $db->num_rows($result);
319
320 $i = 0;
321 $total = 0;
322 $totaltopay = 0;
323
324 print "<br>";
325
326 $labeltax = $langs->transcountry("VAT", $mysoc->country_code);
327
328 print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
329
330 print '<table class="noborder centpercent">';
331 print '<tr class="liste_titre">';
332 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall ');
333 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder);
334 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, '', $sortfield, $sortorder, 'right ');
335 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder);
336 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, '', $sortfield, $sortorder, 'center ');
337 print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
338 if (isModEnabled("bank")) {
339 print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
340 }
341 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, '', $sortfield, $sortorder, 'right ');
342 print "</tr>\n";
343
344 //$imaxinloop = ($limit ? min($num, $limit) : $num);
345 $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown)
346
347 while ($i < $imaxinloop) {
348 $obj = $db->fetch_object($result);
349
350 $totaltopay += $obj->amount_tva;
351 $total += $obj->amount;
352
353 print '<tr class="oddeven">';
354
355 print '<td class="left">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>'."\n";
356
357 $tva_static->id = $obj->id_tva;
358 $tva_static->ref = $obj->label;
359 print "<td>".$tva_static->getNomUrl(1)."</td>\n";
360
361 print '<td class="right"><span class="amount">'.price($obj->amount_tva)."</span></td>";
362
363 // Ref payment
364 $ptva_static->id = $obj->rowid;
365 $ptva_static->ref = $obj->rowid;
366 print '<td>'.$ptva_static->getNomUrl(1)."</td>\n";
367
368 // Date
369 print '<td class="center">'.dol_print_date($db->jdate($obj->date_payment), 'day')."</td>\n";
370
371 // Payment mode
372 $s = '';
373 if ($obj->payment_code) {
374 $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
375 }
376 $s .= $obj->num_payment;
377 print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($s).'">';
378 print $s;
379 print '</td>';
380
381 // Account
382 if (isModEnabled("bank")) {
383 print '<td>';
384 if ($obj->fk_bank > 0) {
385 //$accountstatic->fetch($obj->fk_bank);
386 $accountstatic->id = $obj->bid;
387 $accountstatic->ref = $obj->bref;
388 $accountstatic->number = $obj->bnumber;
389 $accountstatic->account_number = $obj->account_number;
390 $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal;
391 $accountstatic->label = $obj->blabel;
392
393 print $accountstatic->getNomUrl(1);
394 } else {
395 print '&nbsp;';
396 }
397 print '</td>';
398 }
399
400 // Paid
401 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
402 print "</tr>\n";
403
404 $i++;
405 }
406
407
408 print '<tr class="liste_total">';
409
410 print '<td class="liste_total" colspan="2">'.$langs->trans("Total").'</td>';
411
412 // Total here makes no sense because we can have the same line several times.
413 //print '<td class="right">'.price($totaltopay).'</td>';
414 print '<td class="liste_total">&nbsp;</td>';
415
416 print '<td class="liste_total"></td>';
417 print '<td class="liste_total"></td>';
418 print '<td class="liste_total"></td>';
419
420 if (isModEnabled("bank")) {
421 print '<td class="liste_total"></td>';
422 }
423
424 print '<td class="liste_total right">'.price($total)."</td>";
425
426 print "</tr>";
427
428 print "</table>";
429
430 $db->free($result);
431 } else {
432 dol_print_error($db);
433 }
434}
435
436// Localtax
437if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
438 $j = 1;
439 $numlt = 3;
440} elseif ($mysoc->localtax1_assuj == "1") {
441 $j = 1;
442 $numlt = 2;
443} elseif ($mysoc->localtax2_assuj == "1") {
444 $j = 2;
445 $numlt = 3;
446} else {
447 $j = 0;
448 $numlt = 0;
449}
450
451while ($j < $numlt) {
452 print "<br>";
453
454 $labeltax = $langs->transcountry(($j == 1 ? "LT1" : "LT2"), $mysoc->country_code);
455
456 print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
457
458
459 $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp";
460 $sql .= " FROM ".MAIN_DB_PREFIX."localtax as pv";
461 $sql .= " WHERE pv.entity = ".((int) $conf->entity)." AND localtaxtype = ".((int) $j);
462 if ($year > 0) {
463 // If period defined, we use it as date criteria, if not we use date echeance,
464 // so we are compatible when period is not mandatory
465 $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
466 }
467 if (preg_match('/^pv/', (string) $sortfield)) {
468 $sql .= $db->order((string) $sortfield, (string) $sortorder);
469 }
470
471 $result = $db->query($sql);
472 if ($result) {
473 $num = $db->num_rows($result);
474 $i = 0;
475 $total = 0;
476
477 print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
478 print '<table class="noborder centpercent">';
479 print '<tr class="liste_titre">';
480 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder);
481 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder);
482 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder);
483 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pv.rowid", "", $param, '', $sortfield, $sortorder);
484 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pv.datep", "", $param, 'align="center"', $sortfield, $sortorder);
485 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder);
486 print "</tr>\n";
487
488 while ($i < $num) {
489 $obj = $db->fetch_object($result);
490
491 $total += $obj->amount;
492
493 print '<tr class="oddeven">';
494 print '<td class="left">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>'."\n";
495
496 print "<td>".$obj->label."</td>\n";
497
498 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
499
500 // Ref payment
501 $ptva_static->id = $obj->rowid;
502 $ptva_static->ref = $obj->rowid;
503 print '<td class="left">'.$ptva_static->getNomUrl(1)."</td>\n";
504
505 print '<td class="center">'.dol_print_date($db->jdate($obj->dp), 'day')."</td>\n";
506 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
507 print "</tr>\n";
508
509 $i++;
510 }
511 print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
512 print '<td class="right">'.price($total)."</td>";
513 print '<td align="center">&nbsp;</td>';
514 print '<td align="center">&nbsp;</td>';
515 print '<td class="right">'.price($total)."</td>";
516 print "</tr>";
517
518 print "</table>";
519 print '</div>';
520
521 $db->free($result);
522 } else {
523 dol_print_error($db);
524 }
525
526 $j++;
527}
528
529print '</form>';
530
531$parameters = array('user' => $user);
532$reshook = $hookmanager->executeHooks('dashboardSpecialBills', $parameters, $object); // Note that $action and $object may have been modified by hook
533
534// End of page
535llxFooter();
536$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 bank accounts.
Class for managing the social charges.
Class to manage payments of social contributions.
Class to manage payments of social contributions.
Class to manage salary payments.
Class to manage VAT - Value-added tax (also known in French as TVA)
Definition tva.class.php:39
global $mysoc
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_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:
dol_now($mode='gmt')
Return date for now.
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.
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).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.