dolibarr 19.0.3
supplier_turnover.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2020 Maxime Kohlhaas <maxime@atm-consulting.fr>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
23// Load Dolibarr environment
24require '../../main.inc.php';
25require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
26require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
27
28// Load translation files required by the page
29$langs->loadLangs(array('compta', 'bills'));
30
31$date_startday = GETPOST('date_startday', 'int');
32$date_startmonth = GETPOST('date_startmonth', 'int');
33$date_startyear = GETPOST('date_startyear', 'int');
34$date_endday = GETPOST('date_endday', 'int');
35$date_endmonth = GETPOST('date_endmonth', 'int');
36$date_endyear = GETPOST('date_endyear', 'int');
37
38$nbofyear = 4;
39
40// Date range
41$year = GETPOST('year', 'int');
42if (empty($year)) {
43 $year_current = dol_print_date(dol_now(), "%Y");
44 $month_current = dol_print_date(dol_now(), "%m");
45 $year_start = $year_current - ($nbofyear - 1);
46} else {
47 $year_current = $year;
48 $month_current = dol_print_date(dol_now(), "%m");
49 $year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
50}
51$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere
52$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere
53
54// We define date_start and date_end
55if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
56 $q = GETPOST("q") ? GETPOST("q") : 0;
57 if ($q == 0) {
58 // We define date_start and date_end
59 $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
60 $month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
61 if (!GETPOST('month')) {
62 if (!$year && $month_start > $month_current) {
63 $year_start--;
64 $year_end--;
65 }
66 $month_end = $month_start - 1;
67 if ($month_end < 1) {
68 $month_end = 12;
69 }
70 } else {
71 $month_end = $month_start;
72 }
73 $date_start = dol_get_first_day($year_start, $month_start, false);
74 $date_end = dol_get_last_day($year_end, $month_end, false);
75 }
76 if ($q == 1) {
77 $date_start = dol_get_first_day($year_start, 1, false);
78 $date_end = dol_get_last_day($year_start, 3, false);
79 }
80 if ($q == 2) {
81 $date_start = dol_get_first_day($year_start, 4, false);
82 $date_end = dol_get_last_day($year_start, 6, false);
83 }
84 if ($q == 3) {
85 $date_start = dol_get_first_day($year_start, 7, false);
86 $date_end = dol_get_last_day($year_start, 9, false);
87 }
88 if ($q == 4) {
89 $date_start = dol_get_first_day($year_start, 10, false);
90 $date_end = dol_get_last_day($year_start, 12, false);
91 }
92}
93
94$userid = GETPOST('userid', 'int');
95$socid = GETPOST('socid', 'int');
96
97$tmps = dol_getdate($date_start);
98$year_start = $tmps['year'];
99$tmpe = dol_getdate($date_end);
100$year_end = $tmpe['year'];
101$nbofyear = ($year_end - $year_start) + 1;
102
103// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
104$modecompta = $conf->global->ACCOUNTING_MODE;
105if (isModEnabled('accounting')) {
106 $modecompta = 'BOOKKEEPING';
107}
108if (GETPOST("modecompta", 'alpha')) {
109 $modecompta = GETPOST("modecompta", 'alpha');
110}
111
112// Security check
113if ($user->socid > 0) {
114 $socid = $user->socid;
115}
116if (isModEnabled('comptabilite')) {
117 $result = restrictedArea($user, 'compta', '', '', 'resultat');
118}
119if (isModEnabled('accounting')) {
120 $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
121}
122
123
124/*
125 * View
126 */
127
128llxHeader();
129
130$form = new Form($db);
131
132$exportlink = '';
133$namelink = '';
134$builddate = dol_now();
135
136// TODO Report from bookkeeping not yet available, so we switch on report on business events
137/*if ($modecompta == "BOOKKEEPING") {
138 $modecompta = "CREANCES-DETTES";
139}*/
140if ($modecompta == "BOOKKEEPINGCOLLECTED") {
141 $modecompta = "RECETTES-DEPENSES";
142}
143
144// Affiche en-tete du rapport
145if ($modecompta == "CREANCES-DETTES") {
146 $name = $langs->trans("PurchaseTurnover");
147 $periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
148 $description = $langs->trans("RulesPurchaseTurnoverDue");
149 //$exportlink=$langs->trans("NotYetAvailable");
150} elseif ($modecompta == "RECETTES-DEPENSES") {
151 $name = $langs->trans("PurchaseTurnoverCollected");
152 $periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
153 $description = $langs->trans("RulesPurchaseTurnoverIn");
154 //$exportlink=$langs->trans("NotYetAvailable");
155} elseif ($modecompta == "BOOKKEEPING") {
156 $name = $langs->trans("PurchaseTurnover");
157 $periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
158 $description = $langs->trans("RulesPurchaseTurnoverOfExpenseAccounts");
159 //$exportlink=$langs->trans("NotYetAvailable");
160} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
161 $name = $langs->trans("PurchaseTurnoverCollected");
162 $periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
163 $description = $langs->trans("RulesPurchaseTurnoverCollectedOfExpenseAccounts");
164 //$exportlink=$langs->trans("NotYetAvailable");
165}
166
167$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
168$period .= ' - ';
169$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
170
171$moreparam = array();
172if (!empty($modecompta)) {
173 $moreparam['modecompta'] = $modecompta;
174}
175
176// Define $calcmode line
177$calcmode = '';
178if ($modecompta == "RECETTES-DEPENSES" || $modecompta == "BOOKKEEPINGCOLLECTED") {
179 /*if (isModEnabled('accounting')) {
180 $calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPINGCOLLECTED"'.($modecompta == 'BOOKKEEPINGCOLLECTED' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
181 $calcmode .= '<br>';
182 }*/
183 $calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
184 if (isModEnabled('accounting')) {
185 $calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
186 }
187 $calcmode .= '</label>';
188} else {
189 if (isModEnabled('accounting')) {
190 $calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
191 $calcmode .= '<br>';
192 }
193 $calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
194 if (isModEnabled('accounting')) {
195 $calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
196 }
197 $calcmode .= '</label>';
198}
199
200
201report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
202
203if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
204 print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
205}
206
207
208if ($modecompta == 'CREANCES-DETTES') {
209 $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
210 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
211 $sql .= " WHERE f.fk_statut in (1,2)";
212 $sql .= " AND f.type IN (0,2)";
213 $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
214 if ($socid) {
215 $sql .= " AND f.fk_soc = ".((int) $socid);
216 }
217} elseif ($modecompta == "RECETTES-DEPENSES") {
218 $sql = "SELECT date_format(p.datep,'%Y-%m') as dm, sum(pf.amount) as amount_ttc";
219 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
220 $sql .= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf";
221 $sql .= ", ".MAIN_DB_PREFIX."paiementfourn as p";
222 $sql .= " WHERE p.rowid = pf.fk_paiementfourn";
223 $sql .= " AND pf.fk_facturefourn = f.rowid";
224 $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
225 if ($socid) {
226 $sql .= " AND f.fk_soc = ".((int) $socid);
227 }
228} elseif ($modecompta == "BOOKKEEPING") {
229 $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
230 $pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
231 if (empty($pcgvercode)) {
232 $pcgvercode = $pcgverid;
233 }
234
235 $sql = "SELECT date_format(b.doc_date, '%Y-%m') as dm, sum(b.debit - b.credit) as amount_ttc";
236 $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b,";
237 $sql .= " ".MAIN_DB_PREFIX."accounting_account as aa";
238 $sql .= " WHERE b.entity = ".$conf->entity; // In module double party accounting, we never share entities
239 $sql .= " AND b.doc_type = 'supplier_invoice'";
240 $sql .= " AND b.numero_compte = aa.account_number";
241 $sql .= " AND aa.entity = ".$conf->entity;
242 $sql .= " AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
243 $sql .= " AND aa.pcg_type = 'EXPENSE'"; // TODO Be able to use a custom group
244}
245//print $sql;
246
247$sql .= " GROUP BY dm";
248$sql .= " ORDER BY dm";
249// TODO Add a filter on $date_start and $date_end to reduce quantity on data
250//print $sql;
251
252$minyearmonth = $maxyearmonth = 0;
253
254$cum = array();
255$cum_ht = array();
256$total_ht = array();
257$total = array();
258
259$result = $db->query($sql);
260if ($result) {
261 $num = $db->num_rows($result);
262 $i = 0;
263 while ($i < $num) {
264 $obj = $db->fetch_object($result);
265 $cum_ht[$obj->dm] = empty($obj->amount) ? 0 : $obj->amount;
266 $cum[$obj->dm] = empty($obj->amount_ttc) ? 0 : $obj->amount_ttc;
267 if ($obj->amount_ttc) {
268 $minyearmonth = ($minyearmonth ? min($minyearmonth, $obj->dm) : $obj->dm);
269 $maxyearmonth = max($maxyearmonth, $obj->dm);
270 }
271 $i++;
272 }
273 $db->free($result);
274} else {
275 dol_print_error($db);
276}
277
278$moreforfilter = '';
279
280print '<div class="div-table-responsive">';
281print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
282
283print '<tr class="liste_titre"><td>&nbsp;</td>';
284
285for ($annee = $year_start; $annee <= $year_end; $annee++) {
286 if ($modecompta == 'CREANCES-DETTES') {
287 print '<td align="center" width="10%" colspan="3">';
288 } else {
289 print '<td align="center" width="10%" colspan="2" class="borderrightlight">';
290 }
291 if ($modecompta != 'BOOKKEEPING') {
292 print '<a href="supplier_turnover_by_thirdparty.php?year='.$annee.($modecompta ? '&modecompta='.$modecompta : '').'">';
293 }
294 print $annee;
295 if (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1) {
296 print '-'.($annee + 1);
297 }
298 if ($modecompta != 'BOOKKEEPING') {
299 print '</a>';
300 }
301 print '</td>';
302 if ($annee != $year_end) {
303 print '<td width="15">&nbsp;</td>';
304 }
305}
306print '</tr>';
307
308print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
309for ($annee = $year_start; $annee <= $year_end; $annee++) {
310 if ($modecompta == 'CREANCES-DETTES') {
311 print '<td class="liste_titre right">'.$langs->trans("AmountHT").'</td>';
312 }
313 print '<td class="liste_titre right">';
314 if ($modecompta == "BOOKKEEPING") {
315 print $langs->trans("Amount");
316 } else {
317 print $langs->trans("AmountTTC");
318 }
319 print '</td>';
320 print '<td class="liste_titre right borderrightlight">'.$langs->trans("Delta").'</td>';
321 if ($annee != $year_end) {
322 print '<td class="liste_titre" width="15">&nbsp;</td>';
323 }
324}
325print '</tr>';
326
327$now_show_delta = 0;
328$minyear = substr($minyearmonth, 0, 4);
329$maxyear = substr($maxyearmonth, 0, 4);
330$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
331//$nowyearmonth = strftime("%Y-%m", dol_now());
332$nowyearmonth = dol_print_date(dol_now(), "%Y-%m");
333$maxyearmonth = max($maxyearmonth, $nowyearmonth);
334$now = dol_now();
335$casenow = dol_print_date($now, "%Y-%m");
336
337// Loop on each month
338$nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START - 1) : 0;
339for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
340 $mois_modulo = $mois; // ajout
341 if ($mois > 12) {
342 $mois_modulo = $mois - 12;
343 } // ajout
344
345 if ($year_start == $year_end) {
346 if ($mois > $date_endmonth && $year_end >= $date_endyear) {
347 break;
348 }
349 }
350
351 print '<tr class="oddeven">';
352
353 // Month
354 print "<td>".dol_print_date(dol_mktime(12, 0, 0, $mois_modulo, 1, 2000), "%B")."</td>";
355
356 for ($annee = $year_start - 1; $annee <= $year_end; $annee++) { // We start one year before to have data to be able to make delta
357 $annee_decalage = $annee;
358 if ($mois > 12) {
359 $annee_decalage = $annee + 1;
360 }
361 $case = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage), "%Y-%m");
362 $caseprev = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage - 1), "%Y-%m");
363
364 if ($annee >= $year_start) { // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output.
365 if ($modecompta == 'CREANCES-DETTES') {
366 // Value turnover of month w/o VAT
367 print '<td class="right">';
368 if (!empty($cum_ht[$case])) {
369 $now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
370 print '<a href="supplier_turnover_by_thirdparty.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">'.price($cum_ht[$case], 1).'</a>';
371 } else {
372 if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) {
373 print '0';
374 } else {
375 print '&nbsp;';
376 }
377 }
378 print "</td>";
379 }
380
381 // Value turnover of month
382 print '<td class="right">';
383 if (!empty($cum[$case])) {
384 $now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
385 if ($modecompta != 'BOOKKEEPING') {
386 print '<a href="supplier_turnover_by_thirdparty.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">';
387 }
388 print price($cum[$case], 1);
389 if ($modecompta != 'BOOKKEEPING') {
390 print '</a>';
391 }
392 } else {
393 if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) {
394 print '0';
395 } else {
396 print '&nbsp;';
397 }
398 }
399 print "</td>";
400
401 // Percentage of month
402 if ($annee_decalage > $minyear && $case <= $casenow) {
403 if (!empty($cum[$caseprev]) && !empty($cum[$case])) {
404 $percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100);
405 //print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
406 print '<td class="borderrightlight right">'.($percent >= 0 ? "+$percent" : "$percent").'%</td>';
407 }
408 if (!empty($cum[$caseprev]) && empty($cum[$case])) {
409 print '<td class="borderrightlight right">-100%</td>';
410 }
411 if (empty($cum[$caseprev]) && !empty($cum[$case])) {
412 //print '<td class="right">+Inf%</td>';
413 print '<td class="borderrightlight right">-</td>';
414 }
415 if (isset($cum[$caseprev]) && empty($cum[$caseprev]) && empty($cum[$case])) {
416 print '<td class="borderrightlight right">+0%</td>';
417 }
418 if (!isset($cum[$caseprev]) && empty($cum[$case])) {
419 print '<td class="borderrightlight right">-</td>';
420 }
421 } else {
422 print '<td class="borderrightlight right">';
423 if ($minyearmonth <= $case && $case <= $maxyearmonth) {
424 print '-';
425 } else {
426 print '&nbsp;';
427 }
428 print '</td>';
429 }
430
431 if ($annee_decalage < $year_end || ($annee_decalage == $year_end && $mois > 12 && $annee < $year_end)) {
432 print '<td width="15">&nbsp;</td>';
433 }
434 }
435
436 if (empty($total_ht[$annee])) {
437 $total_ht[$annee] = ((!empty($cum_ht[$case])) ? $cum_ht[$case] : 0);
438 } else {
439 $total_ht[$annee] += ((!empty($cum_ht[$case])) ? $cum_ht[$case] : 0);
440 }
441 if (empty($total[$annee])) {
442 $total[$annee] = (empty($cum[$case]) ? 0 : $cum[$case]);
443 } else {
444 $total[$annee] += (empty($cum[$case]) ? 0 : $cum[$case]);
445 }
446 }
447
448 print '</tr>';
449}
450
451// Affiche total
452print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td>';
453for ($annee = $year_start; $annee <= $year_end; $annee++) {
454 if ($modecompta == 'CREANCES-DETTES') {
455 // Montant total HT
456 if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) {
457 print '<td class="nowrap right">';
458 print($total_ht[$annee] ? price($total_ht[$annee]) : "0");
459 print "</td>";
460 } else {
461 print '<td>&nbsp;</td>';
462 }
463 }
464
465 // Montant total
466 if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) {
467 print '<td class="nowrap right">'.($total[$annee] ? price($total[$annee]) : "0")."</td>";
468 } else {
469 print '<td>&nbsp;</td>';
470 }
471
472 // Pourcentage total
473 if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) {
474 if ($total[$annee - 1] && $total[$annee]) {
475 $percent = (round(($total[$annee] - $total[$annee - 1]) / $total[$annee - 1], 4) * 100);
476 print '<td class="nowrap borderrightlight right">';
477 print($percent >= 0 ? "+$percent" : "$percent").'%';
478 print '</td>';
479 }
480 if (!empty($total[$annee - 1]) && empty($total[$annee])) {
481 print '<td class="borderrightlight right">-100%</td>';
482 }
483 if (empty($total[$annee - 1]) && !empty($total[$annee])) {
484 print '<td class="borderrightlight right">+'.$langs->trans('Inf').'%</td>';
485 }
486 if (empty($total[$annee - 1]) && empty($total[$annee])) {
487 print '<td class="borderrightlight right">+0%</td>';
488 }
489 } else {
490 print '<td class="borderrightlight right">';
491 if (!empty($total[$annee]) || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) {
492 print '-';
493 } else {
494 print '&nbsp;';
495 }
496 print '</td>';
497 }
498
499 if ($annee != $year_end) {
500 print '<td width="15">&nbsp;</td>';
501 }
502}
503print "</tr>\n";
504print "</table>";
505print '</div>';
506
507// End of page
508llxFooter();
509$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 generation of HTML components Only common components must be here.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:594
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:613
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
img_next($titlealt='default', $moreatt='')
Show next logo.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
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.