Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-08-29 11:23:57 +02:00
parent 4075397f7a
commit a269b1181a

View File

@ -1408,7 +1408,7 @@ class Invoices extends DolibarrApi
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if (empty($accountid)) {
throw new RestException(400, 'Account ID is mandatory');
}
@ -1467,7 +1467,7 @@ class Invoices extends DolibarrApi
throw new RestException(400, 'Payment error : '.$paymentobj->error);
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$label = '(CustomerInvoicePayment)';
if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) {
@ -1531,7 +1531,7 @@ class Invoices extends DolibarrApi
}
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if (empty($accountid)) {
throw new RestException(400, 'Account ID is mandatory');
}
@ -1615,7 +1615,7 @@ class Invoices extends DolibarrApi
$this->db->rollback();
throw new RestException(400, 'Payment error : '.$paymentobj->error);
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$label = '(CustomerInvoicePayment)';
if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) {
throw new RestException(400, 'Emetteur is mandatory when payment code is '.$paymentobj->paiementcode);