dolibarr 21.0.0-beta
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 MDW <mdeweerd@users.noreply.github.com>
11 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 */
26
33// Load Dolibarr environment
34require '../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
36require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
37require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
38require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
39require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
41require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
42
43
53$hookmanager = new HookManager($db);
54
55// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
56$hookmanager->initHooks(array('specialexpensesindex'));
57
58// Load translation files required by the page
59$langs->loadLangs(array('compta', 'bills'));
60
61// Security check
62if ($user->socid) {
63 $socid = $user->socid;
64}
65$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|');
66
67$mode = GETPOST("mode", 'alpha');
68$year = GETPOSTINT("year");
69$filtre = GETPOST("filtre", 'alpha');
70if (!$year) {
71 $year = date("Y", time());
72}
73$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
74
75$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
76$sortfield = GETPOST('sortfield', 'aZ09comma');
77$sortorder = GETPOST('sortorder', 'aZ09comma');
78$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
79if (empty($page) || $page == -1) {
80 $page = 0;
81} // If $page is not defined, or '' or -1
82$offset = $limit * $page;
83$pageprev = $page - 1;
84$pagenext = $page + 1;
85if (!$sortfield) {
86 $sortfield = "cs.date_ech";
87}
88if (!$sortorder) {
89 $sortorder = "DESC";
90}
91
92
93/*
94 * View
95 */
96
97$tva_static = new Tva($db);
98$ptva_static = new PaymentVAT($db);
99$socialcontrib = new ChargeSociales($db);
100$payment_sc_static = new PaymentSocialContribution($db);
101$sal_static = new Salary($db);
102$accountstatic = new Account($db);
103
104llxHeader('', $langs->trans("SpecialExpensesArea"));
105
106$title = $langs->trans("SpecialExpensesArea");
107
108$param = '';
109if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
110 $param .= '&contextpage='.$contextpage;
111}
112if ($limit > 0 && $limit != $conf->liste_limit) {
113 $param .= '&limit='.$limit;
114}
115if ($sortfield) {
116 $param .= '&sortfield='.$sortfield;
117}
118if ($sortorder) {
119 $param .= '&sortorder='.$sortorder;
120}
121
122$totalnboflines = '';
123$num = 0;
124
125print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
126if ($optioncss != '') {
127 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
128}
129print '<input type="hidden" name="token" value="'.newToken().'">';
130print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
131print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
132print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
133print '<input type="hidden" name="page" value="'.$page.'">';
134print '<input type="hidden" name="mode" value="'.$mode.'">';
135
136$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>" : "");
137
138print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 1);
139
140if ($year) {
141 $param .= '&year='.$year;
142}
143
144print '<span class="opacitymedium">'.$langs->trans("DescTaxAndDividendsArea").'</span><br>';
145print "<br>";
146
147if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
148 $sql = "SELECT c.id, c.libelle as label,";
149 $sql .= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total,";
150 $sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
151 $sql .= " pct.code as payment_code,";
152 $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
153 $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
154 $sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
155 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
156 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
157 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
158 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
159 $sql .= " WHERE cs.fk_type = c.id";
160 $sql .= " AND cs.entity IN (".getEntity("tax").")";
161 if ($year > 0) {
162 $sql .= " AND (";
163 // If period defined, we use it as dat criteria, if not we use date echeance,
164 // so we are compatible when period is not mandatory
165 $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))."')";
166 $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))."')";
167 $sql .= ")";
168 }
169 if (preg_match('/^(cs?|pct?)\./', (string) $sortfield)) {
170 $sql .= $db->order($sortfield, $sortorder);
171 }
172 //$sql.= $db->plimit($limit+1,$offset);
173 //print $sql;
174
175 dol_syslog("compta/charges/index.php: select payment", LOG_DEBUG);
176 $resql = $db->query($sql);
177 if ($resql) {
178 $num = $db->num_rows($resql);
179
180 // Social contributions only
181 //print_barre_liste($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, $nav, '', $limit, 1);
182 print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
183
184 print '<table class="noborder centpercent">';
185 print '<tr class="liste_titre">';
186 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall ');
187 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder);
188 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder);
189 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder);
190 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
191 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
192 print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
193 if (isModEnabled("bank")) {
194 print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
195 }
196 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
197 print "</tr>\n";
198
199
200 $total = 0;
201 $totalpaid = 0;
202
203 $i = 0;
204 //$imaxinloop = ($limit ? min($num, $limit) : $num);
205 $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown)
206 while ($i < $imaxinloop) {
207 $obj = $db->fetch_object($resql);
208
209 print '<tr class="oddeven">';
210 // Date
211 $date = $obj->period;
212 if (empty($date)) {
213 $date = $obj->date_ech;
214 }
215 print '<td>'.dol_print_date($date, 'day').'</td>';
216 // Label
217 print '<td>';
218 $socialcontrib->id = $obj->rowid;
219 $socialcontrib->ref = $obj->label;
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->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 has no sens because we can have several time the same line
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 dat 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($sortfield, $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 has no sens because we can have several time the same line
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 dat 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($sortfield, $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();
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:71
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
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.