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