dolibarr  9.0.0
account.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
4  * Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
26 require '../../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
28 require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
29 require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
30 
31 // Load translation files required by the page
32 $langs->loadLangs(array("compta","bills","admin","accountancy","salaries"));
33 
34 $mesg = '';
35 $action = GETPOST('action','aZ09');
36 $cancel = GETPOST('cancel','alpha');
37 $id = GETPOST('id', 'int');
38 $rowid = GETPOST('rowid', 'int');
39 $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist'; // To manage different context of search
40 
41 $search_account = GETPOST('search_account','alpha');
42 $search_label = GETPOST('search_label','alpha');
43 $search_accountparent = GETPOST('search_accountparent','alpha');
44 $search_pcgtype = GETPOST('search_pcgtype','alpha');
45 $search_pcgsubtype = GETPOST('search_pcgsubtype','alpha');
46 
47 // Security check
48 if ($user->societe_id > 0) accessforbidden();
49 if (! $user->rights->accounting->chartofaccount) accessforbidden();
50 
51 // Load variable for pagination
52 $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
53 $sortfield = GETPOST('sortfield','alpha');
54 $sortorder = GETPOST('sortorder','alpha');
55 $page = GETPOST('page','int');
56 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
57 $offset = $limit * $page;
58 $pageprev = $page - 1;
59 $pagenext = $page + 1;
60 if (! $sortfield) $sortfield = "aa.account_number";
61 if (! $sortorder) $sortorder = "ASC";
62 
63 $arrayfields=array(
64  'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
65  'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
66  'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
67  'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
68  'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'),
69  'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
70 );
71 
72 $accounting = new AccountingAccount($db);
73 
74 
75 
76 /*
77  * Actions
78  */
79 
80 if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
81 if (! GETPOST('confirmmassaction','alpha')) { $massaction=''; }
82 
83 $parameters=array();
84 $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
85 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
86 
87 if (empty($reshook))
88 {
89  if (! empty($cancel)) $action = '';
90 
91  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
92 
93  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
94  {
95  $search_account = "";
96  $search_label = "";
97  $search_accountparent = "";
98  $search_pcgtype = "";
99  $search_pcgsubtype = "";
100  $search_array_options=array();
101  }
102 
103  if (GETPOST('change_chart','alpha'))
104  {
105  $chartofaccounts = GETPOST('chartofaccounts', 'int');
106 
107  if ($chartofaccounts > 0)
108  {
109  // Get language code for this $chartofaccounts
110  $sql ='SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
111  $sql.=' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts;
112  $resql = $db->query($sql);
113  if ($resql)
114  {
115  $obj = $db->fetch_object($resql);
116  $country_code = $obj->code;
117  }
118  else dol_print_error($db);
119 
120  // Try to load sql file
121  if ($country_code)
122  {
123  $sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
124 
125  $offsetforchartofaccount = 0;
126  // Get the comment line '-- ADD CCCNNNNN to rowid...' to find CCCNNNNN (CCC is country num, NNNNN is id of accounting account)
127  // and pass CCCNNNNN + (num of company * 100 000 000) as offset to the run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
128  // This is to be sure there is no conflict for each chart of account, whatever is country, whatever is company when multicompany is used.
129  $tmp = file_get_contents($sqlfile);
130  if (preg_match('/-- ADD (\d+) to rowid/ims', $tmp, $reg))
131  {
132  $offsetforchartofaccount += $reg[1];
133  }
134  $offsetforchartofaccount+=($conf->entity * 100000000);
135 
136  $result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount);
137 
138  if ($result > 0)
139  {
140  setEventMessages($langs->trans("ChartLoaded"), null);
141  }
142  else
143  {
144  setEventMessages($langs->trans("ErrorDuringChartLoad"), null, 'warnings');
145  }
146  }
147 
148  if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
149  $error++;
150  }
151  } else {
152  $error++;
153  }
154  }
155 
156  if ($action == 'disable') {
157  if ($accounting->fetch($id)) {
158  $result = $accounting->account_desactivate($id);
159  }
160 
161  $action = 'update';
162  if ($result < 0) {
163  setEventMessages($accounting->error, $accounting->errors, 'errors');
164  }
165  } else if ($action == 'enable') {
166  if ($accounting->fetch($id)) {
167  $result = $accounting->account_activate($id);
168  }
169  $action = 'update';
170  if ($result < 0) {
171  setEventMessages($accounting->error, $accounting->errors, 'errors');
172  }
173  }
174 }
175 
176 
177 /*
178  * View
179  */
180 
181 $form=new Form($db);
182 
183 llxHeader('', $langs->trans("ListAccounts"));
184 
185 if ($action == 'delete') {
186  $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteAccount'), $langs->trans('ConfirmDeleteAccount'), 'confirm_delete', '', 0, 1);
187  print $formconfirm;
188 }
189 
190 $pcgver = $conf->global->CHARTOFACCOUNTS;
191 
192 $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, ";
193 $sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
194 $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
195 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = " . $conf->entity;
196 if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = " . $conf->entity;
197 else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = " . $conf->entity;
198 $sql .= " WHERE asy.rowid = " . $pcgver;
199 //print $sql;
200 if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
201 if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label);
202 if (strlen(trim($search_accountparent))) $sql .= natural_search("aa.account_parent", $search_accountparent);
203 if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype);
204 if (strlen(trim($search_pcgsubtype))) $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
205 $sql .= $db->order($sortfield, $sortorder);
206 
207 // Count total nb of records
208 $nbtotalofrecords = '';
209 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
210 {
211  $resql = $db->query($sql);
212  $nbtotalofrecords = $db->num_rows($resql);
213  if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
214  {
215  $page = 0;
216  $offset = 0;
217  }
218 }
219 
220 $sql .= $db->plimit($limit + 1, $offset);
221 
222 dol_syslog('accountancy/admin/account.php:: $sql=' . $sql);
223 $resql = $db->query($sql);
224 
225 if ($resql)
226 {
227  $num = $db->num_rows($resql);
228 
229  $param='';
230  if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
231  if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
232  if ($search_account) $param.= '&search_account='.urlencode($search_account);
233  if ($search_label) $param.= '&search_label='.urlencode($search_label);
234  if ($search_accountparent) $param.= '&search_accountparent='.urlencode($search_accountparent);
235  if ($search_pcgtype) $param.= '&search_pcgtype='.urlencode($search_pcgtype);
236  if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
237  if ($optioncss != '') $param.='&optioncss='.$optioncss;
238 
239 
240  print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
241  if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
242  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
243  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
244  print '<input type="hidden" name="action" value="list">';
245  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
246  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
247  print '<input type="hidden" name="page" value="'.$page.'">';
248  print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
249 
250  $newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle">' . $langs->trans("Addanaccount").'</span>';
251  $newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
252  $newcardbutton.= '</a>';
253 
254  print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
255 
256  // Box to select active chart of account
257  print $langs->trans("Selectchartofaccounts") . " : ";
258  print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
259  $sql = "SELECT a.rowid, a.pcg_version, a.label, a.active, c.code as country_code";
260  $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system as a";
261  $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON a.fk_country = c.rowid";
262  $sql .= " WHERE a.active = 1";
263  dol_syslog('accountancy/admin/account.php $sql='.$sql);
264  print $sql;
265  $resqlchart = $db->query($sql);
266  if ($resqlchart) {
267  $numbis = $db->num_rows($resqlchart);
268  $i = 0;
269  while ($i < $numbis) {
270  $obj = $db->fetch_object($resqlchart);
271 
272  print '<option value="' . $obj->rowid . '"';
273  print ($pcgver == $obj->rowid) ? ' selected' : '';
274  print '>' . $obj->pcg_version . ' - ' . $obj->label . ' - (' . $obj->country_code . ')</option>';
275 
276  $i++;
277  }
278  }
279  else dol_print_error($db);
280  print "</select>";
281  print ajax_combobox("chartofaccounts");
282  print '<input type="submit" class="button" name="change_chart" tabindex="-1" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
283 
284  print '<br>';
285  print '<br>';
286 
287  $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
288  $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
289 
290  print '<div class="div-table-responsive">';
291  print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
292 
293  // Line for search fields
294  print '<tr class="liste_titre_filter">';
295  if (! empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>';
296  if (! empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
297  if (! empty($arrayfields['aa.account_parent']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="' . $search_accountparent . '"></td>';
298  if (! empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
299  if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
300  if (! empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre">&nbsp;</td>';
301  print '<td align="right" class="liste_titre">';
302  $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
303  print $searchpicto;
304  print '</td>';
305  print '</tr>';
306 
307  print '<tr class="liste_titre">';
308  if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder);
309  if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder);
310  if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder);
311  if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_type']['help']);
312  if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_subtype']['help']);
313  if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder);
314  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
315  print "</tr>\n";
316 
317  $accountstatic = new AccountingAccount($db);
318  $accountparent = new AccountingAccount($db);
319 
320  $i=0;
321  while ($i < min($num, $limit))
322  {
323  $obj = $db->fetch_object($resql);
324 
325  $accountstatic->id = $obj->rowid;
326  $accountstatic->label = $obj->label;
327  $accountstatic->account_number = $obj->account_number;
328 
329  print '<tr class="oddeven">';
330 
331  // Account number
332  if (! empty($arrayfields['aa.account_number']['checked']))
333  {
334  print "<td>";
335  print $accountstatic->getNomUrl(1, 0, 0, '', 0, 1);
336  print "</td>\n";
337  if (! $i) $totalarray['nbfield']++;
338  }
339 
340  // Account label
341  if (! empty($arrayfields['aa.label']['checked']))
342  {
343  print "<td>";
344  print $obj->label;
345  print "</td>\n";
346  if (! $i) $totalarray['nbfield']++;
347  }
348 
349  // Account parent
350  if (! empty($arrayfields['aa.account_parent']['checked']))
351  {
352  if (! empty($obj->account_parent))
353  {
354  $accountparent->id = $obj->rowid2;
355  $accountparent->label = $obj->label2;
356  $accountparent->account_number = $obj->account_number2;
357 
358  print "<td>";
359  print $accountparent->getNomUrl(1);
360  print "</td>\n";
361  if (! $i) $totalarray['nbfield']++;
362  }
363  else
364  {
365  print '<td>&nbsp;</td>';
366  if (! $i) $totalarray['nbfield']++;
367  }
368  }
369 
370  // Chart of accounts type
371  if (! empty($arrayfields['aa.pcg_type']['checked']))
372  {
373  print "<td>";
374  print $obj->pcg_type;
375  print "</td>\n";
376  if (! $i) $totalarray['nbfield']++;
377  }
378 
379  // Chart of accounts subtype
380  if (! empty($arrayfields['aa.pcg_subtype']['checked']))
381  {
382  print "<td>";
383  print $obj->pcg_subtype;
384  print "</td>\n";
385  if (! $i) $totalarray['nbfield']++;
386  }
387 
388  // Activated or not
389  if (! empty($arrayfields['aa.active']['checked']))
390  {
391  print '<td>';
392  if (empty($obj->active)) {
393  print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable">';
394  print img_picto($langs->trans("Disabled"), 'switch_off');
395  print '</a>';
396  } else {
397  print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=disable">';
398  print img_picto($langs->trans("Activated"), 'switch_on');
399  print '</a>';
400  }
401  print '</td>';
402  if (! $i) $totalarray['nbfield']++;
403  }
404 
405  // Action
406  print '<td align="center">';
407  if ($user->rights->accounting->chartofaccount) {
408  print '<a href="./card.php?action=update&id=' . $obj->rowid . '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
409  print img_edit();
410  print '</a>';
411  print '&nbsp;';
412  print '<a href="./card.php?action=delete&id=' . $obj->rowid . '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id). '">';
413  print img_delete();
414  print '</a>';
415  }
416  print '</td>' . "\n";
417  if (! $i) $totalarray['nbfield']++;
418 
419  print "</tr>\n";
420  $i++;
421  }
422 
423  print "</table>";
424  print "</div>";
425  print '</form>';
426 } else {
427  dol_print_error($db);
428 }
429 
430 // End of page
431 llxFooter();
432 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:56
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve')
Convert a html select field into an ajax combobox.
Definition: ajax.lib.php:374
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
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if(! empty($conf->don->enabled) && $user->rights->societe->lire) if(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) if(! empty($conf->facture->enabled) &&! empty($conf->commande->enabled) && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1053
img_edit($titlealt='default', $float=0, $other='class="pictoedit"')
Show logo editer/modifier fiche.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:510
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
img_delete($titlealt='default', $other='class="pictodelete"')
Show delete logo.
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.
llxHeader()
Empty header.
Definition: wrapper.php:44
run_sql($sqlfile, $silent=1, $entity='', $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0)
Launch a sql file.
Definition: admin.lib.php:130
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...
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it&#39;s its name (generic function)