Merge pull request #21937 from aspangaro/16p5

Use IsModEnabled
This commit is contained in:
Laurent Destailleur 2022-08-30 01:16:36 +02:00 committed by GitHub
commit 33278901a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
83 changed files with 388 additions and 388 deletions

View File

@ -102,7 +102,7 @@ $arrayfields = array(
);
// Security check
if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled)) {
if (!isModEnabled('comptabilite') && !isModEnabled('accounting')) {
accessforbidden();
}
if ($user->socid > 0) {
@ -111,12 +111,12 @@ if ($user->socid > 0) {
// Define $arrayofentities if multientity is set.
$arrayofentities = array();
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
if (isModEnabled('multicompany') && is_object($mc)) {
$arrayofentities = $mc->getEntitiesList();
}
$entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : (GETPOSTISSET('search_entity') ? GETPOST('search_entity', 'int') : $conf->entity));
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
if (isModEnabled('multicompany') && is_object($mc)) {
if (empty($entity) && !empty($conf->global->MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES)) {
$entity = '0,'.join(',', array_keys($arrayofentities));
}
@ -129,13 +129,13 @@ $error = 0;
$listofchoices = array(
'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)),
'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->facture->lire)),
'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)),
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)),
'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled), 'perms' => !empty($user->rights->tax->charges->lire)),
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled), 'perms' => !empty($user->rights->salaries->read)),
'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled), 'perms' => !empty($user->rights->banque->lire)),
'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled), 'perms' => !empty($user->rights->loan->read)),
'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => !empty($user->rights->fournisseur->facture->lire)),
'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)),
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->don->lire)),
'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)),
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => !empty($user->rights->salaries->read)),
'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => isModEnabled('banque'), 'perms' => !empty($user->rights->banque->lire)),
'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->loan->read)),
);
@ -444,7 +444,7 @@ if ($result && $action == "dl" && !$error) {
dol_mkdir($dirfortmpfile);
$log = $langs->transnoentitiesnoconv("Type");
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
if (isModEnabled('multicompany') && is_object($mc)) {
$log .= ','.$langs->transnoentitiesnoconv("Entity");
}
$log .= ','.$langs->transnoentitiesnoconv("Date");
@ -478,7 +478,7 @@ if ($result && $action == "dl" && !$error) {
}
$log .= '"'.$langs->trans($file['item']).'"';
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
if (isModEnabled('multicompany') && is_object($mc)) {
$log .= ',"'.(empty($arrayofentities[$file['entity']]) ? $file['entity'] : $arrayofentities[$file['entity']]).'"';
}
$log .= ','.dol_print_date($file['date'], 'dayrfc');
@ -549,7 +549,7 @@ print '<form name="searchfiles" action="?action=searchfiles" method="POST">'."\n
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<span class="opacitymedium">'.$langs->trans("ExportAccountingSourceDocHelp");
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print ' '.$langs->trans("ExportAccountingSourceDocHelp2", $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Journals"));
}
print '</span><br>';
@ -562,7 +562,7 @@ print $form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0, '', '', '
print "\n";
// Export is for current company only
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
if (isModEnabled('multicompany') && is_object($mc)) {
$mc->getInfo($conf->entity);
print '<span class="marginleftonly marginrightonly'.(empty($conf->global->MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES) ? ' opacitymedium' : '').'">('.$langs->trans("Entity").' : ';
print "<td>";
@ -657,21 +657,21 @@ if (!empty($date_start) && !empty($date_stop)) {
print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'nowraponall ');
print '<td>'.$langs->trans("Document").'</td>';
print '<td>'.$langs->trans("Paid").'</td>';
print '<td align="right">'.$langs->trans("TotalHT").($conf->multicurrency->enabled ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalTTC").($conf->multicurrency->enabled ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalVAT").($conf->multicurrency->enabled ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalHT").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalTTC").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalVAT").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td>'.$langs->trans("ThirdParty").'</td>';
print '<td class="center">'.$langs->trans("Code").'</td>';
print '<td class="center">'.$langs->trans("Country").'</td>';
print '<td class="center">'.$langs->trans("VATIntra").'</td>';
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td class="center">'.$langs->trans("Currency").'</td>';
}
print '</tr>';
if (empty($TData)) {
print '<tr class="oddeven"><td colspan="13"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td>';
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td></td>';
}
print '</tr>';
@ -801,7 +801,7 @@ if (!empty($date_start) && !empty($date_stop)) {
$totalVAT_debit -= $data['amount_vat'];
}
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td class="center">'.$data['currency']."</td>\n";
}
@ -815,7 +815,7 @@ if (!empty($date_start) && !empty($date_stop)) {
print '<td align="right">'.price(price2num($totalIT_credit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit, 'MT')).'</td>';
print '<td colspan="4"></td>';
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td></td>';
}
print "</tr>\n";
@ -826,7 +826,7 @@ if (!empty($date_start) && !empty($date_stop)) {
print '<td align="right">'.price(price2num($totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_debit, 'MT')).'</td>';
print '<td colspan="4"></td>';
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td></td>';
}
print "</tr>\n";
@ -837,7 +837,7 @@ if (!empty($date_start) && !empty($date_stop)) {
print '<td align="right">'.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'</td>';
print '<td colspan="4"></td>';
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td></td>';
}
print "</tr>\n";

View File

