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);
96 $backurlforlist = DOL_URL_ROOT.
'/compta/bank/list.php';
98 if (empty($backtopage) || ($cancel && empty($id))) {
99 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
100 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
101 $backtopage = $backurlforlist;
103 $backtopage = DOL_URL_ROOT.
'/compta/bank/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
109 if (!empty($backtopageforcancel)) {
110 header(
"Location: ".$backtopageforcancel);
112 } elseif (!empty($backtopage)) {
113 header(
"Location: ".$backtopage);
119 if ($action ==
'add') {
128 $object->label = trim(
GETPOST(
"label",
'alphanohtml'));
129 $object->courant =
GETPOST(
"type");
130 $object->clos =
GETPOST(
"clos");
131 $object->rappro = (
GETPOST(
"norappro",
'alpha') ? 0 : 1);
132 $object->url = trim(
GETPOST(
"url",
'alpha'));
134 $object->bank = trim(
GETPOST(
"bank"));
135 $object->code_banque = trim(
GETPOST(
"code_banque"));
136 $object->code_guichet = trim(
GETPOST(
"code_guichet"));
137 $object->number = trim(
GETPOST(
"number"));
138 $object->cle_rib = trim(
GETPOST(
"cle_rib"));
139 $object->bic = trim(
GETPOST(
"bic"));
140 $object->iban = trim(
GETPOST(
"iban"));
141 $object->pti_in_ctti = empty(
GETPOST(
"pti_in_ctti")) ? 0 : 1;
143 $object->proprio = trim(
GETPOST(
"proprio",
'alphanohtml'));
144 $object->address = trim(
GETPOST(
"account_address",
"alphanohtml"));
145 $object->domiciliation = $object->address;
146 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
147 $object->owner_zip = trim(
GETPOST(
"owner_zip",
'alphanohtml'));
148 $object->owner_town = trim(
GETPOST(
"owner_town",
'alphanohtml'));
149 $object->owner_country_id =
GETPOST(
"owner_country_id",
'int');
151 $object->ics = trim(
GETPOST(
"ics",
'alpha'));
152 $object->ics_transfer = trim(
GETPOST(
"ics_transfer",
'alpha'));
154 $account_number =
GETPOST(
'account_number',
'alphanohtml');
155 if (empty($account_number) || $account_number ==
'-1') {
156 $object->account_number =
'';
158 $object->account_number = $account_number;
160 $fk_accountancy_journal =
GETPOST(
'fk_accountancy_journal',
'int');
161 if ($fk_accountancy_journal <= 0) {
162 $object->fk_accountancy_journal =
'';
164 $object->fk_accountancy_journal = $fk_accountancy_journal;
171 $object->currency_code = trim(
GETPOST(
"account_currency_code"));
173 $object->state_id =
GETPOST(
"account_state_id",
'int');
174 $object->country_id =
GETPOST(
"account_country_id",
'int');
176 $object->min_allowed =
GETPOST(
"account_min_allowed",
'int');
177 $object->min_desired =
GETPOST(
"account_min_desired",
'int');
178 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
180 $object->fk_user_author = $user->id;
182 if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number)) {
183 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
187 if (empty($object->ref)) {
188 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
192 if (empty($object->label)) {
193 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
199 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
202 $id = $object->create($user);
205 $categories =
GETPOST(
'categories',
'array');
206 $object->setCategories($categories);
222 $urltogo = $backtopage ? str_replace(
'__ID__', $object->id, $backtopage) : $backurlforlist;
223 $urltogo = preg_replace(
'/--IDFORBACKTOPAGE--/', $object->id, $urltogo);
225 if (empty($noback)) {
226 header(
"Location: " . $urltogo);
234 if ($action ==
'update') {
239 $object->fetch(
GETPOST(
"id",
'int'));
241 $object->oldref = $object->ref;
243 $object->label = trim(
GETPOST(
"label",
'alphanohtml'));
244 $object->courant =
GETPOST(
"type");
245 $object->clos =
GETPOST(
"clos");
246 $object->rappro = (
GETPOST(
"norappro",
'alpha') ? 0 : 1);
247 $object->url = trim(
GETPOST(
"url",
'alpha'));
249 $object->bank = trim(
GETPOST(
"bank"));
250 $object->code_banque = trim(
GETPOST(
"code_banque"));
251 $object->code_guichet = trim(
GETPOST(
"code_guichet"));
252 $object->number = trim(
GETPOST(
"number"));
253 $object->cle_rib = trim(
GETPOST(
"cle_rib"));
254 $object->bic = trim(
GETPOST(
"bic"));
255 $object->iban = trim(
GETPOST(
"iban"));
256 $object->pti_in_ctti = empty(
GETPOST(
"pti_in_ctti")) ? 0 : 1;
258 $object->proprio = trim(
GETPOST(
"proprio",
'alphanohtml'));
259 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
260 $object->owner_zip = trim(
GETPOST(
"owner_zip",
'alphanohtml'));
261 $object->owner_town = trim(
GETPOST(
"owner_town",
'alphanohtml'));
262 $object->owner_country_id =
GETPOST(
"owner_country_id",
'int');
264 $object->ics = trim(
GETPOST(
"ics",
'alpha'));
265 $object->ics_transfer = trim(
GETPOST(
"ics_transfer",
'alpha'));
267 $account_number =
GETPOST(
'account_number',
'alphanohtml');
268 if (empty($account_number) || $account_number ==
'-1') {
269 $object->account_number =
'';
271 $object->account_number = $account_number;
273 $fk_accountancy_journal =
GETPOST(
'fk_accountancy_journal',
'int');
274 if ($fk_accountancy_journal <= 0) {
275 $object->fk_accountancy_journal =
'';
277 $object->fk_accountancy_journal = $fk_accountancy_journal;
280 $object->currency_code = trim(
GETPOST(
"account_currency_code"));
282 $object->address = trim(
GETPOST(
"account_address",
"alphanohtml"));
283 $object->state_id =
GETPOSTINT(
"account_state_id");
284 $object->country_id =
GETPOSTINT(
"account_country_id");
286 $object->min_allowed =
GETPOST(
"account_min_allowed",
'int');
287 $object->min_desired =
GETPOST(
"account_min_desired",
'int');
288 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
290 if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number)) {
291 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
295 if (empty($object->ref)) {
296 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
300 if (empty($object->label)) {
301 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
310 $ret = $extrafields->setOptionalsFromPost(
null, $object);
314 $result = $object->update($user);
317 $categories =
GETPOST(
'categories',
'array');
318 $object->setCategories($categories);
320 $_GET[
"id"] =
GETPOST(
"id",
'int');
335 if ($action ==
'confirm_delete' &&
GETPOST(
"confirm") ==
"yes" && $user->hasRight(
'banque',
'configurer')) {
338 $object->fetch(
GETPOST(
"id",
"int"));
339 $result = $object->delete($user);
343 header(
"Location: " . DOL_URL_ROOT .
"/compta/bank/list.php");
357$form =
new Form($db);
360if (isModEnabled(
'accounting')) {
364$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
366$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas|DE:Modul_Banken_und_Barbestände';
367if ($action ==
'create') {
368 $title = $langs->trans(
"NewFinancialAccount");
369} elseif (!empty($object->ref)) {
370 $title = $object->ref.
" - ".$langs->trans(
"Card");
375if ($action ==
'create') {
376 print
load_fiche_titre($langs->trans(
"NewFinancialAccount"),
'',
'bank_account');
378 if ($conf->use_javascript_ajax) {
379 print
"\n".
'<script type="text/javascript">';
380 print
'jQuery(document).ready(function () {
381 jQuery("#type").change(function() {
382 document.formsoc.action.value="create";
383 document.formsoc.submit();
385 jQuery("#selectaccount_country_id").change(function() {
386 document.formsoc.action.value="create";
387 document.formsoc.submit();
390 print
'</script>'.
"\n";
393 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" name="formsoc" method="post">';
394 print
'<input type="hidden" name="token" value="'.newToken().
'">';
395 print
'<input type="hidden" name="action" value="add">';
396 print
'<input type="hidden" name="clos" value="0">';
397 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
401 print
'<table class="border centpercent tableforfieldcreate">';
404 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
405 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>';
408 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LabelBankCashAccount").
'</td>';
409 print
'<td><input type="text" class="flat maxwidth150onsmartphone" name="label" value="'.dol_escape_htmltag(
GETPOST(
'label',
'alpha')).
'"></td></tr>';
412 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
414 $formbank->selectTypeOfBankAccount(GETPOSTISSET(
"type") ?
GETPOST(
'type',
'int') :
Account::TYPE_CURRENT,
'type');
418 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency").
'</td>';
420 $selectedcode = $object->currency_code;
421 if (!$selectedcode) {
422 $selectedcode = $conf->currency;
424 print $form->selectCurrency((GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
430 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
432 print $form->selectarray(
"clos", $object->status, (
GETPOST(
'clos',
'int') !=
'' ?
GETPOST(
'clos',
'int') : $object->clos), 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth150onsmartphone');
437 if (GETPOSTISSET(
"account_country_id")) {
438 $selectedcode =
GETPOST(
"account_country_id") ?
GETPOST(
"account_country_id") : $object->country_code;
439 } elseif (empty($selectedcode)) {
440 $selectedcode = $mysoc->country_code;
442 $object->country_code =
getCountry($selectedcode, 2);
444 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccountCountry").
'</td>';
446 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
447 print $form->select_country($selectedcode,
'account_country_id');
449 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
454 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
456 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
457 print $formcompany->select_state(GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") :
'', $selectedcode,
'account_state_id');
459 print $countrynotdefined;
463 $type = (GETPOSTISSET(
"type") ?
GETPOST(
'type',
'int') :
Account::TYPE_CURRENT);
465 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
466 print
'<textarea class="flat quatrevingtpercent" name="account_address" rows="'.ROWS_2.
'">';
467 print(GETPOSTISSET(
'account_address') ?
GETPOST(
'account_address') : $object->address);
468 print
"</textarea></td></tr>";
472 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
474 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
475 print
'<input class="minwidth300 widthcentpercentminusx maxwidth500" type="text" class="flat" name="url" value="'.GETPOST(
"url").
'">';
479 if (isModEnabled(
'categorie')) {
480 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
481 $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT,
'',
'parent', 64, 0, 1);
483 $arrayselected = array();
485 $cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT);
486 if (is_array($cats)) {
487 foreach ($cats as $cat) {
488 $arrayselected[] = $cat->id;
491 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
496 print
'<tr><td>'.$langs->trans(
"Comment").
'</td>';
499 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
500 $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%');
501 $doleditor->Create();
505 $parameters = array();
506 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
507 print $hookmanager->resPrint;
508 if (empty($reshook)) {
509 print $object->showOptionals($extrafields,
'create', $parameters);
516 print
'<table class="border centpercent">';
519 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"InitialBankBalance").
'</td>';
520 print
'<td><input size="12" type="text" class="flat" name="solde" value="'.(GETPOST(
"solde") ?
GETPOST(
"solde") :
price2num($object->solde)).
'"></td></tr>';
522 print
'<tr><td>'.$langs->trans(
"Date").
'</td>';
524 print $form->selectDate(
'',
're', 0, 0, 0,
'formsoc');
527 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
528 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>';
530 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
531 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>';
536 $type = (GETPOSTISSET(
"type") ?
GETPOST(
'type',
'int') :
Account::TYPE_CURRENT);
538 print
'<table class="border centpercent">';
541 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
542 print
'<td><input type="text" class="flat minwidth150" name="bank" value="'.(GETPOST(
'bank') ?
GETPOST(
'bank',
'alpha') : $object->bank).
'"></td>';
546 $bickey =
"BICNumber";
547 if ($object->getCountryCode() ==
'IN') {
552 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
553 print
'<td><input maxlength="34" type="text" class="flat minwidth300" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alpha') : $object->iban).
'"></td></tr>';
556 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
557 print
'<td><input maxlength="11" type="text" class="flat minwidth150" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alpha') : $object->bic).
'"></td></tr>';
561 foreach ($object->getFieldsToShow() as $val) {
563 if ($val ==
'BankCode') {
564 $name =
'code_banque';
565 $sizecss =
'minwidth100';
566 $content = $object->code_banque;
567 } elseif ($val ==
'DeskCode') {
568 $name =
'code_guichet';
569 $sizecss =
'minwidth100';
570 $content = $object->code_guichet;
571 } elseif ($val ==
'BankAccountNumber') {
573 $sizecss =
'minwidth200';
574 $content = $object->number;
575 } elseif ($val ==
'BankAccountNumberKey') {
577 $sizecss =
'minwidth50';
578 $content = $object->cle_rib;
581 print
'<td>'.$langs->trans($val).
'</td>';
582 print
'<td><input type="text" class="flat '.$sizecss.
'" name="'.$name.
'" value="'.(GETPOSTISSET($name) ?
GETPOST($name,
'alpha') : $content).
'"></td>';
586 if (isModEnabled(
'paymentbybanktransfer')) {
587 if ($mysoc->isInEEC()) {
588 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
589 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. (empty(
GETPOST(
'pti_in_ctti')) ?
'' :
' checked ') .
'>';
596 print
'<table class="border centpercent">';
597 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankAccountOwner").
'</td>';
598 print
'<td><input type="text" class="flat minwidth300" name="proprio" value="'.(GETPOST(
'proprio') ?
GETPOST(
'proprio',
'alpha') : $object->proprio).
'">';
601 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
602 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
603 print(
GETPOST(
'owner_address') ?
GETPOST(
'owner_address',
'alpha') : $object->owner_address);
604 print
"</textarea></td></tr>";
606 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
607 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOST(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') : $object->owner_zip).
'">';
610 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
611 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOST(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') : $object->owner_town).
'">';
614 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
616 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
617 print $form->select_country(
GETPOST(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') : $object->owner_country_id,
'owner_country_id');
624 print
'<table class="border centpercent">';
628 $fieldrequired =
'fieldrequired ';
631 if (isModEnabled(
'accounting')) {
632 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
634 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
635 print $formaccounting->select_account($object->account_number,
'account_number', 1,
'', 1, 1);
636 if ($formaccounting->nbaccounts == 0) {
637 $langs->load(
"errors");
638 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
639 print $form->textwithpicto(
'', $htmltext);
643 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
644 print
'<td><input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
'account_number',
'alpha') : $object->account_number).
'"></td></tr>';
648 if (isModEnabled(
'accounting')) {
649 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
651 print $formaccounting->select_journal($object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
659 print $form->buttonsSaveCancel(
"CreateAccount");
664 if ((
GETPOST(
"id",
'int') ||
GETPOST(
"ref")) && $action !=
'edit') {
668 print
dol_get_fiche_head($head,
'bankname', $langs->trans(
"FinancialAccount"), -1,
'account', 0,
'',
'', 0,
'', 1);
673 if ($action ==
'delete') {
674 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
"DeleteAccount"), $langs->trans(
"ConfirmDeleteAccount"),
"confirm_delete");
680 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
683 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
685 print
'<div class="fichecenter">';
686 print
'<div class="fichehalfleft">';
687 print
'<div class="underbanner clearboth"></div>';
689 print
'<table class="border centpercent tableforfield">';
692 print
'<tr><td class="titlefield">'.$langs->trans(
"AccountType").
'</td>';
693 print
'<td>'.$object->type_lib[$object->type].
'</td></tr>';
696 print
'<tr><td>'.$langs->trans(
"Currency").
'</td>';
698 $selectedcode = $object->currency_code;
699 if (!$selectedcode) {
700 $selectedcode = $conf->currency;
702 print $langs->trans(
"Currency".$selectedcode);
706 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
708 $conciliate = $object->canBeConciliated();
709 if ($conciliate == -2) {
710 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"CashAccount").
')</span>';
711 } elseif ($conciliate == -3) {
712 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"Closed").
')</span>';
714 print($object->rappro == 1 ? $langs->trans(
"Yes") : ($langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"ConciliationDisabled").
')</span>'));
718 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
719 print
'<td>'.$object->min_allowed.
'</td></tr>';
721 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
722 print
'<td>'.$object->min_desired.
'</td></tr>';
725 print
'<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans(
"AccountancyCode").
'</td>';
727 if (isModEnabled(
'accounting')) {
729 $accountingaccount->fetch(
'', $object->account_number, 1);
731 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
733 print $object->account_number;
738 if (isModEnabled(
'accounting')) {
739 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
742 if ($object->fk_accountancy_journal > 0) {
744 $accountingjournal->fetch($object->fk_accountancy_journal);
746 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
753 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
758 print
'<div class="fichehalfright">';
759 print
'<div class="underbanner clearboth"></div>';
761 print
'<table class="border tableforfield centpercent">';
764 if (isModEnabled(
'categorie')) {
765 print
'<tr><td class="titlefield">'.$langs->trans(
"Categories").
'</td><td>';
766 print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1);
770 print
'<tr><td class="tdtop titlefield">'.$langs->trans(
"Comment").
'</td>';
771 print
'<td>'.dol_htmlentitiesbr($object->comment).
'</td></tr>';
776 print
'<table class="border tableforfield centpercent">';
778 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"BankName").
'</td>';
779 print
'<td>'.$object->bank.
'</td></tr>';
782 $bickey =
"BICNumber";
783 if ($object->getCountryCode() ==
'IN') {
788 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
789 print
'<td>'.getIbanHumanReadable($object).
' ';
790 if (!empty($object->iban)) {
792 print
img_picto($langs->trans(
"IbanNotValid"),
'warning');
794 print
img_picto($langs->trans(
"IbanValid"),
'info');
800 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
801 print
'<td>'.$object->bic.
' ';
802 if (!empty($object->bic)) {
804 print
img_picto($langs->trans(
"SwiftNotValid"),
'warning');
806 print
img_picto($langs->trans(
"SwiftValid"),
'info');
814 foreach ($object->getFieldsToShow() as $val) {
816 if ($val ==
'BankCode') {
817 $content = $object->code_banque;
818 } elseif ($val ==
'DeskCode') {
819 $content = $object->code_guichet;
820 } elseif ($val ==
'BankAccountNumber') {
821 $content = $object->number;
822 } elseif ($val ==
'BankAccountNumberKey') {
823 $content = $object->cle_rib;
826 print
'<tr><td>'.$langs->trans($val).
'</td>';
827 print
'<td>'.$content.
'</td>';
831 if (isModEnabled(
'prelevement')) {
832 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
833 print
'<td>'.$object->ics.
'</td>';
837 if (isModEnabled(
'paymentbybanktransfer')) {
839 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
840 print
'<td>'.$object->ics_transfer.
'</td>';
843 if ($mysoc->isInEEC()) {
844 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td><td>';
845 print(empty($object->pti_in_ctti) ? $langs->trans(
"No") : $langs->trans(
"Yes"));
846 print
"</td></tr>\n";
850 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td><td>';
852 print
"</td></tr>\n";
854 print
'<tr><td>'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
855 print nl2br($object->owner_address);
856 print
"</td></tr>\n";
858 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
859 print
'<td>'.dol_escape_htmltag($object->owner_zip);
862 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
863 print
'<td>'.dol_escape_htmltag($object->owner_town);
866 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
868 $object->owner_country_code =
dol_getIdFromCode($db, $object->owner_country_id,
'c_country',
'rowid',
'code');
869 $langs->load(
"dict");
870 print(empty($object->owner_country_code) ?
'' : $langs->convToOutputCharset($langs->transnoentitiesnoconv(
"Country".$object->owner_country_code)));
880 print
'<div class="clearboth"></div>';
887 print
'<div class="tabsAction">';
889 if ($user->hasRight(
'banque',
'configurer')) {
890 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'&id='.$object->id.
'">'.$langs->trans(
"Modify").
'</a>';
893 $canbedeleted = $object->can_be_deleted();
894 if ($user->hasRight(
'banque',
'configurer') && $canbedeleted) {
895 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&id='.$object->id.
'">'.$langs->trans(
"Delete").
'</a>';
907 if (
GETPOST(
'id',
'int') && $action ==
'edit' && $user->hasRight(
'banque',
'configurer')) {
908 print
load_fiche_titre($langs->trans(
"EditFinancialAccount"),
'',
'bank_account');
910 if ($conf->use_javascript_ajax) {
911 print
"\n".
'<script type="text/javascript">';
912 print
'jQuery(document).ready(function () {
913 jQuery("#type").change(function() {
914 document.formsoc.action.value="edit";
915 document.formsoc.submit();
919 print
'jQuery(document).ready(function () {
920 jQuery("#selectaccount_country_id").change(function() {
921 document.formsoc.action.value="edit";
922 document.formsoc.submit();
925 print
'</script>'.
"\n";
928 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'" method="post" name="formsoc">';
929 print
'<input type="hidden" name="token" value="'.newToken().
'">';
930 print
'<input type="hidden" name="action" value="update">';
931 print
'<input type="hidden" name="id" value="'.GETPOST(
"id",
'int').
'">'.
"\n\n";
932 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
938 print
'<table class="border centpercent tableforfieldcreate">';
941 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
942 print
'<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET(
'ref') ?
GETPOST(
'ref',
'alpha') : $object->
ref).
'"></td></tr>';
945 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
946 print
'<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(GETPOSTISSET(
'label') ?
GETPOST(
'label',
'alpha') : $object->label).
'"></td></tr>';
949 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
950 print
'<td class="maxwidth200onsmartphone">';
951 $formbank->selectTypeOfBankAccount((GETPOSTISSET(
'type') ?
GETPOST(
'type',
'int') : $object->
type),
'type');
955 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency");
956 print
'<input type="hidden" value="'.$object->currency_code.
'">';
958 print
'<td class="maxwidth200onsmartphone">';
959 $selectedcode = $object->currency_code;
960 if (!$selectedcode) {
961 $selectedcode = $conf->currency;
963 print
img_picto(
'',
'multicurrency',
'class="pictofixedwidth"');
964 print $form->selectCurrency((GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
970 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
971 print
'<td class="maxwidth200onsmartphone">';
972 print $form->selectarray(
"clos", $object->status, (GETPOSTISSET(
"clos") ?
GETPOST(
"clos",
"int") : $object->clos));
976 $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
977 $selectedcode = $object->country_code;
978 if (GETPOSTISSET(
"account_country_id")) {
979 $selectedcode =
GETPOST(
"account_country_id");
980 } elseif (empty($selectedcode)) {
981 $selectedcode = $mysoc->country_code;
983 $object->country_code =
getCountry($selectedcode, 2);
985 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Country").
'</td>';
986 print
'<td class="maxwidth200onsmartphone">';
987 print
img_picto(
'',
'country',
'class="pictofixedwidth"').$form->select_country($selectedcode,
'account_country_id');
989 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
994 print
'<tr><td>'.$langs->trans(
'State').
'</td><td class="maxwidth200onsmartphone">';
996 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
997 print $formcompany->select_state(GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") : $object->state_id, $selectedcode,
'account_state_id');
999 print $countrynotdefined;
1003 $type = (GETPOSTISSET(
'type') ?
GETPOST(
'type',
'int') : $object->
type);
1005 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
1006 print
'<textarea class="flat quatrevingtpercent" name="account_address" rows="'.ROWS_2.
'">';
1007 print $object->address;
1008 print
"</textarea></td></tr>";
1012 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
1014 $conciliate = $object->canBeConciliated();
1015 if ($conciliate == -2) {
1016 print $langs->trans(
"No").
' ('.$langs->trans(
"CashAccount").
')';
1017 } elseif ($conciliate == -3) {
1018 print $langs->trans(
"No").
' ('.$langs->trans(
"Closed").
')';
1020 print
'<input type="checkbox" class="flat" id="norappro" name="norappro"'.(($conciliate > 0) ?
'' :
' checked="checked"').
'"> <label for="norappro" class="opacitymedium">'.$langs->trans(
"DisableConciliation").
'</label>';
1025 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
1026 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>';
1028 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
1029 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>';
1032 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
1034 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
1035 print
'<input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET(
"url") ?
GETPOST(
"url") : $object->url).
'">';
1039 if (isModEnabled(
'categorie')) {
1040 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1041 $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT,
'',
'parent', 64, 0, 1);
1043 $arrayselected = array();
1045 $cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT);
1046 if (is_array($cats)) {
1047 foreach ($cats as $cat) {
1048 $arrayselected[] = $cat->id;
1051 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1056 print
'<tr><td class="tdtop">'.$langs->trans(
"Comment").
'</td>';
1059 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1060 $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%');
1061 $doleditor->Create();
1065 $parameters = array();
1066 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
1067 print $hookmanager->resPrint;
1068 if (empty($reshook)) {
1069 print $object->showOptionals($extrafields,
'edit', $parameters);
1078 print
'<table class="border centpercent">';
1081 $tdextra =
' class="titlefieldcreate"';
1084 $tdextra =
' class="fieldrequired titlefieldcreate"';
1087 print
'<tr><td'.$tdextra.
'>'.$langs->trans(
"AccountancyCode").
'</td>';
1089 if (isModEnabled(
'accounting')) {
1090 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
1091 print $formaccounting->select_account($object->account_number,
'account_number', 1,
'', 1, 1);
1092 if ($formaccounting->nbaccounts == 0) {
1093 $langs->load(
"errors");
1094 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
1095 print $form->textwithpicto(
'', $htmltext);
1098 print
'<input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
"account_number") : $object->account_number).
'">';
1103 if (isModEnabled(
'accounting')) {
1104 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountancyJournal").
'</td>';
1106 print $formaccounting->select_journal($object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
1112 $type = (GETPOSTISSET(
'type') ?
GETPOST(
'type',
'int') : $object->
type);
1116 print
'<table class="border centpercent">';
1119 print
'<tr class="liste_titre_add"><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
1120 print
'<td><input type="text" class="flat width300" name="bank" value="'.$object->bank.
'"></td>';
1124 $bickey =
"BICNumber";
1125 if ($object->getCountryCode() ==
'IN') {
1131 $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';
1132 print $form->textwithpicto($langs->trans($ibankey), $tooltip, 1,
'help',
'', 0, 3,
'iban');
1134 print
'<td><input class="minwidth300 maxwidth200onsmartphone" maxlength="34" type="text" class="flat" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alphanohtml') : $object->iban).
'"></td></tr>';
1138 $tooltip = $langs->trans(
"Example").
': LIABLT2XXXX';
1139 print $form->textwithpicto($langs->trans($bickey), $tooltip, 1,
'help',
'', 0, 3,
'bic');
1141 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alphanohtml') : $object->bic).
'"></td></tr>';
1144 foreach ($object->getFieldsToShow() as $val) {
1146 if ($val ==
'BankCode') {
1147 $name =
'code_banque';
1149 $content = $object->code_banque;
1150 } elseif ($val ==
'DeskCode') {
1151 $name =
'code_guichet';
1153 $content = $object->code_guichet;
1154 } elseif ($val ==
'BankAccountNumber') {
1157 $content = $object->number;
1158 } elseif ($val ==
'BankAccountNumberKey') {
1161 $content = $object->cle_rib;
1164 print
'<tr><td>'.$langs->trans($val).
'</td>';
1165 print
'<td><input type="text" class="flat '.$css.
'" name="'.$name.
'" value="'.
dol_escape_htmltag($content).
'"></td>';
1169 if (isModEnabled(
'prelevement')) {
1170 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
1171 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET(
'ics') ?
GETPOST(
'ics',
'alphanohtml') : $object->ics).
'"></td></tr>';
1174 if (isModEnabled(
'paymentbybanktransfer')) {
1176 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
1177 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>';
1179 if ($mysoc->isInEEC()) {
1180 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
1181 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. ($object->pti_in_ctti ?
' checked ' :
'') .
'>';
1190 print
'<table class="border centpercent">';
1192 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td>';
1193 print
'<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="proprio" value="'.$object->proprio.
'"></td>';
1196 print
'<tr><td class="titlefieldcreate tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
1197 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
1198 print $object->owner_address;
1199 print
"</textarea></td></tr>";
1201 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
1202 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOST(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') : $object->owner_zip).
'">';
1205 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
1206 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOST(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') : $object->owner_town).
'">';
1209 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
1211 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1212 print $form->select_country(
GETPOST(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') : $object->owner_country_id,
'owner_country_id');
1220 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.
checkSwiftForAccount(Account $account=null, $swift=null)
Check SWIFT informations for a bank account.
checkIbanForAccount(Account $account=null, $ibantocheck=null)
Check IBAN number 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 journals.
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.
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
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 a 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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.