34require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formbank.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
41if (isModEnabled(
'category')) {
42 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
44if (isModEnabled(
'accounting')) {
45 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
47if (isModEnabled(
'accounting')) {
48 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
50if (isModEnabled(
'accounting')) {
51 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
55$langs->loadLangs(array(
"banks",
"bills",
"categories",
"companies",
"compta",
"withdrawals"));
57$action =
GETPOST(
'action',
'aZ09');
58$cancel =
GETPOST(
'cancel',
'alpha');
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
66$extrafields->fetch_name_optionals_label(
$object->table_element);
69$hookmanager->initHooks(array(
'bankcard',
'globalcard'));
84$result =
restrictedArea($user,
'banque', $id,
'bank_account&bank_account',
'',
'', $fieldid);
92$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
98 $backurlforlist = DOL_URL_ROOT.
'/compta/bank/list.php';
100 if (empty($backtopage) || ($cancel && empty($id))) {
101 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
102 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
103 $backtopage = $backurlforlist;
105 $backtopage = DOL_URL_ROOT.
'/compta/bank/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
111 if (!empty($backtopageforcancel)) {
112 header(
"Location: ".$backtopageforcancel);
114 } elseif (!empty($backtopage)) {
115 header(
"Location: ".$backtopage);
121 if ($action ==
'add' && $user->hasRight(
'banque',
'configurer')) {
147 $object->address = trim(
GETPOST(
"account_address",
"alphanohtml"));
152 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
160 $account_number =
GETPOST(
'account_number',
'alphanohtml');
161 if (empty($account_number) || $account_number ==
'-1') {
164 $object->account_number = $account_number;
166 $fk_accountancy_journal =
GETPOSTINT(
'fk_accountancy_journal');
167 if ($fk_accountancy_journal <= 0) {
168 $object->fk_accountancy_journal = 0;
170 $object->fk_accountancy_journal = $fk_accountancy_journal;
184 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
186 $object->fk_user_author = $user->id;
189 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
194 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
199 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
205 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
'@GETPOSTISSET');
211 $categories =
GETPOST(
'categories',
'array');
212 $object->setCategories($categories);
228 $urltogo = $backtopage ? str_replace(
'__ID__', (
string)
$object->id, $backtopage) : $backurlforlist;
229 $urltogo = preg_replace(
'/--IDFORBACKTOPAGE--/', (
string)
$object->id, $urltogo);
231 if (empty($noback)) {
232 header(
"Location: " . $urltogo);
240 if ($action ==
'update' && $user->hasRight(
'banque',
'configurer')) {
268 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
276 $account_number =
GETPOST(
'account_number',
'alphanohtml');
277 if (empty($account_number) || $account_number ==
'-1') {
280 $object->account_number = $account_number;
282 $fk_accountancy_journal =
GETPOSTINT(
'fk_accountancy_journal');
283 if ($fk_accountancy_journal <= 0) {
284 $object->fk_accountancy_journal = 0;
286 $object->fk_accountancy_journal = $fk_accountancy_journal;
291 $object->address = trim(
GETPOST(
"account_address",
"alphanohtml"));
297 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
300 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
305 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
310 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
319 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
323 $result =
$object->update($user);
326 $categories =
GETPOST(
'categories',
'array');
327 $object->setCategories($categories);
344 if ($action ==
'confirm_delete' &&
GETPOST(
"confirm") ==
"yes" && $user->hasRight(
'banque',
'configurer')) {
348 $result =
$object->delete($user);
352 header(
"Location: " . DOL_URL_ROOT .
"/compta/bank/list.php");
366$form =
new Form($db);
369if (isModEnabled(
'accounting')) {
373$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
375$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas|DE:Modul_Banken_und_Barbestände';
376if ($action ==
'create') {
377 $title = $langs->trans(
"NewFinancialAccount");
378} elseif (!empty(
$object->ref)) {
379 $title =
$object->ref.
" - ".$langs->trans(
"Card");
385if ($action ==
'create') {
386 print
load_fiche_titre($langs->trans(
"NewFinancialAccount"),
'',
'bank_account');
388 if ($conf->use_javascript_ajax) {
389 print
"\n".
'<script type="text/javascript">';
390 print
'jQuery(document).ready(function () {
391 jQuery("#type").change(function() {
392 document.formsoc.action.value="create";
393 document.formsoc.submit();
395 jQuery("#selectaccount_country_id").change(function() {
396 document.formsoc.action.value="create";
397 document.formsoc.submit();
400 print
'</script>'.
"\n";
403 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" name="formsoc" method="post">';
404 print
'<input type="hidden" name="token" value="'.newToken().
'">';
405 print
'<input type="hidden" name="action" value="add">';
406 print
'<input type="hidden" name="clos" value="0">';
407 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
411 print
'<table class="border centpercent tableforfieldcreate">';
414 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
415 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>';
418 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LabelBankCashAccount").
'</td>';
419 print
'<td><input type="text" class="flat maxwidth150onsmartphone" name="label" value="'.dol_escape_htmltag(
GETPOST(
'label',
'alpha')).
'"></td></tr>';
422 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
424 $formbank->selectTypeOfBankAccount(GETPOSTISSET(
"type") ?
GETPOSTINT(
'type') :
Account::TYPE_CURRENT,
'type');
428 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency").
'</td>';
430 $selectedcode =
$object->currency_code;
431 if (!$selectedcode) {
432 $selectedcode = $conf->currency;
434 print $form->selectCurrency((GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
440 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
442 print $form->selectarray(
"clos",
$object->labelStatus, (
GETPOSTINT(
'clos') !=
'' ?
GETPOSTINT(
'clos') :
$object->
status), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100 maxwidth150onsmartphone');
447 if (GETPOSTISSET(
"account_country_id")) {
448 $selectedcode =
GETPOST(
"account_country_id") ?
GETPOST(
"account_country_id") :
$object->country_code;
449 } elseif (empty($selectedcode)) {
450 $selectedcode = $mysoc->country_code;
454 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccountCountry").
'</td>';
456 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
457 print $form->select_country($selectedcode,
'account_country_id');
459 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
464 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
466 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
467 print $formcompany->select_state(GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") :
'', $selectedcode,
'account_state_id');
469 print $countrynotdefined;
476 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
477 print
'<textarea class="flat quatrevingtpercent" name="account_address" rows="'.ROWS_2.
'">';
478 print(GETPOSTISSET(
'account_address') ?
GETPOST(
'account_address') :
$object->address);
479 print
"</textarea></td></tr>";
483 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
485 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
486 print
'<input class="minwidth300 widthcentpercentminusx maxwidth500" type="text" class="flat" name="url" value="'.GETPOST(
"url").
'">';
490 if (isModEnabled(
'category')) {
491 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
492 $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT,
'',
'parent', 64, 0, 3);
494 $arrayselected = array();
496 $cats = $c->containing(
$object->id, Categorie::TYPE_ACCOUNT);
497 if (is_array($cats)) {
498 foreach ($cats as $cat) {
499 $arrayselected[] = $cat->id;
502 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
507 print
'<tr><td>'.$langs->trans(
"Comment").
'</td>';
510 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
511 $doleditor =
new DolEditor(
'account_comment', (
GETPOST(
"account_comment") ?
GETPOST(
"account_comment") :
$object->comment),
'', 90,
'dolibarr_notes',
'', false, true, isModEnabled(
'fckeditor') &&
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_4,
'90%');
512 $doleditor->Create();
516 $parameters = array();
517 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
518 print $hookmanager->resPrint;
519 if (empty($reshook)) {
520 print
$object->showOptionals($extrafields,
'create', $parameters);
527 print
'<table class="border centpercent">';
530 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"InitialBankBalance").
'</td>';
531 print
'<td><input size="12" type="text" class="flat" name="solde" value="'.(GETPOSTISSET(
"solde") ?
GETPOST(
"solde") :
price2num(
$object->solde)).
'"></td></tr>';
533 print
'<tr><td>'.$langs->trans(
"Date").
'</td>';
535 print $form->selectDate(
'',
're', 0, 0, 0,
'formsoc');
538 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
539 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>';
541 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
542 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>';
549 print
'<table class="border centpercent">';
552 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
553 print
'<td><input type="text" class="flat minwidth150" name="bank" value="'.(GETPOSTISSET(
'bank') ?
GETPOST(
'bank',
'alpha') :
$object->bank).
'"></td>';
557 $bickey =
"BICNumber";
558 if (
$object->getCountryCode() ==
'IN') {
563 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
564 print
'<td><input maxlength="34" type="text" class="flat minwidth300" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alpha') :
$object->iban).
'"></td></tr>';
567 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
568 print
'<td><input maxlength="11" type="text" class="flat minwidth150" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alpha') :
$object->bic).
'"></td></tr>';
572 foreach (
$object->getFieldsToShow() as $val) {
574 if ($val ==
'BankCode') {
575 $name =
'code_banque';
576 $sizecss =
'minwidth100';
577 $content =
$object->code_banque;
578 } elseif ($val ==
'DeskCode') {
579 $name =
'code_guichet';
580 $sizecss =
'minwidth100';
581 $content =
$object->code_guichet;
582 } elseif ($val ==
'BankAccountNumber') {
584 $sizecss =
'minwidth200';
586 } elseif ($val ==
'BankAccountNumberKey') {
588 $sizecss =
'minwidth50';
592 print
'<td>'.$langs->trans($val).
'</td>';
593 print
'<td><input type="text" class="flat '.$sizecss.
'" name="'.$name.
'" value="'.(GETPOSTISSET($name) ?
GETPOST($name,
'alpha') : $content).
'"></td>';
597 if (isModEnabled(
'paymentbybanktransfer')) {
598 if ($mysoc->isInEEC()) {
599 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
600 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. (empty(
GETPOST(
'pti_in_ctti')) ?
'' :
' checked ') .
'>';
607 print
'<table class="border centpercent">';
608 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankAccountOwner").
'</td>';
609 print
'<td><input type="text" class="flat minwidth300" name="proprio" value="'.(GETPOSTISSET(
'proprio') ?
GETPOST(
'proprio',
'alpha') :
$object->owner_name).
'">';
612 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
613 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
614 print(GETPOSTISSET(
'owner_address') ?
GETPOST(
'owner_address',
'alpha') :
$object->owner_address);
615 print
"</textarea></td></tr>";
617 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
618 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOSTISSET(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') :
$object->owner_zip).
'">';
621 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
622 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOSTISSET(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') :
$object->owner_town).
'">';
625 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
627 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
628 print $form->select_country(GETPOSTISSET(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') :
$object->owner_country_id,
'owner_country_id');
635 print
'<table class="border centpercent">';
639 $fieldrequired =
'fieldrequired ';
642 if (isModEnabled(
'accounting')) {
643 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
645 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
646 print $formaccounting->select_account(
$object->account_number,
'account_number', 1,
'', 1, 1);
647 if ($formaccounting->nbaccounts == 0) {
648 $langs->load(
"errors");
649 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
650 print $form->textwithpicto(
'', $htmltext);
654 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
655 print
'<td><input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
'account_number',
'alpha') :
$object->account_number).
'"></td></tr>';
659 if (isModEnabled(
'accounting')) {
660 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
662 print $formaccounting->select_journal(
$object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
670 print $form->buttonsSaveCancel(
"CreateAccount");
679 print
dol_get_fiche_head($head,
'bankname', $langs->trans(
"FinancialAccount"), -1,
'account', 0,
'',
'', 0,
'', 1);
684 if ($action ==
'delete') {
685 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"DeleteAccount"), $langs->trans(
"ConfirmDeleteAccount"),
"confirm_delete");
691 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
694 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
696 print
'<div class="fichecenter">';
697 print
'<div class="fichehalfleft">';
698 print
'<div class="underbanner clearboth"></div>';
700 print
'<table class="border centpercent tableforfield">';
703 print
'<tr><td class="titlefield">'.$langs->trans(
"AccountType").
'</td>';
704 print
'<td>'.$object->type_lib[
$object->type].
'</td></tr>';
707 print
'<tr><td>'.$langs->trans(
"Currency").
'</td>';
709 $selectedcode =
$object->currency_code;
710 if (!$selectedcode) {
711 $selectedcode = $conf->currency;
713 print $langs->trans(
"Currency".$selectedcode);
717 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
719 $conciliate =
$object->canBeConciliated();
720 if ($conciliate == -2) {
721 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"CashAccount").
')</span>';
722 } elseif ($conciliate == -3) {
723 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"Closed").
')</span>';
725 print(
$object->rappro == 1 ? $langs->trans(
"Yes") : ($langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"ConciliationDisabled").
')</span>'));
729 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
730 print
'<td>'.$object->min_allowed.
'</td></tr>';
732 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
733 print
'<td>'.$object->min_desired.
'</td></tr>';
736 print
'<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans(
"AccountancyCode").
'</td>';
738 if (isModEnabled(
'accounting')) {
740 $accountingaccount->fetch(
'',
$object->account_number, 1);
742 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
749 if (isModEnabled(
'accounting')) {
750 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
753 if (
$object->fk_accountancy_journal > 0) {
755 $accountingjournal->fetch(
$object->fk_accountancy_journal);
757 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
764 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
769 print
'<div class="fichehalfright">';
770 print
'<div class="underbanner clearboth"></div>';
772 print
'<table class="border tableforfield centpercent">';
775 if (isModEnabled(
'category')) {
776 print
'<tr><td class="titlefield">'.$langs->trans(
"Categories").
'</td><td>';
777 print $form->showCategories(
$object->id, Categorie::TYPE_ACCOUNT, 1);
781 print
'<tr><td class="tdtop titlefield">'.$langs->trans(
"Comment").
'</td>';
782 print
'<td>'.dol_htmlentitiesbr(
$object->comment).
'</td></tr>';
787 print
'<table class="border tableforfield centpercent">';
789 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"BankName").
'</td>';
790 print
'<td>'.$object->bank.
'</td></tr>';
793 $bickey =
"BICNumber";
794 if (
$object->getCountryCode() ==
'IN') {
799 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
800 print
'<td>'.getIbanHumanReadable(
$object).
' ';
803 print
img_picto($langs->trans(
"IbanNotValid"),
'warning');
805 print
img_picto($langs->trans(
"IbanValid"),
'tick');
811 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
812 print
'<td>'.$object->bic.
' ';
815 print
img_picto($langs->trans(
"SwiftNotValid"),
'warning');
817 print
img_picto($langs->trans(
"SwiftValid"),
'tick');
825 foreach (
$object->getFieldsToShow() as $val) {
827 if ($val ==
'BankCode') {
828 $content =
$object->code_banque;
829 } elseif ($val ==
'DeskCode') {
830 $content =
$object->code_guichet;
831 } elseif ($val ==
'BankAccountNumber') {
833 } elseif ($val ==
'BankAccountNumberKey') {
837 print
'<tr><td>'.$langs->trans($val).
'</td>';
838 print
'<td>'.$content.
'</td>';
842 if (isModEnabled(
'prelevement')) {
843 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
844 print
'<td>'.$object->ics.
'</td>';
848 if (isModEnabled(
'paymentbybanktransfer')) {
850 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
851 print
'<td>'.$object->ics_transfer.
'</td>';
854 if ($mysoc->isInEEC()) {
855 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td><td>';
856 print(empty(
$object->pti_in_ctti) ? $langs->trans(
"No") : $langs->trans(
"Yes"));
857 print
"</td></tr>\n";
861 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td><td>';
863 print
"</td></tr>\n";
865 print
'<tr><td>'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
866 print nl2br(
$object->owner_address);
867 print
"</td></tr>\n";
869 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
870 print
'<td>'.dol_escape_htmltag(
$object->owner_zip);
873 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
874 print
'<td>'.dol_escape_htmltag(
$object->owner_town);
877 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
880 $langs->load(
"dict");
881 print(empty(
$object->owner_country_code) ?
'' : $langs->convToOutputCharset($langs->transnoentitiesnoconv(
"Country".
$object->owner_country_code)));
891 print
'<div class="clearboth"></div>';
898 print
'<div class="tabsAction">';
900 if ($user->hasRight(
'banque',
'configurer')) {
901 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'&id='.
$object->id.
'">'.$langs->trans(
"Modify").
'</a>';
904 $canbedeleted =
$object->can_be_deleted();
905 if ($user->hasRight(
'banque',
'configurer') && $canbedeleted) {
906 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&id='.
$object->id.
'">'.$langs->trans(
"Delete").
'</a>';
918 if (
GETPOSTINT(
'id') && $action ==
'edit' && $user->hasRight(
'banque',
'configurer')) {
919 print
load_fiche_titre($langs->trans(
"EditFinancialAccount"),
'',
'bank_account');
921 if ($conf->use_javascript_ajax) {
922 print
"\n".
'<script type="text/javascript">';
923 print
'jQuery(document).ready(function () {
924 jQuery("#type").change(function() {
925 document.formsoc.action.value="edit";
926 document.formsoc.submit();
930 print
'jQuery(document).ready(function () {
931 jQuery("#selectaccount_country_id").change(function() {
932 document.formsoc.action.value="edit";
933 document.formsoc.submit();
936 print
'</script>'.
"\n";
939 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post" name="formsoc">';
940 print
'<input type="hidden" name="token" value="'.newToken().
'">';
941 print
'<input type="hidden" name="action" value="update">';
942 print
'<input type="hidden" name="id" value="'.GETPOSTINT(
"id").
'">'.
"\n\n";
943 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
949 print
'<table class="border centpercent tableforfieldcreate">';
952 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
953 print
'<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET(
'ref') ?
GETPOST(
'ref',
'alpha') :
$object->
ref).
'"></td></tr>';
956 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
957 print
'<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(GETPOSTISSET(
'label') ?
GETPOST(
'label',
'alpha') :
$object->label).
'"></td></tr>';
960 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
961 print
'<td class="maxwidth200onsmartphone">';
962 $formbank->selectTypeOfBankAccount((GETPOSTISSET(
'type') ?
GETPOSTINT(
'type') :
$object->
type),
'type');
966 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency");
967 print
'<input type="hidden" value="'.$object->currency_code.
'">';
969 print
'<td class="maxwidth200onsmartphone">';
970 $selectedcode =
$object->currency_code;
971 if (!$selectedcode) {
972 $selectedcode = $conf->currency;
974 print
img_picto(
'',
'multicurrency',
'class="pictofixedwidth"');
975 print $form->selectCurrency((GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
981 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
982 print
'<td class="maxwidth200onsmartphone">';
988 $selectedcode =
$object->country_code;
989 if (GETPOSTISSET(
"account_country_id")) {
990 $selectedcode =
GETPOST(
"account_country_id");
991 } elseif (empty($selectedcode)) {
992 $selectedcode = $mysoc->country_code;
996 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Country").
'</td>';
997 print
'<td class="maxwidth200onsmartphone">';
998 print
img_picto(
'',
'country',
'class="pictofixedwidth"').$form->select_country($selectedcode,
'account_country_id');
1000 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1005 print
'<tr><td>'.$langs->trans(
'State').
'</td><td class="maxwidth200onsmartphone">';
1006 if ($selectedcode) {
1007 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1008 print $formcompany->select_state(GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") :
$object->state_id, $selectedcode,
'account_state_id');
1010 print $countrynotdefined;
1017 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
1018 print
'<textarea class="flat quatrevingtpercent" name="account_address" rows="'.ROWS_2.
'">';
1020 print
"</textarea></td></tr>";
1024 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
1026 $conciliate =
$object->canBeConciliated();
1027 if ($conciliate == -2) {
1028 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"CashAccount").
')</span>';
1029 } elseif ($conciliate == -3) {
1030 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"Closed").
')</span>';
1032 print
'<input type="checkbox" class="flat" id="norappro" name="norappro"'.(($conciliate > 0) ?
'' :
' checked="checked"').
'"> <label for="norappro" class="opacitymedium">'.$langs->trans(
"DisableConciliation").
'</label>';
1037 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
1038 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>';
1040 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
1041 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>';
1044 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
1046 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
1047 print
'<input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET(
"url") ?
GETPOST(
"url") :
$object->url).
'">';
1051 if (isModEnabled(
'category')) {
1052 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1053 $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT,
'',
'parent', 64, 0, 3);
1055 $arrayselected = array();
1057 $cats = $c->containing(
$object->id, Categorie::TYPE_ACCOUNT);
1058 if (is_array($cats)) {
1059 foreach ($cats as $cat) {
1060 $arrayselected[] = $cat->id;
1063 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1068 print
'<tr><td class="tdtop">'.$langs->trans(
"Comment").
'</td>';
1071 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1072 $doleditor =
new DolEditor(
'account_comment', (
GETPOST(
"account_comment") ?
GETPOST(
"account_comment") :
$object->comment),
'', 90,
'dolibarr_notes',
'', false, true, isModEnabled(
'fckeditor') &&
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_4,
'95%');
1073 $doleditor->Create();
1077 $parameters = array();
1078 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
1079 print $hookmanager->resPrint;
1080 if (empty($reshook)) {
1081 print
$object->showOptionals($extrafields,
'edit', $parameters);
1090 print
'<table class="border centpercent">';
1093 $tdextra =
' class="titlefieldcreate"';
1096 $tdextra =
' class="fieldrequired titlefieldcreate"';
1099 print
'<tr><td'.$tdextra.
'>'.$langs->trans(
"AccountancyCode").
'</td>';
1101 if (isModEnabled(
'accounting')) {
1102 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
1103 print $formaccounting->select_account(
$object->account_number,
'account_number', 1,
'', 1, 1);
1104 if ($formaccounting->nbaccounts == 0) {
1105 $langs->load(
"errors");
1106 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
1107 print $form->textwithpicto(
'', $htmltext);
1110 print
'<input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
"account_number") :
$object->account_number).
'">';
1115 if (isModEnabled(
'accounting')) {
1116 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountancyJournal").
'</td>';
1118 print $formaccounting->select_journal(
$object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
1128 print
'<table class="border centpercent">';
1131 print
'<tr class="liste_titre_add"><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
1132 print
'<td><input type="text" class="flat width300" name="bank" value="'.$object->bank.
'"></td>';
1136 $bickey =
"BICNumber";
1137 if (
$object->getCountryCode() ==
'IN') {
1143 $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';
1144 print $form->textwithpicto($langs->trans($ibankey), $tooltip, 1,
'help',
'', 0, 3,
'iban');
1146 print
'<td><input class="minwidth300 maxwidth200onsmartphone" maxlength="34" type="text" class="flat" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alphanohtml') :
$object->iban).
'"></td></tr>';
1150 $tooltip = $langs->trans(
"Example").
': LIABLT2XXXX';
1151 print $form->textwithpicto($langs->trans($bickey), $tooltip, 1,
'help',
'', 0, 3,
'bic');
1153 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alphanohtml') :
$object->bic).
'"></td></tr>';
1156 foreach (
$object->getFieldsToShow() as $val) {
1158 if ($val ==
'BankCode') {
1159 $name =
'code_banque';
1161 $content =
$object->code_banque;
1162 } elseif ($val ==
'DeskCode') {
1163 $name =
'code_guichet';
1165 $content =
$object->code_guichet;
1166 } elseif ($val ==
'BankAccountNumber') {
1170 } elseif ($val ==
'BankAccountNumberKey') {
1176 print
'<tr><td>'.$langs->trans($val).
'</td>';
1177 print
'<td><input type="text" class="flat '.$css.
'" name="'.$name.
'" value="'.
dol_escape_htmltag($content).
'"></td>';
1181 if (isModEnabled(
'prelevement')) {
1182 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
1183 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET(
'ics') ?
GETPOST(
'ics',
'alphanohtml') :
$object->ics).
'"></td></tr>';
1186 if (isModEnabled(
'paymentbybanktransfer')) {
1188 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
1189 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>';
1191 if ($mysoc->isInEEC()) {
1192 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
1193 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. (
$object->pti_in_ctti ?
' checked ' :
'') .
'>';
1202 print
'<table class="border centpercent">';
1204 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td>';
1205 print
'<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="proprio" value="'.(GETPOSTISSET(
'proprio') ?
GETPOST(
'proprio',
'alpha') :
$object->owner_name).
'"></td>';
1208 print
'<tr><td class="titlefieldcreate tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
1209 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
1210 print GETPOSTISSET(
'owner_address') ?
GETPOST(
'owner_address',
'alpha') :
$object->owner_address;
1211 print
"</textarea></td></tr>";
1213 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
1214 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOSTISSET(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') :
$object->owner_zip).
'">';
1217 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
1218 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOSTISSET(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') :
$object->owner_town).
'">';
1221 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
1223 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1224 print $form->select_country(GETPOSTISSET(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') :
$object->owner_country_id,
'owner_country_id');
1232 print $form->buttonsSaveCancel(
"Modify");
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Or an array listing all the potential status of the object: array: int of the status => translated la...
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 information for a bank account.
checkIbanForAccount(Account $account=null, $ibantocheck=null)
Check IBAN number information 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=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
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.