update code

This commit is contained in:
Philippe GRAND 2022-09-04 13:30:34 +02:00
parent 2cd48587ed
commit 4ecceb1fd0
5 changed files with 11 additions and 11 deletions

View File

@ -248,7 +248,7 @@ if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && empty($conf-
}
}
if (!empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) {
if (isModEnabled('accounting') && $line->fk_accounting_account > 0) {
$accountingaccount = new AccountingAccount($this->db);
$accountingaccount->fetch($line->fk_accounting_account);
print '<div class="clearboth"></div><br><span class="opacitymedium">'.$langs->trans('AccountingAffectation').' : </span>'.$accountingaccount->getNomUrl(0, 1, 1);

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
}
@ -169,7 +169,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
$dir = "../../core/modules/dons/";
$form = new Form($db);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
}
@ -335,7 +335,7 @@ print '<td>';
$label = $langs->trans("AccountAccounting");
print '<label for="DONATION_ACCOUNTINGACCOUNT">'.$label.'</label></td>';
print '<td class="center">';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, '', 1, 1);
} else {
print '<input type="text" size="10" id="DONATION_ACCOUNTINGACCOUNT" name="DONATION_ACCOUNTINGACCOUNT" value="'.$conf->global->DONATION_ACCOUNTINGACCOUNT.'">';

View File

@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
@ -1989,7 +1989,7 @@ if ($action == 'create') {
$bankaccountstatic->label = $objp->baref;
$bankaccountstatic->number = $objp->banumber;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$bankaccountstatic->account_number = $objp->account_number;
$accountingjournal = new AccountingJournal($db);
@ -2121,7 +2121,7 @@ if ($action == 'create') {
}
$titlealt = '';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
$accountingaccount = new AccountingAccount($db);
$resaccountingaccount = $accountingaccount->fetch(0, $line->type_fees_accountancy_code, 1);

View File

@ -40,10 +40,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
}

View File

@ -1212,13 +1212,13 @@ class ProductFournisseur extends Product
}
}
if (!empty($conf->accounting->enabled) && $this->status) {
if (isModEnabled('accounting') && $this->status) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
$label .= '<br><b>'.$langs->trans('ProductAccountancySellCode').':</b> '.length_accountg($this->accountancy_code_sell);
$label .= '<br><b>'.$langs->trans('ProductAccountancySellIntraCode').':</b> '.length_accountg($this->accountancy_code_sell_intra);
$label .= '<br><b>'.$langs->trans('ProductAccountancySellExportCode').':</b> '.length_accountg($this->accountancy_code_sell_export);
}
if (!empty($conf->accounting->enabled) && $this->status_buy) {
if (isModEnabled('accounting') && $this->status_buy) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
$label .= '<br><b>'.$langs->trans('ProductAccountancyBuyCode').':</b> '.length_accountg($this->accountancy_code_buy);
$label .= '<br><b>'.$langs->trans('ProductAccountancyBuyIntraCode').':</b> '.length_accountg($this->accountancy_code_buy_intra);