dolibarr  9.0.0
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
4  * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
5  * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
6  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
7  * Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
28 require '../../main.inc.php';
29 
30 require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
31 require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
32 require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
33 require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
34 require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
35 require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
36 
37 // Load translation files required by the page
38 $langs->loadLangs(array("bills","compta","accountancy","other","trips","productbatch"));
39 
40 $action=GETPOST('action','alpha');
41 $massaction=GETPOST('massaction','alpha');
42 $show_files=GETPOST('show_files','int');
43 $confirm=GETPOST('confirm','alpha');
44 $toselect = GETPOST('toselect', 'array');
45 
46 // Select Box
47 $mesCasesCochees = GETPOST('toselect', 'array');
48 
49 // Search Getpost
50 $search_expensereport = GETPOST('search_expensereport', 'alpha');
51 $search_label = GETPOST('search_label', 'alpha');
52 $search_desc = GETPOST('search_desc', 'alpha');
53 $search_amount = GETPOST('search_amount', 'alpha');
54 $search_account = GETPOST('search_account', 'alpha');
55 $search_vat = GETPOST('search_vat', 'alpha');
56 $search_day=GETPOST("search_day","int");
57 $search_month=GETPOST("search_month","int");
58 $search_year=GETPOST("search_year","int");
59 
60 $btn_ventil = GETPOST('ventil', 'alpha');
61 
62 // Load variable for pagination
63 $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
64 $sortfield = GETPOST('sortfield', 'alpha');
65 $sortorder = GETPOST('sortorder', 'alpha');
66 $page = GETPOST('page','int');
67 if (empty($page) || $page < 0) { $page = 0; }
68 $offset = $limit * $page;
69 $pageprev = $page - 1;
70 $pagenext = $page + 1;
71 if (! $sortfield)
72  $sortfield = "erd.date, erd.rowid";
73 if (! $sortorder) {
74  if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
75  $sortorder = "DESC";
76  }
77 }
78 
79 // Security check
80 if ($user->societe_id > 0)
82 if (! $user->rights->accounting->bind->write)
84 
85 $formaccounting = new FormAccounting($db);
86 $accounting = new AccountingAccount($db);
87 
88 $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
89 
90 
91 /*
92  * Action
93  */
94 
95 if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
96 if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
97 
98 // Purge search criteria
99 if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
100 {
101  $search_expensereport = '';
102  $search_label = '';
103  $search_desc = '';
104  $search_amount = '';
105  $search_account = '';
106  $search_vat = '';
107  $search_day = '';
108  $search_month = '';
109  $search_year = '';
110 }
111 
112 // Mass actions
113 $objectclass='ExpenseReport';
114 $objectlabel='ExpenseReport';
115 $permtoread = $user->rights->expensereport->read;
116 $permtodelete = $user->rights->expensereport->delete;
117 $uploaddir = $conf->expensereport->dir_output;
118 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
119 
120 if ($massaction == 'ventil') {
121  $msg='';
122  //print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
123  if (! empty($mesCasesCochees)) {
124  $msg = '<div>' . $langs->trans("SelectedLines") . ': '.count($mesCasesCochees).'</div>';
125  $msg.='<div class="detail">';
126  $mesCodesVentilChoisis = $codeventil;
127  $cpt = 0;
128  $ok=0;
129  $ko=0;
130 
131  foreach ( $mesCasesCochees as $maLigneCochee ) {
132  $maLigneCourante = explode("_", $maLigneCochee);
133  $monId = $maLigneCourante[0];
134  $monCompte = GETPOST('codeventil'.$monId);
135 
136  if ($monCompte <= 0)
137  {
138  $msg.= '<div><font color="red">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("NoAccountSelected") . '</font></div>';
139  $ko++;
140  }
141  else
142  {
143  $sql = " UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
144  $sql .= " SET fk_code_ventilation = " . $monCompte;
145  $sql .= " WHERE rowid = " . $monId;
146 
147  $accountventilated = new AccountingAccount($db);
148  $accountventilated->fetch($monCompte, '');
149 
150  dol_syslog('accountancy/expensereport/list.php:: sql=' . $sql, LOG_DEBUG);
151  if ($db->query($sql)) {
152  $msg.= '<div><font color="green">' . $langs->trans("LineOfExpenseReport") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '</font></div>';
153  $ok++;
154  } else {
155  $msg.= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '<br/> <pre>' . $sql . '</pre></font></div>';
156  $ko++;
157  }
158  }
159 
160  $cpt++;
161  }
162  $msg.='</div>';
163  $msg.= '<div>' . $langs->trans("EndProcessing") . '</div>';
164  //} else {
165  // setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings');
166  }
167 }
168 
169 
170 
171 /*
172  * View
173  */
174 
175 $form = new Form($db);
176 $formother = new FormOther($db);
177 
178 llxHeader('', $langs->trans("ExpenseReportsVentilation"));
179 
180 if (empty($chartaccountcode))
181 {
182  print $langs->trans("ErrorChartOfAccountSystemNotSelected");
183  // End of page
184  llxFooter();
185  $db->close();
186  exit;
187 }
188 
189 // Expense report lines
190 $sql = "SELECT er.ref, er.rowid as erid, er.date_debut,";
191 $sql.= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.vat_src_code, erd.date,";
192 $sql.= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label, f.accountancy_code as code_buy,";
193 $sql.= " aa.rowid as aarowid";
194 $sql.= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
195 $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport_det as erd ON er.rowid = erd.fk_expensereport";
196 $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
197 $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
198 $sql.= " WHERE er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
199 // Add search filter like
200 if (strlen(trim($search_expensereport))) {
201  $sql .= natural_search("er.ref",$search_expensereport);
202 }
203 if (strlen(trim($search_label))) {
204  $sql .= natural_search("f.label",$search_label);
205 }
206 if (strlen(trim($search_desc))) {
207  $sql .= natural_search("erd.comments",$search_desc);
208 }
209 if (strlen(trim($search_amount))) {
210  $sql .= natural_search("erd.total_ht",$search_amount,1);
211 }
212 if (strlen(trim($search_account))) {
213  $sql .= natural_search("aa.account_number",$search_account);
214 }
215 if (strlen(trim($search_vat))) {
216  $sql .= natural_search("erd.tva_tx",$search_vat,1);
217 }
218 if ($search_month > 0)
219 {
220  if ($search_year > 0 && empty($search_day))
221  $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
222  else if ($search_year > 0 && ! empty($search_day))
223  $sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
224  else
225  $sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
226 }
227 else if ($search_year > 0)
228 {
229  $sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
230 }
231 $sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
232 
233 $sql .= $db->order($sortfield, $sortorder);
234 
235 // Count total nb of records
236 $nbtotalofrecords = '';
237 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
238 {
239  $result = $db->query($sql);
240  $nbtotalofrecords = $db->num_rows($result);
241  if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
242  {
243  $page = 0;
244  $offset = 0;
245  }
246 }
247 
248 $sql .= $db->plimit($limit + 1, $offset);
249 
250 dol_syslog('accountancy/expensereport/list.php');
251 $result = $db->query($sql);
252 if ($result) {
253  $num_lines = $db->num_rows($result);
254  $i = 0;
255 
256  $arrayofselected=is_array($toselect)?$toselect:array();
257 
258  $param='';
259  if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
260  if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
261  if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
262  if ($search_day) $param.='&search_day='.urlencode($search_day);
263  if ($search_month) $param.='&search_month='.urlencode($search_month);
264  if ($search_year) $param.='&search_year='.urlencode($search_year);
265  if ($search_expensereport) $param.='&search_expensereport='.urlencode($search_expensereport);
266  if ($search_label) $param.='&search_label='.urlencode($search_label);
267  if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
268  if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
269  if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
270 
271  $arrayofmassactions = array(
272  'ventil'=>$langs->trans("Ventilate")
273  //'presend'=>$langs->trans("SendByMail"),
274  //'builddoc'=>$langs->trans("PDFMerge"),
275  );
276  //if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
277  //if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
278  $massactionbutton=$form->selectMassAction('ventil', $arrayofmassactions, 1);
279 
280 
281  print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
282  print '<input type="hidden" name="action" value="ventil">';
283  if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
284  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
285  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
286  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
287  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
288  print '<input type="hidden" name="page" value="'.$page.'">';
289 
290  print_barre_liste($langs->trans("ExpenseReportLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
291 
292  print $langs->trans("DescVentilTodoExpenseReport") . '</br><br>';
293 
294  /*$topicmail="Information";
295  $modelmail="project";
296  $objecttmp=new Project($db);
297  $trackid='prj'.$object->id;
298  include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';*/
299 
300  if ($msg) print $msg.'<br>';
301 
302  $moreforfilter = '';
303 
304  print '<div class="div-table-responsive">';
305  print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
306 
307  // We add search filter
308  print '<tr class="liste_titre_filter">';
309  print '<td class="liste_titre"></td>';
310  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
311  print '<td class="liste_titre center">';
312  if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
313  print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
314  $formother->select_year($search_year,'search_year',1, 20, 5);
315  print '</td>';
316  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
317  print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
318  print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
319  print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
320  print '<td class="liste_titre"></td>';
321  print '<td class="liste_titre"></td>';
322  print '<td align="center" class="liste_titre">';
323  $searchpicto=$form->showFilterButtons();
324  print $searchpicto;
325  print '</td>';
326  print '</tr>';
327 
328  print '<tr class="liste_titre">';
329  print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
330  print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
331  print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
332  print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
333  print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
334  print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
335  print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
336  print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"', $sortfield, $sortorder);
337  print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"', $sortfield, $sortorder);
338  $checkpicto='';
339  if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
340  print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
341  print "</tr>\n";
342 
343 
344  $expensereport_static = new ExpenseReport($db);
345  $form = new Form($db);
346 
347  while ( $i < min($num_lines, $limit) ) {
348  $objp = $db->fetch_object($result);
349 
350  $objp->aarowid_suggest = '';
351  $objp->aarowid_suggest = $objp->aarowid;
352 
353  $expensereport_static->ref = $objp->ref;
354  $expensereport_static->id = $objp->erid;
355 
356  print '<tr class="oddeven">';
357 
358  // Line id
359  print '<td>' . $objp->rowid . '</td>';
360 
361  // Ref Expense report
362  print '<td>' . $expensereport_static->getNomUrl(1) . '</td>';
363 
364  // Date
365  print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
366 
367  // Fees label
368  print '<td>';
369  print ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code)));
370  print '</td>';
371 
372  // Fees description -- Can be null
373  print '<td>';
374  $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments));
375  $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
376  print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments);
377  print '</td>';
378 
379  print '<td align="right">';
380  print price($objp->price);
381  print '</td>';
382 
383  // Vat rate
384  print '<td align="right">';
385  print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
386  print '</td>';
387 
388  // Current account
389  print '<td align="center">';
390  print length_accountg(html_entity_decode($objp->code_buy));
391  print '</td>';
392 
393  // Suggested accounting account
394  print '<td align="center">';
395  print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
396  print '</td>';
397 
398  print '<td align="center">';
399  print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
400  print '</td>';
401 
402  print "</tr>";
403  $i ++;
404  }
405 
406  print '</table>';
407  print "</div>";
408 
409  print '</form>';
410 } else {
411  print $db->error();
412 }
413 
414 // Add code to auto check the box when we select an account
415 print '<script type="text/javascript" language="javascript">
416 jQuery(document).ready(function() {
417  jQuery(".codeventil").change(function() {
418  var s=$(this).attr("id").replace("codeventil", "")
419  console.log(s+" "+$(this).val());
420  if ($(this).val() == -1) jQuery(".checkforselect"+s).prop("checked", false);
421  else jQuery(".checkforselect"+s).prop("checked", true);
422  });
423 });
424 </script>';
425 
426 // End of page
427 llxFooter();
428 $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_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding &#39;...&#39; if string larger than length.
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_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0)
Return an id or code from a code or id.
const STATUS_CLOSED
Classified paid.
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
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
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.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
Print a title with navigation controls for pagination.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
Classe permettant la generation de composants html autre Only common components are here...
llxHeader()
Empty header.
Definition: wrapper.php:44
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dolGetFirstLineOfText($text, $nboflines=1)
Return first line of text.
Class to manage Trips and Expenses.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0)
Clean a string from all HTML tags and entities.
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
Return a string with VAT rate label formated for view output Used into pdf and HTML pages...
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='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
Show title line of an array.
Class to manage accounting accounts.
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous) ...