diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index e6721e1b73d..c155531c286 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -286,7 +286,7 @@ if ($action == 'create') // Type print ''.$langs->trans("AccountType").''; print ''; - $formbank->selectTypeOfBankAccount(isset($_POST["type"])?$_POST["type"]:1,"type"); + $formbank->selectTypeOfBankAccount(isset($_POST["type"])?$_POST["type"]: Account::TYPE_CURRENT,"type"); print ''; // Currency @@ -377,7 +377,7 @@ if ($action == 'create') print ''; print '
'; - if ($_POST["type"] == 0 || $_POST["type"] == 1) + if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT) { print ''; @@ -927,7 +927,7 @@ else print '
'; print '
'; - if ($_POST["type"] == 0 || $_POST["type"] == 1) + if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT) { print ''; @@ -1030,36 +1030,20 @@ else print '
'; // Accountancy code - if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) - { - if (! empty($conf->accounting->enabled)) - { - print ''; - print ''; - } - else - { - print ''; - print ''; - } + $tdextra = ''; + + if (!empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { + $tdextra = ' class="fieldrequired"'; } - else - { - if (! empty($conf->accounting->enabled)) - { - print ''; - print ''; - } - else - { - print ''; - print ''; - } + + print ''.$langs->trans("AccountancyCode").''; + print ''; // Accountancy journal if (! empty($conf->accounting->enabled))
'.$langs->trans("AccountancyCode").''; - print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1); - print '
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyCode").''; - print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1); - print '
'.$langs->trans("AccountancyCode").'account_number).'">
'; + if (!empty($conf->accounting->enabled)) { + print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1); + } else { + print 'account_number).'">'; } + print '