|
@@ -89,8 +89,7 @@ if ($_POST["action"] == 'add')
|
|
|
$account->proprio = trim($_POST["proprio"]);
|
|
|
$account->owner_address = trim($_POST["owner_address"]);
|
|
|
|
|
|
- if (GETPOST('account_number') <= 0) { $accountancy_code_number = ''; } else { $accountancy_code_number = GETPOST('account_number'); }
|
|
|
- $account->account_number = $accountancy_code_number;
|
|
|
+ $account->account_number = GETPOST('account_number');
|
|
|
$account->accountancy_journal = trim($_POST["accountancy_journal"]);
|
|
|
|
|
|
$account->solde = $_POST["solde"];
|
|
@@ -172,8 +171,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|
|
$account->proprio = trim($_POST["proprio"]);
|
|
|
$account->owner_address = trim($_POST["owner_address"]);
|
|
|
|
|
|
- if (GETPOST('account_number') <= 0) { $accountancy_code_number = ''; } else { $accountancy_code_number = GETPOST('account_number'); }
|
|
|
- $account->account_number = $accountancy_code_number;
|
|
|
+ $account->account_number = GETPOST('account_number');
|
|
|
$account->accountancy_journal = trim($_POST["accountancy_journal"]);
|
|
|
|
|
|
$account->currency_code = trim($_POST["account_currency_code"]);
|
|
@@ -287,7 +285,7 @@ if ($action == 'create')
|
|
|
|
|
|
// Ref
|
|
|
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
|
|
- print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$account->ref).'" maxlength="12"></td></tr>';
|
|
|
+ print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.(GETPOST("ref")?GETPOST("ref",'alpha'):$account->ref).'" maxlength="12"></td></tr>';
|
|
|
|
|
|
// Label
|
|
|
print '<tr><td class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
|
|
@@ -393,10 +391,10 @@ if ($action == 'create')
|
|
|
print '</td></tr>';
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
|
|
- print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_allowed" value="'.($_POST["account_min_allowed"]?$_POST["account_min_allowed"]:$account->min_allowed).'"></td></tr>';
|
|
|
+ print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(GETPOST("account_min_allowed")?GETPOST("account_min_allowed"):$account->min_allowed).'"></td></tr>';
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
|
|
|
- print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.($_POST["account_min_desired"]?$_POST["account_min_desired"]:$account->min_desired).'"></td></tr>';
|
|
|
+ print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.(GETPOST("account_min_desired")?GETPOST("account_min_desired"):$account->min_desired).'"></td></tr>';
|
|
|
|
|
|
print '</table>';
|
|
|
print '<br>';
|
|
@@ -407,7 +405,7 @@ if ($action == 'create')
|
|
|
|
|
|
// If bank account
|
|
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("BankName").'</td>';
|
|
|
- print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$account->bank.'"></td>';
|
|
|
+ print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.(GETPOST('bank')?GETPOST('bank','alpha'):$account->bank).'"></td>';
|
|
|
print '</tr>';
|
|
|
|
|
|
// Show fields of bank account
|
|
@@ -431,7 +429,7 @@ if ($action == 'create')
|
|
|
}
|
|
|
|
|
|
print '<td>'.$langs->trans($val).'</td>';
|
|
|
- print '<td><input size="'.$size.'" type="text" class="flat" name="'.$name.'" value="'.$content.'"></td>';
|
|
|
+ print '<td><input size="'.$size.'" type="text" class="flat" name="'.$name.'" value="'.(GETPOST($name)?GETPOST($name,'alpha'):$content).'"></td>';
|
|
|
print '</tr>';
|
|
|
}
|
|
|
$ibankey = FormBank::getIBANLabel($account);
|
|
@@ -440,23 +438,23 @@ if ($action == 'create')
|
|
|
|
|
|
// IBAN
|
|
|
print '<tr><td>'.$langs->trans($ibankey).'</td>';
|
|
|
- print '<td colspan="3"><input size="34" maxlength="34" type="text" class="flat" name="iban" value="'.$account->iban.'"></td></tr>';
|
|
|
+ print '<td colspan="3"><input size="34" maxlength="34" type="text" class="flat" name="iban" value="'.(GETPOST('iban')?GETPOST('iban','alpha'):$account->iban).'"></td></tr>';
|
|
|
|
|
|
print '<tr><td>'.$langs->trans($bickey).'</td>';
|
|
|
- print '<td colspan="3"><input size="11" maxlength="11" type="text" class="flat" name="bic" value="'.$account->bic.'"></td></tr>';
|
|
|
+ print '<td colspan="3"><input size="11" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOST('bic')?GETPOST('bic','alpha'):$account->bic).'"></td></tr>';
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
|
|
print "<textarea class=\"flat\" name=\"domiciliation\" rows=\"2\" cols=\"40\">";
|
|
|
- print $account->domiciliation;
|
|
|
+ print (GETPOST('domiciliation')?GETPOST('domiciliation'):$account->domiciliation);
|
|
|
print "</textarea></td></tr>";
|
|
|
|
|
|
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';
|
|
|
- print '<td colspan="3"><input size="30" type="text" class="flat" name="proprio" value="'.$account->proprio.'">';
|
|
|
+ print '<td colspan="3"><input size="30" type="text" class="flat" name="proprio" value="'.(GETPOST('proprio')?GETPOST('proprio','alpha'):$account->proprio).'">';
|
|
|
print '</td></tr>';
|
|
|
|
|
|
print '<tr><td class="tdtop">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
|
|
print "<textarea class=\"flat\" name=\"owner_address\" rows=\"2\" cols=\"40\">";
|
|
|
- print $account->owner_address;
|
|
|
+ print (GETPOST('owner_address')?GETPOST('owner_address','alpha'):$account->owner_address);
|
|
|
print "</textarea></td></tr>";
|
|
|
|
|
|
print '</table>';
|