Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-08-29 11:25:07 +02:00
parent 502078cf37
commit 7aa371815a

View File

@ -170,7 +170,7 @@ if (empty($reshook)) {
$error++;
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0) {
setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
@ -244,7 +244,7 @@ if (empty($reshook)) {
$multicurrency_code[$key] = $tmpinvoice->multicurrency_code;
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// If the bank module is active, an account is required to input a payment
if (GETPOST('accountid', 'int') <= 0) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
@ -492,7 +492,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Bank account
print '<tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($facture->type != 2) {
print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>';
}