Little refactor
This commit is contained in:
parent
ba4f5c8648
commit
59bfac65aa
@ -286,7 +286,7 @@ if ($action == 'create')
|
|||||||
// Type
|
// Type
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$formbank->selectTypeOfBankAccount(isset($_POST["type"])?$_POST["type"]:1,"type");
|
$formbank->selectTypeOfBankAccount(isset($_POST["type"])?$_POST["type"]: Account::TYPE_CURRENT,"type");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Currency
|
// Currency
|
||||||
@ -377,7 +377,7 @@ if ($action == 'create')
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if ($_POST["type"] == 0 || $_POST["type"] == 1)
|
if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT)
|
||||||
{
|
{
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -929,7 +929,7 @@ else
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if ($_POST["type"] == 0 || $_POST["type"] == 1)
|
if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT)
|
||||||
{
|
{
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -1033,36 +1033,20 @@ else
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Accountancy code
|
// Accountancy code
|
||||||
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
|
$tdextra = '';
|
||||||
{
|
|
||||||
if (! empty($conf->accounting->enabled))
|
if (!empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) {
|
||||||
{
|
$tdextra = ' class="fieldrequired"';
|
||||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
|
||||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST("account_number"):$account->account_number).'"></td></tr>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
print '<tr><td'.$tdextra.'>'.$langs->trans("AccountancyCode").'</td>';
|
||||||
if (! empty($conf->accounting->enabled))
|
print '<td colspan="3"'.$tdextra.'>';
|
||||||
{
|
if (!empty($conf->accounting->enabled)) {
|
||||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1);
|
||||||
print '<td>';
|
} else {
|
||||||
print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1);
|
print '<input type="text" name="account_number" value="'.(GETPOST("account_number") ? GETPOST("account_number") : $account->account_number).'">';
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<tr><td width="25%">'.$langs->trans("AccountancyCode").'</td>';
|
|
||||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST("account_number"):$account->account_number).'"></td></tr>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Accountancy journal
|
// Accountancy journal
|
||||||
if (! empty($conf->accounting->enabled))
|
if (! empty($conf->accounting->enabled))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user