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