NEW Bank name no more mandatory on creation. Can be generated if empty.
This commit is contained in:
parent
7668233d0c
commit
756a971dad
@ -257,13 +257,8 @@ if (empty($reshook)) {
|
|||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (!GETPOST('label', 'alpha') || !GETPOST('bank', 'alpha')) {
|
if (!GETPOST('label', 'alpha')) {
|
||||||
if (!GETPOST('label', 'alpha')) {
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
|
||||||
}
|
|
||||||
if (!GETPOST('bank', 'alpha')) {
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankName")), null, 'errors');
|
|
||||||
}
|
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -274,6 +269,8 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
$companybankaccount->socid = $object->id;
|
$companybankaccount->socid = $object->id;
|
||||||
|
|
||||||
|
$companybankaccount->fetch_thirdparty();
|
||||||
|
|
||||||
$companybankaccount->bank = GETPOST('bank', 'alpha');
|
$companybankaccount->bank = GETPOST('bank', 'alpha');
|
||||||
$companybankaccount->label = GETPOST('label', 'alpha');
|
$companybankaccount->label = GETPOST('label', 'alpha');
|
||||||
$companybankaccount->courant = GETPOST('courant', 'alpha');
|
$companybankaccount->courant = GETPOST('courant', 'alpha');
|
||||||
@ -293,6 +290,12 @@ if (empty($reshook)) {
|
|||||||
$companybankaccount->datec = dol_now();
|
$companybankaccount->datec = dol_now();
|
||||||
$companybankaccount->status = 1;
|
$companybankaccount->status = 1;
|
||||||
|
|
||||||
|
$companybankaccount->bank = trim($companybankaccount->bank);
|
||||||
|
if (empty($companybankaccount->bank) && !empty($companybankaccount->thirdparty)) {
|
||||||
|
$companybankaccount->bank = $langs->trans("Bank").' '.$companybankaccount->thirdparty->name;
|
||||||
|
}
|
||||||
|
$companybankaccount->bic = str_replace(' ', '', $companybankaccount->bic);
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
// This test can be done only once properties were set
|
// This test can be done only once properties were set
|
||||||
@ -1980,7 +1983,7 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) {
|
|||||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td>';
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td>';
|
||||||
print '<td><input class="minwidth200" type="text" id="label" name="label" value="'.(GETPOSTISSET('label') ? GETPOST('label') : $object->name).'"></td></tr>';
|
print '<td><input class="minwidth200" type="text" id="label" name="label" value="'.(GETPOSTISSET('label') ? GETPOST('label') : $object->name).'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Bank").'</td>';
|
print '<tr><td>'.$langs->trans("Bank").'</td>';
|
||||||
print '<td><input class="minwidth200" type="text" id="bank" name="bank" value="'.GETPOST('bank').'"></td></tr>';
|
print '<td><input class="minwidth200" type="text" id="bank" name="bank" value="'.GETPOST('bank').'"></td></tr>';
|
||||||
|
|
||||||
// Show fields of bank account
|
// Show fields of bank account
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user