Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-08-29 11:21:34 +02:00
parent 88a68c12db
commit 1d875ef025

View File

@ -423,11 +423,11 @@ class PaymentVarious extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -5;
}
if (!empty($conf->banque->enabled) && (empty($this->fk_account) || $this->fk_account <= 0)) {
if (isModEnabled('banque') && (empty($this->fk_account) || $this->fk_account <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount"));
return -6;
}
if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) {
if (isModEnabled('banque') && (empty($this->type_payment) || $this->type_payment <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
return -7;
}
@ -481,7 +481,7 @@ class PaymentVarious extends CommonObject
$this->ref = $this->id;
if ($this->id > 0) {
if (!empty($conf->banque->enabled) && !empty($this->amount)) {
if (isModEnabled('banque') && !empty($this->amount)) {
// Insert into llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';