dolibarr 23.0.3
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-2025 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="'.dolBuildUrl($_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->ref = $obj->label;
221 $socialcontrib->label = $obj->label;
222 print $socialcontrib->getNomUrl(1, '20');
223 print '</td>';
224 // Type
225 print '<td class="tdoverflowmax200"><a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->type_label.'</a></td>';
226 // Expected to pay
227 print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
228 // Ref payment
229 $payment_sc_static->id = $obj->pid;
230 $payment_sc_static->ref = $obj->pid;
231 print '<td>'.$payment_sc_static->getNomUrl(1)."</td>\n";
232 // Date payment
233 print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day').'</td>';
234
235 // Payment mode
236 $s = '';
237 if ($obj->payment_code) {
238 $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
239 }
240 $s .= $obj->num_payment;
241 print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($s).'">';
242 print $s;
243 print '</td>';
244
245 // Account
246 if (isModEnabled("bank")) {
247 print '<td>';
248 if ($obj->fk_bank > 0) {
249 //$accountstatic->fetch($obj->fk_bank);
250 $accountstatic->id = $obj->bid;
251 $accountstatic->ref = $obj->bref;
252 $accountstatic->number = $obj->bnumber;
253 $accountstatic->account_number = $obj->account_number;
254 $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal;
255 $accountstatic->label = $obj->blabel;
256
257 print $accountstatic->getNomUrl(1);
258 } else {
259 print '&nbsp;';
260 }
261 print '</td>';
262 }
263 // Paid
264 print '<td class="right">';
265 if ($obj->totalpaid) {
266 print price($obj->totalpaid);
267 }
268 print '</td>';
269 print '</tr>';
270
271 $total += $obj->total;
272 $totalpaid += $obj->totalpaid;
273 $i++;
274 }
275 print '<tr class="liste_total">';
276
277 print '<td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
278
279 // Total here makes no sense because we can have the same line several times.
280 //print '<td class="liste_total right">'.price($total).'</td>';
281 print '<td class="liste_total right"></td>';
282
283 print '<td class="liste_total center">&nbsp;</td>';
284 print '<td class="liste_total center">&nbsp;</td>';
285 print '<td class="liste_total center">&nbsp;</td>';
286 if (isModEnabled("bank")) {
287 print '<td class="liste_total center"></td>';
288 }
289 print '<td class="liste_total right">'.price($totalpaid)."</td>";
290
291 print "</tr>";
292 } else {
293 dol_print_error($db);
294 }
295 print '</table>';
296}
297
298// VAT
299if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
300 $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,";
301 $sql .= " pct.code as payment_code,";
302 $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
303 $sql .= " FROM ".MAIN_DB_PREFIX."tva as pv";
304 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_vat as ptva ON ptva.fk_tva = pv.rowid";
305 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON (ptva.fk_bank = b.rowid)";
306 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
307 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ptva.fk_typepaiement = pct.id";
308 $sql .= " WHERE pv.entity IN (".getEntity("tax").")";
309 if ($year > 0) {
310 // If period defined, we use it as date criteria, if not we use date echeance,
311 // so we are compatible when period is not mandatory
312 $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
313 }
314 if (preg_match('/^(pv|ptva)\./', (string) $sortfield)) {
315 $sql .= $db->order((string) $sortfield, (string) $sortorder);
316 }
317
318 $result = $db->query($sql);
319 if ($result) {
320 $num = $db->num_rows($result);
321
322 $i = 0;
323 $total = 0;
324 $totaltopay = 0;
325
326 print "<br>";
327
328 $labeltax = $langs->transcountry("VAT", $mysoc->country_code);
329
330 print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
331
332 print '<table class="noborder centpercent">';
333 print '<tr class="liste_titre">';
334 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall ');
335 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder);
336 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, '', $sortfield, $sortorder, 'right ');
337 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder);
338 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, '', $sortfield, $sortorder, 'center ');
339 print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
340 if (isModEnabled("bank")) {
341 print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
342 }
343 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, '', $sortfield, $sortorder, 'right ');
344 print "</tr>\n";
345
346 //$imaxinloop = ($limit ? min($num, $limit) : $num);
347 $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown)
348
349 while ($i < $imaxinloop) {
350 $obj = $db->fetch_object($result);
351
352 $totaltopay += $obj->amount_tva;
353 $total += $obj->amount;
354
355 print '<tr class="oddeven">';
356
357 print '<td class="left">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>'."\n";
358
359 $tva_static->id = $obj->id_tva;
360 $tva_static->ref = $obj->label;
361 print "<td>".$tva_static->getNomUrl(1)."</td>\n";
362
363 print '<td class="right"><span class="amount">'.price($obj->amount_tva)."</span></td>";
364
365 // Ref payment
366 $ptva_static->id = $obj->rowid;
367 $ptva_static->ref = $obj->rowid;
368 print '<td>'.$ptva_static->getNomUrl(1)."</td>\n";
369
370 // Date
371 print '<td class="center">'.dol_print_date($db->jdate($obj->date_payment), 'day')."</td>\n";
372
373 // Payment mode
374 $s = '';
375 if ($obj->payment_code) {
376 $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
377 }
378 $s .= $obj->num_payment;
379 print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute($s).'">';
380 print $s;
381 print '</td>';
382
383 // Account
384 if (isModEnabled("bank")) {
385 print '<td>';
386 if ($obj->fk_bank > 0) {
387 //$accountstatic->fetch($obj->fk_bank);
388 $accountstatic->id = $obj->bid;
389 $accountstatic->ref = $obj->bref;
390 $accountstatic->number = $obj->bnumber;
391 $accountstatic->account_number = $obj->account_number;
392 $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal;
393 $accountstatic->label = $obj->blabel;
394
395 print $accountstatic->getNomUrl(1);
396 } else {
397 print '&nbsp;';
398 }
399 print '</td>';
400 }
401
402 // Paid
403 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
404 print "</tr>\n";
405
406 $i++;
407 }
408
409
410 print '<tr class="liste_total">';
411
412 print '<td class="liste_total" colspan="2">'.$langs->trans("Total").'</td>';
413
414 // Total here makes no sense because we can have the same line several times.
415 //print '<td class="right">'.price($totaltopay).'</td>';
416 print '<td class="liste_total">&nbsp;</td>';
417
418 print '<td class="liste_total"></td>';
419 print '<td class="liste_total"></td>';
420 print '<td class="liste_total"></td>';
421
422 if (isModEnabled("bank")) {
423 print '<td class="liste_total"></td>';
424 }
425
426 print '<td class="liste_total right">'.price($total)."</td>";
427
428 print "</tr>";
429
430 print "</table>";
431
432 $db->free($result);
433 } else {
434 dol_print_error($db);
435 }
436}
437
438// Localtax
439if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
440 $j = 1;
441 $numlt = 3;
442} elseif ($mysoc->localtax1_assuj == "1") {
443 $j = 1;
444 $numlt = 2;
445} elseif ($mysoc->localtax2_assuj == "1") {
446 $j = 2;
447 $numlt = 3;
448} else {
449 $j = 0;
450 $numlt = 0;
451}
452
453while ($j < $numlt) {
454 print "<br>";
455
456 $labeltax = $langs->transcountry(($j == 1 ? "LT1" : "LT2"), $mysoc->country_code);
457
458 print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
459
460
461 $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp";
462 $sql .= " FROM ".MAIN_DB_PREFIX."localtax as pv";
463 $sql .= " WHERE pv.entity = ".$conf->entity." AND localtaxtype = ".((int) $j);
464 if ($year > 0) {
465 // If period defined, we use it as date criteria, if not we use date echeance,
466 // so we are compatible when period is not mandatory
467 $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
468 }
469 if (preg_match('/^pv/', (string) $sortfield)) {
470 $sql .= $db->order((string) $sortfield, (string) $sortorder);
471 }
472
473 $result = $db->query($sql);
474 if ($result) {
475 $num = $db->num_rows($result);
476 $i = 0;
477 $total = 0;
478
479 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
480 print '<table class="noborder centpercent">';
481 print '<tr class="liste_titre">';
482 print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder);
483 print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder);
484 print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder);
485 print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pv.rowid", "", $param, '', $sortfield, $sortorder);
486 print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pv.datep", "", $param, 'align="center"', $sortfield, $sortorder);
487 print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder);
488 print "</tr>\n";
489
490 while ($i < $num) {
491 $obj = $db->fetch_object($result);
492
493 $total += $obj->amount;
494
495 print '<tr class="oddeven">';
496 print '<td class="left">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>'."\n";
497
498 print "<td>".$obj->label."</td>\n";
499
500 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
501
502 // Ref payment
503 $ptva_static->id = $obj->rowid;
504 $ptva_static->ref = $obj->rowid;
505 print '<td class="left">'.$ptva_static->getNomUrl(1)."</td>\n";
506
507 print '<td class="center">'.dol_print_date($db->jdate($obj->dp), 'day')."</td>\n";
508 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>";
509 print "</tr>\n";
510
511 $i++;
512 }
513 print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").'</td>';
514 print '<td class="right">'.price($total)."</td>";
515 print '<td align="center">&nbsp;</td>';
516 print '<td align="center">&nbsp;</td>';
517 print '<td class="right">'.price($total)."</td>";
518 print "</tr>";
519
520 print "</table>";
521 print '</div>';
522
523 $db->free($result);
524 } else {
525 dol_print_error($db);
526 }
527
528 $j++;
529}
530
531print '</form>';
532
533$parameters = array('user' => $user);
534$reshook = $hookmanager->executeHooks('dashboardSpecialBills', $parameters, $object); // Note that $action and $object may have been modified by hook
535
536// End of page
537llxFooter();
538$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:39
global $mysoc
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:603
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:622
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(getDolGlobalString( 'TAKEPOS_SHOW_CUSTOMER')) print $langs trans('Date')." left Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
Definition receipt.php:464
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.