34 require
'../../main.inc.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formbank.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
45 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
48 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
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);
97 if (empty($reshook)) {
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') {
147 $object->address = trim(
GETPOST(
"account_address",
"alphanohtml"));
151 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
159 $account_number =
GETPOST(
'account_number',
'alphanohtml');
160 if (empty($account_number) || $account_number ==
'-1') {
163 $object->account_number = $account_number;
165 $fk_accountancy_journal =
GETPOSTINT(
'fk_accountancy_journal');
166 if ($fk_accountancy_journal <= 0) {
167 $object->fk_accountancy_journal = 0;
169 $object->fk_accountancy_journal = $fk_accountancy_journal;
183 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
185 $object->fk_user_author = $user->id;
188 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
193 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
198 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
204 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
'@GETPOSTISSET');
210 $categories =
GETPOST(
'categories',
'array');
211 $object->setCategories($categories);
227 $urltogo = $backtopage ? str_replace(
'__ID__', (
string)
$object->id, $backtopage) : $backurlforlist;
228 $urltogo = preg_replace(
'/--IDFORBACKTOPAGE--/', (
string)
$object->id, $urltogo);
230 if (empty($noback)) {
231 header(
"Location: " . $urltogo);
239 if ($action ==
'update') {
265 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
273 $account_number =
GETPOST(
'account_number',
'alphanohtml');
274 if (empty($account_number) || $account_number ==
'-1') {
277 $object->account_number = $account_number;
279 $fk_accountancy_journal =
GETPOSTINT(
'fk_accountancy_journal');
280 if ($fk_accountancy_journal <= 0) {
281 $object->fk_accountancy_journal = 0;
283 $object->fk_accountancy_journal = $fk_accountancy_journal;
288 $object->address = trim(
GETPOST(
"account_address",
"alphanohtml"));
294 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
297 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
302 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
307 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
316 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
320 $result =
$object->update($user);
323 $categories =
GETPOST(
'categories',
'array');
324 $object->setCategories($categories);
341 if ($action ==
'confirm_delete' &&
GETPOST(
"confirm") ==
"yes" && $user->hasRight(
'banque',
'configurer')) {
345 $result =
$object->delete($user);
349 header(
"Location: " . DOL_URL_ROOT .
"/compta/bank/list.php");
370 $countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
372 $help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas|DE:Modul_Banken_und_Barbestände';
373 if ($action ==
'create') {
374 $title = $langs->trans(
"NewFinancialAccount");
375 } elseif (!empty(
$object->ref)) {
376 $title =
$object->ref.
" - ".$langs->trans(
"Card");
381 if ($action ==
'create') {
382 print
load_fiche_titre($langs->trans(
"NewFinancialAccount"),
'',
'bank_account');
384 if ($conf->use_javascript_ajax) {
385 print
"\n".
'<script type="text/javascript">';
386 print
'jQuery(document).ready(function () {
387 jQuery("#type").change(function() {
388 document.formsoc.action.value="create";
389 document.formsoc.submit();
391 jQuery("#selectaccount_country_id").change(function() {
392 document.formsoc.action.value="create";
393 document.formsoc.submit();
396 print
'</script>'.
"\n";
399 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" name="formsoc" method="post">';
400 print
'<input type="hidden" name="token" value="'.newToken().
'">';
401 print
'<input type="hidden" name="action" value="add">';
402 print
'<input type="hidden" name="clos" value="0">';
403 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
407 print
'<table class="border centpercent tableforfieldcreate">';
410 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
411 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>';
414 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LabelBankCashAccount").
'</td>';
415 print
'<td><input type="text" class="flat maxwidth150onsmartphone" name="label" value="'.dol_escape_htmltag(
GETPOST(
'label',
'alpha')).
'"></td></tr>';
418 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
424 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency").
'</td>';
426 $selectedcode =
$object->currency_code;
427 if (!$selectedcode) {
428 $selectedcode = $conf->currency;
430 print
$form->selectCurrency((
GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
436 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
438 print
$form->selectarray(
"clos",
$object->status, (
GETPOSTINT(
'clos') !=
'' ?
GETPOSTINT(
'clos') :
$object->status), 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth150onsmartphone');
444 $selectedcode =
GETPOST(
"account_country_id") ?
GETPOST(
"account_country_id") :
$object->country_code;
445 } elseif (empty($selectedcode)) {
446 $selectedcode = $mysoc->country_code;
450 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccountCountry").
'</td>';
452 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
453 print
$form->select_country($selectedcode,
'account_country_id');
455 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
460 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
462 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
463 print $formcompany->select_state(
GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") :
'', $selectedcode,
'account_state_id');
465 print $countrynotdefined;
471 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
472 print
'<textarea class="flat quatrevingtpercent" name="account_address" rows="'.ROWS_2.
'">';
474 print
"</textarea></td></tr>";
478 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
480 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
481 print
'<input class="minwidth300 widthcentpercentminusx maxwidth500" type="text" class="flat" name="url" value="'.GETPOST(
"url").
'">';
486 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
487 $cate_arbo =
$form->select_all_categories(Categorie::TYPE_ACCOUNT,
'',
'parent', 64, 0, 3);
489 $arrayselected = array();
491 $cats = $c->containing(
$object->id, Categorie::TYPE_ACCOUNT);
492 if (is_array($cats)) {
493 foreach ($cats as $cat) {
494 $arrayselected[] = $cat->id;
497 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
502 print
'<tr><td>'.$langs->trans(
"Comment").
'</td>';
505 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
506 $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%');
507 $doleditor->Create();
512 $reshook = $hookmanager->executeHooks(
'formObjectOptions',
$parameters,
$object, $action);
513 print $hookmanager->resPrint;
514 if (empty($reshook)) {
522 print
'<table class="border centpercent">';
525 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"InitialBankBalance").
'</td>';
526 print
'<td><input size="12" type="text" class="flat" name="solde" value="'.(GETPOST(
"solde") ?
GETPOST(
"solde") :
price2num(
$object->solde)).
'"></td></tr>';
528 print
'<tr><td>'.$langs->trans(
"Date").
'</td>';
530 print
$form->selectDate(
'',
're', 0, 0, 0,
'formsoc');
533 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
534 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>';
536 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
537 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>';
544 print
'<table class="border centpercent">';
547 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
548 print
'<td><input type="text" class="flat minwidth150" name="bank" value="'.(GETPOST(
'bank') ?
GETPOST(
'bank',
'alpha') :
$object->bank).
'"></td>';
552 $bickey =
"BICNumber";
553 if (
$object->getCountryCode() ==
'IN') {
558 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
559 print
'<td><input maxlength="34" type="text" class="flat minwidth300" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alpha') :
$object->iban).
'"></td></tr>';
562 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
563 print
'<td><input maxlength="11" type="text" class="flat minwidth150" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alpha') :
$object->bic).
'"></td></tr>';
567 foreach (
$object->getFieldsToShow() as $val) {
569 if ($val ==
'BankCode') {
570 $name =
'code_banque';
571 $sizecss =
'minwidth100';
572 $content =
$object->code_banque;
573 } elseif ($val ==
'DeskCode') {
574 $name =
'code_guichet';
575 $sizecss =
'minwidth100';
576 $content =
$object->code_guichet;
577 } elseif ($val ==
'BankAccountNumber') {
579 $sizecss =
'minwidth200';
581 } elseif ($val ==
'BankAccountNumberKey') {
583 $sizecss =
'minwidth50';
587 print
'<td>'.$langs->trans($val).
'</td>';
588 print
'<td><input type="text" class="flat '.$sizecss.
'" name="'.$name.
'" value="'.(
GETPOSTISSET($name) ?
GETPOST($name,
'alpha') : $content).
'"></td>';
593 if ($mysoc->isInEEC()) {
594 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
595 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. (empty(
GETPOST(
'pti_in_ctti')) ?
'' :
' checked ') .
'>';
602 print
'<table class="border centpercent">';
603 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankAccountOwner").
'</td>';
604 print
'<td><input type="text" class="flat minwidth300" name="proprio" value="'.(GETPOST(
'proprio') ?
GETPOST(
'proprio',
'alpha') :
$object->proprio).
'">';
607 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
608 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
610 print
"</textarea></td></tr>";
612 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
613 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOST(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') :
$object->owner_zip).
'">';
616 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
617 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOST(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') :
$object->owner_town).
'">';
620 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
622 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
623 print
$form->select_country(
GETPOST(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') :
$object->owner_country_id,
'owner_country_id');
630 print
'<table class="border centpercent">';
634 $fieldrequired =
'fieldrequired ';
638 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
640 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
641 print $formaccounting->select_account(
$object->account_number,
'account_number', 1,
'', 1, 1);
642 if ($formaccounting->nbaccounts == 0) {
643 $langs->load(
"errors");
644 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
645 print
$form->textwithpicto(
'', $htmltext);
649 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
650 print
'<td><input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
'account_number',
'alpha') :
$object->account_number).
'"></td></tr>';
655 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
657 print $formaccounting->select_journal(
$object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
665 print
$form->buttonsSaveCancel(
"CreateAccount");
674 print
dol_get_fiche_head($head,
'bankname', $langs->trans(
"FinancialAccount"), -1,
'account', 0,
'',
'', 0,
'', 1);
679 if ($action ==
'delete') {
680 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
"DeleteAccount"), $langs->trans(
"ConfirmDeleteAccount"),
"confirm_delete");
686 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
689 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
691 print
'<div class="fichecenter">';
692 print
'<div class="fichehalfleft">';
693 print
'<div class="underbanner clearboth"></div>';
695 print
'<table class="border centpercent tableforfield">';
698 print
'<tr><td class="titlefield">'.$langs->trans(
"AccountType").
'</td>';
699 print
'<td>'.$object->type_lib[
$object->type].
'</td></tr>';
702 print
'<tr><td>'.$langs->trans(
"Currency").
'</td>';
704 $selectedcode =
$object->currency_code;
705 if (!$selectedcode) {
706 $selectedcode = $conf->currency;
708 print $langs->trans(
"Currency".$selectedcode);
712 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
714 $conciliate =
$object->canBeConciliated();
715 if ($conciliate == -2) {
716 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"CashAccount").
')</span>';
717 } elseif ($conciliate == -3) {
718 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"Closed").
')</span>';
720 print(
$object->rappro == 1 ? $langs->trans(
"Yes") : ($langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"ConciliationDisabled").
')</span>'));
724 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
725 print
'<td>'.$object->min_allowed.
'</td></tr>';
727 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
728 print
'<td>'.$object->min_desired.
'</td></tr>';
731 print
'<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans(
"AccountancyCode").
'</td>';
735 $accountingaccount->fetch(
'',
$object->account_number, 1);
737 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
745 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
748 if (
$object->fk_accountancy_journal > 0) {
750 $accountingjournal->fetch(
$object->fk_accountancy_journal);
752 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
759 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
764 print
'<div class="fichehalfright">';
765 print
'<div class="underbanner clearboth"></div>';
767 print
'<table class="border tableforfield centpercent">';
771 print
'<tr><td class="titlefield">'.$langs->trans(
"Categories").
'</td><td>';
772 print
$form->showCategories(
$object->id, Categorie::TYPE_ACCOUNT, 1);
776 print
'<tr><td class="tdtop titlefield">'.$langs->trans(
"Comment").
'</td>';
777 print
'<td>'.dol_htmlentitiesbr(
$object->comment).
'</td></tr>';
782 print
'<table class="border tableforfield centpercent">';
784 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"BankName").
'</td>';
785 print
'<td>'.$object->bank.
'</td></tr>';
788 $bickey =
"BICNumber";
789 if (
$object->getCountryCode() ==
'IN') {
794 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
795 print
'<td>'.getIbanHumanReadable(
$object).
' ';
798 print
img_picto($langs->trans(
"IbanNotValid"),
'warning');
800 print
img_picto($langs->trans(
"IbanValid"),
'info');
806 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
807 print
'<td>'.$object->bic.
' ';
810 print
img_picto($langs->trans(
"SwiftNotValid"),
'warning');
812 print
img_picto($langs->trans(
"SwiftValid"),
'info');
820 foreach (
$object->getFieldsToShow() as $val) {
822 if ($val ==
'BankCode') {
823 $content =
$object->code_banque;
824 } elseif ($val ==
'DeskCode') {
825 $content =
$object->code_guichet;
826 } elseif ($val ==
'BankAccountNumber') {
828 } elseif ($val ==
'BankAccountNumberKey') {
832 print
'<tr><td>'.$langs->trans($val).
'</td>';
833 print
'<td>'.$content.
'</td>';
838 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
839 print
'<td>'.$object->ics.
'</td>';
845 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
846 print
'<td>'.$object->ics_transfer.
'</td>';
849 if ($mysoc->isInEEC()) {
850 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td><td>';
851 print(empty(
$object->pti_in_ctti) ? $langs->trans(
"No") : $langs->trans(
"Yes"));
852 print
"</td></tr>\n";
856 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td><td>';
858 print
"</td></tr>\n";
860 print
'<tr><td>'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
861 print nl2br(
$object->owner_address);
862 print
"</td></tr>\n";
864 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
865 print
'<td>'.dol_escape_htmltag(
$object->owner_zip);
868 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
869 print
'<td>'.dol_escape_htmltag(
$object->owner_town);
872 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
875 $langs->load(
"dict");
876 print(empty(
$object->owner_country_code) ?
'' : $langs->convToOutputCharset($langs->transnoentitiesnoconv(
"Country".$object->owner_country_code)));
886 print
'<div class="clearboth"></div>';
893 print
'<div class="tabsAction">';
895 if ($user->hasRight(
'banque',
'configurer')) {
896 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'&id='.
$object->id.
'">'.$langs->trans(
"Modify").
'</a>';
899 $canbedeleted =
$object->can_be_deleted();
900 if ($user->hasRight(
'banque',
'configurer') && $canbedeleted) {
901 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&id='.
$object->id.
'">'.$langs->trans(
"Delete").
'</a>';
913 if (
GETPOSTINT(
'id') && $action ==
'edit' && $user->hasRight(
'banque',
'configurer')) {
914 print
load_fiche_titre($langs->trans(
"EditFinancialAccount"),
'',
'bank_account');
916 if ($conf->use_javascript_ajax) {
917 print
"\n".
'<script type="text/javascript">';
918 print
'jQuery(document).ready(function () {
919 jQuery("#type").change(function() {
920 document.formsoc.action.value="edit";
921 document.formsoc.submit();
925 print
'jQuery(document).ready(function () {
926 jQuery("#selectaccount_country_id").change(function() {
927 document.formsoc.action.value="edit";
928 document.formsoc.submit();
931 print
'</script>'.
"\n";
934 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post" name="formsoc">';
935 print
'<input type="hidden" name="token" value="'.newToken().
'">';
936 print
'<input type="hidden" name="action" value="update">';
937 print
'<input type="hidden" name="id" value="'.GETPOSTINT(
"id").
'">'.
"\n\n";
938 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
944 print
'<table class="border centpercent tableforfieldcreate">';
947 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
948 print
'<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(
GETPOSTISSET(
'ref') ?
GETPOST(
'ref',
'alpha') :
$object->ref).
'"></td></tr>';
951 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
952 print
'<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(
GETPOSTISSET(
'label') ?
GETPOST(
'label',
'alpha') :
$object->label).
'"></td></tr>';
955 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
956 print
'<td class="maxwidth200onsmartphone">';
961 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency");
962 print
'<input type="hidden" value="'.$object->currency_code.
'">';
964 print
'<td class="maxwidth200onsmartphone">';
965 $selectedcode =
$object->currency_code;
966 if (!$selectedcode) {
967 $selectedcode = $conf->currency;
969 print
img_picto(
'',
'multicurrency',
'class="pictofixedwidth"');
970 print
$form->selectCurrency((
GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
976 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
977 print
'<td class="maxwidth200onsmartphone">';
983 $selectedcode =
$object->country_code;
985 $selectedcode =
GETPOST(
"account_country_id");
986 } elseif (empty($selectedcode)) {
987 $selectedcode = $mysoc->country_code;
991 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Country").
'</td>';
992 print
'<td class="maxwidth200onsmartphone">';
993 print
img_picto(
'',
'country',
'class="pictofixedwidth"').$form->select_country($selectedcode,
'account_country_id');
995 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1000 print
'<tr><td>'.$langs->trans(
'State').
'</td><td class="maxwidth200onsmartphone">';
1001 if ($selectedcode) {
1002 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1003 print $formcompany->select_state(
GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") :
$object->state_id, $selectedcode,
'account_state_id');
1005 print $countrynotdefined;
1011 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
1012 print
'<textarea class="flat quatrevingtpercent" name="account_address" rows="'.ROWS_2.
'">';
1014 print
"</textarea></td></tr>";
1018 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
1020 $conciliate =
$object->canBeConciliated();
1021 if ($conciliate == -2) {
1022 print $langs->trans(
"No").
' ('.$langs->trans(
"CashAccount").
')';
1023 } elseif ($conciliate == -3) {
1024 print $langs->trans(
"No").
' ('.$langs->trans(
"Closed").
')';
1026 print
'<input type="checkbox" class="flat" id="norappro" name="norappro"'.(($conciliate > 0) ?
'' :
' checked="checked"').
'"> <label for="norappro" class="opacitymedium">'.$langs->trans(
"DisableConciliation").
'</label>';
1031 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
1032 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>';
1034 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
1035 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>';
1038 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
1040 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
1041 print
'<input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET(
"url") ?
GETPOST(
"url") :
$object->url).
'">';
1046 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1047 $cate_arbo =
$form->select_all_categories(Categorie::TYPE_ACCOUNT,
'',
'parent', 64, 0, 3);
1049 $arrayselected = array();
1051 $cats = $c->containing(
$object->id, Categorie::TYPE_ACCOUNT);
1052 if (is_array($cats)) {
1053 foreach ($cats as $cat) {
1054 $arrayselected[] = $cat->id;
1057 print
img_picto(
'',
'category').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
1062 print
'<tr><td class="tdtop">'.$langs->trans(
"Comment").
'</td>';
1065 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1066 $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%');
1067 $doleditor->Create();
1072 $reshook = $hookmanager->executeHooks(
'formObjectOptions',
$parameters,
$object, $action);
1073 print $hookmanager->resPrint;
1074 if (empty($reshook)) {
1084 print
'<table class="border centpercent">';
1087 $tdextra =
' class="titlefieldcreate"';
1090 $tdextra =
' class="fieldrequired titlefieldcreate"';
1093 print
'<tr><td'.$tdextra.
'>'.$langs->trans(
"AccountancyCode").
'</td>';
1096 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
1097 print $formaccounting->select_account(
$object->account_number,
'account_number', 1,
'', 1, 1);
1098 if ($formaccounting->nbaccounts == 0) {
1099 $langs->load(
"errors");
1100 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
1101 print
$form->textwithpicto(
'', $htmltext);
1104 print
'<input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
"account_number") :
$object->account_number).
'">';
1110 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountancyJournal").
'</td>';
1112 print $formaccounting->select_journal(
$object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
1122 print
'<table class="border centpercent">';
1125 print
'<tr class="liste_titre_add"><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
1126 print
'<td><input type="text" class="flat width300" name="bank" value="'.$object->bank.
'"></td>';
1130 $bickey =
"BICNumber";
1131 if (
$object->getCountryCode() ==
'IN') {
1137 $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';
1138 print
$form->textwithpicto($langs->trans($ibankey), $tooltip, 1,
'help',
'', 0, 3,
'iban');
1140 print
'<td><input class="minwidth300 maxwidth200onsmartphone" maxlength="34" type="text" class="flat" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alphanohtml') :
$object->iban).
'"></td></tr>';
1144 $tooltip = $langs->trans(
"Example").
': LIABLT2XXXX';
1145 print
$form->textwithpicto($langs->trans($bickey), $tooltip, 1,
'help',
'', 0, 3,
'bic');
1147 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alphanohtml') :
$object->bic).
'"></td></tr>';
1150 foreach (
$object->getFieldsToShow() as $val) {
1152 if ($val ==
'BankCode') {
1153 $name =
'code_banque';
1155 $content =
$object->code_banque;
1156 } elseif ($val ==
'DeskCode') {
1157 $name =
'code_guichet';
1159 $content =
$object->code_guichet;
1160 } elseif ($val ==
'BankAccountNumber') {
1164 } elseif ($val ==
'BankAccountNumberKey') {
1170 print
'<tr><td>'.$langs->trans($val).
'</td>';
1171 print
'<td><input type="text" class="flat '.$css.
'" name="'.$name.
'" value="'.
dol_escape_htmltag($content).
'"></td>';
1176 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
1177 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET(
'ics') ?
GETPOST(
'ics',
'alphanohtml') :
$object->ics).
'"></td></tr>';
1182 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
1183 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>';
1185 if ($mysoc->isInEEC()) {
1186 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
1187 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. (
$object->pti_in_ctti ?
' checked ' :
'') .
'>';
1196 print
'<table class="border centpercent">';
1198 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td>';
1199 print
'<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="proprio" value="'.$object->proprio.
'"></td>';
1202 print
'<tr><td class="titlefieldcreate tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
1203 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
1205 print
"</textarea></td></tr>";
1207 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
1208 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOST(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') :
$object->owner_zip).
'">';
1211 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
1212 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOST(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') :
$object->owner_town).
'">';
1215 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
1217 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1218 print
$form->select_country(
GETPOST(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') :
$object->owner_country_id,
'owner_country_id');
1226 print
$form->buttonsSaveCancel(
"Modify");
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information in HTML for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
$formconfirm
if ($action == 'delbookkeepingyear') {
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.