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.formaccounting.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formbank.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
46 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
49 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
62$langs->loadLangs(array(
"banks",
"bills",
"categories",
"companies",
"compta",
"withdrawals"));
64$action =
GETPOST(
'action',
'aZ09');
65$cancel =
GETPOST(
'cancel',
'alpha');
66$backtopage =
GETPOST(
'backtopage',
'alpha');
67$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
73$extrafields->fetch_name_optionals_label(
$object->table_element);
76$hookmanager->initHooks(array(
'bankcard',
'globalcard'));
91$result =
restrictedArea($user,
'banque', $id,
'bank_account&bank_account',
'',
'', $fieldid);
99$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
104if (empty($reshook)) {
105 $backurlforlist = DOL_URL_ROOT.
'/compta/bank/list.php';
107 if (empty($backtopage) || ($cancel && empty($id))) {
108 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
109 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
110 $backtopage = $backurlforlist;
112 $backtopage = DOL_URL_ROOT.
'/compta/bank/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
118 if (!empty($backtopageforcancel)) {
119 header(
"Location: ".$backtopageforcancel);
121 } elseif (!empty($backtopage)) {
122 header(
"Location: ".$backtopage);
128 if ($action ==
'add' && $user->hasRight(
'banque',
'configurer')) {
154 $object->address = trim(
GETPOST(
"account_address",
"alphanohtml"));
157 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
165 $account_number =
GETPOST(
'account_number',
'alphanohtml');
166 if (empty($account_number) || $account_number ==
'-1') {
169 $object->account_number = $account_number;
171 $fk_accountancy_journal =
GETPOSTINT(
'fk_accountancy_journal');
172 if ($fk_accountancy_journal <= 0) {
173 $object->fk_accountancy_journal = 0;
175 $object->fk_accountancy_journal = $fk_accountancy_journal;
189 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
191 $object->fk_user_author = $user->id;
194 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
199 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
204 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
210 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
216 $categories =
GETPOST(
'categories',
'array:int');
217 $object->setCategories($categories);
233 $urltogo = $backtopage ? str_replace(
'__ID__', (
string)
$object->id, $backtopage) : $backurlforlist;
234 $urltogo = preg_replace(
'/--IDFORBACKTOPAGE--/', (
string)
$object->id, $urltogo);
236 if (empty($noback)) {
237 header(
"Location: " . $urltogo);
245 if ($action ==
'update' && $user->hasRight(
'banque',
'configurer')) {
272 $object->owner_address = trim(
GETPOST(
"owner_address",
'alphanohtml'));
280 $account_number =
GETPOST(
'account_number',
'alphanohtml');
281 if (empty($account_number) || $account_number ==
'-1') {
284 $object->account_number = $account_number;
286 $fk_accountancy_journal =
GETPOSTINT(
'fk_accountancy_journal');
287 if ($fk_accountancy_journal <= 0) {
288 $object->fk_accountancy_journal = 0;
290 $object->fk_accountancy_journal = $fk_accountancy_journal;
295 $object->address = trim(
GETPOST(
"account_address",
"alphanohtml"));
301 $object->comment = trim(
GETPOST(
"account_comment",
'restricthtml'));
304 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"AccountancyCode")),
null,
'errors');
309 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Ref")),
null,
'errors');
314 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"LabelBankCashAccount")),
null,
'errors');
323 $ret = $extrafields->setOptionalsFromPost(
null, $object);
327 $result =
$object->update($user);
330 $categories =
GETPOST(
'categories',
'array:int');
331 $object->setCategories($categories);
348 if ($action ==
'confirm_delete' &&
GETPOST(
"confirm") ==
"yes" && $user->hasRight(
'banque',
'configurer')) {
352 $result =
$object->delete($user);
356 header(
"Location: " . DOL_URL_ROOT .
"/compta/bank/list.php");
370$form =
new Form($db);
375$countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
377$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas|DE:Modul_Banken_und_Barbestände';
378$title = $langs->trans(
"BankAccount");
379if ($action ==
'create') {
380 $title = $langs->trans(
"NewFinancialAccount");
381} elseif (!empty(
$object->ref)) {
382 $title =
$object->ref.
" - ".$langs->trans(
"Card");
388if ($action ==
'create') {
389 print
load_fiche_titre($langs->trans(
"NewFinancialAccount"),
'',
'bank_account');
391 if ($conf->use_javascript_ajax) {
392 print
"\n".
'<script type="text/javascript">';
393 print
'jQuery(document).ready(function () {
394 jQuery("#type").change(function() {
395 document.formsoc.action.value="create";
396 document.formsoc.submit();
398 jQuery("#selectaccount_country_id").change(function() {
399 document.formsoc.action.value="create";
400 document.formsoc.submit();
403 print
'</script>'.
"\n";
406 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" name="formsoc" method="post">';
407 print
'<input type="hidden" name="token" value="'.newToken().
'">';
408 print
'<input type="hidden" name="action" value="add">';
409 print
'<input type="hidden" name="clos" value="0">';
410 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
414 print
'<table class="border centpercent tableforfieldcreate">';
417 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
418 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>';
421 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LabelBankCashAccount").
'</td>';
422 print
'<td><input type="text" class="flat maxwidth150onsmartphone" name="label" value="'.dol_escape_htmltag(
GETPOST(
'label',
'alpha')).
'"></td></tr>';
425 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
427 $formbank->selectTypeOfBankAccount(GETPOSTISSET(
"type") ?
GETPOSTINT(
'type') :
Account::TYPE_CURRENT,
'type');
431 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency").
'</td>';
433 $selectedcode =
$object->currency_code;
434 if (!$selectedcode) {
435 $selectedcode = $conf->currency;
437 print $form->selectCurrency((GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
443 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
445 print $form->selectarray(
"clos",
$object->labelStatus, (
GETPOSTINT(
'clos') !=
'' ?
GETPOSTINT(
'clos') :
$object->
status), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth100 maxwidth150onsmartphone');
450 if (GETPOSTISSET(
"account_country_id")) {
451 $selectedcode =
GETPOST(
"account_country_id") ?
GETPOST(
"account_country_id") :
$object->country_code;
452 } elseif (empty($selectedcode)) {
453 $selectedcode =
$mysoc->country_code;
457 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccountCountry").
'</td>';
459 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
460 print $form->select_country($selectedcode,
'account_country_id');
462 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
467 print
'<tr><td>'.$langs->trans(
'State').
'</td><td>';
469 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
470 print $formcompany->select_state(GETPOSTISSET(
"account_state_id") ?
GETPOSTINT(
"account_state_id") : 0, $selectedcode,
'account_state_id');
472 print $countrynotdefined;
479 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
480 print
'<textarea class="flat quatrevingtpercent" name="account_address" rows="'.ROWS_2.
'">';
482 print
"</textarea></td></tr>";
486 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
488 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
489 print
'<input class="minwidth300 widthcentpercentminusx maxwidth500" type="text" class="flat" name="url" value="'.GETPOST(
"url").
'">';
494 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
495 print $form->selectCategories(Categorie::TYPE_ACCOUNT,
'categories', $object);
500 print
'<tr><td>'.$langs->trans(
"Comment").
'</td>';
503 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
504 $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%');
505 $doleditor->Create();
509 $parameters = array();
510 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
511 print $hookmanager->resPrint;
512 if (empty($reshook)) {
513 print
$object->showOptionals($extrafields,
'create', $parameters);
520 print
'<table class="border centpercent">';
523 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"InitialBankBalance").
'</td>';
524 print
'<td><input size="12" type="text" class="flat" name="solde" value="'.(GETPOSTISSET(
"solde") ?
GETPOST(
"solde") :
price2num(
$object->solde)).
'"></td></tr>';
526 print
'<tr><td>'.$langs->trans(
"Date").
'</td>';
529 print $form->selectDate($startdate,
're', 0, 0, 0,
'formsoc');
532 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
533 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>';
535 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
536 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>';
543 print
'<table class="border centpercent">';
546 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
547 print
'<td><input type="text" class="flat minwidth150" name="bank" value="'.(GETPOSTISSET(
'bank') ?
GETPOST(
'bank',
'alpha') :
$object->bank).
'"></td>';
551 $bickey =
"BICNumber";
552 if (
$object->getCountryCode() ==
'IN') {
557 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
558 print
'<td><input maxlength="34" type="text" class="flat minwidth300" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alpha') :
$object->iban).
'"></td></tr>';
561 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
562 print
'<td><input maxlength="11" type="text" class="flat minwidth150" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alpha') :
$object->bic).
'"></td></tr>';
566 foreach (
$object->getFieldsToShow() as $val) {
568 if ($val ==
'BankCode') {
569 $name =
'code_banque';
570 $sizecss =
'minwidth100';
571 $content =
$object->code_banque;
572 } elseif ($val ==
'DeskCode') {
573 $name =
'code_guichet';
574 $sizecss =
'minwidth100';
575 $content =
$object->code_guichet;
576 } elseif ($val ==
'BankAccountNumber') {
578 $sizecss =
'minwidth200';
580 } elseif ($val ==
'BankAccountNumberKey') {
582 $sizecss =
'minwidth50';
586 $sizecss =
'undefined';
587 $content =
'undefined';
590 print
'<td>'.$langs->trans($val).
'</td>';
591 print
'<td><input type="text" class="flat '.$sizecss.
'" name="'.$name.
'" value="'.(GETPOSTISSET($name) ?
GETPOST($name,
'alpha') : $content).
'"></td>';
597 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
598 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. (empty(
GETPOST(
'pti_in_ctti')) ?
'' :
' checked ') .
'>';
605 print
'<table class="border centpercent">';
606 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BankAccountOwner").
'</td>';
607 print
'<td><input type="text" class="flat minwidth300" name="proprio" value="'.(GETPOSTISSET(
'proprio') ?
GETPOST(
'proprio',
'alpha') :
$object->owner_name).
'">';
610 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
611 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
612 print(GETPOSTISSET(
'owner_address') ?
GETPOST(
'owner_address',
'alpha') :
$object->owner_address);
613 print
"</textarea></td></tr>";
615 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
616 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOSTISSET(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') :
$object->owner_zip).
'">';
619 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
620 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOSTISSET(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') :
$object->owner_town).
'">';
623 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
625 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
626 print $form->select_country(GETPOSTISSET(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') :
$object->owner_country_id,
'owner_country_id');
633 print
'<table class="border centpercent">';
637 $fieldrequired =
'fieldrequired ';
642 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
644 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
645 print $formaccounting->select_account(
$object->account_number,
'account_number', 1, array(), 1, 1);
646 if ($formaccounting->nbaccounts == 0) {
647 $langs->load(
"errors");
648 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
649 print $form->textwithpicto(
'', $htmltext);
653 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyCode").
'</td>';
654 print
'<td><input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
'account_number',
'alpha') :
$object->account_number).
'"></td></tr>';
660 print
'<tr><td class="'.$fieldrequired.
'titlefieldcreate">'.$langs->trans(
"AccountancyJournal").
'</td>';
662 print $formaccounting->select_journal((
string)
$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="titlefieldmiddle">'.$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>';
739 if (empty(
$object->account_number)) {
743 $accountingaccount->fetch(0,
$object->account_number, 1);
744 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
753 print
'<tr><td>'.$langs->trans(
"AccountancyJournal").
'</td>';
755 if (empty(
$object->fk_accountancy_journal)) {
757 } elseif (
$object->fk_accountancy_journal > 0) {
759 $accountingjournal->fetch(
$object->fk_accountancy_journal);
760 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
767 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
772 print
'<div class="fichehalfright">';
773 print
'<div class="underbanner clearboth"></div>';
775 print
'<table class="border tableforfield centpercent">';
779 print
'<tr><td class="titlefield">'.$langs->trans(
"Categories").
'</td><td>';
780 print $form->showCategories(
$object->id, Categorie::TYPE_ACCOUNT, 1);
784 print
'<tr><td class="tdtop titlefield">'.$langs->trans(
"Comment").
'</td>';
785 print
'<td>'.dol_htmlentitiesbr(
$object->comment).
'</td></tr>';
790 print
'<table class="border tableforfield centpercent">';
792 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"BankName").
'</td>';
793 print
'<td>'.$object->bank.
'</td></tr>';
796 $bickey =
"BICNumber";
797 if (
$object->getCountryCode() ==
'IN') {
802 print
'<tr><td>'.$langs->trans($ibankey).
'</td>';
803 print
'<td>'.getIbanHumanReadable($object).
' ';
806 print
img_picto($langs->trans(
"IbanNotValid"),
'warning');
808 print
img_picto($langs->trans(
"IbanValid"),
'tick');
814 print
'<tr><td>'.$langs->trans($bickey).
'</td>';
815 print
'<td>'.$object->bic.
' ';
818 print
img_picto($langs->trans(
"SwiftNotValid"),
'warning');
820 print
img_picto($langs->trans(
"SwiftValid"),
'tick');
828 foreach (
$object->getFieldsToShow() as $val) {
830 if ($val ==
'BankCode') {
831 $content =
$object->code_banque;
832 } elseif ($val ==
'DeskCode') {
833 $content =
$object->code_guichet;
834 } elseif ($val ==
'BankAccountNumber') {
836 } elseif ($val ==
'BankAccountNumberKey') {
840 print
'<tr><td>'.$langs->trans($val).
'</td>';
841 print
'<td>'.$content.
'</td>';
846 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
847 print
'<td>'.$object->ics.
'</td>';
853 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
854 print
'<td>'.$object->ics_transfer.
'</td>';
858 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td><td>';
859 print(empty(
$object->pti_in_ctti) ? $langs->trans(
"No") : $langs->trans(
"Yes"));
860 print
"</td></tr>\n";
864 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td><td>';
866 print
"</td></tr>\n";
868 print
'<tr><td>'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
869 print nl2br(
$object->owner_address);
870 print
"</td></tr>\n";
872 print
'<tr><td>'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
873 print
'<td>'.dol_escape_htmltag(
$object->owner_zip);
876 print
'<tr><td>'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
877 print
'<td>'.dol_escape_htmltag(
$object->owner_town);
880 print
'<tr><td>'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
883 $langs->load(
"dict");
884 print(empty(
$object->owner_country_code) ?
'' : $langs->convToOutputCharset($langs->transnoentitiesnoconv(
"Country".
$object->owner_country_code)));
894 print
'<div class="clearboth"></div>';
901 print
'<div class="tabsAction">';
902 $parameters = array();
903 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
908 if (empty($reshook)) {
909 if ($user->hasRight(
'banque',
'configurer')) {
910 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'&id='.
$object->id.
'">'.$langs->trans(
"Modify").
'</a>';
913 $canbedeleted =
$object->can_be_deleted();
914 if ($user->hasRight(
'banque',
'configurer') && $canbedeleted) {
915 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&id='.
$object->id.
'">'.$langs->trans(
"Delete").
'</a>';
928 if (
GETPOSTINT(
'id') && $action ==
'edit' && $user->hasRight(
'banque',
'configurer')) {
929 print
load_fiche_titre($langs->trans(
"EditFinancialAccount"),
'',
'bank_account');
931 if ($conf->use_javascript_ajax) {
932 print
"\n".
'<script type="text/javascript">';
933 print
'jQuery(document).ready(function () {
934 jQuery("#type").change(function() {
935 document.formsoc.action.value="edit";
936 document.formsoc.submit();
940 print
'jQuery(document).ready(function () {
941 jQuery("#selectaccount_country_id").change(function() {
942 document.formsoc.action.value="edit";
943 document.formsoc.submit();
946 print
'</script>'.
"\n";
949 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post" name="formsoc">';
950 print
'<input type="hidden" name="token" value="'.newToken().
'">';
951 print
'<input type="hidden" name="action" value="update">';
952 print
'<input type="hidden" name="id" value="'.GETPOSTINT(
"id").
'">'.
"\n\n";
953 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
959 print
'<table class="border centpercent tableforfieldcreate">';
962 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Ref").
'</td>';
963 print
'<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET(
'ref') ?
GETPOST(
'ref',
'alpha') :
$object->
ref).
'" maxlength="12" autofocus></td></tr>';
966 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
967 print
'<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(GETPOSTISSET(
'label') ?
GETPOST(
'label',
'alpha') :
$object->label).
'"></td></tr>';
970 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountType").
'</td>';
971 print
'<td class="maxwidth200onsmartphone">';
972 $formbank->selectTypeOfBankAccount((GETPOSTISSET(
'type') ?
GETPOSTINT(
'type') :
$object->
type),
'type');
976 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency");
977 print
'<input type="hidden" value="'.$object->currency_code.
'">';
979 print
'<td class="maxwidth200onsmartphone">';
980 $selectedcode =
$object->currency_code;
981 if (!$selectedcode) {
982 $selectedcode = $conf->currency;
984 print
img_picto(
'',
'multicurrency',
'class="pictofixedwidth"');
985 print $form->selectCurrency((GETPOSTISSET(
"account_currency_code") ?
GETPOST(
"account_currency_code") : $selectedcode),
'account_currency_code');
991 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td>';
992 print
'<td class="maxwidth200onsmartphone">';
998 $selectedcode =
$object->country_code;
999 if (GETPOSTISSET(
"account_country_id")) {
1000 $selectedcode =
GETPOST(
"account_country_id");
1001 } elseif (empty($selectedcode)) {
1002 $selectedcode =
$mysoc->country_code;
1006 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Country").
'</td>';
1007 print
'<td class="maxwidth200onsmartphone">';
1008 print
img_picto(
'',
'country',
'class="pictofixedwidth"').$form->select_country($selectedcode,
'account_country_id');
1010 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1015 print
'<tr><td>'.$langs->trans(
'State').
'</td><td class="maxwidth200onsmartphone">';
1016 if ($selectedcode) {
1017 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
1018 print $formcompany->select_state(GETPOSTISSET(
"account_state_id") ?
GETPOST(
"account_state_id") :
$object->state_id, $selectedcode,
'account_state_id');
1020 print $countrynotdefined;
1027 print
'<tr><td>'.$langs->trans(
"BankAccountDomiciliation").
'</td><td>';
1028 print
'<textarea class="flat quatrevingtpercent" name="account_address" rows="'.ROWS_2.
'">';
1030 print
"</textarea></td></tr>";
1034 print
'<tr><td>'.$langs->trans(
"Conciliable").
'</td>';
1036 $conciliate =
$object->canBeConciliated();
1037 if ($conciliate == -2) {
1038 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"CashAccount").
')</span>';
1039 } elseif ($conciliate == -3) {
1040 print $langs->trans(
"No").
' <span class="opacitymedium">('.$langs->trans(
"Closed").
')</span>';
1042 print
'<input type="checkbox" class="flat" id="norappro" name="norappro"'.(($conciliate > 0) ?
'' :
' checked="checked"').
'"> <label for="norappro" class="opacitymedium">'.$langs->trans(
"DisableConciliation").
'</label>';
1047 print
'<tr><td>'.$langs->trans(
"BalanceMinimalAllowed").
'</td>';
1048 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>';
1050 print
'<tr><td>'.$langs->trans(
"BalanceMinimalDesired").
'</td>';
1051 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>';
1054 print
'<tr><td>'.$langs->trans(
"Web").
'</td>';
1056 print
img_picto(
'',
'globe',
'class="pictofixedwidth"');
1057 print
'<input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET(
"url") ?
GETPOST(
"url") :
$object->url).
'">';
1062 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1063 print $form->selectCategories(Categorie::TYPE_ACCOUNT,
'categories', $object);
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>';
1103 print
img_picto(
'',
'accounting_account',
'class="pictofixedwidth"');
1104 print $formaccounting->select_account(
$object->account_number,
'account_number', 1, array(), 1, 1);
1105 if ($formaccounting->nbaccounts == 0) {
1106 $langs->load(
"errors");
1107 $htmltext = $langs->transnoentitiesnoconv(
"WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv(
"MenuAccountancy"), $langs->transnoentitiesnoconv(
"Setup"), $langs->transnoentitiesnoconv(
"Chartofaccounts"));
1108 print $form->textwithpicto(
'', $htmltext);
1111 print
'<input type="text" name="account_number" value="'.(GETPOST(
"account_number") ?
GETPOST(
"account_number") :
$object->account_number).
'">';
1118 print
'<tr><td class="fieldrequired">'.$langs->trans(
"AccountancyJournal").
'</td>';
1120 print $formaccounting->select_journal((
string)
$object->fk_accountancy_journal,
'fk_accountancy_journal', 4, 1, 0, 0);
1130 print
'<table class="border centpercent">';
1133 print
'<tr class="liste_titre_add"><td class="titlefieldcreate">'.$langs->trans(
"BankName").
'</td>';
1134 print
'<td><input type="text" class="flat width300" name="bank" value="'.$object->bank.
'"></td>';
1138 $bickey =
"BICNumber";
1139 if (
$object->getCountryCode() ==
'IN') {
1145 $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';
1146 print $form->textwithpicto($langs->trans($ibankey), $tooltip, 1,
'help',
'', 0, 3,
'iban');
1148 print
'<td><input class="minwidth300 maxwidth200onsmartphone" maxlength="34" type="text" class="flat" name="iban" value="'.(GETPOSTISSET(
'iban') ?
GETPOST(
'iban',
'alphanohtml') :
$object->iban).
'"></td></tr>';
1152 $tooltip = $langs->trans(
"Example").
': LIABLT2XXXX';
1153 print $form->textwithpicto($langs->trans($bickey), $tooltip, 1,
'help',
'', 0, 3,
'bic');
1155 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOSTISSET(
'bic') ?
GETPOST(
'bic',
'alphanohtml') :
$object->bic).
'"></td></tr>';
1158 foreach (
$object->getFieldsToShow() as $val) {
1160 if ($val ==
'BankCode') {
1161 $name =
'code_banque';
1163 $content =
$object->code_banque;
1164 } elseif ($val ==
'DeskCode') {
1165 $name =
'code_guichet';
1167 $content =
$object->code_guichet;
1168 } elseif ($val ==
'BankAccountNumber') {
1172 } elseif ($val ==
'BankAccountNumberKey') {
1177 $name =
'undefined';
1179 $content =
'undefined';
1182 print
'<tr><td>'.$langs->trans($val).
'</td>';
1183 print
'<td><input type="text" class="flat '.$css.
'" name="'.$name.
'" value="'.
dol_escape_htmltag($content).
'"></td>';
1188 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"ICS"), $langs->trans(
"ICS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"StandingOrder")).
')').
'</td>';
1189 print
'<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET(
'ics') ?
GETPOST(
'ics',
'alphanohtml') :
$object->ics).
'"></td></tr>';
1194 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"IDS"), $langs->trans(
"IDS").
' ('.$langs->trans(
"UsedFor", $langs->transnoentitiesnoconv(
"BankTransfer")).
')').
'</td>';
1195 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>';
1197 if (
$mysoc->isInSEPA()) {
1198 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation"), $langs->trans(
"SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp")).
'</td>';
1199 print
'<td><input type="checkbox" class="flat" name="pti_in_ctti"'. (
$object->pti_in_ctti ?
' checked ' :
'') .
'>';
1208 print
'<table class="border centpercent">';
1210 print
'<tr><td>'.$langs->trans(
"BankAccountOwner").
'</td>';
1211 print
'<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="proprio" value="'.(GETPOSTISSET(
'proprio') ?
GETPOST(
'proprio',
'alpha') :
$object->owner_name).
'"></td>';
1214 print
'<tr><td class="titlefieldcreate tdtop">'.$langs->trans(
"BankAccountOwnerAddress").
'</td><td>';
1215 print
'<textarea class="flat quatrevingtpercent" name="owner_address" rows="'.ROWS_2.
'">';
1216 print GETPOSTISSET(
'owner_address') ?
GETPOST(
'owner_address',
'alpha') :
$object->owner_address;
1217 print
"</textarea></td></tr>";
1219 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerZip").
'</td>';
1220 print
'<td><input type="text" class="flat maxwidth100" name="owner_zip" value="'.(GETPOSTISSET(
'owner_zip') ?
GETPOST(
'owner_zip',
'alpha') :
$object->owner_zip).
'">';
1223 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerTown").
'</td>';
1224 print
'<td><input type="text" class="flat maxwidth200" name="owner_town" value="'.(GETPOSTISSET(
'owner_town') ?
GETPOST(
'owner_town',
'alpha') :
$object->owner_town).
'">';
1227 print
'<tr><td class="tdtop">'.$langs->trans(
"BankAccountOwnerCountry").
'</td>';
1229 print
img_picto(
'',
'country',
'class="pictofixedwidth"');
1230 print $form->select_country(GETPOSTISSET(
'owner_country_id') ?
GETPOST(
'owner_country_id',
'alpha') :
$object->owner_country_id,
'owner_country_id');
1238 print $form->buttonsSaveCancel(
"Modify");
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
checkIbanForAccount($account=null, $ibantocheck=null)
Check IBAN number information for a bank account.
bank_prepare_head(Account $object)
Prepare array with list of tabs.
checkSwiftForAccount($account=null, $swift=null)
Check SWIFT information for a bank account.
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 a WYSIWYG editor.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
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...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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, $morecssdiv='')
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
div refaddress div address
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
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.