Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-08-29 11:34:56 +02:00
parent 5b810db990
commit b1514af198

View File

@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
@ -494,7 +494,7 @@ if ($action == 'create') {
print "</td>\n";
print "</tr>";
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// Bank account
print '<tr><td class="fieldrequired" id="label_fk_account">'.$langs->trans("BankAccount").'</td><td>';
print img_picto('', 'bank_account', 'pictofixedwidth');
@ -629,7 +629,7 @@ if ($id > 0) {
print '</td></tr>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('BankAccount');
@ -660,7 +660,7 @@ if ($id > 0) {
print '<div class="fichehalfright">';
$nbcols = 3;
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$nbcols++;
}
@ -695,7 +695,7 @@ if ($id > 0) {
print '<td>'.$langs->trans("RefPayment").'</td>';
print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="liste_titre right">'.$langs->trans('BankAccount').'</td>';
}
print '<td class="right">'.$langs->trans("Amount").'</td>';
@ -712,14 +712,14 @@ if ($id > 0) {
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref;
$bankaccountstatic->number = $objp->banumber;
$bankaccountstatic->currency_code = $objp->bacurrency_code;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$bankaccountstatic->account_number = $objp->account_number;
$accountingjournal = new AccountingJournal($db);