dolibarr  9.0.0
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.dolibarr@gmail.com>
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 <http://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  }
94  else $month_end=$month_start;
95  $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false);
96  }
97  if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); }
98  if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); }
99  if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); }
100  if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
101 }
102 
103 if (($date_start < dol_time_plus_duree($date_end, -1, 'y')) || ($date_start > $date_end))
104 {
105  $date_end = dol_time_plus_duree($date_start - 1, 1, 'y');
106 }
107 
108 // $date_start and $date_end are defined. We force $start_year and $nbofyear
109 $tmps=dol_getdate($date_start);
110 $start_year = $tmps['year'];
111 $start_month = $tmps['mon'];
112 $tmpe=dol_getdate($date_end);
113 $year_end = $tmpe['year'];
114 $month_end = $tmpe['mon'];
115 $nbofyear = ($year_end - $start_year) + 1;
116 
117 $date_start_previous = dol_time_plus_duree($date_start, -1, 'y');
118 $date_end_previous = dol_time_plus_duree($date_end, -1, 'y');
119 
120 //var_dump($date_start." ".$date_end." ".$date_start_previous." ".$date_end_previous." ".$nbofyear);
121 
122 
123 if($cat_id == 0){
124  $cat_id = null;
125 }
126 
127 // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
128 $modecompta = $conf->global->ACCOUNTING_MODE;
129 if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING';
130 if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta",'alpha');
131 
132 // Security check
133 if ($user->societe_id > 0)
134  accessforbidden();
135 if (! $user->rights->accounting->comptarapport->lire)
136  accessforbidden();
137 
138 $AccCat = new AccountancyCategory($db);
139 
140 
141 /*
142  * View
143  */
144 
145 $months = array(
146  $langs->trans("JanuaryMin"),
147  $langs->trans("FebruaryMin"),
148  $langs->trans("MarchMin"),
149  $langs->trans("AprilMin"),
150  $langs->trans("MayMin"),
151  $langs->trans("JuneMin"),
152  $langs->trans("JulyMin"),
153  $langs->trans("AugustMin"),
154  $langs->trans("SeptemberMin"),
155  $langs->trans("OctoberMin"),
156  $langs->trans("NovemberMin"),
157  $langs->trans("DecemberMin"),
158 );
159 
160 llxheader('', $langs->trans('ReportInOut'));
161 
162 $formaccounting = new FormAccounting($db);
163 $form = new Form($db);
164 
165 $textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($start_year - 1) . '">' . img_previous() . '</a>';
166 $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($start_year + 1) . '">' . img_next() . '</a>';
167 
168 
169 
170 // Affiche en-tete de rapport
171 if ($modecompta=="CREANCES-DETTES")
172 {
173  $name=$langs->trans("AnnualByAccountDueDebtMode");
174  $calcmode=$langs->trans("CalcModeDebt");
175  $calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$start_year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=RECETTES-DEPENSES">','</a>').')';
176  if (! empty($conf->accounting->enabled)) $calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$start_year.'&modecompta=BOOKKEEPING">','</a>').')';
177  $period=$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
178  //$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>';
179  $description=$langs->trans("RulesResultDue");
180  if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
181  else $description.= $langs->trans("DepositsAreIncluded");
182  $builddate=dol_now();
183  //$exportlink=$langs->trans("NotYetAvailable");
184 }
185 elseif ($modecompta=="RECETTES-DEPENSES") {
186  $name=$langs->trans("AnnualByAccountInputOutputMode");
187  $calcmode=$langs->trans("CalcModeEngagement");
188  $calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=CREANCES-DETTES">','</a>').')';
189  if (! empty($conf->accounting->enabled)) $calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=BOOKKEEPING">','</a>').')';
190  $period=$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
191  //$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>';
192  $description=$langs->trans("RulesResultInOut");
193  $builddate=dol_now();
194  //$exportlink=$langs->trans("NotYetAvailable");
195 }
196 elseif ($modecompta=="BOOKKEEPING")
197 {
198  $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups");
199  $calcmode=$langs->trans("CalcModeBookkeeping");
200  //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
201  //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
202  $period=$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
203  $arraylist=array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
204  $period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
205  $periodlink = $textprevyear . $textnextyear ;
206  $exportlink = '';
207  $description=$langs->trans("RulesResultBookkeepingPersonalized").
208  $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")).')';
209  //if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
210  //else $description.= $langs->trans("DepositsAreIncluded");
211  $builddate=dol_now();
212 }
213 
214 report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'action' => ''), $calcmode);
215 
216 
217 if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
218 {
219  print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
220 }
221 
222 
223 $moreforfilter='';
224 
225 print '<div class="div-table-responsive">';
226 print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
227 
228 print '<tr class="liste_titre">';
229 print '<th class="liste_titre">'.$langs->trans("AccountingCategory").'</th>';
230 print '<th class="liste_titre"></th>';
231 print '<th class="liste_titre" align="right">'.$langs->trans("PreviousPeriod").'</th>';
232 print '<th class="liste_titre" align="right">'.$langs->trans("SelectedPeriod").'</th>';
233 foreach($months as $k => $v){
234  if (($k+1) >= $date_startmonth)
235  {
236  print '<th class="liste_titre width50" align="right" >'.$langs->trans('MonthShort'.sprintf("%02s",($k+1))).'</th>';
237  }
238 }
239 foreach($months as $k => $v){
240  if (($k+1) < $date_startmonth)
241  {
242  print '<th class="liste_titre width50" align="right" >'.$langs->trans('MonthShort'.sprintf("%02s",($k+1))).'</th>';
243  }
244 }
245 print '</tr>';
246 
247 if ($modecompta == 'CREANCES-DETTES')
248 {
249  //if (! empty($date_start) && ! empty($date_end))
250  // $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
251 }
252 elseif ($modecompta=="RECETTES-DEPENSES")
253 {
254  //if (! empty($date_start) && ! empty($date_end))
255  // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
256 }
257 elseif ($modecompta=="BOOKKEEPING")
258 {
259 
260  // Get array of all report groups that are active
261  $cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include
262 
263  /*
264  $sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa';
265  $sql.= " WHERE t.numero_compte = aa.account_number AND aa.fk_accounting_category = 0";
266  if (! empty($date_start) && ! empty($date_end))
267  $sql.= " AND t.doc_date >= '".$db->idate($date_start)."' AND t.doc_date <= '".$db->idate($date_end)."'";
268  if (! empty($month)) {
269  $sql .= " AND MONTH(t.doc_date) = " . $month;
270  }
271  $resql = $db->query($sql);
272  if ($resql)
273  {
274  $num_rows = $db->num_rows($resql);
275  if ($num_rows) {
276 
277  print '<div class="warning">Warning: There is '.$num_rows.' accounts in your ledger table that are not set into a reporting group</div>';
278  $i = 0;
279  //while ($i < $num) {
280  // $obj = $db->fetch_object($resql);
281  // $i++;
282  //}
283  }
284  }
285  else dol_print_error($db);
286  */
287 
288  $j=1;
289  $sommes = array();
290  $totPerAccount = array();
291 
292  foreach ($cats as $cat) // Loop on each group
293  {
294  if (!empty($cat['category_type'])) // category calculed
295  {
296  // When we enter here, $sommes was filled by group of accounts
297 
298  $formula = $cat['formula'];
299 
300  print '<tr class="liste_total">';
301 
302  // Year NP
303  print '<td class="liste_total width200">';
304  print $cat['code'];
305  print '</td><td>';
306  print $cat['label'];
307  print '</td>';
308 
309  $vars = array();
310 
311  // Previous Fiscal year (N-1)
312  foreach($sommes as $code => $det){
313  $vars[$code] = $det['NP'];
314  }
315 
316 
317  $result = strtr($formula, $vars);
318 
319  //var_dump($result);
320  //$r = $AccCat->calculate($result);
321  $r = dol_eval($result, 1);
322  //var_dump($r);
323 
324  print '<td class="liste_total right">' . price($r) . '</td>';
325 
326  // Year N
327  $code = $cat['code']; // code of categorie ('VTE', 'MAR', ...)
328  $sommes[$code]['NP'] += $r;
329 
330  // Current fiscal year (N)
331  if (is_array($sommes) && ! empty($sommes)){
332  foreach($sommes as $code => $det){
333  $vars[$code] = $det['N'];
334  }
335  }
336 
337  $result = strtr($formula, $vars);
338 
339  //$r = $AccCat->calculate($result);
340  $r = dol_eval($result, 1);
341 
342  print '<td class="liste_total right">' . price($r) . '</td>';
343  $sommes[$code]['N'] += $r;
344 
345  // Detail by month
346  foreach($months as $k => $v)
347  {
348  if (($k+1) >= $date_startmonth)
349  {
350  foreach($sommes as $code => $det){
351  $vars[$code] = $det['M'][$k];
352  }
353  $result = strtr($formula, $vars);
354 
355  //$r = $AccCat->calculate($result);
356  $r = dol_eval($result, 1);
357 
358  print '<td class="liste_total right">' . price($r) . '</td>';
359  $sommes[$code]['M'][$k] += $r;
360  }
361  }
362  foreach($months as $k => $v)
363  {
364  if (($k+1) < $date_startmonth)
365  {
366  foreach($sommes as $code => $det){
367  $vars[$code] = $det['M'][$k];
368  }
369  $result = strtr($formula, $vars);
370 
371  //$r = $AccCat->calculate($result);
372  $r = dol_eval($result, 1);
373 
374  print '<td class="liste_total right">' . price($r) . '</td>';
375  $sommes[$code]['M'][$k] += $r;
376  }
377  }
378 
379  print "</tr>\n";
380 
381  //var_dump($sommes);
382  }
383  else // normal category
384  {
385  $code = $cat['code']; // Category code we process
386 
387  $totCat = array();
388  $totCat['NP'] = 0;
389  $totCat['N'] = 0;
390  $totCat['M'] = array();
391  foreach($months as $k => $v)
392  {
393  $totCat['M'][$k] = 0;
394  }
395 
396  // Set $cpts with array of accounts in the category/group
397  $cpts = $AccCat->getCptsCat($cat['rowid']);
398 
399  $arrayofaccountforfilter=array();
400  foreach($cpts as $i => $cpt) // Loop on each account.
401  {
402  $arrayofaccountforfilter[]=$cpt['account_number'];
403  }
404 
405  // N-1
406  if (! empty($arrayofaccountforfilter))
407  {
408  $return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cpt['dc']?$cpt['dc']:0);
409 
410  if ($return < 0) {
411  setEventMessages(null, $AccCat->errors, 'errors');
412  $resultNP=0;
413  } else {
414  foreach($cpts as $i => $cpt) // Loop on each account.
415  {
416  $resultNP = empty($AccCat->sdcperaccount[$cpt['account_number']])?0:$AccCat->sdcperaccount[$cpt['account_number']];
417 
418  $totCat['NP'] += $resultNP;
419  $sommes[$code]['NP'] += $resultNP;
420  $totPerAccount[$cpt['account_number']]['NP'] = $resultNP;
421  }
422  }
423  }
424 
425  // Set value into column N and month M ($totCat)
426  // This make 12 calls for each accountancy account (12 monthes M)
427  foreach($cpts as $i => $cpt) // Loop on each account.
428  {
429  // We make 1 loop for each account because we may want detail per account.
430  // @TODO Optimize to ask a 'group by' account and a filter with account in (..., ...) in request
431 
432  // Each month
433  $resultN = 0;
434  foreach($months as $k => $v)
435  {
436  $monthtoprocess = $k+1; // ($k+1) is month 1, 2, ..., 12
437  $yeartoprocess = $start_year;
438  if (($k+1) < $start_month) $yeartoprocess++;
439 
440  //var_dump($monthtoprocess.'_'.$yeartoprocess);
441  $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cpt['dc']?$cpt['dc']:0, 'nofilter', $monthtoprocess, $yeartoprocess);
442  if ($return < 0) {
443  setEventMessages(null, $AccCat->errors, 'errors');
444  $resultM=0;
445  } else {
446  $resultM=$AccCat->sdc;
447  }
448  $totCat['M'][$k] += $resultM;
449  $sommes[$code]['M'][$k] += $resultM;
450  $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM;
451 
452  $resultN += $resultM;
453  }
454 
455  $totCat['N'] += $resultN;
456  $sommes[$code]['N'] += $resultN;
457  $totPerAccount[$cpt['account_number']]['N'] = $resultN;
458  }
459 
460 
461  // Now output columns for row $code ('VTE', 'MAR', ...)
462 
463  print "<tr>";
464 
465  // Column group
466  print '<td class="width200">';
467  print $cat['code'];
468  print '</td>';
469 
470  // Label of group
471  print '<td>';
472  print $cat['label'];
473  if (count($cpts) > 0) // Show example of 5 first accounting accounts
474  {
475  $i=0;
476  foreach($cpts as $cpt)
477  {
478  if ($i > 5)
479  {
480  print '...)';
481  break;
482  }
483  if ($i > 0) print ', ';
484  else print ' (';
485  print $cpt['account_number'];
486  $i++;
487  }
488  if ($i <= 5) print ')';
489  }
490  else
491  {
492  print ' - <span class="warning">'.$langs->trans("GroupIsEmptyCheckSetup").'</span>';
493  }
494  print '</td>';
495 
496  print '<td align="right">' . price($totCat['NP']) . '</td>';
497  print '<td align="right">' . price($totCat['N']) . '</td>';
498 
499  // Each month
500  foreach($totCat['M'] as $k => $v){
501  if (($k+1) >= $date_startmonth) print '<td align="right">' . price($v) . '</td>';
502  }
503  foreach($totCat['M'] as $k => $v){
504  if (($k+1) < $date_startmonth) print '<td align="right">' . price($v) . '</td>';
505  }
506 
507  print "</tr>\n";
508 
509  // Loop on detail of all accounts to output the detail
510  if ($showaccountdetail != 'no')
511  {
512  foreach($cpts as $i => $cpt)
513  {
514  $resultNP=$totPerAccount[$cpt['account_number']]['NP'];
515  $resultN=$totPerAccount[$cpt['account_number']]['N'];
516 
517  if ($showaccountdetail == 'all' || $resultN > 0)
518  {
519  print '<tr>';
520  print '<td></td>';
521  print '<td class="tdoverflowmax200">';
522  print ' &nbsp; &nbsp; ' . length_accountg($cpt['account_number']);
523  print ' - ';
524  print $cpt['account_label'];
525  print '</td>';
526  print '<td align="right">' . price($resultNP) . '</td>';
527  print '<td align="right">' . price($resultN) . '</td>';
528 
529  // Make one call for each month
530  foreach($months as $k => $v)
531  {
532  if (($k+1) >= $date_startmonth)
533  {
534  $resultM=$totPerAccount[$cpt['account_number']]['M'][$k];
535  print '<td align="right">' . price($resultM) . '</td>';
536  }
537  }
538  foreach($months as $k => $v)
539  {
540  if (($k+1) < $date_startmonth)
541  {
542  $resultM=$totPerAccount[$cpt['account_number']]['M'][$k];
543  print '<td align="right">' . price($resultM) . '</td>';
544  }
545  }
546  print "</tr>\n";
547  }
548  }
549  }
550  }
551  }
552 }
553 
554 print "</table>";
555 print '</div>';
556 
557 // End of page
558 llxFooter();
559 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:56
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
dol_eval($s, $returnvalue=0, $hideerrors=1)
Replace eval function to add more security.
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:453
img_next($titlealt='default', $moreatt='')
Show next logo.
Class to manage categories of an accounting account.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage generation of HTML components Only common components must be here.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='')
Show information for admin users or standard users.
dol_now($mode='gmt')
Return date for now.
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_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:467
Class to manage generation of HTML components for accounting management.
dol_getdate($timestamp, $fast=false)
Return an array with locale date info.
img_previous($titlealt='default', $moreatt='')
Show previous logo.
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous) ...
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
Definition: report.lib.php:41
dol_time_plus_duree($time, $duration_value, $duration_unit)
Add a delay to a date.
Definition: date.lib.php:116