Use isModEnabled
This commit is contained in:
parent
ca3f592875
commit
94e4144c27
@ -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)),
|
||||
'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' => !empty($conf->loan->enabled), 'perms' => !empty($user->rights->loan->read)),
|
||||
'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');
|
||||
@ -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";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user