dolibarr  13.0.2
result.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2016-2017 Jamal Elbaz <jamelbaz@gmail.com>
3  * Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
4  * Copyright (C) 2018 Laurent Destailleur <eldy@destailleur.fr>
5  * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
27 require '../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
33 
34 // Load translation files required by the page
35 $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy'));
36 
37 $error = 0;
38 
39 $mesg = '';
40 $action = GETPOST('action', 'aZ09');
41 $cat_id = GETPOST('account_category');
42 $selectcpt = GETPOST('cpt_bk');
43 $id = GETPOST('id', 'int');
44 $rowid = GETPOST('rowid', 'int');
45 $cancel = GETPOST('cancel', 'alpha');
46 $showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ?GETPOST('showaccountdetail', 'aZ09') : 'no';
47 
48 
49 $date_startmonth = GETPOST('date_startmonth', 'int');
50 $date_startday = GETPOST('date_startday', 'int');
51 $date_startyear = GETPOST('date_startyear', 'int');
52 $date_endmonth = GETPOST('date_endmonth', 'int');
53 $date_endday = GETPOST('date_endday', 'int');
54 $date_endyear = GETPOST('date_endyear', 'int');
55 
56 $nbofyear = 1;
57 
58 // Date range
59 $year = GETPOST('year', 'int');
60 if (empty($year))
61 {
62  $year_current = strftime("%Y", dol_now());
63  $month_current = strftime("%m", dol_now());
64  $year_start = $year_current - ($nbofyear - 1);
65 } else {
66  $year_current = $year;
67  $month_current = strftime("%m", dol_now());
68  $year_start = $year - ($nbofyear - 1);
69 }
70 $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
71 $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
72 
73 // We define date_start and date_end
74 if (empty($date_start) || empty($date_end)) // We define date_start and date_end
75 {
76  $q = GETPOST("q") ?GETPOST("q") : 0;
77  if ($q == 0)
78  {
79  // We define date_start and date_end
80  $year_end = $year_start + ($nbofyear - 1);
81  $month_start = GETPOST("month", 'int') ?GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
82  $date_startmonth = $month_start;
83  if (!GETPOST('month'))
84  {
85  if (!GETPOST("year") && $month_start > $month_current)
86  {
87  $year_start--;
88  $year_end--;
89  }
90  $month_end = $month_start - 1;
91  if ($month_end < 1) $month_end = 12;
92  else $year_end++;
93  } else $month_end = $month_start;
94  $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
95  }
96  if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); }
97  if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); }
98  if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); }
99  if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); }
100 }
101 
102 if (($date_start < dol_time_plus_duree($date_end, -1, 'y')) || ($date_start > $date_end))
103 {
104  $date_end = dol_time_plus_duree($date_start - 1, 1, 'y');
105 }
106 
107 // $date_start and $date_end are defined. We force $start_year and $nbofyear
108 $tmps = dol_getdate($date_start);
109 $start_year = $tmps['year'];
110 $start_month = $tmps['mon'];
111 $tmpe = dol_getdate($date_end);
112 $year_end = $tmpe['year'];
113 $month_end = $tmpe['mon'];
114 $nbofyear = ($year_end - $start_year) + 1;
115 
116 $date_start_previous = dol_time_plus_duree($date_start, -1, 'y');
117 $date_end_previous = dol_time_plus_duree($date_end, -1, 'y');
118 
119 //var_dump($date_start." ".$date_end." ".$date_start_previous." ".$date_end_previous." ".$nbofyear);
120 
121 
122 if ($cat_id == 0) {
123  $cat_id = null;
124 }
125 
126 // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
127 $modecompta = $conf->global->ACCOUNTING_MODE;
128 if (!empty($conf->accounting->enabled)) $modecompta = 'BOOKKEEPING';
129 if (GETPOST("modecompta")) $modecompta = GETPOST("modecompta", 'alpha');
130 
131 // Security check
132 if ($user->socid > 0)
133  accessforbidden();
134 if (!$user->rights->accounting->comptarapport->lire)
135  accessforbidden();
136 
137 $AccCat = new AccountancyCategory($db);
138 
139 
140 /*
141  * View
142  */
143 
144 $months = array(
145  $langs->trans("MonthShort01"),
146  $langs->trans("MonthShort02"),
147  $langs->trans("MonthShort03"),
148  $langs->trans("MonthShort04"),
149  $langs->trans("MonthShort05"),
150  $langs->trans("MonthShort06"),
151  $langs->trans("MonthShort07"),
152  $langs->trans("MonthShort08"),
153  $langs->trans("MonthShort09"),
154  $langs->trans("MonthShort10"),
155  $langs->trans("MonthShort11"),
156  $langs->trans("MonthShort12"),
157 );
158 
159 llxheader('', $langs->trans('ReportInOut'));
160 
161 $formaccounting = new FormAccounting($db);
162 $form = new Form($db);
163 
164 $textprevyear = '<a href="'.$_SERVER["PHP_SELF"].'?year='.($start_year - 1).'">'.img_previous().'</a>';
165 $textnextyear = '&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?year='.($start_year + 1).'">'.img_next().'</a>';
166 
167 
168 
169 // Affiche en-tete de rapport
170 if ($modecompta == "CREANCES-DETTES")
171 {
172  $name = $langs->trans("AnnualByAccountDueDebtMode");
173  $calcmode = $langs->trans("CalcModeDebt");
174  $calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$start_year.(GETPOST("month") > 0 ? '&month='.GETPOST("month") : '').'&modecompta=RECETTES-DEPENSES">', '</a>').')';
175  if (!empty($conf->accounting->enabled)) $calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$start_year.'&modecompta=BOOKKEEPING">', '</a>').')';
176  $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
177  //$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
178  $description = $langs->trans("RulesResultDue");
179  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded");
180  else $description .= $langs->trans("DepositsAreIncluded");
181  $builddate = dol_now();
182  //$exportlink=$langs->trans("NotYetAvailable");
183 } elseif ($modecompta == "RECETTES-DEPENSES") {
184  $name = $langs->trans("AnnualByAccountInputOutputMode");
185  $calcmode = $langs->trans("CalcModeEngagement");
186  $calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month") > 0 ? '&month='.GETPOST("month") : '').'&modecompta=CREANCES-DETTES">', '</a>').')';
187  if (!empty($conf->accounting->enabled)) $calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=BOOKKEEPING">', '</a>').')';
188  $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
189  //$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
190  $description = $langs->trans("RulesResultInOut");
191  $builddate = dol_now();
192  //$exportlink=$langs->trans("NotYetAvailable");
193 } elseif ($modecompta == "BOOKKEEPING")
194 {
195  $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups");
196  $calcmode = $langs->trans("CalcModeBookkeeping");
197  //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
198  //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
199  $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
200  $arraylist = array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
201  $period .= ' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
202  $periodlink = $textprevyear.$textnextyear;
203  $exportlink = '';
204  $description = $langs->trans("RulesResultBookkeepingPersonalized").
205  $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("AccountingCategory")).')';
206  //if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
207  //else $description.= $langs->trans("DepositsAreIncluded");
208  $builddate = dol_now();
209 }
210 
211 report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'action' => ''), $calcmode);
212 
213 
214 if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
215 {
216  print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
217 }
218 
219 
220 $moreforfilter = '';
221 
222 print '<div class="div-table-responsive">';
223 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
224 
225 print '<tr class="liste_titre">';
226 print '<th class="liste_titre">'.$langs->trans("AccountingCategory").'</th>';
227 print '<th class="liste_titre"></th>';
228 print '<th class="liste_titre right">'.$langs->trans("PreviousPeriod").'</th>';
229 print '<th class="liste_titre right">'.$langs->trans("SelectedPeriod").'</th>';
230 foreach ($months as $k => $v) {
231  if (($k + 1) >= $date_startmonth)
232  {
233  print '<th class="liste_titre right width50">'.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).'</th>';
234  }
235 }
236 foreach ($months as $k => $v) {
237  if (($k + 1) < $date_startmonth)
238  {
239  print '<th class="liste_titre right width50">'.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).'</th>';
240  }
241 }
242 print '</tr>';
243 
244 if ($modecompta == 'CREANCES-DETTES')
245 {
246  //if (! empty($date_start) && ! empty($date_end))
247  // $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
248 } elseif ($modecompta == "RECETTES-DEPENSES")
249 {
250  //if (! empty($date_start) && ! empty($date_end))
251  // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
252 } elseif ($modecompta == "BOOKKEEPING")
253 {
254  // Get array of all report groups that are active
255  $cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include
256 
257  /*
258  $sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa';
259  $sql.= " WHERE t.numero_compte = aa.account_number AND aa.fk_accounting_category = 0";
260  if (! empty($date_start) && ! empty($date_end))
261  $sql.= " AND t.doc_date >= '".$db->idate($date_start)."' AND t.doc_date <= '".$db->idate($date_end)."'";
262  if (! empty($month)) {
263  $sql .= " AND MONTH(t.doc_date) = " . $month;
264  }
265  $resql = $db->query($sql);
266  if ($resql)
267  {
268  $num_rows = $db->num_rows($resql);
269  if ($num_rows) {
270 
271  print '<div class="warning">Warning: There is '.$num_rows.' accounts in your ledger table that are not set into a reporting group</div>';
272  $i = 0;
273  //while ($i < $num) {
274  // $obj = $db->fetch_object($resql);
275  // $i++;
276  //}
277  }
278  }
279  else dol_print_error($db);
280  */
281 
282  $j = 1;
283  $sommes = array();
284  $totPerAccount = array();
285  if (!is_array($cats) && $cats < 0) {
286  setEventMessages(null, $AccCat->errors, 'errors');
287  } elseif (is_array($cats) && count($cats) > 0) {
288  foreach ($cats as $cat) {
289  // Loop on each group
290  if (!empty($cat['category_type'])) {
291  // category calculed
292  // When we enter here, $sommes was filled by group of accounts
293 
294  $formula = $cat['formula'];
295 
296  print '<tr class="liste_total">';
297 
298  // Year NP
299  print '<td class="liste_total width200">';
300  print $cat['code'];
301  print '</td><td>';
302  print $cat['label'];
303  print '</td>';
304 
305  $vars = array();
306 
307  // Previous Fiscal year (N-1)
308  foreach ($sommes as $code => $det) {
309  $vars[$code] = $det['NP'];
310  }
311 
312  $result = strtr($formula, $vars);
313 
314  //var_dump($result);
315  //$r = $AccCat->calculate($result);
316  $r = dol_eval($result, 1);
317  //var_dump($r);
318 
319  print '<td class="liste_total right">'.price($r).'</td>';
320 
321  // Year N
322  $code = $cat['code']; // code of categorie ('VTE', 'MAR', ...)
323  $sommes[$code]['NP'] += $r;
324 
325  // Current fiscal year (N)
326  if (is_array($sommes) && !empty($sommes)) {
327  foreach ($sommes as $code => $det) {
328  $vars[$code] = $det['N'];
329  }
330  }
331 
332  $result = strtr($formula, $vars);
333 
334  //$r = $AccCat->calculate($result);
335  $r = dol_eval($result, 1);
336 
337  print '<td class="liste_total right">'.price($r).'</td>';
338  $sommes[$code]['N'] += $r;
339 
340  // Detail by month
341  foreach ($months as $k => $v) {
342  if (($k + 1) >= $date_startmonth) {
343  foreach ($sommes as $code => $det) {
344  $vars[$code] = $det['M'][$k];
345  }
346  $result = strtr($formula, $vars);
347 
348  //$r = $AccCat->calculate($result);
349  $r = dol_eval($result, 1);
350 
351  print '<td class="liste_total right">'.price($r).'</td>';
352  $sommes[$code]['M'][$k] += $r;
353  }
354  }
355  foreach ($months as $k => $v) {
356  if (($k + 1) < $date_startmonth) {
357  foreach ($sommes as $code => $det) {
358  $vars[$code] = $det['M'][$k];
359  }
360  $result = strtr($formula, $vars);
361 
362  //$r = $AccCat->calculate($result);
363  $r = dol_eval($result, 1);
364 
365  print '<td class="liste_total right">'.price($r).'</td>';
366  $sommes[$code]['M'][$k] += $r;
367  }
368  }
369 
370  print "</tr>\n";
371 
372  //var_dump($sommes);
373  } else // normal category
374  {
375  $code = $cat['code']; // Category code we process
376 
377  $totCat = array();
378  $totCat['NP'] = 0;
379  $totCat['N'] = 0;
380  $totCat['M'] = array();
381  foreach ($months as $k => $v) {
382  $totCat['M'][$k] = 0;
383  }
384 
385  // Set $cpts with array of accounts in the category/group
386  $cpts = $AccCat->getCptsCat($cat['rowid']);
387 
388  $arrayofaccountforfilter = array();
389  foreach ($cpts as $i => $cpt) // Loop on each account.
390  {
391  $arrayofaccountforfilter[] = $cpt['account_number'];
392  }
393 
394  // N-1
395  if (!empty($arrayofaccountforfilter)) {
396  $return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cat['dc'] ? $cat['dc'] : 0);
397 
398  if ($return < 0) {
399  setEventMessages(null, $AccCat->errors, 'errors');
400  $resultNP = 0;
401  } else {
402  foreach ($cpts as $i => $cpt) // Loop on each account.
403  {
404  $resultNP = empty($AccCat->sdcperaccount[$cpt['account_number']]) ? 0 : $AccCat->sdcperaccount[$cpt['account_number']];
405 
406  $totCat['NP'] += $resultNP;
407  $sommes[$code]['NP'] += $resultNP;
408  $totPerAccount[$cpt['account_number']]['NP'] = $resultNP;
409  }
410  }
411  }
412 
413  // Set value into column N and month M ($totCat)
414  // This make 12 calls for each accountancy account (12 monthes M)
415  foreach ($cpts as $i => $cpt) // Loop on each account.
416  {
417  // We make 1 loop for each account because we may want detail per account.
418  // @todo Optimize to ask a 'group by' account and a filter with account in (..., ...) in request
419 
420  // Each month
421  $resultN = 0;
422  foreach ($months as $k => $v) {
423  $monthtoprocess = $k + 1; // ($k+1) is month 1, 2, ..., 12
424  $yeartoprocess = $start_year;
425  if (($k + 1) < $start_month)
426  $yeartoprocess++;
427 
428  //var_dump($monthtoprocess.'_'.$yeartoprocess);
429  $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cat['dc'] ? $cat['dc'] : 0, 'nofilter', $monthtoprocess, $yeartoprocess);
430  if ($return < 0) {
431  setEventMessages(null, $AccCat->errors, 'errors');
432  $resultM = 0;
433  } else {
434  $resultM = $AccCat->sdc;
435  }
436  $totCat['M'][$k] += $resultM;
437  $sommes[$code]['M'][$k] += $resultM;
438  $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM;
439 
440  $resultN += $resultM;
441  }
442 
443  $totCat['N'] += $resultN;
444  $sommes[$code]['N'] += $resultN;
445  $totPerAccount[$cpt['account_number']]['N'] = $resultN;
446  }
447 
448 
449  // Now output columns for row $code ('VTE', 'MAR', ...)
450 
451  print "<tr>";
452 
453  // Column group
454  print '<td class="width200">';
455  print $cat['code'];
456  print '</td>';
457 
458  // Label of group
459  print '<td>';
460  print $cat['label'];
461  if (count($cpts) > 0) // Show example of 5 first accounting accounts
462  {
463  $i = 0;
464  foreach ($cpts as $cpt) {
465  if ($i > 5) {
466  print '...)';
467  break;
468  }
469  if ($i > 0)
470  print ', ';
471  else print ' (';
472  print $cpt['account_number'];
473  $i++;
474  }
475  if ($i <= 5)
476  print ')';
477  } else {
478  print ' - <span class="warning">'.$langs->trans("GroupIsEmptyCheckSetup").'</span>';
479  }
480  print '</td>';
481 
482  print '<td class="right">'.price($totCat['NP']).'</td>';
483  print '<td class="right">'.price($totCat['N']).'</td>';
484 
485  // Each month
486  foreach ($totCat['M'] as $k => $v) {
487  if (($k + 1) >= $date_startmonth)
488  print '<td class="right">'.price($v).'</td>';
489  }
490  foreach ($totCat['M'] as $k => $v) {
491  if (($k + 1) < $date_startmonth)
492  print '<td class="right">'.price($v).'</td>';
493  }
494 
495  print "</tr>\n";
496 
497  // Loop on detail of all accounts to output the detail
498  if ($showaccountdetail != 'no') {
499  foreach ($cpts as $i => $cpt) {
500  $resultNP = $totPerAccount[$cpt['account_number']]['NP'];
501  $resultN = $totPerAccount[$cpt['account_number']]['N'];
502 
503  if ($showaccountdetail == 'all' || $resultN != 0) {
504  print '<tr>';
505  print '<td></td>';
506  print '<td class="tdoverflowmax200">';
507  print ' &nbsp; &nbsp; '.length_accountg($cpt['account_number']);
508  print ' - ';
509  print $cpt['account_label'];
510  print '</td>';
511  print '<td class="right">'.price($resultNP).'</td>';
512  print '<td class="right">'.price($resultN).'</td>';
513 
514  // Make one call for each month
515  foreach ($months as $k => $v) {
516  if (($k + 1) >= $date_startmonth) {
517  $resultM = $totPerAccount[$cpt['account_number']]['M'][$k];
518  print '<td class="right">'.price($resultM).'</td>';
519  }
520  }
521  foreach ($months as $k => $v) {
522  if (($k + 1) < $date_startmonth) {
523  $resultM = $totPerAccount[$cpt['account_number']]['M'][$k];
524  print '<td class="right">'.price($resultM).'</td>';
525  }
526  }
527  print "</tr>\n";
528  }
529  }
530  }
531  }
532  }
533  }
534 }
535 
536 print "</table>";
537 print '</div>';
538 
539 // End of page
540 llxFooter();
541 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_eval($s, $returnvalue=0, $hideerrors=1)
Replace eval function to add more security.
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_now($mode= 'auto')
Return date for now.
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink= '', $moreparam=array(), $calcmode= '', $varlink= '')
Show header of a report.
Definition: report.lib.php:41
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:481
Class to manage categories of an accounting account.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage generation of HTML components Only common components must be here.
dol_getdate($timestamp, $fast=false, $forcetimezone= '')
Return an array with locale date info.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
img_next($titlealt= 'default', $moreatt= '')
Show next logo.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:498
print
Draft customers invoices.
Definition: index.php:89
img_previous($titlealt= 'default', $moreatt= '')
Show previous logo.
Class to manage generation of HTML components for accounting management.
llxFooter()
Empty footer.
Definition: wrapper.php:59
dol_time_plus_duree($time, $duration_value, $duration_unit)
Add a delay to a date.
Definition: date.lib.php:114
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= '', $textfordropdown= '')
Show information for admin users or standard users.