33require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formbank.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
40if (isModEnabled(
'categorie')) {
41 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
43if (isModEnabled(
'accounting')) {
44 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
46if (isModEnabled(
'accounting')) {
47 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
49if (isModEnabled(
'accounting')) {
50 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
54$langs->loadLangs(array(
"banks",
"bills",
"categories",
"companies",
"compta",
"withdrawals"));
56$action =
GETPOST(
'action',
'aZ09');
57$cancel =
GETPOST(
'cancel',
'alpha');
58$backtopage =
GETPOST(
'backtopage',
'alpha');
59$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
65$extrafields->fetch_name_optionals_label($object->table_element);
68$hookmanager->initHooks(array(
'bankcard',
'globalcard'));
72$fieldid =
GETPOST(
"id",
'int') ?
'rowid' :
'ref';
76 $object->fetch(
GETPOST(
"id",
'int'));
79 $object->fetch(0,
GETPOST(
"ref"));
83$result =
restrictedArea($user,
'banque', $id,
'bank_account&bank_account',
'',
'', $fieldid);
90$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
91if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
94 $backurlforlist = DOL_URL_ROOT.
'/compta/bank/list.php';
96 if (empty($backtopage) || ($cancel && empty($id))) {
97 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
98 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
99 $backtopage = $backurlforlist;
101 $backtopage = DOL_URL_ROOT.
'/compta/bank/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
107 if (!empty($backtopageforcancel)) {
108 header(
"Location: ".$backtopageforcancel);
110 } elseif (!empty($backtopage)) {
111 header(
"Location: ".$backtopage);
117 if ($action ==
'add') {
126 $object->label = trim(
GETPOST(
"label",
'alphanohtml'));
127 $object->courant =
GETPOST(
"type");
128 $object->clos =
GETPOST(
"clos");
129 $object->rappro = (
GETPOST(
"norappro",
'alpha') ? 0 : 1);
130 $object->url = trim(
GETPOST(
"url",
'alpha'));
132 $object->bank = trim(
GETPOST(
"bank"));
133 $object->code_banque = trim(
GETPOST(
"code_banque"));
134 $object->code_guichet = trim(
GETPOST(
"code_guichet"));
135 $object->number = trim(
GETPOST(
"number"));
136 $object->cle_rib = trim(
GETPOST(
"cle_rib"));
137 $object->bic = trim(
GETPOST(
"bic"));
138 $object->iban = trim(
GETPOST(
"iban"));
139 $object->domiciliation = trim(
GETPOST(
"domiciliation",
"alphanohtml"));
140 $object->pti_in_ctti = empty(
GETPOST(
"pti_in_ctti")) ? 0 : 1;
142 $object->proprio = trim(
GETPOST(
"proprio",
'alphanohtml'));
143 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
144 $object->owner_zip = trim(
GETPOST(
"owner_zip",
'alphanohtml'));
145 $object->owner_town = trim(
GETPOST(
"owner_town",
'alphanohtml'));
146 $object->owner_country_id =
GETPOST(
"owner_country_id",
'int');
148 $object->ics = trim(
GETPOST(
"ics",
'alpha'));
149 $object->ics_transfer = trim(
GETPOST(
"ics_transfer",
'alpha'));
151 $account_number =
GETPOST(
'account_number',
'alphanohtml');
152 if (empty($account_number) || $account_number ==
'-1') {
153 $object->account_number =
'';
155 $object->account_number = $account_number;
157 $fk_accountancy_journal =
GETPOST(
'fk_accountancy_journal',
'int');
158 if ($fk_accountancy_journal <= 0) {
159 $object->fk_accountancy_journal =
'';
161 $object->fk_accountancy_journal = $fk_accountancy_journal;
168 $object->currency_code = trim(
GETPOST(
"account_currency_code"));
170 $object->state_id =
GETPOST(
"account_state_id",
'int');
171 $object->country_id =
GETPOST(
"account_country_id",
'int');
173 $object->min_allowed =
GETPOST(
"account_min_allowed",
'int');
174 $object->min_desired =
GETPOST(
"account_min_desired",
'int');
175 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
177 $object->fk_user_author = $user->id;
179 if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number)) {
180 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
184 if (empty($object->ref)) {
185 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
189 if (empty($object->label)) {
190 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
196 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
199 $id = $object->create($user);
202 $categories =
GETPOST(
'categories',
'array');
203 $object->setCategories($categories);
219 $urltogo = $backtopage ? str_replace(
'__ID__', $object->id, $backtopage) : $backurlforlist;
220 $urltogo = preg_replace(
'/--IDFORBACKTOPAGE--/', $object->id, $urltogo);
222 if (empty($noback)) {
223 header(
"Location: " . $urltogo);
231 if ($action ==
'update') {
236 $object->fetch(
GETPOST(
"id",
'int'));
238 $object->oldref = $object->ref;
240 $object->label = trim(
GETPOST(
"label",
'alphanohtml'));
241 $object->courant =
GETPOST(
"type");
242 $object->clos =
GETPOST(
"clos");
243 $object->rappro = (
GETPOST(
"norappro",
'alpha') ? 0 : 1);
244 $object->url = trim(
GETPOST(
"url",
'alpha'));
246 $object->bank = trim(
GETPOST(
"bank"));
247 $object->code_banque = trim(
GETPOST(
"code_banque"));
248 $object->code_guichet = trim(
GETPOST(
"code_guichet"));
249 $object->number = trim(
GETPOST(
"number"));
250 $object->cle_rib = trim(
GETPOST(
"cle_rib"));
251 $object->bic = trim(
GETPOST(
"bic"));
252 $object->iban = trim(
GETPOST(
"iban"));
253 $object->domiciliation = trim(
GETPOST(
"domiciliation",
"alphanohtml"));
254 $object->pti_in_ctti = empty(
GETPOST(
"pti_in_ctti")) ? 0 : 1;
256 $object->proprio = trim(
GETPOST(
"proprio",
'alphanohtml'));
257 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
258 $object->owner_zip = trim(
GETPOST(
"owner_zip",
'alphanohtml'));
259 $object->owner_town = trim(
GETPOST(
"owner_town",
'alphanohtml'));
260 $object->owner_country_id =
GETPOST(
"owner_country_id",
'int');
262 $object->ics = trim(
GETPOST(
"ics",
'alpha'));
263 $object->ics_transfer = trim(
GETPOST(
"ics_transfer",
'alpha'));
265 $account_number =
GETPOST(
'account_number',
'alphanohtml');
266 if (empty($account_number) || $account_number ==
'-1') {
267 $object->account_number =
'';
269 $object->account_number = $account_number;
271 $fk_accountancy_journal =
GETPOST(
'fk_accountancy_journal',
'int');
272 if ($fk_accountancy_journal <= 0) {
273 $object->fk_accountancy_journal =
'';
275 $object->fk_accountancy_journal = $fk_accountancy_journal;
278 $object->currency_code = trim(
GETPOST(
"account_currency_code"));
280 $object->state_id =
GETPOST(
"account_state_id",
'int');
281 $object->country_id =
GETPOST(
"account_country_id",
'int');
283 $object->min_allowed =
GETPOST(
"account_min_allowed",
'int');
284 $object->min_desired =
GETPOST(
"account_min_desired",
'int');
285 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
287 if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number)) {
288 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
292 if (empty($object->ref)) {
293 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
297 if (empty($object->label)) {
298 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
307 $ret = $extrafields->setOptionalsFromPost(
null, $object);
311 $result = $object->update($user);
314 $categories =
GETPOST(
'categories',
'array');
315 $object->setCategories($categories);
317 $_GET[
"id"] =
GETPOST(
"id",
'int');
332 if ($action ==
'confirm_delete' &&
GETPOST(
"confirm") ==
"yes" && $user->rights->banque->configurer) {
335 $object->fetch(
GETPOST(
"id",
"int"));
336 $result = $object->delete($user);
340 header(
"Location: " . DOL_URL_ROOT .
"/compta/bank/list.php");
354$form =
new Form($db);
357if (isModEnabled(
'accounting')) {
361$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
363$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas|DE:Modul_Banken_und_Barbestände';
364if ($action ==
'create') {
365 $title = $langs->trans(
"NewFinancialAccount");
366} elseif (!empty($object->ref)) {
367 $title = $object->ref.
" - ".$langs->trans(
"Card");
372if ($action ==
'create') {
373 print
load_fiche_titre($langs->trans(
"NewFinancialAccount"),
'',
'bank_account');
375 if ($conf->use_javascript_ajax) {
376 print
"\n".
'<script type="text/javascript">';
377 print
'jQuery(document).ready(function () {
378 jQuery("#type").change(function() {
379 document.formsoc.action.value="create";
380 document.formsoc.submit();
382 jQuery("#selectaccount_country_id").change(function() {
383 document.formsoc.action.value="create";
384 document.formsoc.submit();
387 print
'</script>'.
"\n";
390 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" name="formsoc" method="post">';
391 print
'<input type="hidden" name="token" value="'.newToken().
'">';
392 print
'<input type="hidden" name="action" value="add">';
393 print
'<input type="hidden" name="clos" value="0">';
394 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
398 print
'<table class="border centpercent tableforfieldcreate">';
401 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
402 print
'<td><input type="text" class="flat width100" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET(
'ref') ?
GETPOST(
"ref",
'alpha') : $object->
ref).
'" maxlength="12" autofocus></td></tr>';
405 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LabelBankCashAccount").
'</td>';
406 print
'<td><input type="text" class="flat maxwidth150onsmartphone" name="label" value="'.dol_escape_htmltag(
GETPOST(
'label',
'alpha')).
'"></td></tr>';
409 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
411 $formbank->selectTypeOfBankAccount(GETPOSTISSET(
"type") ?
GETPOST(
'type',
'int') :
Account::TYPE_CURRENT,
'type');
415 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency").
'</td>';
417 $selectedcode = $object->currency_code;
418 if (!$selectedcode) {
419 $selectedcode = $conf->currency;
421 print $form->selectCurrency((GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
427 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
429 print $form->selectarray(
"clos", $object->status, (
GETPOST(
'clos',
'int') !=
'' ?
GETPOST(
'clos',
'int') : $object->clos), 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth150onsmartphone');
434 if (GETPOSTISSET(
"account_country_id")) {
435 $selectedcode =
GETPOST(
"account_country_id") ?
GETPOST(
"account_country_id") : $object->country_code;
436 } elseif (empty($selectedcode)) {
437 $selectedcode = $mysoc->country_code;
439 $object->country_code =
getCountry($selectedcode, 2);
441 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccountCountry").
'</td>';
443 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
444 print $form->select_country($selectedcode,
'account_country_id');
446 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
451 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
453 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
454 print $formcompany->select_state(GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") :
'', $selectedcode,
'account_state_id');
456 print $countrynotdefined;
460 $type = (GETPOSTISSET(
"type") ?
GETPOST(
'type',
'int') :
Account::TYPE_CURRENT);
462 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
463 print
'<textarea class="flat quatrevingtpercent" name="domiciliation" rows="'.ROWS_2.
'">';
464 print (GETPOSTISSET(
'domiciliation') ?
GETPOST(
'domiciliation') : $object->domiciliation);
465 print
"</textarea></td></tr>";
469 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
471 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
472 print
'<input class="minwidth300 widthcentpercentminusx maxwidth500" type="text" class="flat" name="url" value="'.GETPOST(
"url").
'">';
476 if (isModEnabled(
'categorie')) {
477 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
478 $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT,
'',
'parent', 64, 0, 1);
480 $arrayselected = array();
482 $cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT);
483 if (is_array($cats)) {
484 foreach ($cats as $cat) {
485 $arrayselected[] = $cat->id;
488 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
493 print
'<tr><td>'.$langs->trans(
"Comment").
'</td>';
496 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
497 $doleditor =
new DolEditor(
'account_comment', (
GETPOST(
"account_comment") ?
GETPOST(
"account_comment") : $object->comment),
'', 90,
'dolibarr_notes',
'', false, true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_4,
'90%');
498 $doleditor->Create();
502 $parameters = array();
503 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
504 print $hookmanager->resPrint;
505 if (empty($reshook)) {
506 print $object->showOptionals($extrafields,
'create', $parameters);
513 print
'<table class="border centpercent">';
516 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"InitialBankBalance").
'</td>';
517 print
'<td><input size="12" type="text" class="flat" name="solde" value="'.(GETPOST(
"solde") ?
GETPOST(
"solde") :
price2num($object->solde)).
'"></td></tr>';
519 print
'<tr><td>'.$langs->trans(
"Date").
'</td>';
521 print $form->selectDate(
'',
're', 0, 0, 0,
'formsoc');
524 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
525 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>';
527 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
528 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>';
533 $type = (GETPOSTISSET(
"type") ?
GETPOST(
'type',
'int') :
Account::TYPE_CURRENT);
535 print
'<table class="border centpercent">';
538 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
539 print
'<td><input type="text" class="flat minwidth150" name="bank" value="'.(GETPOST(
'bank') ?
GETPOST(
'bank',
'alpha') : $object->bank).
'"></td>';
543 $bickey =
"BICNumber";
544 if ($object->getCountryCode() ==
'IN') {
549 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
550 print
'<td><input maxlength="34" type="text" class="flat minwidth300" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alpha') : $object->iban).
'"></td></tr>';
553 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
554 print
'<td><input maxlength="11" type="text" class="flat minwidth150" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alpha') : $object->bic).
'"></td></tr>';
558 foreach ($object->getFieldsToShow() as $val) {
560 if ($val ==
'BankCode') {
561 $name =
'code_banque';
562 $sizecss =
'minwidth100';
563 $content = $object->code_banque;
564 } elseif ($val ==
'DeskCode') {
565 $name =
'code_guichet';
566 $sizecss =
'minwidth100';
567 $content = $object->code_guichet;
568 } elseif ($val ==
'BankAccountNumber') {
570 $sizecss =
'minwidth200';
571 $content = $object->number;
572 } elseif ($val ==
'BankAccountNumberKey') {
574 $sizecss =
'minwidth50';
575 $content = $object->cle_rib;
578 print
'<td>'.$langs->trans($val).
'</td>';
579 print
'<td><input type="text" class="flat '.$sizecss.
'" name="'.$name.
'" value="'.(GETPOSTISSET($name) ?
GETPOST($name,
'alpha') : $content).
'"></td>';
583 if (isModEnabled(
'paymentbybanktransfer')) {
584 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
585 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. (empty(
GETPOST(
'pti_in_ctti')) ?
'' :
' checked ') .
'>';
591 print
'<table class="border centpercent">';
592 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankAccountOwner").
'</td>';
593 print
'<td><input type="text" class="flat minwidth300" name="proprio" value="'.(GETPOST(
'proprio') ?
GETPOST(
'proprio',
'alpha') : $object->proprio).
'">';
596 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
597 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
598 print (
GETPOST(
'owner_address') ?
GETPOST(
'owner_address',
'alpha') : $object->owner_address);
599 print
"</textarea></td></tr>";
601 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
602 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOST(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') : $object->owner_zip).
'">';
605 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
606 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOST(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') : $object->owner_town).
'">';
609 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
611 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
612 print $form->select_country(
GETPOST(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') : $object->owner_country_id,
'owner_country_id');
619 print
'<table class="border centpercent">';
622 if (!empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) {
623 $fieldrequired =
'fieldrequired ';
626 if (isModEnabled(
'accounting')) {
627 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
629 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
630 print $formaccounting->select_account($object->account_number,
'account_number', 1,
'', 1, 1);
631 if ($formaccounting->nbaccounts == 0) {
632 $langs->load(
"errors");
633 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
634 print $form->textwithpicto(
'', $htmltext);
638 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
639 print
'<td><input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
'account_number',
'alpha') : $object->account_number).
'"></td></tr>';
643 if (isModEnabled(
'accounting')) {
644 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
646 print $formaccounting->select_journal($object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
654 print $form->buttonsSaveCancel(
"CreateAccount");
659 if ((
GETPOST(
"id",
'int') ||
GETPOST(
"ref")) && $action !=
'edit') {
663 print
dol_get_fiche_head($head,
'bankname', $langs->trans(
"FinancialAccount"), -1,
'account', 0,
'',
'', 0,
'', 1);
668 if ($action ==
'delete') {
669 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
"DeleteAccount"), $langs->trans(
"ConfirmDeleteAccount"),
"confirm_delete");
675 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
678 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
681 print
'<div class="fichecenter">';
682 print
'<div class="fichehalfleft">';
683 print
'<div class="underbanner clearboth"></div>';
685 print
'<table class="border centpercent tableforfield">';
688 print
'<tr><td class="titlefield">'.$langs->trans(
"AccountType").
'</td>';
689 print
'<td>'.$object->type_lib[$object->type].
'</td></tr>';
692 print
'<tr><td>'.$langs->trans(
"Currency").
'</td>';
694 $selectedcode = $object->currency_code;
695 if (!$selectedcode) {
696 $selectedcode = $conf->currency;
698 print $langs->trans(
"Currency".$selectedcode);
702 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
704 $conciliate = $object->canBeConciliated();
705 if ($conciliate == -2) {
706 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"CashAccount").
')</span>';
707 } elseif ($conciliate == -3) {
708 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"Closed").
')</span>';
710 print ($object->rappro == 1 ? $langs->trans(
"Yes") : ($langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"ConciliationDisabled").
')</span>'));
714 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
715 print
'<td>'.$object->min_allowed.
'</td></tr>';
717 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
718 print
'<td>'.$object->min_desired.
'</td></tr>';
721 print
'<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans(
"AccountancyCode").
'</td>';
723 if (isModEnabled(
'accounting')) {
725 $accountingaccount->fetch(
'', $object->account_number, 1);
727 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
729 print $object->account_number;
734 if (isModEnabled(
'accounting')) {
735 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
738 if ($object->fk_accountancy_journal > 0) {
740 $accountingjournal->fetch($object->fk_accountancy_journal);
742 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
749 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
754 print
'<div class="fichehalfright">';
755 print
'<div class="underbanner clearboth"></div>';
757 print
'<table class="border tableforfield centpercent">';
760 if (isModEnabled(
'categorie')) {
761 print
'<tr><td class="titlefield">'.$langs->trans(
"Categories").
'</td><td>';
762 print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1);
766 print
'<tr><td class="tdtop titlefield">'.$langs->trans(
"Comment").
'</td>';
767 print
'<td>'.dol_htmlentitiesbr($object->comment).
'</td></tr>';
772 print
'<table class="border tableforfield centpercent">';
774 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"BankName").
'</td>';
775 print
'<td>'.$object->bank.
'</td></tr>';
778 $bickey =
"BICNumber";
779 if ($object->getCountryCode() ==
'IN') {
784 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
785 print
'<td>'.getIbanHumanReadable($object).
' ';
786 if (!empty($object->iban)) {
788 print
img_picto($langs->trans(
"IbanNotValid"),
'warning');
790 print
img_picto($langs->trans(
"IbanValid"),
'info');
796 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
797 print
'<td>'.$object->bic.
' ';
798 if (!empty($object->bic)) {
800 print
img_picto($langs->trans(
"SwiftNotValid"),
'warning');
802 print
img_picto($langs->trans(
"SwiftValid"),
'info');
810 foreach ($object->getFieldsToShow() as $val) {
812 if ($val ==
'BankCode') {
813 $content = $object->code_banque;
814 } elseif ($val ==
'DeskCode') {
815 $content = $object->code_guichet;
816 } elseif ($val ==
'BankAccountNumber') {
817 $content = $object->number;
818 } elseif ($val ==
'BankAccountNumberKey') {
819 $content = $object->cle_rib;
822 print
'<tr><td>'.$langs->trans($val).
'</td>';
823 print
'<td>'.$content.
'</td>';
827 if (isModEnabled(
'prelevement')) {
828 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
829 print
'<td>'.$object->ics.
'</td>';
834 if (isModEnabled(
'paymentbybanktransfer')) {
835 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
836 print
'<td>'.$object->ics_transfer.
'</td>';
839 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td><td>';
840 print (empty($object->pti_in_ctti) ? $langs->trans(
"No") : $langs->trans(
"Yes"));
841 print
"</td></tr>\n";
844 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td><td>';
845 print $object->proprio;
846 print
"</td></tr>\n";
848 print
'<tr><td>'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
849 print nl2br($object->owner_address);
850 print
"</td></tr>\n";
852 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
853 print
'<td>'.$object->owner_zip;
856 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
857 print
'<td>'.$object->owner_town;
860 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
862 $object->owner_country_code =
dol_getIdFromCode($db, $object->owner_country_id,
'c_country',
'rowid',
'code');
863 $langs->load(
"dict");
864 print (empty($object->owner_country_code) ?
'' : $langs->convToOutputCharset($langs->transnoentitiesnoconv(
"Country".$object->owner_country_code)));
874 print
'<div class="clearboth"></div>';
881 print
'<div class="tabsAction">';
883 if ($user->rights->banque->configurer) {
884 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'&id='.$object->id.
'">'.$langs->trans(
"Modify").
'</a>';
887 $canbedeleted = $object->can_be_deleted();
888 if ($user->rights->banque->configurer && $canbedeleted) {
889 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&id='.$object->id.
'">'.$langs->trans(
"Delete").
'</a>';
901 if (
GETPOST(
'id',
'int') && $action ==
'edit' && $user->rights->banque->configurer) {
902 print
load_fiche_titre($langs->trans(
"EditFinancialAccount"),
'',
'bank_account');
904 if ($conf->use_javascript_ajax) {
905 print
"\n".
'<script type="text/javascript">';
906 print
'jQuery(document).ready(function () {
907 jQuery("#type").change(function() {
908 document.formsoc.action.value="edit";
909 document.formsoc.submit();
913 print
'jQuery(document).ready(function () {
914 jQuery("#selectaccount_country_id").change(function() {
915 document.formsoc.action.value="edit";
916 document.formsoc.submit();
919 print
'</script>'.
"\n";
922 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'" method="post" name="formsoc">';
923 print
'<input type="hidden" name="token" value="'.newToken().
'">';
924 print
'<input type="hidden" name="action" value="update">';
925 print
'<input type="hidden" name="id" value="'.GETPOST(
"id",
'int').
'">'.
"\n\n";
926 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
932 print
'<table class="border centpercent tableforfieldcreate">';
935 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
936 print
'<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET(
'ref') ?
GETPOST(
'ref',
'alpha') : $object->
ref).
'"></td></tr>';
939 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
940 print
'<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(GETPOSTISSET(
'label') ?
GETPOST(
'label',
'alpha') : $object->label).
'"></td></tr>';
943 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
944 print
'<td class="maxwidth200onsmartphone">';
945 $formbank->selectTypeOfBankAccount((GETPOSTISSET(
'type') ?
GETPOST(
'type',
'int') : $object->
type),
'type');
949 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency");
950 print
'<input type="hidden" value="'.$object->currency_code.
'">';
952 print
'<td class="maxwidth200onsmartphone">';
953 $selectedcode = $object->currency_code;
954 if (!$selectedcode) {
955 $selectedcode = $conf->currency;
957 print
img_picto(
'',
'multicurrency',
'class="pictofixedwidth"');
958 print $form->selectCurrency((GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
964 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
965 print
'<td class="maxwidth200onsmartphone">';
966 print $form->selectarray(
"clos", $object->status, (GETPOSTISSET(
"clos") ?
GETPOST(
"clos",
"int") : $object->clos));
970 $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
971 $selectedcode = $object->country_code;
972 if (GETPOSTISSET(
"account_country_id")) {
973 $selectedcode =
GETPOST(
"account_country_id");
974 } elseif (empty($selectedcode)) {
975 $selectedcode = $mysoc->country_code;
977 $object->country_code =
getCountry($selectedcode, 2);
979 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Country").
'</td>';
980 print
'<td class="maxwidth200onsmartphone">';
981 print
img_picto(
'',
'country',
'class="pictofixedwidth"').$form->select_country($selectedcode,
'account_country_id');
983 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
988 print
'<tr><td>'.$langs->trans(
'State').
'</td><td class="maxwidth200onsmartphone">';
990 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
991 print $formcompany->select_state(GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") : $object->state_id, $selectedcode,
'account_state_id');
993 print $countrynotdefined;
997 $type = (GETPOSTISSET(
'type') ?
GETPOST(
'type',
'int') : $object->
type);
999 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
1000 print
'<textarea class="flat quatrevingtpercent" name="domiciliation" rows="'.ROWS_2.
'">';
1001 print $object->domiciliation;
1002 print
"</textarea></td></tr>";
1006 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
1008 $conciliate = $object->canBeConciliated();
1009 if ($conciliate == -2) {
1010 print $langs->trans(
"No").
' ('.$langs->trans(
"CashAccount").
')';
1011 } elseif ($conciliate == -3) {
1012 print $langs->trans(
"No").
' ('.$langs->trans(
"Closed").
')';
1014 print
'<input type="checkbox" class="flat" id="norappro" name="norappro"'.(($conciliate > 0) ?
'' :
' checked="checked"').
'"> <label for="norappro" class="opacitymedium">'.$langs->trans(
"DisableConciliation").
'</label>';
1019 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
1020 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>';
1022 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
1023 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>';
1026 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
1028 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
1029 print
'<input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET(
"url") ?
GETPOST(
"url") : $object->url).
'">';
1033 if (isModEnabled(
'categorie')) {
1034 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1035 $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT,
'',
'parent', 64, 0, 1);
1037 $arrayselected = array();
1039 $cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT);
1040 if (is_array($cats)) {
1041 foreach ($cats as $cat) {
1042 $arrayselected[] = $cat->id;
1045 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1050 print
'<tr><td class="tdtop">'.$langs->trans(
"Comment").
'</td>';
1053 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1054 $doleditor =
new DolEditor(
'account_comment', (
GETPOST(
"account_comment") ?
GETPOST(
"account_comment") : $object->comment),
'', 90,
'dolibarr_notes',
'', false, true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_4,
'95%');
1055 $doleditor->Create();
1059 $parameters = array();
1060 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
1061 print $hookmanager->resPrint;
1062 if (empty($reshook)) {
1063 print $object->showOptionals($extrafields,
'edit', $parameters);
1072 print
'<table class="border centpercent">';
1075 $tdextra =
' class="titlefieldcreate"';
1077 if (!empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) {
1078 $tdextra =
' class="fieldrequired titlefieldcreate"';
1081 print
'<tr><td'.$tdextra.
'>'.$langs->trans(
"AccountancyCode").
'</td>';
1083 if (isModEnabled(
'accounting')) {
1084 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
1085 print $formaccounting->select_account($object->account_number,
'account_number', 1,
'', 1, 1);
1086 if ($formaccounting->nbaccounts == 0) {
1087 $langs->load(
"errors");
1088 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
1089 print $form->textwithpicto(
'', $htmltext);
1092 print
'<input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
"account_number") : $object->account_number).
'">';
1097 if (isModEnabled(
'accounting')) {
1098 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountancyJournal").
'</td>';
1100 print $formaccounting->select_journal($object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
1106 $type = (GETPOSTISSET(
'type') ?
GETPOST(
'type',
'int') : $object->
type);
1110 print
'<table class="border centpercent">';
1113 print
'<tr class="liste_titre_add"><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
1114 print
'<td><input type="text" class="flat width300" name="bank" value="'.$object->bank.
'"></td>';
1118 $bickey =
"BICNumber";
1119 if ($object->getCountryCode() ==
'IN') {
1125 $tooltip = $langs->trans(
"Example").
':<br>CH93 0076 2011 6238 5295 7<br>LT12 1000 0111 0100 1000<br>FR14 2004 1010 0505 0001 3M02 606<br>LU28 0019 4006 4475 0000<br>DE89 3704 0044 0532 0130 00';
1126 print $form->textwithpicto($langs->trans($ibankey), $tooltip);
1128 print
'<td><input class="minwidth300 maxwidth200onsmartphone" maxlength="34" type="text" class="flat" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alphanohtml') : $object->iban).
'"></td></tr>';
1132 $tooltip = $langs->trans(
"Example").
': LIABLT2XXXX';
1133 print $form->textwithpicto($langs->trans($bickey), $tooltip);
1135 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alphanohtml') : $object->bic).
'"></td></tr>';
1138 foreach ($object->getFieldsToShow() as $val) {
1140 if ($val ==
'BankCode') {
1141 $name =
'code_banque';
1143 $content = $object->code_banque;
1144 } elseif ($val ==
'DeskCode') {
1145 $name =
'code_guichet';
1147 $content = $object->code_guichet;
1148 } elseif ($val ==
'BankAccountNumber') {
1151 $content = $object->number;
1152 } elseif ($val ==
'BankAccountNumberKey') {
1155 $content = $object->cle_rib;
1158 print
'<tr><td>'.$langs->trans($val).
'</td>';
1159 print
'<td><input type="text" class="flat '.$css.
'" name="'.$name.
'" value="'.
dol_escape_htmltag($content).
'"></td>';
1163 if (isModEnabled(
'prelevement')) {
1164 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
1165 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET(
'ics') ?
GETPOST(
'ics',
'alphanohtml') : $object->ics).
'"></td></tr>';
1168 if (isModEnabled(
'paymentbybanktransfer')) {
1169 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
1170 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics_transfer" value="'.(GETPOSTISSET(
'ics_transfer') ?
GETPOST(
'ics_transfer',
'alphanohtml') : $object->ics_transfer).
'"></td></tr>';
1172 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
1173 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. ($object->pti_in_ctti ?
' checked ' :
'') .
'>';
1177 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td>';
1178 print
'<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="proprio" value="'.$object->proprio.
'"></td>';
1184 print
'<table class="border centpercent">';
1186 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
1187 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
1188 print $object->owner_address;
1189 print
"</textarea></td></tr>";
1191 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
1192 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOST(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') : $object->owner_zip).
'">';
1195 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
1196 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOST(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') : $object->owner_town).
'">';
1199 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
1201 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1202 print $form->select_country(
GETPOST(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') : $object->owner_country_id,
'owner_country_id');
1210 print $form->buttonsSaveCancel(
"Modify");
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
checkIbanForAccount(Account $account)
Check IBAN number informations for a bank account.
checkSwiftForAccount($account)
Check SWIFT informations for a bank account.
bank_prepare_head(Account $object)
Prepare array with list of tabs.
Class to manage bank accounts.
const TYPE_SAVINGS
Savings account.
const TYPE_CURRENT
Current account.
Class to manage accounting accounts.
Class to manage accounting accounts.
Class to manage categories.
Class to manage a WYSIWYG editor.
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
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.
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...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_string_nospecial($str, $newstr='_', $badcharstoreplace='', $badcharstoremove='', $keepspaces=0)
Clean a string from all punctuation characters to use it as a ref or login.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.