@ -361,7 +361,7 @@ if (GETPOST('save') && !$cancel && !empty($user->rights->banque->modifier)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
}
/*if (! empty($conf->accounting->enabled) && (empty($search_accountancy_code) || $search_accountancy_code == '-1'))
/*if (isModEnabled('accounting') && (empty($search_accountancy_code) || $search_accountancy_code == '-1'))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors');
$error++;
@ -875,7 +875,7 @@ if ($resql) {
print '<td class=right>'.$langs->trans("BankAccount").'</td>';
print '<td class=right>'.$langs->trans("Debit").'</td>';
print '<td class=right>'.$langs->trans("Credit").'</td>';
/*if (! empty($conf->accounting->enabled))
/*if (isModEnabled('accounting'))
{
print '<td class="center">';
print $langs->trans("AccountAccounting");
@ -910,7 +910,7 @@ if ($resql) {
//}
print '<td class="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST("adddebit", "alpha").'"></td>';
print '<td class="right"><input name="addcredit" class="flat" type="text" size="4" value="'.GETPOST("addcredit", "alpha").'"></td>';
/*if (! empty($conf->accounting->enabled))
/*if (isModEnabled('accounting'))
{
print '<td class="center">';
print $formaccounting->select_account($search_accountancy_code, 'search_accountancy_code', 1, null, 1, 1, '');
@ -1019,9 +1019,9 @@ if ($resql) {
$moreforfilter .= '</div>';
$moreforfilter .= '</div>';
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
// Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$langs->load('categories');
// Bank line

View File

@ -36,16 +36,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.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';
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
@ -326,7 +326,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formbank = new FormBank($db);
$formcompany = new FormCompany($db);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
}
@ -437,7 +437,7 @@ if ($action == 'create') {
print '</td></tr>';
// Tags-Categories
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
@ -573,7 +573,7 @@ if ($action == 'create') {
$fieldrequired = 'fieldrequired ';
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
print '<td>';
print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
@ -584,7 +584,7 @@ if ($action == 'create') {
}
// Accountancy journal
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
print '<td>';
print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);
@ -677,7 +677,7 @@ if ($action == 'create') {
// Accountancy code
print '<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans("AccountancyCode").'</td>';
print '<td>';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $object->account_number, 1);
@ -688,7 +688,7 @@ if ($action == 'create') {
print '</td></tr>';
// Accountancy journal
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
print '<td>';
@ -714,7 +714,7 @@ if ($action == 'create') {
print '<table class="border tableforfield centpercent">';
// Categories
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1);
print "</td></tr>";
@ -967,7 +967,7 @@ if ($action == 'create') {
print '</td></tr>';
// Tags-Categories
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
@ -1015,7 +1015,7 @@ if ($action == 'create') {
print '<tr class="liste_titre_add"><td'.$tdextra.'>'.$langs->trans("AccountancyCode").'</td>';
print '<td>';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
} else {
print '<input type="text" name="account_number" value="'.(GETPOST("account_number") ? GETPOST("account_number") : $object->account_number).'">';
@ -1023,7 +1023,7 @@ if ($action == 'create') {
print '</td></tr>';
// Accountancy journal
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print '<tr><td class="fieldrequired">'.$langs->trans("AccountancyJournal").'</td>';
print '<td>';
print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);

View File

@ -1397,7 +1397,7 @@ class Account extends CommonObject
$option = 'nolink';
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
$langs->load("accountancy");
$label .= '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number);

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';

View File

@ -37,16 +37,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other'));
if (!empty($conf->adherent->enabled)) {
if (isModEnabled('adherent')) {
$langs->load("members");
}
if (!empty($conf->don->enabled)) {
if (isModEnabled('don')) {
$langs->load("donations");
}
if (!empty($conf->loan->enabled)) {
if (isModEnabled('loan')) {
$langs->load("loan");
}
if (!empty($conf->salaries->enabled)) {
if (isModEnabled('salaries')) {
$langs->load("salaries");
}
@ -580,7 +580,7 @@ if ($result) {
print "</tr>";
// Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$langs->load('categories');
// Bank line

View File

@ -32,13 +32,13 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@ -58,7 +58,7 @@ $search_number = GETPOST('search_number', 'alpha');
$search_status = GETPOST('search_status') ?GETPOST('search_status', 'alpha') : 'opened'; // 'all' or ''='opened'
$optioncss = GETPOST('optioncss', 'alpha');
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
$search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array");
}
@ -116,8 +116,8 @@ $arrayfields = array(
'b.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1, 'position'=>12),
'accountype'=>array('label'=>$langs->trans("Type"), 'checked'=>1, 'position'=>14),
'b.number'=>array('label'=>$langs->trans("AccountIdShort"), 'checked'=>1, 'position'=>16),
'b.account_number'=>array('label'=>$langs->trans("AccountAccounting"), 'checked'=>(!empty($conf->accounting->enabled) || !empty($conf->accounting->enabled)), 'position'=>18),
'b.fk_accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>(!empty($conf->accounting->enabled) || !empty($conf->accounting->enabled)), 'position'=>20),
'b.account_number'=>array('label'=>$langs->trans("AccountAccounting"), 'checked'=>(isModEnabled('accounting')), 'position'=>18),
'b.fk_accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>(isModEnabled('accounting')), 'position'=>20),
'toreconcile'=>array('label'=>$langs->trans("TransactionsToConciliate"), 'checked'=>1, 'position'=>50),
'b.currency_code'=>array('label'=>$langs->trans("Currency"), 'checked'=>0, 'position'=>22),
'b.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
@ -197,7 +197,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label']) && is_arra
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
}
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
$sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_ACCOUNT, "b.rowid");
}
@ -209,7 +209,7 @@ if ($search_status == 'closed') {
$sql .= " AND clos = 1";
}
if (!empty($conf->categorie->enabled)) {
if (isModEnabled('categorie')) {
$sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_ACCOUNT, "b.rowid", $search_category_list);
}
@ -344,7 +344,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
$moreforfilter = '';
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
$moreforfilter .= $form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list);
}
@ -569,7 +569,7 @@ foreach ($accounts as $key => $type) {
// Account number
if (!empty($arrayfields['b.account_number']['checked'])) {
print '<td class="tdoverflowmax250">';
if (!empty($conf->accounting->enabled) && !empty($objecttmp->account_number)) {
if (isModEnabled('accounting') && !empty($objecttmp->account_number)) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $objecttmp->account_number, 1);
print '<span title="'.dol_escape_htmltag($accountingaccount->account_number.' - '.$accountingaccount->label).'">';
@ -587,7 +587,7 @@ foreach ($accounts as $key => $type) {
// Accountancy journal
if (!empty($arrayfields['b.fk_accountancy_journal']['checked'])) {
print '<td class="tdoverflowmax125">';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
if (empty($objecttmp->fk_accountancy_journal)) {
print img_warning($langs->trans("Mandatory"));
} else {

View File

@ -270,12 +270,12 @@ print '</tr>';
print '<tr class="oddeven"><td>';
print img_picto('', 'bank_account', 'class="paddingright"');
$form->select_comptes($account_from, 'account_from', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1);
$form->select_comptes($account_from, 'account_from', 0, '', 1, '', !isModEnabled('multicurrency') ? 0 : 1);
print "</td>";
print "<td>\n";
print img_picto('', 'bank_account', 'class="paddingright"');
$form->select_comptes($account_to, 'account_to', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1);
$form->select_comptes($account_to, 'account_to', 0, '', 1, '', !isModEnabled('multicurrency') ? 0 : 1);
print "</td>\n";
print "<td>";

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -52,7 +52,7 @@ $amount = price2num(GETPOST("amount", "alpha"));
$paymenttype = GETPOST("paymenttype", "aZ09");
$accountancy_code = GETPOST("accountancy_code", "alpha");
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
if (!empty($conf->accounting->enabled) && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
if (isModEnabled('accounting') && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
$subledger_account = GETPOST("subledger_account", "alpha") > 0 ? GETPOST("subledger_account", "alpha") : '';
} else {
$subledger_account = GETPOST("subledger_account", "alpha");
@ -139,7 +139,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
$error++;
}
if (!empty($conf->banque->enabled) && !$object->accountid > 0) {
if (isModEnabled('banque') && !$object->accountid > 0) {
$langs->load('errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
$error++;
@ -149,7 +149,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors');
$error++;
}
if (!empty($conf->accounting->enabled) && !$object->accountancy_code) {
if (isModEnabled('accounting') && !$object->accountancy_code) {
$langs->load('errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors');
$error++;
@ -308,10 +308,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->banque->m
llxHeader("", $langs->trans("VariousPayment"));
$form = new Form($db);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
}
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@ -409,7 +409,7 @@ if ($action == 'create') {
print '</td></tr>';
// Bank
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<tr><td>';
print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).'</td><td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
@ -424,7 +424,7 @@ if ($action == 'create') {
print '</tr>';
// Number
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<tr><td><label for="num_payment">'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</label></td>';
@ -444,7 +444,7 @@ if ($action == 'create') {
}
// Accountancy account
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
// TODO Remove the fieldrequired and allow instead to edit a various payment to enter accounting code
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("AccountAccounting").'</td>';
print '<td>';
@ -457,7 +457,7 @@ if ($action == 'create') {
}
// Subledger account
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print '<tr><td>'.$langs->trans("SubledgerAccount").'</td>';
print '<td>';
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
@ -481,7 +481,7 @@ if ($action == 'create') {
print '</td></tr>';
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
// Associated project
@ -553,7 +553,7 @@ if ($id) {
$morehtmlref = '<div class="refidno">';
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->banque->modifier) {
@ -621,7 +621,7 @@ if ($id) {
print '<tr><td class="nowrap">';
print $langs->trans("AccountAccounting");
print '</td><td>';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $object->accountancy_code, 1);
@ -638,7 +638,7 @@ if ($id) {
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0);
print '</td></tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($object->fk_account > 0) {
$bankline = new AccountLine($db);
$bankline->fetch($object->fk_bank);

View File

@ -97,7 +97,7 @@ if ($object->id) {
$morehtmlref = '<div class="refidno">';
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' : ';
if ($user->rights->banque->modifier && 0) {

View File

@ -57,7 +57,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $ob
$morehtmlref = '<div class="refidno">';
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' : ';
if ($user->rights->banque->modifier && 0) {

View File

@ -152,10 +152,10 @@ $arrayfields = array(
'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130),
'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140),
'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)),
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>!empty($conf->banque->enabled)),
'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)),
'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>!empty($conf->accounting->enabled)),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled('banque')),
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled('banque')),
'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>isModEnabled('accounting')),
'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>isModEnabled('accounting')),
'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500),
'credit' =>array('label'=>"Credit", 'checked'=>1, 'position'=>510),
);
@ -190,7 +190,7 @@ $form = new Form($db);
if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) {
$formaccounting = new FormAccounting($db);
}
if ($arrayfields['bank']['checked'] && !empty($conf->accounting->enabled)) {
if ($arrayfields['bank']['checked'] && isModEnabled('accounting')) {
$accountingjournal = new AccountingJournal($db);
}
if ($arrayfields['ref']['checked']) {
@ -621,7 +621,7 @@ if ($resql) {
$accountstatic->ref = $obj->bref;
$accountstatic->number = $obj->bnumber;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$accountstatic->account_number = $obj->bank_account_number;
$accountingjournal->fetch($obj->accountancy_journal);
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);

View File

@ -70,10 +70,10 @@ if ($contextpage == 'takepos') {
$arrayofpaymentmode = array('cash'=>'Cash', 'cheque'=>'Cheque', 'card'=>'CreditCard');
$arrayofposavailable = array();
if (!empty($conf->cashdesk->enabled)) {
if (isModEnabled('cashdesk')) {
$arrayofposavailable['cashdesk'] = $langs->trans('CashDesk').' (cashdesk)';
}
if (!empty($conf->takepos->enabled)) {
if (isModEnabled('takepos')) {
$arrayofposavailable['takepos'] = $langs->trans('TakePOS').' (takepos)';
}
// TODO Add hook here to allow other POS to add themself

View File

@ -133,7 +133,7 @@ if ($year) {
print '<span class="opacitymedium">'.$langs->trans("DescTaxAndDividendsArea").'</span><br>';
print "<br>";
if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
if (isModEnabled('tax') && $user->rights->tax->charges->lire) {
// Social contributions only
print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
@ -146,7 +146,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
}
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
@ -220,7 +220,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
}
print $obj->num_payment.'</td>';
// Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td>';
if ($obj->fk_bank > 0) {
//$accountstatic->fetch($obj->fk_bank);
@ -254,7 +254,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td></td>';
}
print '<td class="liste_total right">'.price($totalpaid)."</td>";
@ -266,7 +266,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
}
// VAT
if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
if (isModEnabled('tax') && $user->rights->tax->charges->lire) {
print "<br>";
$tva = new Tva($db);
@ -304,7 +304,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
}
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder);
@ -341,7 +341,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print $obj->num_payment.'</td>';
// Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td>';
if ($obj->fk_bank > 0) {
//$accountstatic->fetch($obj->fk_bank);

View File

@ -29,7 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -422,7 +422,7 @@ if ($action == 'create') {
print '</td></tr>';
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load('projects');
print '<tr>';
print '<td>';

View File

@ -34,7 +34,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
//include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
}
@ -924,7 +924,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), $help_url);
$form = new Form($db);
$formother = new FormOther($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
$companystatic = new Societe($db);
@ -954,7 +954,7 @@ if ($action == 'create') {
print dol_get_fiche_head(null, '', '', 0);
$rowspan = 4;
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$rowspan++;
}
if ($object->fk_account > 0) {
@ -1047,7 +1047,7 @@ if ($action == 'create') {
}
// Project
if (!empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
if (isModEnabled('project') && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
$projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project;
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td>';
@ -1117,9 +1117,9 @@ if ($action == 'create') {
$title = $langs->trans("ProductsAndServices");
if (empty($conf->service->enabled)) {
if (!isModEnabled('service')) {
$title = $langs->trans("Products");
} elseif (empty($conf->product->enabled)) {
} elseif (!isModEnabled('product')) {
$title = $langs->trans("Services");
}
@ -1203,7 +1203,7 @@ if ($action == 'create') {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {
@ -1310,7 +1310,7 @@ if ($action == 'create') {
print '</td></tr>';
// Multicurrency
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
// Multicurrency code
print '<tr>';
print '<td>';
@ -1573,7 +1573,7 @@ if ($action == 'create') {
if ($object->frequency > 0) {
print '<br>';
if (empty($conf->cron->enabled)) {
if (!isModEnabled('cron')) {
print info_admin($langs->trans("EnableAndSetupModuleCron", $langs->transnoentitiesnoconv("Module2300Name")));
}

View File

@ -51,28 +51,28 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->commande->enabled)) {
if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
}
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
if (!empty($conf->variants->enabled)) {
if (isModEnabled('variants')) {
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
// Load translation files required by the page
$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals'));
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
$langs->load('incoterm');
}
if (!empty($conf->margin->enabled)) {
if (isModEnabled('margin')) {
$langs->load('margins');
}
@ -540,7 +540,7 @@ if (empty($reshook)) {
}
}
}
} elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) { // Set incoterm
} elseif ($action == 'set_incoterms' && isModEnabled('incoterm')) { // Set incoterm
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
} elseif ($action == 'setbankaccount' && $usercancreate) { // bank account
$result = $object->setBankAccount(GETPOST('fk_account', 'int'));
@ -2076,7 +2076,7 @@ if (empty($reshook)) {
$error++;
}
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') {
if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') {
if ($combinations = GETPOST('combinations', 'array')) {
//Check if there is a product with the given combination
$prodcomb = new ProductCombination($db);
@ -2874,7 +2874,7 @@ $formmargin = new FormMargin($db);
$soc = new Societe($db);
$paymentstatic = new Paiement($db);
$bankaccountstatic = new Account($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@ -2994,7 +2994,7 @@ if ($action == 'create') {
$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
if (!empty($objectsrc->multicurrency_code)) {
$currency_code = $objectsrc->multicurrency_code;
}
@ -3016,7 +3016,7 @@ if ($action == 'create') {
$remise_absolue = 0;
$dateinvoice = (empty($dateinvoice) ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $dateinvoice); // Do not set 0 here (0 for a date is 1970)
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) {
if (isModEnabled('multicurrency') && !empty($soc->multicurrency_code)) {
$currency_code = $soc->multicurrency_code;
}
}
@ -3650,7 +3650,7 @@ if ($action == 'create') {
print '</td></tr>';
// Bank Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
print $form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
@ -3658,7 +3658,7 @@ if ($action == 'create') {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
@ -3667,7 +3667,7 @@ if ($action == 'create') {
}
// Incoterms
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->label_incoterms) ? $objectsrc->label_incoterms : '', 1).'</label></td>';
print '<td colspan="2" class="maxwidthonsmartphone">';
@ -3715,7 +3715,7 @@ if ($action == 'create') {
print "</td></tr>";
// Multicurrency
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<tr>';
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
print '<td colspan="2" class="maxwidthonsmartphone">';
@ -3836,7 +3836,7 @@ if ($action == 'create') {
}
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
@ -3912,7 +3912,7 @@ if ($action == 'create') {
$resteapayer = price2num($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
// Multicurrency
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
$multicurrency_totalpaid = $object->getSommePaiement(1);
$multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1);
$multicurrency_totaldeposits = $object->getSumDepositsUsed(1);
@ -4284,7 +4284,7 @@ if ($action == 'create') {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherBills").'</a>)';
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($usercancreate) {
@ -4504,7 +4504,7 @@ if ($action == 'create') {
print '</td></tr>';
// Multicurrency
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
// Multicurrency code
print '<tr>';
print '<td>';
@ -4550,7 +4550,7 @@ if ($action == 'create') {
}
// Bank Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<tr><td class="nowrap">';
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
print $langs->trans('BankAccount');
@ -4570,7 +4570,7 @@ if ($action == 'create') {
}
// Incoterms
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
print '<tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('IncotermLabel');
@ -4708,7 +4708,7 @@ if ($action == 'create') {
$sign = -1; // We invert sign for output
}
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) {
if (isModEnabled('multicurrency') && ($object->multicurrency_code != $conf->currency)) {
// Multicurrency Amount HT
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>';
print '<td class="nowrap right amountcard">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
@ -4803,10 +4803,10 @@ if ($action == 'create') {
$nbrows = 8;
$nbcols = 3;
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$nbrows++;
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$nbrows++;
$nbcols++;
}
@ -4819,10 +4819,10 @@ if ($action == 'create') {
if ($selleruserevenustamp) {
$nbrows++;
}
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
$nbrows += 5;
}
if (!empty($conf->incoterm->enabled)) {
if (isModEnabled('incoterm')) {
$nbrows += 1;
}
@ -4835,7 +4835,7 @@ if ($action == 'create') {
print '<td>'.$langs->trans('ListOfSituationInvoices').'</td>';
print '<td></td>';
print '<td class="center">'.$langs->trans('Situation').'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="right"></td>';
}
print '<td class="right">'.$langs->trans('AmountHT').'</td>';
@ -4859,7 +4859,7 @@ if ($action == 'create') {
print '<td>'.$prev_invoice->getNomUrl(1).'</td>';
print '<td></td>';
print '<td align="center" >'.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$prev_invoice->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="right"></td>';
}
print '<td class="right"><span class="amount">'.price($prev_invoice->total_ht).'</span></td>';
@ -4879,7 +4879,7 @@ if ($action == 'create') {
print '<td>'.$object->getNomUrl(1).'</td>';
print '<td></td>';
print '<td class="center">'.(($object->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$object->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="right"></td>';
}
print '<td class="right"><span class="amount">'.price($object->total_ht).'</span></td>';
@ -4902,7 +4902,7 @@ if ($action == 'create') {
$i++;
}
print '</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td></td>';
}
print '<td class="right"><b>'.price($total_global_ht).'</b></td>';
@ -4917,7 +4917,7 @@ if ($action == 'create') {
print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>';
print '<td></td>';
print '<td></td>';
if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
if (isModEnabled('banque')) print '<td class="right"></td>';
print '<td class="right">' . $langs->trans('AmountHT') . '</td>';
print '<td class="right">' . $langs->trans('AmountTTC') . '</td>';
print '<td width="18">&nbsp;</td>';
@ -4934,7 +4934,7 @@ if ($action == 'create') {
print '<td>'.$next_invoice->getNomUrl(1).'</td>';
print '<td></td>';
print '<td class="center">'.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$next_invoice->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="right"></td>';
}
print '<td class="right"><span class="amount">'.price($next_invoice->total_ht).'</span></td>';
@ -4948,7 +4948,7 @@ if ($action == 'create') {
print '<tr class="oddeven">';
print '<td colspan="3" class="right"></td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="right"></td>';
}
print '<td class="right"><b>'.price($total_global_ht).'</b></td>';
@ -4975,7 +4975,7 @@ if ($action == 'create') {
print '<td class="liste_titre">'.($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Date').'</span></td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Type').'</span></td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('BankAccount').'</span></td>';
}
print '<td class="liste_titre right">'.$langs->trans('Amount').'</td>';
@ -5024,14 +5024,14 @@ if ($action == 'create') {
print '</td>';
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
print '<td>'.$label.' '.$objp->num_payment.'</td>';
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);
@ -5259,7 +5259,7 @@ if ($action == 'create') {
print '</div>';
// Margin Infos
if (!empty($conf->margin->enabled)) {
if (isModEnabled('margin')) {
$formmargin->displayMarginInfos($object);
}
@ -5477,7 +5477,7 @@ if ($action == 'create') {
}
// POS Ticket
if (!empty($conf->takepos->enabled) && $object->module_source == 'takepos') {
if (isModEnabled('takepos') && $object->module_source == 'takepos') {
$langs->load("cashdesk");
$receipt_url = DOL_URL_ROOT."/takepos/receipt.php";
print '<a target="_blank" rel="noopener noreferrer" class="butAction" href="'.$receipt_url.'?facid='.((int) $object->id).'">'.$langs->trans('POSTicket').'</a>';

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);

View File

@ -47,10 +47,10 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.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

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -97,7 +97,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -257,7 +257,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), 'ch-facture.html#s-fac-factur
$form = new Form($db);
$formother = new FormOther($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
$companystatic = new Societe($db);

View File

@ -39,7 +39,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
if (!empty($conf->margin->enabled)) {
if (isModEnabled('margin')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
}
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
@ -53,7 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (!empty($conf->commande->enabled)) {
if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
}
@ -237,13 +237,13 @@ $arrayfields = array(
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>166),
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>280),
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>285),
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>290),
'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>291),
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>292),
'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>295),
'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>296), // Not enabled by default because slow
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>280),
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>285),
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>290),
'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>291),
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>292),
'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>295),
'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>296), // Not enabled by default because slow
'total_pa' => array('label' => ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1') ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
@ -545,7 +545,7 @@ $form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$formmargin = null;
if (!empty($conf->margin->enabled)) {
if (isModEnabled('margin')) {
$formmargin = new FormMargin($db);
}
$bankaccountstatic = new Account($db);
@ -1200,7 +1200,7 @@ if ($resql) {
$moreforfilter .= '</div>';
}
// Filter on product tags
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');
@ -1208,7 +1208,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth250', 1);
$moreforfilter .= '</div>';
}
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
@ -1702,7 +1702,7 @@ if ($resql) {
$totalarray['val']['f.total_ttc'] = 0;
$with_margin_info = false;
if (!empty($conf->margin->enabled) && (
if (isModEnabled('margin') && (
!empty($arrayfields['total_pa']['checked'])
|| !empty($arrayfields['total_margin']['checked'])
|| !empty($arrayfields['total_margin_rate']['checked'])

View File

@ -29,7 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -114,7 +114,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -349,7 +349,7 @@ if ($object->id > 0) {
}
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($usercancreate) {
@ -616,7 +616,7 @@ if ($object->id > 0) {
print '<table class="border centpercent tableforfield">';
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) {
if (isModEnabled('multicurrency') && ($object->multicurrency_code != $conf->currency)) {
// Multicurrency Amount HT
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>';
print '<td class="nowrap">'.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
if (!empty($conf->category->enabled)) {
if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@ -72,7 +72,7 @@ $endyear = $year;
/*
* View
*/
if (!empty($conf->category->enabled)) {
if (isModEnabled('categorie')) {
$langs->load('categories');
}
$form = new Form($db);
@ -299,7 +299,7 @@ if ($user->admin) {
print '</td></tr>';
// Category
if (!empty($conf->category->enabled)) {
if (isModEnabled('categorie')) {
if ($mode == 'customer') {
$cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));

View File

@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('compta', 'bills'));
if (!empty($conf->commande->enabled)) {
if (isModEnabled('commande')) {
$langs->load("orders");
}

View File

@ -48,10 +48,10 @@ $date_endyear = GETPOST('date_endyear');
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}

View File

@ -50,10 +50,10 @@ $date_endyear = GETPOST('date_endyear');
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}

View File

@ -174,7 +174,7 @@ if ($action == 'create') {
// Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.GETPOST("amount").'"></td></tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// Type payment
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$form->select_types_paiements(GETPOST("paiementtype"), "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx');
@ -243,7 +243,7 @@ if ($id) {
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($object->fk_account > 0) {
$bankline = new AccountLine($db);
$bankline->fetch($object->fk_bank);

View File

@ -467,11 +467,11 @@ class Localtax extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -4;
}
if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) {
if (isModEnabled('banque') && (empty($this->accountid) || $this->accountid <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
return -5;
}
if (!empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) {
if (isModEnabled('banque') && (empty($this->paymenttype) || $this->paymenttype <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
return -5;
}
@ -503,7 +503,7 @@ class Localtax extends CommonObject
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax"); // TODO devrait s'appeler paiementlocaltax
if ($this->id > 0) {
$ok = 1;
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// Insertion dans llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -170,7 +170,7 @@ if (empty($reshook)) {
$error++;
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0) {
setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
@ -244,7 +244,7 @@ if (empty($reshook)) {
$multicurrency_code[$key] = $tmpinvoice->multicurrency_code;
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// If the bank module is active, an account is required to input a payment
if (GETPOST('accountid', 'int') <= 0) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
@ -492,7 +492,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Bank account
print '<tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($facture->type != 2) {
print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>';
}
@ -597,7 +597,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<td>'.$arraytitle.'</td>';
print '<td class="center">'.$langs->trans('Date').'</td>';
print '<td class="center">'.$langs->trans('DateMaxPayment').'</td>';
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td>'.$langs->trans('Currency').'</td>';
print '<td class="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
print '<td class="right">'.$multicurrencyalreadypayedlabel.'</td>';
@ -640,7 +640,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
// Multicurrency Price
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
$multicurrency_payment = $invoice->getSommePaiement(1);
$multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1);
$multicurrency_deposits = $invoice->getSumDepositsUsed(1);
@ -676,12 +676,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
// Currency
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td class="center">'.$objp->multicurrency_code."</td>\n";
}
// Multicurrency Price
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td class="right">';
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) {
print price($sign * $objp->multicurrency_total_ttc);
@ -814,7 +814,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Print total
print '<tr class="liste_total">';
print '<td colspan="3" class="left">'.$langs->trans('TotalTTC').'</td>';
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
print '<td></td>';
print '<td></td>';
print '<td></td>';

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
@ -285,7 +285,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, '',
$disable_delete = 0;
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$bankline = new AccountLine($db);
if ($object->fk_account > 0) {
@ -327,7 +327,7 @@ print '</td></tr>';
*/
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($object->fk_account > 0) {
if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
@ -425,7 +425,7 @@ if ($resql) {
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Bill').'</td>';
print '<td>'.$langs->trans('Company').'</td>';
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
print '<td>'.$langs->trans('Entity').'</td>';
}
print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
@ -462,7 +462,7 @@ if ($resql) {
print '</td>';
// Expected to pay
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
print '<td>';
$mc->getInfo($objp->entity);
print $mc->label;

View File

@ -628,7 +628,7 @@ class Paiement extends CommonObject
$error = 0;
$bank_line_id = 0;
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($accountid <= 0) {
$this->error = 'Bad value for parameter accountid='.$accountid;
dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR);
@ -656,7 +656,7 @@ class Paiement extends CommonObject
}
// if dolibarr currency != bank currency then we received an amount in customer currency (currently I don't manage the case : my currency is USD, the customer currency is EUR and he paid me in GBP. Seems no sense for me)
if (!empty($conf->multicurrency->enabled) && $conf->currency != $acc->currency_code) {
if (isModEnabled('multicurrency') && $conf->currency != $acc->currency_code) {
$totalamount = $this->multicurrency_amount; // We will insert into llx_bank.amount in foreign currency
$totalamount_main_currency = $this->amount; // We will also save the amount in main currency into column llx_bank.amount_main_currency
}
@ -1165,7 +1165,7 @@ class Paiement extends CommonObject
global $conf;
$way = 'dolibarr';
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
foreach ($this->multicurrency_amounts as $value) {
if (!empty($value)) { // one value found then payment is in invoice currency
$way = 'customer';

View File

@ -104,8 +104,8 @@ $arrayfields = array(
'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20),
's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40),
'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->banque->enabled))),
'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(!empty($conf->banque->enabled))),
'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>isModEnabled('banque')),
'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled('banque'))),
'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"),
'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80),
'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))),

View File

@ -71,7 +71,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
$error++;
$action = 'create';
}
if (!empty($conf->banque->enabled) && !(GETPOST("accountid") > 0)) {
if (isModEnabled('banque') && !(GETPOST("accountid") > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors');
$error++;
$action = 'create';

View File

@ -69,7 +69,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
$error++;
$action = 'create';
}
if (!empty($conf->banque->enabled) && !(GETPOST("accountid", 'int') > 0)) {
if (isModEnabled('banque') && !(GETPOST("accountid", 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors');
$error++;
$action = 'create';

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
@ -141,7 +141,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($object->bank_account) {
$bankline = new AccountLine($db);
$bankline->fetch($object->bank_line);

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
@ -194,7 +194,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($object->bank_account) {
$bankline = new AccountLine($db);
$bankline->fetch($object->bank_line);

View File

@ -132,7 +132,7 @@ $nbofyear = ($year_end - $year_start) + 1;
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING';
}
if (GETPOST("modecompta", 'alpha')) {
@ -146,10 +146,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -174,7 +174,7 @@ if ($modecompta == "CREANCES-DETTES") {
$calcmode = $langs->trans("CalcModeDebt");
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
}
@ -193,7 +193,7 @@ if ($modecompta == "CREANCES-DETTES") {
$calcmode = $langs->trans("CalcModeEngagement");
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
}
@ -223,7 +223,7 @@ $hselected = 'report';
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'showaccountdetail'=>$showaccountdetail), $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}
@ -537,7 +537,7 @@ if ($modecompta == 'BOOKKEEPING') {
* Donations
*/
if (!empty($conf->don->enabled)) {
if (isModEnabled('don')) {
print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Donations").'</td></tr>';
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
@ -932,7 +932,7 @@ if ($modecompta == 'BOOKKEEPING') {
* Salaries
*/
if (!empty($conf->salaries->enabled)) {
if (isModEnabled('salaries')) {
print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Salaries").'</td></tr>';
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
@ -1035,7 +1035,7 @@ if ($modecompta == 'BOOKKEEPING') {
* Expense report
*/
if (!empty($conf->expensereport->enabled)) {
if (isModEnabled('expensereport')) {
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
$langs->load('trips');
if ($modecompta == 'CREANCES-DETTES') {
@ -1127,7 +1127,7 @@ if ($modecompta == 'BOOKKEEPING') {
*/
//$conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY = 1;
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled('banque') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
$subtotal_ht = 0;
$subtotal_ttc = 0;
@ -1206,7 +1206,7 @@ if ($modecompta == 'BOOKKEEPING') {
* Payment Loan
*/
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && isModEnabled('don') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
$subtotal_ht = 0;
$subtotal_ttc = 0;

View File

@ -110,7 +110,7 @@ $nbofyear = ($year_end - $year_start) + 1;
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING';
}
if (GETPOST("modecompta", 'alpha')) {
@ -122,10 +122,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -151,7 +151,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$calcmode = $langs->trans("CalcModeDebt");
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
}
@ -171,7 +171,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$calcmode = $langs->trans("CalcModeEngagement");
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
}
@ -200,7 +200,7 @@ $hselected = 'report';
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta), $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}
@ -391,7 +391,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta
$subtotal_ht = 0;
$subtotal_ttc = 0;
if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if ($modecompta == 'CREANCES-DETTES') {
// TVA collected to pay
$sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm";
@ -555,7 +555,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
$subtotal_ht = 0;
$subtotal_ttc = 0;
if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
@ -613,7 +613,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
* Salaries
*/
if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (isModEnabled('salaries') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if ($modecompta == 'CREANCES-DETTES') {
$column = 's.dateep'; // we use the date of end of period of salary
@ -675,7 +675,7 @@ if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo
* Expense reports
*/
if (!empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (!isModEnabled('expensereport') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
$langs->load('trips');
if ($modecompta == 'CREANCES-DETTES') {
@ -737,7 +737,7 @@ if (!empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' |
* Donation get dunning payments
*/
if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (isModEnabled('don') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
$subtotal_ht = 0;
$subtotal_ttc = 0;
@ -796,7 +796,7 @@ if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
* Various Payments
*/
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled('banque') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
// decaiss
$sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p";
@ -867,7 +867,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba
* Payement Loan
*/
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && isModEnabled('loan') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
$sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount_capital + p.amount_insurance + p.amount_interest) AS amount";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_loan AS p, ".MAIN_DB_PREFIX."loan as l";
$sql .= " WHERE l.entity IN (".getEntity('variouspayment').")";
@ -907,7 +907,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan
* Request in mode BOOKKEEPING
*/
if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) {
if (isModEnabled('accounting') && ($modecompta == 'BOOKKEEPING')) {
$predefinedgroupwhere = "(";
$predefinedgroupwhere .= " (aa.pcg_type = 'EXPENSE')";
$predefinedgroupwhere .= " OR ";

View File

@ -137,7 +137,7 @@ if ($cat_id == 0) {
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING';
}
if (GETPOST("modecompta")) {
@ -151,10 +151,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -193,7 +193,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("AnnualByAccountDueDebtMode");
$calcmode = $langs->trans("CalcModeDebt");
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$start_year.(GETPOST("month") > 0 ? '&month='.GETPOST("month") : '').'&modecompta=RECETTES-DEPENSES">', '</a>').')';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$start_year.'&modecompta=BOOKKEEPING">', '</a>').')';
}
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
@ -210,7 +210,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("AnnualByAccountInputOutputMode");
$calcmode = $langs->trans("CalcModeEngagement");
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month") > 0 ? '&month='.GETPOST("month") : '').'&modecompta=CREANCES-DETTES">', '</a>').')';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=BOOKKEEPING">', '</a>').')';
}
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
@ -238,7 +238,7 @@ if ($modecompta == "CREANCES-DETTES") {
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'action' => ''), $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}

View File

@ -34,11 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
@ -333,7 +333,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$formsocialcontrib = new FormSocialContrib($db);
$bankaccountstatic = new Account($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@ -407,7 +407,7 @@ if ($action == 'create') {
print '<td>'.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).'</td></tr>';
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
// Associated project
@ -426,7 +426,7 @@ if ($action == 'create') {
print '</td></tr>';
// Bank Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<tr><td>'.$langs->trans('DefaultBankAccount').'</td><td colspan="2">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 2, '', 0, '', 1);
print '</td></tr>';
@ -540,7 +540,7 @@ if ($id > 0) {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->tax->charges->creer) {
@ -638,7 +638,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('DefaultBankAccount');
@ -668,7 +668,7 @@ if ($id > 0) {
print '<div class="fichehalfright">';
$nbcols = 3;
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$nbcols++;
}
@ -703,7 +703,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>';
@ -726,14 +726,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);

View File

@ -552,7 +552,7 @@ class PaymentSocialContribution extends CommonObject
$error = 0;
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -101,7 +101,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) {
*/
$form = new Form($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@ -121,7 +121,7 @@ if ($object->id) {
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {

View File

@ -25,7 +25,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -68,7 +68,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) {
$form = new Form($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@ -90,7 +90,7 @@ $morehtmlref = '<div class="refidno">';
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -107,7 +107,7 @@ $arrayfields = array(
'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110),
);
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$arrayfields['cs.fk_account'] = array('checked'=>-1, 'position'=>90, 'label'=>"DefaultBankAccount");
}
@ -179,7 +179,7 @@ $formother = new FormOther($db);
$bankstatic = new Account($db);
$formsocialcontrib = new FormSocialContrib($db);
$chargesociale_static = new ChargeSociales($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$projectstatic = new Project($db);
}
@ -187,7 +187,7 @@ llxHeader('', $langs->trans("SocialContributions"));
$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
}
$sql .= " c.libelle as type_label, c.accountancy_code as type_accountancy_code,";
@ -197,7 +197,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (cs.fk_account = ba.rowid)";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cs.fk_projet";
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
@ -211,7 +211,7 @@ if ($search_ref) {
if ($search_label) {
$sql .= natural_search("cs.libelle", $search_label);
}
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
if ($search_project_ref != '') {
$sql .= natural_search("p.ref", $search_project_ref);
}
@ -247,7 +247,7 @@ if ($search_typeid > 0) {
$sql .= " AND cs.fk_type = ".((int) $search_typeid);
}
$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname";
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$sql .= ", p.rowid, p.ref, p.title";
}
$sql .= $db->order($sortfield, $sortorder);
@ -553,7 +553,7 @@ while ($i < min($num, $limit)) {
$chargesociale_static->label = $obj->label;
$chargesociale_static->type_label = $obj->type_label;
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$projectstatic->id = $obj->project_id;
$projectstatic->ref = $obj->project_ref;
$projectstatic->title = $obj->project_label;
@ -589,7 +589,7 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['cs.fk_type']['checked'])) {
$typelabeltoshow = $obj->type_label;
$typelabelpopup = $obj->type_label;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$typelabelpopup .= ' - '.$langs->trans("AccountancyCode").': '.$obj->type_accountancy_code;
}
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($typelabelpopup).'">'.dol_escape_htmltag($typelabeltoshow).'</td>';

View File

@ -25,7 +25,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {

View File

@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
@ -225,7 +225,7 @@ print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
}
@ -245,7 +245,7 @@ print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $pa
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "pc.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber');
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "pc.fk_bank", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
}
@ -323,7 +323,7 @@ while ($i < min($num, $limit)) {
print '<td>'.$obj->num_payment.'</td>';
// Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// Bank transaction
print '<td class="nowraponall">';
$accountlinestatic->id = $obj->fk_bank;
@ -341,7 +341,7 @@ while ($i < min($num, $limit)) {
$accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code);
$accountstatic->clos = $obj->clos;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$accountstatic->account_number = $obj->account_number;
$accountstatic->accountancy_journal = $obj->account_journal;
}
@ -379,7 +379,7 @@ print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td></td>';
print '<td></td>';
}

View File

@ -282,7 +282,7 @@ $description .= ' <input type="hidden" name="modecompta" value="'.$modecompta.'
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}

View File

@ -40,10 +40,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -272,7 +272,7 @@ if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}

View File

@ -39,10 +39,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -231,7 +231,7 @@ if (!empty($modecompta)) {
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}
@ -497,10 +497,10 @@ if (count($amount)) {
// Other stats
print '<td class="center">';
if (!empty($conf->propal->enabled) && $key > 0) {
if (isModEnabled('propal') && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
if (!empty($conf->commande->enabled) && $key > 0) {
if (isModEnabled('commande') && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
}
if (isModEnabled('facture') && $key > 0) {

View File

@ -68,10 +68,10 @@ if (GETPOST('subcat', 'alpha') === 'yes') {
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -256,7 +256,7 @@ if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}
@ -673,10 +673,10 @@ if (count($amount)) {
// Other stats
print '<td class="center">';
if (!empty($conf->propal->enabled) && $key > 0) {
if (isModEnabled('propal') && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
if (!empty($conf->commande->enabled) && $key > 0) {
if (isModEnabled('commande') && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
}
if (isModEnabled('facture') && $key > 0) {

View File

@ -109,7 +109,7 @@ $nbofyear = ($year_end - $year_start) + 1;
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING';
}
if (GETPOST("modecompta")) {
@ -120,10 +120,10 @@ if (GETPOST("modecompta")) {
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -153,7 +153,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("Turnover");
$calcmode = $langs->trans("CalcModeDebt");
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
$calcmode = str_replace('{link1}', '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=BOOKKEEPING">', $calcmode);
$calcmode = str_replace('{link2}', '</a>', $calcmode);
@ -171,7 +171,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("TurnoverCollected");
$calcmode = $langs->trans("CalcModeEngagement");
//$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
//if (!empty($conf->accounting->enabled)) {
//if (isModEnabled('accounting')) {
//$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPINGCOLLECTED">','</a>').')';
//}
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
@ -201,7 +201,7 @@ if (!empty($modecompta)) {
}
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}

View File

@ -103,7 +103,7 @@ $nbofyear = ($year_end - $year_start) + 1;
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING';
}
if (GETPOST("modecompta")) {
@ -114,10 +114,10 @@ if (GETPOST("modecompta")) {
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -142,7 +142,7 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("PurchaseTurnover");
$calcmode = $langs->trans("CalcModeDebt");
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
$calcmode = str_replace('{link1}', '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', $calcmode);
$calcmode = str_replace('{link2}', '</a>', $calcmode);
@ -187,7 +187,7 @@ if (!empty($modecompta)) {
}
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}

View File

@ -197,10 +197,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -252,7 +252,7 @@ if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}

View File

@ -168,10 +168,10 @@ foreach ($allparams as $key => $value) {
if ($user->socid > 0) {
$socid = $user->socid;
}
if (!empty($conf->comptabilite->enabled)) {
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@ -224,7 +224,7 @@ if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}
@ -590,10 +590,10 @@ if (count($amount)) {
if (!empty($conf->supplier_proposal->enabled) && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $key > 0) {
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order')) && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
}
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $key > 0) {
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice')) && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
}
print '</td>';

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);

View File

@ -560,7 +560,7 @@ class PaymentVAT extends CommonObject
$error = 0;
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);

View File

@ -572,11 +572,11 @@ class Tva extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -4;
}
if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) {
if (isModEnabled('banque') && (empty($this->accountid) || $this->accountid <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
return -5;
}
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 -5;
}
@ -633,7 +633,7 @@ class Tva extends CommonObject
if ($this->id > 0) {
$ok = 1;
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';

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -102,7 +102,7 @@ if ($action == 'setlib' && $permissiontoadd) {
*/
$form = new Form($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}

View File

@ -83,7 +83,7 @@ $arrayfields = array(
't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"),
);
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount");
}

View File

@ -118,7 +118,7 @@ if ($year) {
$param .= '&year='.$year;
}
if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
if (isModEnabled('tax') && $user->rights->tax->charges->lire) {
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -129,7 +129,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "ptva.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber');
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "ptva.fk_bank", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "bank.ref", "", $param, '', $sortfield, $sortorder);
}
@ -221,7 +221,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
// Chq number
print '<td>'.dol_escape_htmltag($obj->num_payment).'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// Bank transaction
print '<td>';
$accountlinestatic->id = $obj->fk_bank;
@ -258,7 +258,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print '<td class="liste_total right"></td>'; // A total here has no sense
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
}

View File

@ -135,7 +135,7 @@ if ($object->id > 0) {
}
llxHeader('', $title);
if (!empty($conf->notification->enabled)) {
if (isModEnabled('notification')) {
$langs->load("mails");
}
$type = $langs->trans('ResourceSingular');

View File

@ -29,11 +29,11 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled('product') || isModEnabled('service')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
}
@ -349,7 +349,7 @@ if (!$ret) {
// Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
$morehtmlref .= $langs->trans('Project').': ';
@ -517,7 +517,7 @@ if (!$ret) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$fichinter->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {

View File

@ -27,7 +27,7 @@ require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
}
@ -83,7 +83,7 @@ if (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) {
llxHeader('', $langs->trans('SalariesSetup'));
$form = new Form($db);
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
}
@ -119,7 +119,7 @@ foreach ($list as $key) {
// Value
print '<td>';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
} else {
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';

View File

@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
// Load translation files required by the page
$langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips"));
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
}
@ -260,7 +260,7 @@ if ($action == 'add' && empty($cancel)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
$error++;
}
if (!empty($conf->banque->enabled) && !empty($auto_create_paiement) && !$object->accountid > 0) {
if (isModEnabled('banque') && !empty($auto_create_paiement) && !$object->accountid > 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
$error++;
}
@ -441,7 +441,7 @@ if ($action == "update_extras" && !empty($user->rights->salaries->read)) {
$form = new Form($db);
$formfile = new FormFile($db);
if (!empty($conf->project->enabled)) $formproject = new FormProjets($db);
if (isModEnabled('project')) $formproject = new FormProjets($db);
$title = $langs->trans('Salary')." - ".$langs->trans('Card');
$help_url = "";
@ -559,7 +559,7 @@ if ($action == 'create') {
print '</tr>';
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
print '<tr><td>'.$langs->trans("Project").'</td><td>';
@ -583,7 +583,7 @@ if ($action == 'create') {
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_paiement) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n"; // Date payment
// Bank
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<tr><td id="label_fk_account">';
print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).'</td><td>';
print img_picto('', 'bank_account', 'class="paddingrighonly"');
@ -610,7 +610,7 @@ if ($action == 'create') {
print '</td></tr>';
// Number
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// Number
print '<tr class="hide_if_no_auto_create_payment"><td><label for="num_payment">'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
@ -794,7 +794,7 @@ if ($id) {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {
@ -893,7 +893,7 @@ if ($id) {
print '</td></tr>';
// Default 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('DefaultBankAccount');
@ -922,7 +922,7 @@ if ($id) {
print '<div class="fichehalfright">';
$nbcols = 3;
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
$nbcols++;
}
@ -956,7 +956,7 @@ if ($id) {
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>';
@ -972,14 +972,14 @@ if ($id) {
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);

View File

@ -493,7 +493,7 @@ class PaymentSalary extends CommonObject
$error = 0;
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);

View File

@ -372,12 +372,12 @@ class Salary extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -5;
}
/* if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0))
/* if (isModEnabled('banque') && (empty($this->accountid) || $this->accountid <= 0))
{
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
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;

View File

@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -132,7 +132,7 @@ if ($action == 'setlabel' && $user->rights->salaries->write) {
*/
$form = new Form($db);
if (!empty($conf->project->enabled)) $formproject = new FormProjets($db);
if (isModEnabled('project')) $formproject = new FormProjets($db);
$title = $langs->trans('Salary')." - ".$langs->trans('Documents');
$help_url = "";
@ -176,7 +176,7 @@ if ($object->id) {
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {

View File

@ -28,7 +28,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -100,7 +100,7 @@ if ($action == 'setlabel' && $user->rights->salaries->write) {
* View
*/
if (!empty($conf->project->enabled)) $formproject = new FormProjets($db);
if (isModEnabled('project')) $formproject = new FormProjets($db);
$title = $langs->trans('Salary')." - ".$langs->trans('Info');
$help_url = "";
@ -139,7 +139,7 @@ if ($action != 'editlabel') {
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {

View File

@ -27,7 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
@ -438,7 +438,7 @@ $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16
print '</td>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td class="liste_titre">';
$form->select_comptes($search_account, 'search_account', 0, '', 1);
print '</td>';
@ -476,7 +476,7 @@ print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "s.datesp,s.rowid", "
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "s.dateep,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("DefaultPaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print_liste_field_titre("DefaultBankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
}
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder);
@ -577,7 +577,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
}
// Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print '<td>';
if ($obj->fk_account > 0) {
//$accountstatic->fetch($obj->fk_bank);
@ -591,7 +591,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
$accountstatic->account_number = $obj->account_number;
$accountstatic->clos = $obj->clos;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$accountstatic->account_number = $obj->account_number;
$accountingjournal = new AccountingJournal($db);
@ -663,7 +663,7 @@ if ($num == 0) {
}
}*/
$colspan = 9;
if (!empty($conf->banque->enabled)) { $colspan++; }
if (isModEnabled('banque')) { $colspan++; }
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}

View File

@ -77,7 +77,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
$error++;
$action = 'create';
}
if (!empty($conf->banque->enabled) && !(GETPOST("accountid", 'int') > 0)) {
if (isModEnabled('banque') && !(GETPOST("accountid", 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors');
$error++;
$action = 'create';

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
if (isModEnabled('banque')) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
$langs->loadLangs(array('bills', 'banks', 'companies', 'salaries'));
@ -152,7 +152,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
if ($object->bank_account) {
$bankline = new AccountLine($db);
$bankline->fetch($object->bank_line);

View File

@ -28,7 +28,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
@ -448,7 +448,7 @@ print '</td>';
// Chq number
print '<td class="liste_titre right"><input name="search_chq_number" class="flat" type="text" size="8" value="'.$db->escape($search_chq_number).'"></td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// Bank transaction
print '<td class="liste_titre center">';
print '<input class="flat" type="text" size="3" name="search_fk_bank" value="'.$db->escape($search_fk_bank).'">';
@ -489,7 +489,7 @@ print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "s.datep,s.rowid",
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pst.code", "", $param, 'class="left"', $sortfield, $sortorder);
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "s.num_payment", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber');
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "s.fk_bank", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
}
@ -604,7 +604,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
}
// Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled('banque')) {
// Bank transaction
print '<td>';
$accountlinestatic->id = $obj->fk_bank;
@ -625,7 +625,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
$accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code);
$accountstatic->clos = $obj->clos;
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$accountstatic->account_number = $obj->account_number;
$accountingjournal = new AccountingJournal($db);

View File

@ -170,7 +170,7 @@ if (!empty($object->origin_email)) {
}
// Thirdparty
if (!empty($conf->societe->enabled)) {
if (isModEnabled('societe')) {
$morehtmlref .= '<br>'.$langs->trans('ThirdParty');
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&token='.newToken().'&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
@ -184,7 +184,7 @@ if (!empty($conf->societe->enabled)) {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project');
if ($user->rights->ticket->write) {

View File

@ -34,12 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
}
if (!empty($conf->contrat->enabled)) {
if (isModEnabled('contrat')) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php';
@ -698,7 +698,7 @@ if (empty($reshook)) {
$userstat = new User($db);
$form = new Form($db);
$formticket = new FormTicket($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@ -940,7 +940,7 @@ if ($action == 'create' || $action == 'presend') {
}
// Thirdparty
if (!empty($conf->societe->enabled)) {
if (isModEnabled('societe')) {
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' ';
if ($action != 'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref .= '<a class="editfielda" href="'.$url_page_current.'?action=editcustomer&token='.newToken().'&track_id='.$object->track_id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 0).'</a> : ';
@ -953,7 +953,7 @@ if ($action == 'create' || $action == 'presend') {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
@ -1107,7 +1107,7 @@ if ($action == 'create' || $action == 'presend') {
print '</tr>';
// Timing (Duration sum of linked fichinter)
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
$object->fetchObjectLinked();
$num = count($object->linkedObjects);
$timing = 0;

View File

@ -189,7 +189,7 @@ class CTicketCategory extends CommonObject
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
$this->fields['rowid']['visible'] = 0;
}
if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) {
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
$this->fields['entity']['enabled'] = 0;
}

View File

@ -1816,7 +1816,7 @@ class Ticket extends CommonObject
$error = 0;
// Valid and close fichinter linked
if (!empty($conf->ficheinter->enabled) && !empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) {
if (isModEnabled('ficheinter') && !empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) {
dol_syslog("We have closed the ticket, so we close all linked interventions");
$this->fetchObjectLinked($this->id, $this->element, null, 'fichinter');
if ($this->linkedObjectsIds) {

View File

@ -210,7 +210,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
}
// Thirdparty
if (!empty($conf->societe->enabled)) {
if (isModEnabled('societe')) {
$morehtmlref .= '<br>'.$langs->trans('ThirdParty');
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&token='.newToken().'&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
@ -224,7 +224,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {

View File

@ -145,7 +145,7 @@ if ($object->id) {
}
// Thirdparty
if (!empty($conf->societe->enabled)) {
if (isModEnabled('societe')) {
$morehtmlref .= '<br>'.$langs->trans('ThirdParty');
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&token='.newToken().'&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
@ -159,7 +159,7 @@ if ($object->id) {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {

View File

@ -171,7 +171,7 @@ if ($object->fk_user_create > 0) {
}
// Thirdparty
if (!empty($conf->societe->enabled)) {
if (isModEnabled('societe')) {
$morehtmlref .= '<br>'.$langs->trans('ThirdParty');
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&token='.newToken().'&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
@ -185,7 +185,7 @@ if (!empty($conf->societe->enabled)) {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project');
if ($user->rights->ticket->write) {