Update create.php
Fix : unable to create a direct debit if ics and ics_transfer are empty even though ics_transfer is only used for bank transfer.
This commit is contained in:
parent
a57e8a14b8
commit
18da6e6d6f
@ -95,7 +95,9 @@ if (empty($reshook)) {
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
$bank = new Account($db);
|
$bank = new Account($db);
|
||||||
$bank->fetch($conf->global->{$default_account});
|
$bank->fetch($conf->global->{$default_account});
|
||||||
if (empty($bank->ics) || empty($bank->ics_transfer)) {
|
if ((empty($bank->ics) && $type !== 'bank-transfer')
|
||||||
|
|| (empty($bank->ics_transfer) && $type === 'bank-transfer')
|
||||||
|
) {
|
||||||
$errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}'));
|
$errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}'));
|
||||||
setEventMessages($errormessage, null, 'errors');
|
setEventMessages($errormessage, null, 'errors');
|
||||||
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php');
|
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user