dolibarr 22.0.5
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-2025 MDW <mdeweerd@users.noreply.github.com>
11 * Copyright (C) 2024 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';
36require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
37require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
38require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
39require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
40require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
41require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
42require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
43
44
54$hookmanager = new HookManager($db);
55
56// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
57$hookmanager->initHooks(array('specialexpensesindex'));
58
59// Load translation files required by the page
60$langs->loadLangs(array('compta', 'bills'));
61
62// Security check
63if ($user->socid) {
64 $socid = $user->socid;
65}
66$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|');
67
68$mode = GETPOST("mode", 'alpha');
69$year = GETPOSTINT("year");
70$filtre = GETPOST("filtre", 'alpha');
71if (!$year) {
72 $year = date("Y", time());
73}
74$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
75
76$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
77$sortfield = GETPOST('sortfield', 'aZ09comma');
78$sortorder = GETPOST('sortorder', 'aZ09comma');
79$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
80if (empty($page) || $page == -1) {
81 $page = 0;
82} // If $page is not defined, or '' or -1
83$offset = $limit * $page;
84$pageprev = $page - 1;
85$pagenext = $page + 1;
86if (!$sortfield) {
87 $sortfield = "cs.date_ech";
88}
89if (!$sortorder) {
90 $sortorder = "DESC";
91}
92
93
94/*
95 * View
96 */
97
98$tva_static = new Tva($db);
99$ptva_static = new PaymentVAT($db);
100$socialcontrib = new ChargeSociales($db);
101$payment_sc_static = new PaymentSocialContribution($db);
102$sal_static = new Salary($db);
103$accountstatic = new Account($db);
104
105llxHeader('', $langs->trans("SpecialExpensesArea"));
106
107$title = $langs->trans("SpecialExpensesArea");
108
109$param = '';
110if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
111 $param .= '&contextpage='.$contextpage;
112}
113if ($limit > 0 && $limit != $conf->liste_limit) {
114 $param .= '&limit='.$limit;
115}
116if ($sortfield) {
117 $param .= '&sortfield='.$sortfield;
118}
119if ($sortorder) {
120 $param .= '&sortorder='.$sortorder;
121}
122
123$totalnboflines = '';
124$num = 0;
125
126print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
127if ($optioncss != '') {
128 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
129}
130print '<input type="hidden" name="token" value="'.newToken().'">';
131print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
132print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
133print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
134print '<input type="hidden" name="page" value="'.$page.'">';
135print '<input type="hidden" name="mode" value="'.$mode.'">';
136
137$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>" : "");
138
139print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 1);
140
141if ($year) {
142 $param .= '&year='.$year;
143}
144
145print '<span class="opacitymedium">'.$langs->trans("DescTaxAndDividendsArea").'</span><br>';
146print "<br>";
147
148if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
149 $sql = "SELECT c.id, c.libelle as type_label,";
150 $sql .= " cs.rowid, cs.libelle as label, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total,";
151 $sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
152 $sql .= " pct.code as payment_code,";
153 $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
154 $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
155 $sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
156 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
157 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
158 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
159 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
160 $sql .= " WHERE cs.fk_type = c.id";
161 $sql .= " AND cs.entity IN (".getEntity("tax").")";
162 if ($year > 0) {
163 $sql .= " AND (";
164 // If period defined, we use it as date criteria, if not we use date echeance,
165 // so we are compatible when period is not mandatory
166 $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))."')";
167 $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))."')";
168 $sql .= ")";
169 }
170 if (preg_match('/^(cs?|pct?)\./', (string) $sortfield)) {
171 $sql .= $db->order((string) $sortfield, (string) $sortorder);
172 }
173 //$sql.= $db->plimit($limit+1,$offset);
174 //print $sql;
175
176 dol_syslog("compta/charges/index.php: select payment", LOG_DEBUG);
177 $resql = $db->query($sql);
178 if ($resql) {
179 $num = $db->num_rows($resql);
180
181 // Social contributions only
182 //print_barre_liste($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, $nav, '', $limit, 1);
183 print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
184
185 print '<table class="noborder centpercent">';
186 print '<tr class="liste_titre">';
187 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall ');
188 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "cs.libelle", "", $param, '', $sortfield, $sortorder);
189 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder);
190 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder);
191 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
192 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
193 print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
194 if (isModEnabled("bank")) {
195 print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
196 }
197 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
198 print "</tr>\n";
199
200
201 $total = 0;
202 $totalpaid = 0;
203
204 $i = 0;
205 //$imaxinloop = ($limit ? min($num, $limit) : $num);
206 $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown)
207 while ($i < $imaxinloop) {
208 $obj = $db->fetch_object($resql);
209
210 print '<tr class="oddeven">';
211 // Date
212 $date = $obj->period;
213 if (empty($date)) {
214 $date = $obj->date_ech;
215 }
216 print '<td>'.dol_print_date($date, 'day').'</td>';
217 // Label
218 print '<td>';
219 $socialcontrib->id = $obj->rowid;
220 $socialcontrib->label = $obj->label;
221 print $socialcontrib->getNomUrl(1, '20');
222 print '</td>';
223 // Type
224 print '<td class="tdoverflowmax200"><a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->type_label.'</a></td>';
225 // Expected to pay
226 print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
227 // Ref payment
228 $payment_sc_static->id = $obj->pid;
229 $payment_sc_static->ref = $obj->pid;
230 print '<td>'.$payment_sc_static->getNomUrl(1)."</td>\n";
231 // Date payment
232 print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day').'</td>';
233
234 // Payment mode
235 $s = '';
236 if ($obj->payment_code) {
237 $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
238 }
239 $s .= $obj->num_payment;
240 print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($s).'">';
241 print $s;
242 print '</td>';
243
244 // Account
245 if (isModEnabled("bank")) {
246 print '<td>';
247 if ($obj->fk_bank > 0) {
248 //$accountstatic->fetch($obj->fk_bank);
249 $accountstatic->id = $obj->bid;
250 $accountstatic->ref = $obj->bref;
251 $accountstatic->number = $obj->bnumber;
252 $accountstatic->account_number = $obj->account_number;
253 $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal;
254 $accountstatic->label = $obj->blabel;
255
256 print $accountstatic->getNomUrl(1);
257 } else {
258 print '&nbsp;';
259 }
260 print '</td>';
261 }
262 // Paid
263 print '<td class="right">';
264 if ($obj->totalpaid) {
265 print price($obj->totalpaid);
266 }
267 print '</td>';
268 print '</tr>';
269
270 $total += $obj->total;
271 $totalpaid += $obj->totalpaid;
272 $i++;
273 }
274 print '<tr class="liste_total">';
275
276 print '<td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
277
278 //Total here makes no sense because we can have the same line several times.
279 //print '<td class="liste_total right">'.price($total).'</td>';
280 print '<td class="liste_total right"></td>';
281
282 print '<td class="liste_total center">&nbsp;</td>';
283 print '<td class="liste_total center">&nbsp;</td>';
284 print '<td class="liste_total center">&nbsp;</td>';
285 if (isModEnabled("bank")) {
286 print '<td class="liste_total center"></td>';
287 }
288 print '<td class="liste_total right">'.price($totalpaid)."</td>";
289
290 print "</tr>";
291 } else {
292 dol_print_error($db);
293 }
294 print '</table>';
295}
296
297// VAT
298if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
299 $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,";
300 $sql .= " pct.code as payment_code,";
301 $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
302 $sql .= " FROM ".MAIN_DB_PREFIX."tva as pv";
303 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_vat as ptva ON ptva.fk_tva = pv.rowid";
304 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON (ptva.fk_bank = b.rowid)";
305 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
306 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ptva.fk_typepaiement = pct.id";
307 $sql .= " WHERE pv.entity IN (".getEntity("tax").")";
308 if ($year > 0) {
309 // If period defined, we use it as date criteria, if not we use date echeance,
310 // so we are compatible when period is not mandatory
311 $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
312 }
313 if (preg_match('/^(pv|ptva)\./', (string) $sortfield)) {
314 $sql .= $db->order((string) $sortfield, (string) $sortorder);
315 }
316
317 $result = $db->query($sql);
318 if ($result) {
319 $num = $db->num_rows($result);
320
321 $i = 0;
322 $total = 0;
323 $totaltopay = 0;
324
325 print "<br>";
326
327 $labeltax = $langs->transcountry("VAT", $mysoc->country_code);
328
329 print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
330
331 print '<table class="noborder centpercent">';
332 print '<tr class="liste_titre">';
333 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall ');
334 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder);
335 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, '', $sortfield, $sortorder, 'right ');
336 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder);
337 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, '', $sortfield, $sortorder, 'center ');
338 print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
339 if (isModEnabled("bank")) {
340 print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
341 }
342 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, '', $sortfield, $sortorder, 'right ');
343 print "</tr>\n";
344
345 //$imaxinloop = ($limit ? min($num, $limit) : $num);
346 $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown)
347
348 while ($i < $imaxinloop) {
349 $obj = $db->fetch_object($result);
350
351 $totaltopay += $obj->amount_tva;
352 $total += $obj->amount;
353
354 print '<tr class="oddeven">';
355
356 print '<td class="left">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>'."\n";
357
358 $tva_static->id = $obj->id_tva;
359 $tva_static->ref = $obj->label;
360 print "<td>".$tva_static->getNomUrl(1)."</td>\n";
361
362 print '<td class="right"><span class="amount">'.price($obj->amount_tva)."</span></td>";
363
364 // Ref payment
365 $ptva_static->id = $obj->rowid;
366 $ptva_static->ref = $obj->rowid;
367 print '<td>'.$ptva_static->getNomUrl(1)."</td>\n";
368
369 // Date
370 print '<td class="center">'.dol_print_date($db->jdate($obj->date_payment), 'day')."</td>\n";
371
372 // Payment mode
373 $s = '';
374 if ($obj->payment_code) {
375 $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
376 }
377 $s .= $obj->num_payment;
378 print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($s).'">';
379 print $s;
380 print '</td>';
381
382 // Account
383 if (isModEnabled("bank")) {
384 print '<td>';
385 if ($obj->fk_bank > 0) {
386 //$accountstatic->fetch($obj->fk_bank);
387 $accountstatic->id = $obj->bid;
388 $accountstatic->ref = $obj->bref;
389 $accountstatic->number = $obj->bnumber;
390 $accountstatic->account_number = $obj->account_number;
391 $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal;
392 $accountstatic->label = $obj->blabel;
393
394 print $accountstatic->getNomUrl(1);
395 } else {
396 print '&nbsp;';
397 }
398 print '</td>';
399 }
400
401 // Paid
402 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
403 print "</tr>\n";
404
405 $i++;
406 }
407
408
409 print '<tr class="liste_total">';
410
411 print '<td class="liste_total" colspan="2">'.$langs->trans("Total").'</td>';
412
413 // Total here makes no sense because we can have the same line several times.
414 //print '<td class="right">'.price($totaltopay).'</td>';
415 print '<td class="liste_total">&nbsp;</td>';
416
417 print '<td class="liste_total"></td>';
418 print '<td class="liste_total"></td>';
419 print '<td class="liste_total"></td>';
420
421 if (isModEnabled("bank")) {
422 print '<td class="liste_total"></td>';
423 }
424
425 print '<td class="liste_total right">'.price($total)."</td>";
426
427 print "</tr>";
428
429 print "</table>";
430
431 $db->free($result);
432 } else {
433 dol_print_error($db);
434 }
435}
436
437// Localtax
438if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
439 $j = 1;
440 $numlt = 3;
441} elseif ($mysoc->localtax1_assuj == "1") {
442 $j = 1;
443 $numlt = 2;
444} elseif ($mysoc->localtax2_assuj == "1") {
445 $j = 2;
446 $numlt = 3;
447} else {
448 $j = 0;
449 $numlt = 0;
450}
451
452while ($j < $numlt) {
453 print "<br>";
454
455 $labeltax = $langs->transcountry(($j == 1 ? "LT1" : "LT2"), $mysoc->country_code);
456
457 print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
458
459
460 $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp";
461 $sql .= " FROM ".MAIN_DB_PREFIX."localtax as pv";
462 $sql .= " WHERE pv.entity = ".$conf->entity." AND localtaxtype = ".((int) $j);
463 if ($year > 0) {
464 // If period defined, we use it as date criteria, if not we use date echeance,
465 // so we are compatible when period is not mandatory
466 $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
467 }
468 if (preg_match('/^pv/', (string) $sortfield)) {
469 $sql .= $db->order((string) $sortfield, (string) $sortorder);
470 }
471
472 $result = $db->query($sql);
473 if ($result) {
474 $num = $db->num_rows($result);
475 $i = 0;
476 $total = 0;
477
478 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
479 print '<table class="noborder centpercent">';
480 print '<tr class="liste_titre">';
481 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder);
482 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder);
483 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder);
484 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pv.rowid", "", $param, '', $sortfield, $sortorder);
485 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pv.datep", "", $param, 'align="center"', $sortfield, $sortorder);
486 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder);
487 print "</tr>\n";
488
489 while ($i < $num) {
490 $obj = $db->fetch_object($result);
491
492 $total += $obj->amount;
493
494 print '<tr class="oddeven">';
495 print '<td class="left">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>'."\n";
496
497 print "<td>".$obj->label."</td>\n";
498
499 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
500
501 // Ref payment
502 $ptva_static->id = $obj->rowid;
503 $ptva_static->ref = $obj->rowid;
504 print '<td class="left">'.$ptva_static->getNomUrl(1)."</td>\n";
505
506 print '<td class="center">'.dol_print_date($db->jdate($obj->dp), 'day')."</td>\n";
507 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
508 print "</tr>\n";
509
510 $i++;
511 }
512 print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
513 print '<td class="right">'.price($total)."</td>";
514 print '<td align="center">&nbsp;</td>';
515 print '<td align="center">&nbsp;</td>';
516 print '<td class="right">'.price($total)."</td>";
517 print "</tr>";
518
519 print "</table>";
520 print '</div>';
521
522 $db->free($result);
523 } else {
524 dol_print_error($db);
525 }
526
527 $j++;
528}
529
530print '</form>';
531
532$parameters = array('user' => $user);
533$reshook = $hookmanager->executeHooks('dashboardSpecialBills', $parameters, $object); // Note that $action and $object may have been modified by hook
534
535// End of page
536llxFooter();
537$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 hooks.
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 - Taxe sur la valeur ajoutée)
Definition tva.class.php:38
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:600
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:619
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
img_previous($titlealt='default', $moreatt='')
Show previous logo.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_next($titlealt='default', $moreatt='')
Show next logo.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.