diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index a864168d161..e9f9f9e5e65 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -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);