dolibarr  13.0.2
card.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
4  * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2014-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
7  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
8  * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
9  * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <https://www.gnu.org/licenses/>.
23  */
24 
31 require '../../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
38 if (!empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
39 if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
40 if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
41 if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
42 
43 // Load translation files required by the page
44 $langs->loadLangs(array("banks", "bills", "categories", "companies", "compta"));
45 
46 $action = GETPOST('action', 'aZ09');
47 $cancel = GETPOST('cancel', 'alpha');
48 
49 // Security check
50 $id = GETPOST("id", 'int') ? GETPOST("id", 'int') : GETPOST('ref', 'alpha');
51 $fieldid = GETPOSTISSET("ref") ? 'ref' : 'rowid';
52 
53 $result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid);
54 
55 $object = new Account($db);
56 $extrafields = new ExtraFields($db);
57 
58 // fetch optionals attributes and labels
59 $extrafields->fetch_name_optionals_label($object->table_element);
60 
61 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
62 $hookmanager->initHooks(array('bankcard', 'globalcard'));
63 
64 /*
65  * Actions
66  */
67 
68 if ($cancel) $action = '';
69 
70 if ($action == 'add')
71 {
72  $error = 0;
73 
74  $db->begin();
75 
76  // Create account
77  $object = new Account($db);
78 
79  $object->ref = dol_string_nospecial(trim(GETPOST('ref', 'alpha')));
80  $object->label = trim(GETPOST("label", 'alphanohtml'));
81  $object->courant = $_POST["type"];
82  $object->clos = $_POST["clos"];
83  $object->rappro = (GETPOST("norappro", 'alpha') ? 0 : 1);
84  $object->url = trim(GETPOST("url", 'alpha'));
85 
86  $object->bank = trim($_POST["bank"]);
87  $object->code_banque = trim($_POST["code_banque"]);
88  $object->code_guichet = trim($_POST["code_guichet"]);
89  $object->number = trim($_POST["number"]);
90  $object->cle_rib = trim($_POST["cle_rib"]);
91  $object->bic = trim($_POST["bic"]);
92  $object->iban = trim($_POST["iban"]);
93  $object->domiciliation = trim(GETPOST("domiciliation", "nohtml"));
94 
95  $object->proprio = trim(GETPOST("proprio", 'alphanohtml'));
96  $object->owner_address = trim(GETPOST("owner_address", 'nohtml'));
97 
98  $account_number = GETPOST('account_number', 'alphanohtml');
99  if (empty($account_number) || $account_number == '-1')
100  {
101  $object->account_number = '';
102  } else {
103  $object->account_number = $account_number;
104  }
105  $fk_accountancy_journal = GETPOST('fk_accountancy_journal', 'int');
106  if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; }
107 
108  $object->solde = $_POST["solde"];
109  $object->date_solde = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST('reday', 'int'), GETPOST("reyear", 'int'));
110 
111  $object->currency_code = trim($_POST["account_currency_code"]);
112 
113  $object->state_id = GETPOST("account_state_id", 'int');
114  $object->country_id = GETPOST("account_country_id", 'int');
115 
116  $object->min_allowed = GETPOST("account_min_allowed", 'int');
117  $object->min_desired = GETPOST("account_min_desired", 'int');
118  $object->comment = trim(GETPOST("account_comment", 'restricthtml'));
119 
120  $object->fk_user_author = $user->id;
121 
122  if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number))
123  {
124  setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountancyCode")), null, 'errors');
125  $action = 'create'; // Force chargement page en mode creation
126  $error++;
127  }
128  if (empty($object->ref))
129  {
130  setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Ref")), null, 'errors');
131  $action = 'create'; // Force chargement page en mode creation
132  $error++;
133  }
134  if (empty($object->label))
135  {
136  setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("LabelBankCashAccount")), null, 'errors');
137  $action = 'create'; // Force chargement page en mode creation
138  $error++;
139  }
140 
141  // Fill array 'array_options' with data from add form
142  $ret = $extrafields->setOptionalsFromPost(null, $object);
143 
144  if (!$error)
145  {
146  $id = $object->create($user);
147  if ($id > 0)
148  {
149  // Category association
150  $categories = GETPOST('categories', 'array');
151  $object->setCategories($categories);
152 
153  $_GET["id"] = $id; // Force chargement page en mode visu
154 
155  $action = '';
156  } else {
157  $error++;
158  setEventMessages($object->error, $object->errors, 'errors');
159 
160  $action = 'create'; // Force chargement page en mode creation
161  }
162  }
163 
164  if (!$error)
165  {
166  $db->commit();
167  } else {
168  $db->rollback();
169  }
170 }
171 
172 if ($action == 'update')
173 {
174  $error = 0;
175 
176  // Update account
177  $object = new Account($db);
178  $object->fetch(GETPOST("id", 'int'));
179 
180  $object->ref = dol_string_nospecial(trim(GETPOST('ref', 'alpha')));
181  $object->label = trim(GETPOST("label", 'alphanohtml'));
182  $object->courant = $_POST["type"];
183  $object->clos = $_POST["clos"];
184  $object->rappro = (GETPOST("norappro", 'alpha') ? 0 : 1);
185  $object->url = trim(GETPOST("url", 'alpha'));
186 
187  $object->bank = trim($_POST["bank"]);
188  $object->code_banque = trim($_POST["code_banque"]);
189  $object->code_guichet = trim($_POST["code_guichet"]);
190  $object->number = trim($_POST["number"]);
191  $object->cle_rib = trim($_POST["cle_rib"]);
192  $object->bic = trim($_POST["bic"]);
193  $object->iban = trim($_POST["iban"]);
194  $object->domiciliation = trim(GETPOST("domiciliation", "nohtml"));
195 
196  $object->proprio = trim(GETPOST("proprio", 'alphanohtml'));
197  $object->owner_address = trim(GETPOST("owner_address", 'nohtml'));
198 
199  $account_number = GETPOST('account_number', 'alpha');
200  if (empty($account_number) || $account_number == '-1')
201  {
202  $object->account_number = '';
203  } else {
204  $object->account_number = $account_number;
205  }
206  $fk_accountancy_journal = GETPOST('fk_accountancy_journal', 'int');
207  if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; }
208 
209  $object->currency_code = trim($_POST["account_currency_code"]);
210 
211  $object->state_id = GETPOST("account_state_id", 'int');
212  $object->country_id = GETPOST("account_country_id", 'int');
213 
214  $object->min_allowed = GETPOST("account_min_allowed", 'int');
215  $object->min_desired = GETPOST("account_min_desired", 'int');
216  $object->comment = trim(GETPOST("account_comment", 'restricthtml'));
217 
218  if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number))
219  {
220  setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountancyCode")), null, 'errors');
221  $action = 'edit'; // Force chargement page en mode creation
222  $error++;
223  }
224  if (empty($object->ref))
225  {
226  setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Ref")), null, 'errors');
227  $action = 'edit'; // Force chargement page en mode creation
228  $error++;
229  }
230  if (empty($object->label))
231  {
232  setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("LabelBankCashAccount")), null, 'errors');
233  $action = 'edit'; // Force chargement page en mode creation
234  $error++;
235  }
236 
237  $db->begin();
238 
239  if (!$error)
240  {
241  // Fill array 'array_options' with data from add form
242  $ret = $extrafields->setOptionalsFromPost(null, $object);
243  }
244 
245  if (!$error)
246  {
247  $result = $object->update($user);
248  if ($result >= 0)
249  {
250  // Category association
251  $categories = GETPOST('categories', 'array');
252  $object->setCategories($categories);
253 
254  $_GET["id"] = $_POST["id"]; // Force chargement page en mode visu
255  } else {
256  $error++;
257  setEventMessages($object->error, $object->errors, 'errors');
258  $action = 'edit'; // Force chargement page edition
259  }
260  }
261 
262  if (!$error)
263  {
264  $db->commit();
265  } else {
266  $db->rollback();
267  }
268 }
269 
270 if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer)
271 {
272  // Delete
273  $object = new Account($db);
274  $object->fetch(GETPOST("id", "int"));
275  $result = $object->delete($user);
276 
277  if ($result > 0)
278  {
279  setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
280  header("Location: ".DOL_URL_ROOT."/compta/bank/list.php");
281  exit;
282  } else {
283  setEventMessages($object->error, $object->errors, 'errors');
284  $action = '';
285  }
286 }
287 
288 
289 /*
290  * View
291  */
292 
293 $form = new Form($db);
294 $formbank = new FormBank($db);
295 $formcompany = new FormCompany($db);
296 if (!empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
297 
298 $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
299 
300 $title = $langs->trans("FinancialAccount")." - ".$langs->trans("Card");
301 $helpurl = "";
302 llxHeader("", $title, $helpurl);
303 
304 
305 // Creation
306 
307 if ($action == 'create')
308 {
309  $object = new Account($db);
310 
311  print load_fiche_titre($langs->trans("NewFinancialAccount"), '', 'bank_account');
312 
313  if ($conf->use_javascript_ajax)
314  {
315  print "\n".'<script type="text/javascript" language="javascript">';
316  print 'jQuery(document).ready(function () {
317  jQuery("#selecttype").change(function() {
318  document.formsoc.action.value="create";
319  document.formsoc.submit();
320  });
321  jQuery("#selectaccount_country_id").change(function() {
322  document.formsoc.action.value="create";
323  document.formsoc.submit();
324  });
325  })';
326  print '</script>'."\n";
327  }
328 
329  print '<form action="'.$_SERVER["PHP_SELF"].'" name="formsoc" method="post">';
330  print '<input type="hidden" name="token" value="'.newToken().'">';
331  print '<input type="hidden" name="action" value="add">';
332  print '<input type="hidden" name="clos" value="0">';
333 
335 
336  print '<table class="border centpercent">';
337 
338  // Ref
339  print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
340  print '<td><input size="8" type="text" class="flat" name="ref" value="'.dol_escape_htmltag(GETPOST("ref") ?GETPOST("ref", 'alpha') : $object->ref).'" maxlength="12" autofocus></td></tr>';
341 
342  // Label
343  print '<tr><td class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
344  print '<td><input type="text" class="flat maxwidth150onsmartphone" name="label" value="'.dol_escape_htmltag(GETPOST("label", 'alpha')).'"></td></tr>';
345 
346  // Type
347  print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
348  print '<td>';
349  $formbank->selectTypeOfBankAccount(GETPOSTISSET("type") ? GETPOST("type") : Account::TYPE_CURRENT, "type");
350  print '</td></tr>';
351 
352  // Currency
353  print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
354  print '<td>';
355  $selectedcode = $object->currency_code;
356  if (!$selectedcode) $selectedcode = $conf->currency;
357  print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code');
358  //print $langs->trans("Currency".$conf->currency);
359  //print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
360  print '</td></tr>';
361 
362  // Status
363  print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
364  print '<td>';
365  print $form->selectarray("clos", $object->status, (GETPOST("clos", 'int') != '' ?GETPOST("clos", 'int') : $object->clos), 0, 0, 0, '', 0, 0, 0, '', 'maxwidth150onsmartphone');
366  print '</td></tr>';
367 
368  // Country
369  $selectedcode = '';
370  if (GETPOSTISSET("account_country_id")) {
371  $selectedcode = GETPOST("account_country_id") ? GETPOST("account_country_id") : $object->country_code;
372  } elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code;
373  $object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
374 
375  print '<tr><td class="fieldrequired">'.$langs->trans("BankAccountCountry").'</td>';
376  print '<td>';
377  print $form->select_country($selectedcode, 'account_country_id');
378  if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
379  print '</td></tr>';
380 
381  // State
382  print '<tr><td>'.$langs->trans('State').'</td><td>';
383  if ($selectedcode)
384  {
385  $formcompany->select_departement(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id');
386  } else {
387  print $countrynotdefined;
388  }
389  print '</td></tr>';
390 
391  // Web
392  print '<tr><td>'.$langs->trans("Web").'</td>';
393  print '<td><input class="minwidth300" type="text" class="flat" name="url" value="'.GETPOST("url").'"></td></tr>';
394 
395  // Tags-Categories
396  if ($conf->categorie->enabled)
397  {
398  print '<tr><td>'.$langs->trans("Categories").'</td><td>';
399  $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
400 
401  $arrayselected = array();
402  $c = new Categorie($db);
403  $cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT);
404  if (is_array($cats))
405  {
406  foreach ($cats as $cat) {
407  $arrayselected[] = $cat->id;
408  }
409  }
410  print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
411  print "</td></tr>";
412  }
413 
414  // Comment
415  print '<tr><td>'.$langs->trans("Comment").'</td>';
416  print '<td>';
417  // Editor wysiwyg
418  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
419  $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_4, '90%');
420  $doleditor->Create();
421  print '</td></tr>';
422 
423  // Other attributes
424  $parameters = array();
425  $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
426  print $hookmanager->resPrint;
427  if (empty($reshook))
428  {
429  print $object->showOptionals($extrafields, 'edit', $parameters);
430  }
431 
432  print '</table>';
433 
434  print '<br>';
435 
436  print '<table class="border centpercent">';
437 
438  // Sold
439  print '<tr><td class="titlefieldcreate">'.$langs->trans("InitialBankBalance").'</td>';
440  print '<td><input size="12" type="text" class="flat" name="solde" value="'.(GETPOST("solde") ?GETPOST("solde") : price2num($object->solde)).'"></td></tr>';
441 
442  print '<tr><td>'.$langs->trans("Date").'</td>';
443  print '<td>';
444  print $form->selectDate('', 're', 0, 0, 0, 'formsoc');
445  print '</td></tr>';
446 
447  print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
448  print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(GETPOST("account_min_allowed") ?GETPOST("account_min_allowed") : $object->min_allowed).'"></td></tr>';
449 
450  print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
451  print '<td><input size="12" type="text" class="flat" name="account_min_desired" value="'.(GETPOST("account_min_desired") ?GETPOST("account_min_desired") : $object->min_desired).'"></td></tr>';
452 
453  print '</table>';
454  print '<br>';
455 
456  if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT)
457  {
458  print '<table class="border centpercent">';
459 
460  // If bank account
461  print '<tr><td class="titlefieldcreate">'.$langs->trans("BankName").'</td>';
462  print '<td><input type="text" class="flat minwidth150" name="bank" value="'.(GETPOST('bank') ?GETPOST('bank', 'alpha') : $object->bank).'"></td>';
463  print '</tr>';
464 
465  // Show fields of bank account
466  $sizecss = '';
467  foreach ($object->getFieldsToShow() as $val) {
468  if ($val == 'BankCode') {
469  $name = 'code_banque';
470  $sizecss = 'minwidth100';
471  $content = $object->code_banque;
472  } elseif ($val == 'DeskCode') {
473  $name = 'code_guichet';
474  $sizecss = 'minwidth100';
475  $content = $object->code_guichet;
476  } elseif ($val == 'BankAccountNumber') {
477  $name = 'number';
478  $sizecss = 'minwidth200';
479  $content = $object->number;
480  } elseif ($val == 'BankAccountNumberKey') {
481  $name = 'cle_rib';
482  $sizecss = 'minwidth50';
483  $content = $object->cle_rib;
484  }
485 
486  print '<td>'.$langs->trans($val).'</td>';
487  print '<td><input type="text" class="flat '.$sizecss.'" name="'.$name.'" value="'.(GETPOST($name) ?GETPOST($name, 'alpha') : $content).'"></td>';
488  print '</tr>';
489  }
490  $ibankey = FormBank::getIBANLabel($object);
491  $bickey = "BICNumber";
492  if ($object->getCountryCode() == 'IN') $bickey = "SWIFT";
493 
494  // IBAN
495  print '<tr><td>'.$langs->trans($ibankey).'</td>';
496  print '<td><input maxlength="34" type="text" class="flat minwidth300" name="iban" value="'.(GETPOST('iban') ?GETPOST('iban', 'alpha') : $object->iban).'"></td></tr>';
497 
498  print '<tr><td>'.$langs->trans($bickey).'</td>';
499  print '<td><input maxlength="11" type="text" class="flat minwidth150" name="bic" value="'.(GETPOST('bic') ?GETPOST('bic', 'alpha') : $object->bic).'"></td></tr>';
500 
501  print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td>';
502  print '<textarea class="flat quatrevingtpercent" name="domiciliation" rows="'.ROWS_2.'">';
503  print (GETPOST('domiciliation') ?GETPOST('domiciliation') : $object->domiciliation);
504  print "</textarea></td></tr>";
505 
506  print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';
507  print '<td><input type="text" class="flat minwidth300" name="proprio" value="'.(GETPOST('proprio') ?GETPOST('proprio', 'alpha') : $object->proprio).'">';
508  print '</td></tr>';
509 
510  print '<tr><td class="tdtop">'.$langs->trans("BankAccountOwnerAddress").'</td><td>';
511  print '<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.'">';
512  print (GETPOST('owner_address') ?GETPOST('owner_address', 'alpha') : $object->owner_address);
513  print "</textarea></td></tr>";
514 
515  print '</table>';
516  print '<br>';
517  }
518 
519  print '<table class="border centpercent">';
520  // Accountancy code
521  $fieldrequired = '';
522  if (!empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) $fieldrequired = 'fieldrequired ';
523 
524  if (!empty($conf->accounting->enabled))
525  {
526  print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
527  print '<td>';
528  print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
529  print '</td></tr>';
530  } else {
531  print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
532  print '<td><input type="text" name="account_number" value="'.(GETPOST("account_number") ?GETPOST('account_number', 'alpha') : $object->account_number).'"></td></tr>';
533  }
534 
535  // Accountancy journal
536  if (!empty($conf->accounting->enabled))
537  {
538  print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
539  print '<td>';
540  print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);
541  print '</td></tr>';
542  }
543 
544  print '</table>';
545 
547 
548  print '<div class="center">';
549  print '<input type="submit" class="button" value="'.$langs->trans("CreateAccount").'">';
550  print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
551  print '<input type="button" class="button button-cancel" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
552  print '</div>';
553 
554  print '</form>';
555 } else {
556  /* ************************************************************************** */
557  /* */
558  /* Visu et edition */
559  /* */
560  /* ************************************************************************** */
561 
562  if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') {
563  $object = new Account($db);
564  if ($_GET["id"])
565  {
566  $object->fetch($_GET["id"]);
567  }
568  if ($_GET["ref"])
569  {
570  $object->fetch(0, $_GET["ref"]);
571  $_GET["id"] = $object->id;
572  }
573 
574  // Show tabs
575  $head = bank_prepare_head($object);
576  print dol_get_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account');
577 
578  $formconfirm = '';
579 
580  // Confirmation to delete
581  if ($action == 'delete')
582  {
583  $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteAccount"), $langs->trans("ConfirmDeleteAccount"), "confirm_delete");
584  }
585 
586  // Print form confirm
587  print $formconfirm;
588 
589  $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
590 
591  $morehtmlref = '';
592  dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
593 
594 
595  print '<div class="fichecenter">';
596  print '<div class="fichehalfleft">';
597  print '<div class="underbanner clearboth"></div>';
598 
599  print '<table class="border tableforfield" width="100%">';
600 
601  // Type
602  print '<tr><td class="titlefield">'.$langs->trans("AccountType").'</td>';
603  print '<td>'.$object->type_lib[$object->type].'</td></tr>';
604 
605  // Currency
606  print '<tr><td>'.$langs->trans("Currency").'</td>';
607  print '<td>';
608  $selectedcode = $object->currency_code;
609  if (!$selectedcode) $selectedcode = $conf->currency;
610  print $langs->trans("Currency".$selectedcode);
611  print '</td></tr>';
612 
613  // Conciliate
614  print '<tr><td>'.$langs->trans("Conciliable").'</td>';
615  print '<td>';
616  $conciliate = $object->canBeConciliated();
617  if ($conciliate == -2) print $langs->trans("No").' <span class="opacitymedium">('.$langs->trans("CashAccount").')</span>';
618  elseif ($conciliate == -3) print $langs->trans("No").' <span class="opacitymedium">('.$langs->trans("Closed").')</span>';
619  else print ($object->rappro == 1 ? $langs->trans("Yes") : ($langs->trans("No").' <span class="opacitymedium">('.$langs->trans("ConciliationDisabled").')</span>'));
620  print '</td></tr>';
621 
622  print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
623  print '<td>'.$object->min_allowed.'</td></tr>';
624 
625  print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
626  print '<td>'.$object->min_desired.'</td></tr>';
627 
628  // Accountancy code
629  print '<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans("AccountancyCode").'</td>';
630  print '<td>';
631  if (!empty($conf->accounting->enabled)) {
632  $accountingaccount = new AccountingAccount($db);
633  $accountingaccount->fetch('', $object->account_number, 1);
634 
635  print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
636  } else {
637  print $object->account_number;
638  }
639  print '</td></tr>';
640 
641  // Accountancy journal
642  if (!empty($conf->accounting->enabled))
643  {
644  print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
645  print '<td>';
646 
647  if ($object->fk_accountancy_journal > 0) {
648  $accountingjournal = new AccountingJournal($db);
649  $accountingjournal->fetch($object->fk_accountancy_journal);
650 
651  print $accountingjournal->getNomUrl(0, 1, 1, '', 1);
652  }
653  print '</td></tr>';
654  }
655 
656  // Other attributes
657  $cols = 2;
658  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
659 
660  print '</table>';
661 
662  print '</div>';
663  print '<div class="fichehalfright">';
664  print '<div class="ficheaddleft">';
665  print '<div class="underbanner clearboth"></div>';
666 
667  print '<table class="border tableforfield centpercent">';
668 
669  // Categories
670  if ($conf->categorie->enabled) {
671  print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
672  print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1);
673  print "</td></tr>";
674  }
675 
676  print '<tr><td class="tdtop titlefield">'.$langs->trans("Comment").'</td>';
677  print '<td>'.dol_htmlentitiesbr($object->comment).'</td></tr>';
678 
679  print '</table>';
680 
681  if ($object->type == Account::TYPE_SAVINGS || $object->type == Account::TYPE_CURRENT)
682  {
683  print '<div class="underbanner clearboth"></div>';
684 
685  print '<table class="border tableforfield centpercent">';
686 
687  print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("BankName").'</td>';
688  print '<td>'.$object->bank.'</td></tr>';
689 
690  // Show fields of bank account
691  foreach ($object->getFieldsToShow() as $val) {
692  if ($val == 'BankCode') {
693  $content = $object->code_banque;
694  } elseif ($val == 'DeskCode') {
695  $content = $object->code_guichet;
696  } elseif ($val == 'BankAccountNumber') {
697  $content = $object->number;
698  } elseif ($val == 'BankAccountNumberKey') {
699  $content = $object->cle_rib;
700  }
701 
702  print '<tr><td>'.$langs->trans($val).'</td>';
703  print '<td>'.$content.'</td>';
704  print '</tr>';
705  }
706 
707  $ibankey = FormBank::getIBANLabel($object);
708  $bickey = "BICNumber";
709  if ($object->getCountryCode() == 'IN') $bickey = "SWIFT";
710 
711  print '<tr><td>'.$langs->trans($ibankey).'</td>';
712  print '<td>'.$object->iban.'&nbsp;';
713  if (!empty($object->iban)) {
714  if (!checkIbanForAccount($object)) {
715  print img_picto($langs->trans("IbanNotValid"), 'warning');
716  } else {
717  print img_picto($langs->trans("IbanValid"), 'info');
718  }
719  }
720  print '</td></tr>';
721 
722  print '<tr><td>'.$langs->trans($bickey).'</td>';
723  print '<td>'.$object->bic.'&nbsp;';
724  if (!empty($object->bic)) {
725  if (!checkSwiftForAccount($object)) {
726  print img_picto($langs->trans("SwiftNotValid"), 'warning');
727  } else {
728  print img_picto($langs->trans("SwiftValid"), 'info');
729  }
730  }
731  print '</td></tr>';
732 
733  print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td>';
734  print nl2br($object->domiciliation);
735  print "</td></tr>\n";
736 
737  print '<tr><td>'.$langs->trans("BankAccountOwner").'</td><td>';
738  print $object->proprio;
739  print "</td></tr>\n";
740 
741  print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td>';
742  print nl2br($object->owner_address);
743  print "</td></tr>\n";
744 
745  print '</table>';
746  }
747 
748  print '</div>';
749  print '</div>';
750  print '</div>';
751 
752  print '<div class="clearboth"></div>';
753 
755 
756  /*
757  * Barre d'actions
758  */
759  print '<div class="tabsAction">';
760 
761  if ($user->rights->banque->configurer)
762  {
763  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
764  }
765 
766  $canbedeleted = $object->can_be_deleted(); // Renvoi vrai si compte sans mouvements
767  if ($user->rights->banque->configurer && $canbedeleted)
768  {
769  print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Delete").'</a>';
770  }
771 
772  print '</div>';
773  }
774 
775  /* ************************************************************************** */
776  /* */
777  /* Edition */
778  /* */
779  /* ************************************************************************** */
780 
781  if (GETPOST('id', 'int') && $action == 'edit' && $user->rights->banque->configurer)
782  {
783  $object = new Account($db);
784  $object->fetch(GETPOST('id', 'int'));
785 
786  print load_fiche_titre($langs->trans("EditFinancialAccount"), '', 'bank_account');
787 
788  if ($conf->use_javascript_ajax)
789  {
790  print "\n".'<script type="text/javascript" language="javascript">';
791  print 'jQuery(document).ready(function () {
792  jQuery("#selecttype").change(function() {
793  document.formsoc.action.value="edit";
794  document.formsoc.submit();
795  });
796  })'."\n";
797 
798  print 'jQuery(document).ready(function () {
799  jQuery("#selectaccount_country_id").change(function() {
800  document.formsoc.action.value="edit";
801  document.formsoc.submit();
802  });
803  })';
804  print '</script>'."\n";
805  }
806 
807  print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" name="formsoc">';
808  print '<input type="hidden" name="token" value="'.newToken().'">';
809  print '<input type="hidden" name="action" value="update">';
810  print '<input type="hidden" name="id" value="'.$_REQUEST["id"].'">'."\n\n";
811 
812  print dol_get_fiche_head(array(), 0, '', 0);
813 
814  //print '<div class="underbanner clearboth"></div>';
815 
816  print '<table class="border centpercent">';
817 
818  // Ref
819  print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
820  print '<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET("ref") ? GETPOST("ref") : $object->ref).'"></td></tr>';
821 
822  // Label
823  print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
824  print '<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(GETPOSTISSET("label") ? GETPOST("label") : $object->label).'"></td></tr>';
825 
826  // Type
827  print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
828  print '<td class="maxwidth200onsmartphone">';
829  $formbank->selectTypeOfBankAccount((GETPOSTISSET("type") ? GETPOST("type") : $object->type), "type");
830  print '</td></tr>';
831 
832  // Currency
833  print '<tr><td class="fieldrequired">'.$langs->trans("Currency");
834  print '<input type="hidden" value="'.$object->currency_code.'">';
835  print '</td>';
836  print '<td class="maxwidth200onsmartphone">';
837  $selectedcode = $object->currency_code;
838  if (!$selectedcode) $selectedcode = $conf->currency;
839  print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code');
840  //print $langs->trans("Currency".$conf->currency);
841  //print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
842  print '</td></tr>';
843 
844  // Status
845  print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
846  print '<td class="maxwidth200onsmartphone">';
847  print $form->selectarray("clos", $object->status, (GETPOSTISSET("clos") ? GETPOST("clos") : $object->clos));
848  print '</td></tr>';
849 
850  // Country
851  $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
852  $selectedcode = $object->country_code;
853  if (GETPOSTISSET("account_country_id")) $selectedcode = GETPOST("account_country_id");
854  elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code;
855  $object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
856 
857  print '<tr><td class="fieldrequired">'.$langs->trans("Country").'</td>';
858  print '<td class="maxwidth200onsmartphone">';
859  print $form->select_country($selectedcode, 'account_country_id');
860  if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
861  print '</td></tr>';
862 
863  // State
864  print '<tr><td>'.$langs->trans('State').'</td><td class="maxwidth200onsmartphone">';
865  if ($selectedcode)
866  {
867  print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : $object->state_id, $selectedcode, 'account_state_id');
868  } else {
869  print $countrynotdefined;
870  }
871  print '</td></tr>';
872 
873  // Conciliable
874  print '<tr><td>'.$langs->trans("Conciliable").'</td>';
875  print '<td>';
876  $conciliate = $object->canBeConciliated();
877  if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
878  elseif ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
879  else print '<input type="checkbox" class="flat" name="norappro"'.(($conciliate > 0) ? '' : ' checked="checked"').'"> '.$langs->trans("DisableConciliation");
880  print '</td></tr>';
881 
882  // Balance
883  print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
884  print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(GETPOSTISSET("account_min_allowed") ? GETPOST("account_min_allowed") : $object->min_allowed).'"></td></tr>';
885 
886  print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
887  print '<td><input size="12" type="text" class="flat" name="account_min_desired" value="'.(GETPOSTISSET("account_min_desired") ? GETPOST("account_min_desired") : $object->min_desired).'"></td></tr>';
888 
889  // Web
890  print '<tr><td>'.$langs->trans("Web").'</td>';
891  print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET("url") ? GETPOST("url") : $object->url).'">';
892  print '</td></tr>';
893 
894  // Tags-Categories
895  if ($conf->categorie->enabled)
896  {
897  print '<tr><td class="tdtop">'.$langs->trans("Categories").'</td><td>';
898  $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
899  $c = new Categorie($db);
900  $cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT);
901  if (is_array($cats))
902  {
903  foreach ($cats as $cat) {
904  $arrayselected[] = $cat->id;
905  }
906  }
907  print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
908  print "</td></tr>";
909  }
910 
911  // Comment
912  print '<tr><td class="tdtop">'.$langs->trans("Comment").'</td>';
913  print '<td>';
914  // Editor wysiwyg
915  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
916  $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_4, '95%');
917  $doleditor->Create();
918  print '</td></tr>';
919 
920  // Other attributes
921  $parameters = array();
922  $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
923  print $hookmanager->resPrint;
924  if (empty($reshook))
925  {
926  print $object->showOptionals($extrafields, 'edit', $parameters);
927  }
928 
929  print '</table>';
930  print '<br>';
931 
932 
933  //print '<div class="underbanner clearboth"></div>';
934 
935  print '<table class="border centpercent">';
936 
937  // Accountancy code
938  $tdextra = ' class="titlefieldcreate"';
939 
940  if (!empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) {
941  $tdextra = ' class="fieldrequired titlefieldcreate"';
942  }
943 
944  print '<tr class="liste_titre_add"><td'.$tdextra.'>'.$langs->trans("AccountancyCode").'</td>';
945  print '<td>';
946  if (!empty($conf->accounting->enabled)) {
947  print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
948  } else {
949  print '<input type="text" name="account_number" value="'.(GETPOST("account_number") ? GETPOST("account_number") : $object->account_number).'">';
950  }
951  print '</td></tr>';
952 
953  // Accountancy journal
954  if (!empty($conf->accounting->enabled))
955  {
956  print '<tr><td class="fieldrequired">'.$langs->trans("AccountancyJournal").'</td>';
957  print '<td>';
958  print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);
959  print '</td></tr>';
960  }
961 
962  print '</table>';
963 
964  if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT)
965  {
966  print '<br>';
967 
968  //print '<div class="underbanner clearboth"></div>';
969 
970  print '<table class="border centpercent">';
971 
972  // If bank account
973  print '<tr class="liste_titre_add"><td class="titlefieldcreate">'.$langs->trans("BankName").'</td>';
974  print '<td><input size="30" type="text" class="flat" name="bank" value="'.$object->bank.'"></td>';
975  print '</tr>';
976 
977  // Show fields of bank account
978  foreach ($object->getFieldsToShow() as $val) {
979  if ($val == 'BankCode') {
980  $name = 'code_banque';
981  $size = 8;
982  $content = $object->code_banque;
983  } elseif ($val == 'DeskCode') {
984  $name = 'code_guichet';
985  $size = 8;
986  $content = $object->code_guichet;
987  } elseif ($val == 'BankAccountNumber') {
988  $name = 'number';
989  $size = 18;
990  $content = $object->number;
991  } elseif ($val == 'BankAccountNumberKey') {
992  $name = 'cle_rib';
993  $size = 3;
994  $content = $object->cle_rib;
995  }
996 
997  print '<tr><td>'.$langs->trans($val).'</td>';
998  print '<td><input size="'.$size.'" type="text" class="flat" name="'.$name.'" value="'.$content.'"></td>';
999  print '</tr>';
1000  }
1001 
1002  $ibankey = FormBank::getIBANLabel($object);
1003  $bickey = "BICNumber";
1004  if ($object->getCountryCode() == 'IN') $bickey = "SWIFT";
1005 
1006  // IBAN
1007  print '<tr><td>'.$langs->trans($ibankey).'</td>';
1008  print '<td><input class="minwidth300 maxwidth200onsmartphone" maxlength="34" type="text" class="flat" name="iban" value="'.$object->iban.'"></td></tr>';
1009 
1010  print '<tr><td>'.$langs->trans($bickey).'</td>';
1011  print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.$object->bic.'"></td></tr>';
1012 
1013  print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td>';
1014  print '<textarea class="flat quatrevingtpercent" name="domiciliation" rows="'.ROWS_2.'">';
1015  print $object->domiciliation;
1016  print "</textarea></td></tr>";
1017 
1018  print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';
1019  print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="proprio" value="'.$object->proprio.'"></td>';
1020  print '</tr>';
1021 
1022  print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td>';
1023  print '<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.'">';
1024  print $object->owner_address;
1025  print "</textarea></td></tr>";
1026 
1027  print '</table>';
1028  }
1029 
1031 
1032  print '<div class="center">';
1033  print '<input value="'.$langs->trans("Modify").'" type="submit" class="button">';
1034  print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
1035  print '<input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button button-cancel">';
1036  print '</div>';
1037 
1038  print '</form>';
1039  }
1040 }
1041 
1042 // End of page
1043 llxFooter();
1044 $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_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...
bank_prepare_head(Account $object)
Prepare array with list of tabs.
Definition: bank.lib.php:35
const TYPE_CURRENT
Current account.
checkSwiftForAccount($account)
Check SWIFT informations for a bank account.
Definition: bank.lib.php:251
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:108
Class to manage bank accounts.
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to build HTML component for third parties management Only common components are here...
dol_string_nospecial($str, $newstr= '_', $badcharstoreplace= '')
Clean a string from all punctuation characters to use it as a ref or login.
Class to manage standard extra fields.
static getIBANLabel(Account $account)
Returns the name of the Iban label.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage categories.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is &#39;...
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
if(!GETPOST('transkey', 'alphanohtml')&&!GETPOST('transphrase', 'alphanohtml')) else
View.
Definition: notice.php:44
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
Definition: index.php:89
checkIbanForAccount($account)
Check IBAN number informations for a bank account.
Definition: bank.lib.php:267
Class to manage generation of HTML components for accounting management.
newToken()
Return the value of token currently saved into session with name &#39;newtoken&#39;.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage a WYSIWYG editor.
const TYPE_SAVINGS
Savings account.
Class to manage accounting accounts.
Class to manage accounting accounts.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.
llxFooter()
Empty footer.
Definition: wrapper.php:59
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= '', $textfordropdown= '')
Show information for admin users or standard users.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:105
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.
Class to manage generation of HTML components for bank module.