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