Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-08-31 17:57:14 +02:00
commit a5c18ea776
93 changed files with 472 additions and 444 deletions

View File

@ -28,7 +28,7 @@ Following changes may create regressions for some external modules, but were nec
For users: For users:
--------------- ---------------
NEW: PHP 8.1 compatibility. NEW: PHP 8.1 compatibility:
Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending
on the PHP setup). Removal of all PHP warnings on server side is planned for v17. on the PHP setup). Removal of all PHP warnings on server side is planned for v17.
NEW: Support for recurring purchase invoices. NEW: Support for recurring purchase invoices.
@ -139,6 +139,7 @@ NEW: Ticket triggers: allow to automatically send messages on new tickets
NEW: Accountancy - Add hidden feature for accounting reconciliation NEW: Accountancy - Add hidden feature for accounting reconciliation
NEW: Can store the session into database (instead of beeing managed by PHP) NEW: Can store the session into database (instead of beeing managed by PHP)
NEW: Added MMK currency (Myanmar Kyat) NEW: Added MMK currency (Myanmar Kyat)
NEW: On a form to send an email, we show all emails of contacts of object
Modules Modules
NEW: Module Partnership Management NEW: Module Partnership Management

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro> /* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -124,7 +124,8 @@ if (!empty($cat_id)) {
$arraykeyvalue = array(); $arraykeyvalue = array();
foreach ($accountingcategory->lines_cptbk as $key => $val) { foreach ($accountingcategory->lines_cptbk as $key => $val) {
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte).' ('.$val->label_compte.($val->doc_ref ? ' '.$val->doc_ref : '').')'; $doc_ref = !empty($val->doc_ref) ? $val->doc_ref : '';
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . ($doc_ref ? ' '.$doc_ref : '');
} }
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) { if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* *
@ -542,21 +542,24 @@ if ($action == 'create') {
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Date document export // Don't show in tmp mode, inevitably empty
print '<tr>'; if ($mode != "_tmp") {
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>'; // Date document export
print '<td>'; print '<tr>';
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : '&nbsp;'; print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>';
print '</td>'; print '<td>';
print '</tr>'; print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : '&nbsp;';
print '</td>';
print '</tr>';
// Date document validation // Date document validation
print '<tr>'; print '<tr>';
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>'; print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>';
print '<td>'; print '<td>';
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : '&nbsp;'; print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : '&nbsp;';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
}
// Validate // Validate
/* /*

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* *
@ -1136,6 +1136,9 @@ $totalarray = array();
$totalarray['nbfield'] = 0; $totalarray['nbfield'] = 0;
$total_debit = 0; $total_debit = 0;
$total_credit = 0; $total_credit = 0;
$totalarray['val'] = array ();
$totalarray['val']['totaldebit'] = 0;
$totalarray['val']['totalcredit'] = 0;
while ($i < min($num, $limit)) { while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);

View File

@ -824,17 +824,22 @@ print $hookmanager->resPrint;
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
$total_debit = 0;
$total_credit = 0;
$sous_total_debit = 0;
$sous_total_credit = 0;
$displayed_account_number = null; // Start with undefined to be able to distinguish with empty $displayed_account_number = null; // Start with undefined to be able to distinguish with empty
// Loop on record // Loop on record
// -------------------------------------------------------------------- // --------------------------------------------------------------------
$i = 0; $i = 0;
$totalarray = array(); $totalarray = array();
$totalarray['val'] = array ();
$totalarray['nbfield'] = 0;
$total_debit = 0;
$total_credit = 0;
$sous_total_debit = 0;
$sous_total_credit = 0;
$totalarray['val']['totaldebit'] = 0;
$totalarray['val']['totalcredit'] = 0;
while ($i < min($num, $limit)) { while ($i < min($num, $limit)) {
$line = $object->lines[$i]; $line = $object->lines[$i];

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2020 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2015-2020 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* *
@ -1667,7 +1667,9 @@ class BookKeeping extends CommonObject
$this->doc_type = $obj->doc_type; $this->doc_type = $obj->doc_type;
$this->date_creation = $this->db->jdate($obj->date_creation); $this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_modification = $this->db->jdate($obj->date_modification); $this->date_modification = $this->db->jdate($obj->date_modification);
$this->date_export = $this->db->jdate($obj->date_export); if ($mode != "_tmp") {
$this->date_export = $this->db->jdate($obj->date_export);
}
$this->date_validation = $this->db->jdate($obj->date_validation); $this->date_validation = $this->db->jdate($obj->date_validation);
} else { } else {
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
@ -1764,7 +1766,9 @@ class BookKeeping extends CommonObject
$line->piece_num = $obj->piece_num; $line->piece_num = $obj->piece_num;
$line->date_creation = $obj->date_creation; $line->date_creation = $obj->date_creation;
$line->date_modification = $obj->date_modification; $line->date_modification = $obj->date_modification;
$line->date_export = $obj->date_export; if ($mode != "_tmp") {
$line->date_export = $obj->date_export;
}
$line->date_validation = $obj->date_validation; $line->date_validation = $obj->date_validation;
$this->linesmvt[] = $line; $this->linesmvt[] = $line;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@open-dsi.fr> /* Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
// $formatexportset ùust be defined // $formatexportset must be defined
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) { if (empty($conf) || !is_object($conf)) {
@ -24,11 +24,11 @@ if (empty($conf) || !is_object($conf)) {
exit; exit;
} }
$code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE; $code = getDolGlobalString('MAIN_INFO_ACCOUNTANT_CODE');
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC; $prefix = getDolGlobalString('ACCOUNTING_EXPORT_PREFIX_SPEC');
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT; $format = getDolGlobalString('ACCOUNTING_EXPORT_FORMAT');
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME; $nodateexport = getDolGlobalInt('ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME');
$siren = $conf->global->MAIN_INFO_SIREN; $siren = getDolGlobalString('MAIN_INFO_SIREN');
$date_export = "_".dol_print_date(dol_now(), '%Y%m%d%H%M%S'); $date_export = "_".dol_print_date(dol_now(), '%Y%m%d%H%M%S');
$endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');

View File

@ -663,6 +663,10 @@ class Adherent extends CommonObject
{ {
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$nbrowsaffected = 0; $nbrowsaffected = 0;
$error = 0; $error = 0;

View File

@ -1496,7 +1496,7 @@ if ($action == 'create') {
// Description // Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); $doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, isModEnabled('fckeditor'), ROWS_4, '90%');
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';

View File

@ -194,7 +194,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>'; print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap right tdamount amount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>'; print '<td class="nowrap right tdamount amount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
print '</tr>'; print '</tr>';
@ -291,7 +291,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>'; print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>'; print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
@ -389,7 +389,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>'; print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>'; print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
@ -487,7 +487,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>'; print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>'; print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
@ -573,8 +573,9 @@ if (!empty($conf->ficheinter->enabled)) {
$companystatic->email = $obj->email; $companystatic->email = $obj->email;
$companystatic->entity = $obj->entity; $companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'; print '<td class="nowraponall tdoverflowmax100">';
print $fichinterstatic->getNomUrl(1); print $fichinterstatic->getNomUrl(1);
print "</td>"; print "</td>";
print '<td class="nowrap tdoverflowmax100">'; print '<td class="nowrap tdoverflowmax100">';
@ -654,7 +655,7 @@ if (isModEnabled("societe") && $user->rights->societe->lire) {
$companystatic->canvas = $objp->canvas; $companystatic->canvas = $objp->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
//print $companystatic->getLibCustProspStatut(); //print $companystatic->getLibCustProspStatut();
@ -751,7 +752,7 @@ if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERM
$companystatic->canvas = $objp->canvas; $companystatic->canvas = $objp->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td>'; print '<td>';
$obj = $companystatic; $obj = $companystatic;
@ -865,8 +866,8 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
$staticcontrat->ref = $obj->ref; $staticcontrat->ref = $obj->ref;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$staticcontrat->getNomUrl(1).'</td>'; print '<td class="nowraponall">'.$staticcontrat->getNomUrl(1).'</td>';
print '<td>'.$companystatic->getNomUrl(1, 'customer', 44).'</td>'; print '<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
print '<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).'</td>'; print '<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).'</td>';
print '</tr>'; print '</tr>';
@ -962,7 +963,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
print '<td class="nowrap" width="140">'; print '<td class="nowrap" width="140">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>'; print '<td class="nobordernopadding nowraponall">'.$propalstatic->getNomUrl(1).'</td>';
print '<td width="18" class="nobordernopadding nowrap">'.$warning.'</td>'; print '<td width="18" class="nobordernopadding nowrap">'.$warning.'</td>';
print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>'; print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>';
print '</tr>'; print '</tr>';
@ -1082,7 +1083,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
print '<td class="nowrap" width="140">'; print '<td class="nowrap" width="140">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'.$orderstatic->getNomUrl(1).'</td>'; print '<td class="nobordernopadding nowraponall">'.$orderstatic->getNomUrl(1).'</td>';
print '<td width="18" class="nobordernopadding nowrap"></td>'; print '<td width="18" class="nobordernopadding nowrap"></td>';
print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).'</td>'; print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).'</td>';
print '</tr>'; print '</tr>';

View File

@ -108,7 +108,7 @@ $arrayfields = array(
); );
// Security check // Security check
if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled)) { if (!isModEnabled('comptabilite') && !isModEnabled('accounting')) {
accessforbidden(); accessforbidden();
} }
if ($user->socid > 0) { if ($user->socid > 0) {
@ -135,13 +135,13 @@ $error = 0;
$listofchoices = array( $listofchoices = array(
'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)), 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)),
'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => isModEnabled("supplier_invoice"), 'perms' => !empty($user->rights->fournisseur->facture->lire)), 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => !empty($user->rights->fournisseur->facture->lire)),
'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)), 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)),
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->don->lire)),
'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled), 'perms' => !empty($user->rights->tax->charges->lire)), 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)),
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled), 'perms' => !empty($user->rights->salaries->read)), '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)), '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)),
); );
@ -569,7 +569,7 @@ print '<form name="searchfiles" action="?action=searchfiles" method="POST">'."\n
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<span class="opacitymedium">'.$langs->trans("ExportAccountingSourceDocHelp"); 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 ' '.$langs->trans("ExportAccountingSourceDocHelp2", $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Journals"));
} }
print '</span><br>'; print '</span><br>';
@ -689,21 +689,21 @@ if (!empty($date_start) && !empty($date_stop)) {
print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'nowraponall '); print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'nowraponall ');
print '<td>'.$langs->trans("Document").'</td>'; print '<td>'.$langs->trans("Document").'</td>';
print '<td>'.$langs->trans("Paid").'</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("TotalHT").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalTTC").($conf->multicurrency->enabled ? ' ('.$conf->currency.')' : '').'</td>'; print '<td align="right">'.$langs->trans("TotalTTC").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalVAT").($conf->multicurrency->enabled ? ' ('.$conf->currency.')' : '').'</td>'; print '<td align="right">'.$langs->trans("TotalVAT").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td>'.$langs->trans("ThirdParty").'</td>'; print '<td>'.$langs->trans("ThirdParty").'</td>';
print '<td class="center">'.$langs->trans("Code").'</td>'; print '<td class="center">'.$langs->trans("Code").'</td>';
print '<td class="center">'.$langs->trans("Country").'</td>'; print '<td class="center">'.$langs->trans("Country").'</td>';
print '<td class="center">'.$langs->trans("VATIntra").'</td>'; print '<td class="center">'.$langs->trans("VATIntra").'</td>';
if (isModEnabled('multicompany')) { if (isModEnabled('multicurrency')) {
print '<td class="center">'.$langs->trans("Currency").'</td>'; print '<td class="center">'.$langs->trans("Currency").'</td>';
} }
print '</tr>'; print '</tr>';
if (empty($TData)) { if (empty($TData)) {
print '<tr class="oddeven"><td colspan="13"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td>'; print '<tr class="oddeven"><td colspan="13"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td>';
if (isModEnabled('multicompany')) { if (isModEnabled('multicurrency')) {
print '<td></td>'; print '<td></td>';
} }
print '</tr>'; print '</tr>';
@ -833,7 +833,7 @@ if (!empty($date_start) && !empty($date_stop)) {
$totalVAT_debit -= $data['amount_vat']; $totalVAT_debit -= $data['amount_vat'];
} }
if (isModEnabled('multicompany')) { if (isModEnabled('multicurrency')) {
print '<td class="center">'.$data['currency']."</td>\n"; print '<td class="center">'.$data['currency']."</td>\n";
} }
@ -847,7 +847,7 @@ if (!empty($date_start) && !empty($date_stop)) {
print '<td align="right">'.price(price2num($totalIT_credit, 'MT')).'</td>'; print '<td align="right">'.price(price2num($totalIT_credit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit, 'MT')).'</td>'; print '<td align="right">'.price(price2num($totalVAT_credit, 'MT')).'</td>';
print '<td colspan="4"></td>'; print '<td colspan="4"></td>';
if (isModEnabled('multicompany')) { if (isModEnabled('multicurrency')) {
print '<td></td>'; print '<td></td>';
} }
print "</tr>\n"; print "</tr>\n";
@ -858,7 +858,7 @@ if (!empty($date_start) && !empty($date_stop)) {
print '<td align="right">'.price(price2num($totalIT_debit, 'MT')).'</td>'; print '<td align="right">'.price(price2num($totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_debit, 'MT')).'</td>'; print '<td align="right">'.price(price2num($totalVAT_debit, 'MT')).'</td>';
print '<td colspan="4"></td>'; print '<td colspan="4"></td>';
if (isModEnabled('multicompany')) { if (isModEnabled('multicurrency')) {
print '<td></td>'; print '<td></td>';
} }
print "</tr>\n"; print "</tr>\n";
@ -869,7 +869,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($totalIT_credit + $totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'</td>'; print '<td align="right">'.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'</td>';
print '<td colspan="4"></td>'; print '<td colspan="4"></td>';
if (isModEnabled('multicompany')) { if (isModEnabled('multicurrency')) {
print '<td></td>'; print '<td></td>';
} }
print "</tr>\n"; print "</tr>\n";

View File

@ -365,7 +365,7 @@ if (GETPOST('save') && !$cancel && !empty($user->rights->banque->modifier)) {
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); 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'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors');
$error++; $error++;
@ -882,7 +882,7 @@ if ($resql) {
print '<td class=right>'.$langs->trans("BankAccount").'</td>'; print '<td class=right>'.$langs->trans("BankAccount").'</td>';
print '<td class=right>'.$langs->trans("Debit").'</td>'; print '<td class=right>'.$langs->trans("Debit").'</td>';
print '<td class=right>'.$langs->trans("Credit").'</td>'; print '<td class=right>'.$langs->trans("Credit").'</td>';
/*if (! empty($conf->accounting->enabled)) /*if (isModEnabled('accounting'))
{ {
print '<td class="center">'; print '<td class="center">';
print $langs->trans("AccountAccounting"); print $langs->trans("AccountAccounting");
@ -917,7 +917,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="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>'; 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 '<td class="center">';
print $formaccounting->select_account($search_accountancy_code, 'search_accountancy_code', 1, null, 1, 1, ''); print $formaccounting->select_account($search_accountancy_code, 'search_accountancy_code', 1, null, 1, 1, '');
@ -1026,9 +1026,9 @@ if ($resql) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
// Categories // Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$langs->load('categories'); $langs->load('categories');
// Bank line // 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.'/core/class/html.formbank.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.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'; 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'; 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'; 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'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
} }
@ -336,7 +336,7 @@ if (empty($reshook)) {
$form = new Form($db); $form = new Form($db);
$formbank = new FormBank($db); $formbank = new FormBank($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
} }
@ -445,7 +445,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Tags-Categories // Tags-Categories
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
print '<tr><td>'.$langs->trans("Categories").'</td><td>'; print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
@ -581,7 +581,7 @@ if ($action == 'create') {
$fieldrequired = 'fieldrequired '; $fieldrequired = 'fieldrequired ';
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
print '<td>'; print '<td>';
print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1); print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
@ -592,7 +592,7 @@ if ($action == 'create') {
} }
// Accountancy journal // Accountancy journal
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>'; print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
print '<td>'; print '<td>';
print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0); print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);
@ -671,7 +671,7 @@ if ($action == 'create') {
// Accountancy code // Accountancy code
print '<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans("AccountancyCode").'</td>'; print '<tr class="liste_titre_add"><td class="titlefield">'.$langs->trans("AccountancyCode").'</td>';
print '<td>'; print '<td>';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$accountingaccount = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $object->account_number, 1); $accountingaccount->fetch('', $object->account_number, 1);
@ -682,7 +682,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Accountancy journal // Accountancy journal
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>'; print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
print '<td>'; print '<td>';
@ -708,7 +708,7 @@ if ($action == 'create') {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
// Categories // Categories
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1); print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1);
print "</td></tr>"; print "</td></tr>";
@ -958,7 +958,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Tags-Categories // Tags-Categories
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
print '<tr><td>'.$langs->trans("Categories").'</td><td>'; print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
$c = new Categorie($db); $c = new Categorie($db);
@ -1006,7 +1006,7 @@ if ($action == 'create') {
print '<tr><td'.$tdextra.'>'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td'.$tdextra.'>'.$langs->trans("AccountancyCode").'</td>';
print '<td>'; print '<td>';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1); print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
} else { } else {
print '<input type="text" name="account_number" value="'.(GETPOST("account_number") ? GETPOST("account_number") : $object->account_number).'">'; print '<input type="text" name="account_number" value="'.(GETPOST("account_number") ? GETPOST("account_number") : $object->account_number).'">';
@ -1014,7 +1014,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Accountancy journal // Accountancy journal
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print '<tr><td class="fieldrequired">'.$langs->trans("AccountancyJournal").'</td>'; print '<tr><td class="fieldrequired">'.$langs->trans("AccountancyJournal").'</td>';
print '<td>'; print '<td>';
print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0); print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0);

View File

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

View File

@ -37,16 +37,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other')); $langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other'));
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
} }
if (!empty($conf->don->enabled)) { if (isModEnabled('don')) {
$langs->load("donations"); $langs->load("donations");
} }
if (!empty($conf->loan->enabled)) { if (isModEnabled('loan')) {
$langs->load("loan"); $langs->load("loan");
} }
if (!empty($conf->salaries->enabled)) { if (isModEnabled('salaries')) {
$langs->load("salaries"); $langs->load("salaries");
} }
@ -580,7 +580,7 @@ if ($result) {
print "</tr>"; print "</tr>";
// Categories // Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$langs->load('categories'); $langs->load('categories');
// Bank line // 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/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.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'; 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'; 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'; 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' $search_status = GETPOST('search_status') ?GETPOST('search_status', 'alpha') : 'opened'; // 'all' or ''='opened'
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
$search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array"); $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), 'b.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1, 'position'=>12),
'accountype'=>array('label'=>$langs->trans("Type"), 'checked'=>1, 'position'=>14), 'accountype'=>array('label'=>$langs->trans("Type"), 'checked'=>1, 'position'=>14),
'b.number'=>array('label'=>$langs->trans("AccountIdShort"), 'checked'=>1, 'position'=>16), '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.account_number'=>array('label'=>$langs->trans("AccountAccounting"), 'checked'=>(isModEnabled('accounting')), 'position'=>18),
'b.fk_accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>(!empty($conf->accounting->enabled) || !empty($conf->accounting->enabled)), 'position'=>20), 'b.fk_accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>(isModEnabled('accounting')), 'position'=>20),
'toreconcile'=>array('label'=>$langs->trans("TransactionsToConciliate"), 'checked'=>1, 'position'=>50), 'toreconcile'=>array('label'=>$langs->trans("TransactionsToConciliate"), 'checked'=>1, 'position'=>50),
'b.currency_code'=>array('label'=>$langs->trans("Currency"), 'checked'=>0, 'position'=>22), 'b.currency_code'=>array('label'=>$langs->trans("Currency"), 'checked'=>0, 'position'=>22),
'b.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), '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)"; $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"); $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_ACCOUNT, "b.rowid");
} }
@ -209,7 +209,7 @@ if ($search_status == 'closed') {
$sql .= " AND clos = 1"; $sql .= " AND clos = 1";
} }
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
$sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_ACCOUNT, "b.rowid", $search_category_list); $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 = ''; $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); $moreforfilter .= $form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list);
} }
@ -569,7 +569,7 @@ foreach ($accounts as $key => $type) {
// Account number // Account number
if (!empty($arrayfields['b.account_number']['checked'])) { if (!empty($arrayfields['b.account_number']['checked'])) {
print '<td class="tdoverflowmax250">'; 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 = new AccountingAccount($db);
$accountingaccount->fetch('', $objecttmp->account_number, 1); $accountingaccount->fetch('', $objecttmp->account_number, 1);
print '<span title="'.dol_escape_htmltag($accountingaccount->account_number.' - '.$accountingaccount->label).'">'; print '<span title="'.dol_escape_htmltag($accountingaccount->account_number.' - '.$accountingaccount->label).'">';
@ -587,7 +587,7 @@ foreach ($accounts as $key => $type) {
// Accountancy journal // Accountancy journal
if (!empty($arrayfields['b.fk_accountancy_journal']['checked'])) { if (!empty($arrayfields['b.fk_accountancy_journal']['checked'])) {
print '<td class="tdoverflowmax125">'; print '<td class="tdoverflowmax125">';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
if (empty($objecttmp->fk_accountancy_journal)) { if (empty($objecttmp->fk_accountancy_journal)) {
print img_warning($langs->trans("Mandatory")); print img_warning($langs->trans("Mandatory"));
} else { } else {

View File

@ -270,12 +270,12 @@ print '</tr>';
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print img_picto('', 'bank_account', 'class="paddingright"'); 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>";
print "<td>\n"; print "<td>\n";
print img_picto('', 'bank_account', 'class="paddingright"'); 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>\n";
print "<td>"; 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.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.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.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.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"); $paymenttype = GETPOST("paymenttype", "aZ09");
$accountancy_code = GETPOST("accountancy_code", "alpha"); $accountancy_code = GETPOST("accountancy_code", "alpha");
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); $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") : ''; $subledger_account = GETPOST("subledger_account", "alpha") > 0 ? GETPOST("subledger_account", "alpha") : '';
} else { } else {
$subledger_account = GETPOST("subledger_account", "alpha"); $subledger_account = GETPOST("subledger_account", "alpha");
@ -149,7 +149,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors');
$error++; $error++;
} }
if (!empty($conf->accounting->enabled) && !$object->accountancy_code) { if (isModEnabled('accounting') && !$object->accountancy_code) {
$langs->load('errors'); $langs->load('errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors');
$error++; $error++;
@ -305,10 +305,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->banque->m
* View * View
*/ */
$form = new Form($db); $form = new Form($db);
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
} }
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
} }
@ -448,7 +448,7 @@ if ($action == 'create') {
} }
// Accountancy account // 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 // 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 '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("AccountAccounting").'</td>';
print '<td>'; print '<td>';
@ -461,7 +461,7 @@ if ($action == 'create') {
} }
// Subledger account // Subledger account
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print '<tr><td>'.$langs->trans("SubledgerAccount").'</td>'; print '<tr><td>'.$langs->trans("SubledgerAccount").'</td>';
print '<td>'; print '<td>';
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
@ -485,7 +485,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
// Associated project // Associated project
@ -557,7 +557,7 @@ if ($id) {
$morehtmlref = '<div class="refidno">'; $morehtmlref = '<div class="refidno">';
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= $langs->trans('Project').' '; $morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->banque->modifier) { if ($user->rights->banque->modifier) {
@ -625,7 +625,7 @@ if ($id) {
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print $langs->trans("AccountAccounting"); print $langs->trans("AccountAccounting");
print '</td><td>'; print '</td><td>';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$accountingaccount = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $object->accountancy_code, 1); $accountingaccount->fetch('', $object->accountancy_code, 1);

View File

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

View File

@ -154,8 +154,8 @@ $arrayfields = array(
'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)), 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("banque")), 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("banque")),
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("banque")), 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("banque")),
'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)), 'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>isModEnabled('accounting')),
'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>!empty($conf->accounting->enabled)), 'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>isModEnabled('accounting')),
'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500), 'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500),
'credit' =>array('label'=>"Credit", 'checked'=>1, 'position'=>510), 'credit' =>array('label'=>"Credit", 'checked'=>1, 'position'=>510),
); );
@ -190,7 +190,7 @@ $form = new Form($db);
if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) { if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) {
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
} }
if ($arrayfields['bank']['checked'] && !empty($conf->accounting->enabled)) { if ($arrayfields['bank']['checked'] && isModEnabled('accounting')) {
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);
} }
if ($arrayfields['ref']['checked']) { if ($arrayfields['ref']['checked']) {
@ -621,7 +621,7 @@ if ($resql) {
$accountstatic->ref = $obj->bref; $accountstatic->ref = $obj->bref;
$accountstatic->number = $obj->bnumber; $accountstatic->number = $obj->bnumber;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$accountstatic->account_number = $obj->bank_account_number; $accountstatic->account_number = $obj->bank_account_number;
$accountingjournal->fetch($obj->accountancy_journal); $accountingjournal->fetch($obj->accountancy_journal);
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); $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'); $arrayofpaymentmode = array('cash'=>'Cash', 'cheque'=>'Cheque', 'card'=>'CreditCard');
$arrayofposavailable = array(); $arrayofposavailable = array();
if (!empty($conf->cashdesk->enabled)) { if (isModEnabled('cashdesk')) {
$arrayofposavailable['cashdesk'] = $langs->trans('CashDesk').' (cashdesk)'; $arrayofposavailable['cashdesk'] = $langs->trans('CashDesk').' (cashdesk)';
} }
if (!empty($conf->takepos->enabled)) { if (isModEnabled('takepos')) {
$arrayofposavailable['takepos'] = $langs->trans('TakePOS').' (takepos)'; $arrayofposavailable['takepos'] = $langs->trans('TakePOS').' (takepos)';
} }
// TODO Add hook here to allow other POS to add themself // 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 '<span class="opacitymedium">'.$langs->trans("DescTaxAndDividendsArea").'</span><br>';
print "<br>"; print "<br>";
if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { if (isModEnabled('tax') && $user->rights->tax->charges->lire) {
// Social contributions only // Social contributions only
print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
@ -266,7 +266,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
} }
// VAT // VAT
if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { if (isModEnabled('tax') && $user->rights->tax->charges->lire) {
print "<br>"; print "<br>";
$tva = new Tva($db); $tva = new Tva($db);

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

View File

@ -54,30 +54,28 @@ 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/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.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'; 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.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
} }
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.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'; 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'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
} }
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals')); $langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals'));
if (isModEnabled('incoterm')) {
if (!empty($conf->incoterm->enabled)) {
$langs->load('incoterm'); $langs->load('incoterm');
} }
if (isModEnabled('margin')) {
if (!empty($conf->margin->enabled)) {
$langs->load('margins'); $langs->load('margins');
} }
@ -549,7 +547,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')); $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
} elseif ($action == 'setbankaccount' && $usercancreate) { // bank account } elseif ($action == 'setbankaccount' && $usercancreate) { // bank account
$result = $object->setBankAccount(GETPOST('fk_account', 'int')); $result = $object->setBankAccount(GETPOST('fk_account', 'int'));
@ -2105,7 +2103,7 @@ if (empty($reshook)) {
$error++; $error++;
} }
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') {
if ($combinations = GETPOST('combinations', 'array')) { if ($combinations = GETPOST('combinations', 'array')) {
//Check if there is a product with the given combination //Check if there is a product with the given combination
$prodcomb = new ProductCombination($db); $prodcomb = new ProductCombination($db);
@ -2952,7 +2950,7 @@ $formmargin = new FormMargin($db);
$soc = new Societe($db); $soc = new Societe($db);
$paymentstatic = new Paiement($db); $paymentstatic = new Paiement($db);
$bankaccountstatic = new Account($db); $bankaccountstatic = new Account($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
} }
@ -3074,7 +3072,7 @@ if ($action == 'create') {
$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0)); $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)); $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)) { if (!empty($objectsrc->multicurrency_code)) {
$currency_code = $objectsrc->multicurrency_code; $currency_code = $objectsrc->multicurrency_code;
} }
@ -3096,7 +3094,7 @@ if ($action == 'create') {
$remise_absolue = 0; $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) $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; $currency_code = $soc->multicurrency_code;
} }
} }
@ -3738,7 +3736,7 @@ if ($action == 'create') {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load('projects'); $langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">'; 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'); print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
@ -3747,7 +3745,7 @@ if ($action == 'create') {
} }
// Incoterms // Incoterms
if (!empty($conf->incoterm->enabled)) { if (isModEnabled('incoterm')) {
print '<tr>'; 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><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">'; print '<td colspan="2" class="maxwidthonsmartphone">';
@ -3795,7 +3793,7 @@ if ($action == 'create') {
print "</td></tr>"; print "</td></tr>";
// Multicurrency // Multicurrency
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
print '<tr>'; print '<tr>';
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>'; print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
print '<td colspan="2" class="maxwidthonsmartphone">'; print '<td colspan="2" class="maxwidthonsmartphone">';
@ -3916,7 +3914,7 @@ if ($action == 'create') {
} }
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>"; 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('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('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>"; print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
@ -3992,7 +3990,7 @@ if ($action == 'create') {
$resteapayer = price2num($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT'); $resteapayer = price2num($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
// Multicurrency // Multicurrency
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
$multicurrency_totalpaid = $object->getSommePaiement(1); $multicurrency_totalpaid = $object->getSommePaiement(1);
$multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1);
$multicurrency_totaldeposits = $object->getSumDepositsUsed(1); $multicurrency_totaldeposits = $object->getSumDepositsUsed(1);
@ -4364,7 +4362,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>)'; $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 // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($usercancreate) { if ($usercancreate) {
@ -4584,7 +4582,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Multicurrency // Multicurrency
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
// Multicurrency code // Multicurrency code
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
@ -4650,7 +4648,7 @@ if ($action == 'create') {
} }
// Incoterms // Incoterms
if (!empty($conf->incoterm->enabled)) { if (isModEnabled('incoterm')) {
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>'; print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('IncotermLabel'); print $langs->trans('IncotermLabel');
@ -4788,7 +4786,7 @@ if ($action == 'create') {
$sign = -1; // We invert sign for output $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 // Multicurrency Amount HT
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>'; 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>'; 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>';
@ -4883,7 +4881,7 @@ if ($action == 'create') {
$nbrows = 8; $nbrows = 8;
$nbcols = 3; $nbcols = 3;
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$nbrows++; $nbrows++;
} }
if (isModEnabled("banque")) { if (isModEnabled("banque")) {
@ -4899,10 +4897,10 @@ if ($action == 'create') {
if ($selleruserevenustamp) { if ($selleruserevenustamp) {
$nbrows++; $nbrows++;
} }
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
$nbrows += 5; $nbrows += 5;
} }
if (!empty($conf->incoterm->enabled)) { if (isModEnabled('incoterm')) {
$nbrows += 1; $nbrows += 1;
} }
@ -4997,7 +4995,7 @@ if ($action == 'create') {
print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>'; print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>';
print '<td></td>'; print '<td></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('AmountHT') . '</td>';
print '<td class="right">' . $langs->trans('AmountTTC') . '</td>'; print '<td class="right">' . $langs->trans('AmountTTC') . '</td>';
print '<td width="18">&nbsp;</td>'; print '<td width="18">&nbsp;</td>';
@ -5111,7 +5109,7 @@ if ($action == 'create') {
$bankaccountstatic->number = $objp->banumber; $bankaccountstatic->number = $objp->banumber;
$bankaccountstatic->currency_code = $objp->bacurrency_code; $bankaccountstatic->currency_code = $objp->bacurrency_code;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$bankaccountstatic->account_number = $objp->account_number; $bankaccountstatic->account_number = $objp->account_number;
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);
@ -5339,7 +5337,7 @@ if ($action == 'create') {
print '</div>'; print '</div>';
// Margin Infos // Margin Infos
if (!empty($conf->margin->enabled)) { if (isModEnabled('margin')) {
$formmargin->displayMarginInfos($object); $formmargin->displayMarginInfos($object);
} }
@ -5562,7 +5560,7 @@ if ($action == 'create') {
} }
// POS Ticket // POS Ticket
if (!empty($conf->takepos->enabled) && $object->module_source == 'takepos') { if (isModEnabled('takepos') && $object->module_source == 'takepos') {
$langs->load("cashdesk"); $langs->load("cashdesk");
$receipt_url = DOL_URL_ROOT."/takepos/receipt.php"; $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>'; print '<a target="_blank" rel="noopener noreferrer" class="butAction" href="'.$receipt_url.'?facid='.((int) $object->id).'">'.$langs->trans('POSTicket').'</a>';

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.'/margin/lib/margins.lib.php';
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.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'; 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'; 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/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.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'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
} }
@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty // Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) { 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/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.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.'/projet/class/project.class.php';
} }
@ -141,7 +141,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty // Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) { 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/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.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'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
} }
@ -97,7 +97,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl
// Thirdparty // Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) { 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); $form = new Form($db);
$formother = new FormOther($db); $formother = new FormOther($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
} }
$companystatic = new Societe($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.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.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/class/html.formmargin.class.php';
} }
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.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/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.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'; 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 'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>166), '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_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>280),
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>285), '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'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>290), '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'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>291), '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'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>292), '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'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>295), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 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 '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_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' => 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)), '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); $formother = new FormOther($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$formmargin = null; $formmargin = null;
if (!empty($conf->margin->enabled)) { if (isModEnabled('margin')) {
$formmargin = new FormMargin($db); $formmargin = new FormMargin($db);
} }
$bankaccountstatic = new Account($db); $bankaccountstatic = new Account($db);
@ -1200,7 +1200,7 @@ if ($resql) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// Filter on product tags // 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'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag'); $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 .= 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>'; $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'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); $tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
@ -1721,7 +1721,7 @@ if ($resql) {
$totalarray['val']['f.total_ttc'] = 0; $totalarray['val']['f.total_ttc'] = 0;
$with_margin_info = false; $with_margin_info = false;
if (!empty($conf->margin->enabled) && ( if (isModEnabled('margin') && (
!empty($arrayfields['total_pa']['checked']) !empty($arrayfields['total_pa']['checked'])
|| !empty($arrayfields['total_margin']['checked']) || !empty($arrayfields['total_margin']['checked'])
|| !empty($arrayfields['total_margin_rate']['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.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.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/lib/invoice.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.'/projet/class/project.class.php';
} }
@ -119,7 +119,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty // Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) { if ($user->rights->facture->creer) {

View File

@ -349,7 +349,7 @@ if ($object->id > 0) {
} }
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($usercancreate) { if ($usercancreate) {
@ -616,7 +616,7 @@ if ($object->id > 0) {
print '<table class="border centpercent tableforfield">'; 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 // Multicurrency Amount HT
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>'; 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>'; 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.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.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'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
} }
@ -72,7 +72,7 @@ $endyear = $year;
/* /*
* View * View
*/ */
if (!empty($conf->category->enabled)) { if (isModEnabled('categorie')) {
$langs->load('categories'); $langs->load('categories');
} }
$form = new Form($db); $form = new Form($db);
@ -299,7 +299,7 @@ if ($user->admin) {
print '</td></tr>'; print '</td></tr>';
// Category // Category
if (!empty($conf->category->enabled)) { if (isModEnabled('categorie')) {
if ($mode == 'customer') { if ($mode == 'customer') {
$cat_type = Categorie::TYPE_CUSTOMER; $cat_type = Categorie::TYPE_CUSTOMER;
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("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 // Load translation files required by the page
$langs->loadLangs(array('compta', 'bills')); $langs->loadLangs(array('compta', 'bills'));
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$langs->load("orders"); $langs->load("orders");
} }

View File

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

View File

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

View File

@ -597,7 +597,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<td>'.$arraytitle.'</td>'; print '<td>'.$arraytitle.'</td>';
print '<td class="center">'.$langs->trans('Date').'</td>'; print '<td class="center">'.$langs->trans('Date').'</td>';
print '<td class="center">'.$langs->trans('DateMaxPayment').'</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>'.$langs->trans('Currency').'</td>';
print '<td class="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>'; print '<td class="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
print '<td class="right">'.$multicurrencyalreadypayedlabel.'</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'); $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
// Multicurrency Price // Multicurrency Price
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
$multicurrency_payment = $invoice->getSommePaiement(1); $multicurrency_payment = $invoice->getSommePaiement(1);
$multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1); $multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1);
$multicurrency_deposits = $invoice->getSumDepositsUsed(1); $multicurrency_deposits = $invoice->getSumDepositsUsed(1);
@ -676,12 +676,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
} }
// Currency // Currency
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
print '<td class="center">'.$objp->multicurrency_code."</td>\n"; print '<td class="center">'.$objp->multicurrency_code."</td>\n";
} }
// Multicurrency Price // Multicurrency Price
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
print '<td class="right">'; print '<td class="right">';
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) {
print price($sign * $objp->multicurrency_total_ttc); print price($sign * $objp->multicurrency_total_ttc);
@ -814,7 +814,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Print total // Print total
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="3" class="left">'.$langs->trans('TotalTTC').'</td>'; 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>'; print '<td></td>';
print '<td></td>'; print '<td></td>';

View File

@ -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 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 = $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 $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; global $conf;
$way = 'dolibarr'; $way = 'dolibarr';
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
foreach ($this->multicurrency_amounts as $value) { foreach ($this->multicurrency_amounts as $value) {
if (!empty($value)) { // one value found then payment is in invoice currency if (!empty($value)) { // one value found then payment is in invoice currency
$way = 'customer'; $way = 'customer';

View File

@ -132,7 +132,7 @@ $nbofyear = ($year_end - $year_start) + 1;
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE; $modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING'; $modecompta = 'BOOKKEEPING';
} }
if (GETPOST("modecompta", 'alpha')) { if (GETPOST("modecompta", 'alpha')) {
@ -146,10 +146,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
} }
@ -174,7 +174,7 @@ if ($modecompta == "CREANCES-DETTES") {
$calcmode = $langs->trans("CalcModeDebt"); $calcmode = $langs->trans("CalcModeDebt");
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')'; $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); $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 .= '<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); $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 = $langs->trans("CalcModeEngagement");
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')'; $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); $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 .= '<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); $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); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }
@ -537,7 +537,7 @@ if ($modecompta == 'BOOKKEEPING') {
* Donations * Donations
*/ */
if (!empty($conf->don->enabled)) { if (isModEnabled('don')) {
print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Donations").'</td></tr>'; print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Donations").'</td></tr>';
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
@ -932,7 +932,7 @@ if ($modecompta == 'BOOKKEEPING') {
* Salaries * Salaries
*/ */
if (!empty($conf->salaries->enabled)) { if (isModEnabled('salaries')) {
print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Salaries").'</td></tr>'; print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Salaries").'</td></tr>';
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
@ -1035,7 +1035,7 @@ if ($modecompta == 'BOOKKEEPING') {
* Expense report * Expense report
*/ */
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
$langs->load('trips'); $langs->load('trips');
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
@ -1206,7 +1206,7 @@ if ($modecompta == 'BOOKKEEPING') {
* Payment Loan * 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_ht = 0;
$subtotal_ttc = 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') // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE; $modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING'; $modecompta = 'BOOKKEEPING';
} }
if (GETPOST("modecompta", 'alpha')) { if (GETPOST("modecompta", 'alpha')) {
@ -122,10 +122,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
} }
@ -151,7 +151,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$calcmode = $langs->trans("CalcModeDebt"); $calcmode = $langs->trans("CalcModeDebt");
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')'; $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); $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 .= '<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); $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 = $langs->trans("CalcModeEngagement");
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')'; $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); $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 .= '<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); $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); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }
@ -391,7 +391,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta
$subtotal_ht = 0; $subtotal_ht = 0;
$subtotal_ttc = 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') { if ($modecompta == 'CREANCES-DETTES') {
// TVA collected to pay // TVA collected to pay
$sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; $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_ht = 0;
$subtotal_ttc = 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') { 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 = "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"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
@ -613,7 +613,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
* Salaries * 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') { if ($modecompta == 'CREANCES-DETTES') {
$column = 's.dateep'; // we use the date of end of period of salary $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 * 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'); $langs->load('trips');
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
@ -737,7 +737,7 @@ if (!empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' |
* Donation get dunning payments * 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_ht = 0;
$subtotal_ttc = 0; $subtotal_ttc = 0;
@ -867,7 +867,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled("ba
* Payement Loan * 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 = "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 .= " FROM ".MAIN_DB_PREFIX."payment_loan AS p, ".MAIN_DB_PREFIX."loan as l";
$sql .= " WHERE l.entity IN (".getEntity('variouspayment').")"; $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 * Request in mode BOOKKEEPING
*/ */
if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) { if (isModEnabled('accounting') && ($modecompta == 'BOOKKEEPING')) {
$predefinedgroupwhere = "("; $predefinedgroupwhere = "(";
$predefinedgroupwhere .= " (aa.pcg_type = 'EXPENSE')"; $predefinedgroupwhere .= " (aa.pcg_type = 'EXPENSE')";
$predefinedgroupwhere .= " OR "; $predefinedgroupwhere .= " OR ";

View File

@ -137,7 +137,7 @@ if ($cat_id == 0) {
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE; $modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING'; $modecompta = 'BOOKKEEPING';
} }
if (GETPOST("modecompta")) { if (GETPOST("modecompta")) {
@ -151,10 +151,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
} }
@ -193,7 +193,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("AnnualByAccountDueDebtMode"); $name = $langs->trans("AnnualByAccountDueDebtMode");
$calcmode = $langs->trans("CalcModeDebt"); $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>').')'; $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>').')'; $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); $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"); $name = $langs->trans("AnnualByAccountInputOutputMode");
$calcmode = $langs->trans("CalcModeEngagement"); $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>').')'; $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>').')'; $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); $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); 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); 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/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.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.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.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'; include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
} }
@ -333,7 +333,7 @@ $form = new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$formsocialcontrib = new FormSocialContrib($db); $formsocialcontrib = new FormSocialContrib($db);
$bankaccountstatic = new Account($db); $bankaccountstatic = new Account($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $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>'; print '<td>'.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).'</td></tr>';
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
// Associated project // Associated project
@ -540,7 +540,7 @@ if ($id > 0) {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->tax->charges->creer) { if ($user->rights->tax->charges->creer) {
@ -733,7 +733,7 @@ if ($id > 0) {
$bankaccountstatic->number = $objp->banumber; $bankaccountstatic->number = $objp->banumber;
$bankaccountstatic->currency_code = $objp->bacurrency_code; $bankaccountstatic->currency_code = $objp->bacurrency_code;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$bankaccountstatic->account_number = $objp->account_number; $bankaccountstatic->account_number = $objp->account_number;
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($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/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.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.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.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); $form = new Form($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $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->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); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : '; $morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_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.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.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.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.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); $form = new Form($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $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->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); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : '; $morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_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.formsocialcontrib.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.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'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
} }
@ -179,7 +179,7 @@ $formother = new FormOther($db);
$bankstatic = new Account($db); $bankstatic = new Account($db);
$formsocialcontrib = new FormSocialContrib($db); $formsocialcontrib = new FormSocialContrib($db);
$chargesociale_static = new ChargeSociales($db); $chargesociale_static = new ChargeSociales($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$projectstatic = new Project($db); $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 = "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,"; $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 .= " 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,"; $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 .= " ".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."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)'; $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."projet as p ON p.rowid = cs.fk_projet";
} }
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $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) { if ($search_label) {
$sql .= natural_search("cs.libelle", $search_label); $sql .= natural_search("cs.libelle", $search_label);
} }
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
if ($search_project_ref != '') { if ($search_project_ref != '') {
$sql .= natural_search("p.ref", $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 .= " 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"; $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 .= ", p.rowid, p.ref, p.title";
} }
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
@ -553,7 +553,7 @@ while ($i < min($num, $limit)) {
$chargesociale_static->label = $obj->label; $chargesociale_static->label = $obj->label;
$chargesociale_static->type_label = $obj->type_label; $chargesociale_static->type_label = $obj->type_label;
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$projectstatic->id = $obj->project_id; $projectstatic->id = $obj->project_id;
$projectstatic->ref = $obj->project_ref; $projectstatic->ref = $obj->project_ref;
$projectstatic->title = $obj->project_label; $projectstatic->title = $obj->project_label;
@ -589,7 +589,7 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['cs.fk_type']['checked'])) { if (!empty($arrayfields['cs.fk_type']['checked'])) {
$typelabeltoshow = $obj->type_label; $typelabeltoshow = $obj->type_label;
$typelabelpopup = $obj->type_label; $typelabelpopup = $obj->type_label;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$typelabelpopup .= ' - '.$langs->trans("AccountancyCode").': '.$obj->type_accountancy_code; $typelabelpopup .= ' - '.$langs->trans("AccountancyCode").': '.$obj->type_accountancy_code;
} }
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($typelabelpopup).'">'.dol_escape_htmltag($typelabeltoshow).'</td>'; 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.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.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.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.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->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); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : '; $morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_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.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; 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.formsocialcontrib.class.php';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
} }
@ -341,7 +341,7 @@ while ($i < min($num, $limit)) {
$accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code); $accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code);
$accountstatic->clos = $obj->clos; $accountstatic->clos = $obj->clos;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$accountstatic->account_number = $obj->account_number; $accountstatic->account_number = $obj->account_number;
$accountstatic->accountancy_journal = $obj->account_journal; $accountstatic->accountancy_journal = $obj->account_journal;
} }

View File

@ -282,7 +282,7 @@ $description .= ' <input type="hidden" name="modecompta" value="'.$modecompta.'
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }

View File

@ -40,10 +40,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $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); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }

View File

@ -39,10 +39,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
} }
@ -231,7 +231,7 @@ if (!empty($modecompta)) {
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }
@ -500,7 +500,7 @@ if (count($amount)) {
if (isModEnabled("propal") && $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;'; 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;'; 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) { if (isModEnabled('facture') && $key > 0) {

View File

@ -68,10 +68,10 @@ if (GETPOST('subcat', 'alpha') === 'yes') {
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $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); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }
@ -676,7 +676,7 @@ if (count($amount)) {
if (isModEnabled("propal") && $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;'; 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;'; 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) { 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') // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE; $modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING'; $modecompta = 'BOOKKEEPING';
} }
if (GETPOST("modecompta")) { if (GETPOST("modecompta")) {
@ -120,10 +120,10 @@ if (GETPOST("modecompta")) {
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
} }
@ -153,7 +153,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("Turnover"); $name = $langs->trans("Turnover");
$calcmode = $langs->trans("CalcModeDebt"); $calcmode = $langs->trans("CalcModeDebt");
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')'; //$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 .= '<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('{link1}', '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=BOOKKEEPING">', $calcmode);
$calcmode = str_replace('{link2}', '</a>', $calcmode); $calcmode = str_replace('{link2}', '</a>', $calcmode);
@ -171,7 +171,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("TurnoverCollected"); $name = $langs->trans("TurnoverCollected");
$calcmode = $langs->trans("CalcModeEngagement"); $calcmode = $langs->trans("CalcModeEngagement");
//$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')'; //$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>').')'; //$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>" : ""); $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); 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); 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') // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE; $modecompta = $conf->global->ACCOUNTING_MODE;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING'; $modecompta = 'BOOKKEEPING';
} }
if (GETPOST("modecompta")) { if (GETPOST("modecompta")) {
@ -114,10 +114,10 @@ if (GETPOST("modecompta")) {
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
} }
@ -142,7 +142,7 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
if ($modecompta == "CREANCES-DETTES") { if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("PurchaseTurnover"); $name = $langs->trans("PurchaseTurnover");
$calcmode = $langs->trans("CalcModeDebt"); $calcmode = $langs->trans("CalcModeDebt");
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')'; $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('{link1}', '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', $calcmode);
$calcmode = str_replace('{link2}', '</a>', $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); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }

View File

@ -197,10 +197,10 @@ $socid = GETPOST('socid', 'int');
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $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); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }

View File

@ -168,10 +168,10 @@ foreach ($allparams as $key => $value) {
if ($user->socid > 0) { if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
if (!empty($conf->comptabilite->enabled)) { if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat'); $result = restrictedArea($user, 'compta', '', '', 'resultat');
} }
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); $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); 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); print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
} }

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.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.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'; include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
} }
@ -719,7 +719,7 @@ if ($id > 0) {
$bankaccountstatic->number = $objp->banumber; $bankaccountstatic->number = $objp->banumber;
$bankaccountstatic->currency_code = $objp->bacurrency_code; $bankaccountstatic->currency_code = $objp->bacurrency_code;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$bankaccountstatic->account_number = $objp->account_number; $bankaccountstatic->account_number = $objp->account_number;
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);

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/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.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.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.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); $form = new Form($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
} }

View File

@ -118,7 +118,7 @@ if ($year) {
$param .= '&year='.$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 '<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 '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';

View File

@ -1918,10 +1918,11 @@ class Form
* @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
* @param int $outputmode 0=HTML select string, 1=Array * @param int $outputmode 0=HTML select string, 1=Array
* @param bool $multiple add [] in the name of element and add 'multiple' attribut * @param bool $multiple add [] in the name of element and add 'multiple' attribut
* @param int $forcecombo Force the component to be a simple combo box without ajax
* @return string HTML select string * @return string HTML select string
* @see select_dolgroups() * @see select_dolgroups()
*/ */
public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false) public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false, $forcecombo = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf, $user, $langs, $hookmanager; global $conf, $user, $langs, $hookmanager;
@ -2124,7 +2125,7 @@ class Form
} }
$out .= '</select>'; $out .= '</select>';
if ($num) { if ($num && !$forcecombo) {
// Enhance with select2 // Enhance with select2
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox($htmlname); $out .= ajax_combobox($htmlname);

View File

@ -7064,7 +7064,7 @@ function dol_html_entity_decode($a, $b, $c = 'UTF-8', $keepsomeentities = 0)
if ($keepsomeentities) { if ($keepsomeentities) {
$newstring = strtr($newstring, array('&amp;'=>'__andamp__', '&lt;'=>'__andlt__', '&gt;'=>'__andgt__', '"'=>'__dquot__')); $newstring = strtr($newstring, array('&amp;'=>'__andamp__', '&lt;'=>'__andlt__', '&gt;'=>'__andgt__', '"'=>'__dquot__'));
} }
$newstring = html_entity_decode($newstring, $b, $c); $newstring = html_entity_decode((string) $newstring, (int) $b, (string) $c);
if ($keepsomeentities) { if ($keepsomeentities) {
$newstring = strtr($newstring, array('__andamp__'=>'&amp;', '__andlt__'=>'&lt;', '__andgt__'=>'&gt;', '__dquot__'=>'"')); $newstring = strtr($newstring, array('__andamp__'=>'&amp;', '__andlt__'=>'&lt;', '__andgt__'=>'&gt;', '__dquot__'=>'"'));
} }
@ -7671,6 +7671,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__ONLINE_PAYMENT_URL__'] = $paymenturl; $substitutionarray['__ONLINE_PAYMENT_URL__'] = $paymenturl;
if (is_object($object) && $object->element == 'propal') { if (is_object($object) && $object->element == 'propal') {
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref); $substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref);
} }
if (!empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'propal') { if (!empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'propal') {

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -53,7 +54,7 @@ function takepos_admin_prepare_head()
$head[$h][2] = 'bar'; $head[$h][2] = 'bar';
$h++; $h++;
$numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS); $numterminals = max(1, getDolGlobalInt('TAKEPOS_NUM_TERMINALS', 1));
for ($i = 1; $i <= $numterminals; $i++) { for ($i = 1; $i <= $numterminals; $i++) {
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i; $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
$head[$h][1] = getDolGlobalString('TAKEPOS_TERMINAL_NAME_'.$i, $langs->trans("TerminalName", $i)); $head[$h][1] = getDolGlobalString('TAKEPOS_TERMINAL_NAME_'.$i, $langs->trans("TerminalName", $i));

View File

@ -58,11 +58,11 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
*/ */
public function info() public function info()
{ {
global $conf, $langs; global $db, $langs;
$langs->load('cashdesk@cashdesk'); $langs->load('cashdesk@cashdesk');
$form = new Form($this->db); $form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n"; $texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; $texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@ -80,9 +80,9 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
// Setting up the prefix // Setting up the prefix
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>'; $texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte .= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskvalue" value="'.$conf->global->TAKEPOS_REF_UNIVERSAL_MASK.'">', $tooltip, 1, 1).'</td>'; $texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskvalue" value="'.getDolGlobalString('TAKEPOS_REF_UNIVERSAL_MASK').'">', $tooltip, 1, 1).'</td>';
$texte .= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>'; $texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
$texte .= '</tr>'; $texte .= '</tr>';
@ -122,12 +122,12 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
*/ */
public function getNextValue($objsoc = null, $invoice = null, $mode = 'next') public function getNextValue($objsoc = null, $invoice = null, $mode = 'next')
{ {
global $db, $conf; global $db;
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// We define search criteria counter // We define search criteria counter
$mask = $conf->global->TAKEPOS_REF_UNIVERSAL_MASK; $mask = getDolGlobalString('TAKEPOS_REF_UNIVERSAL_MASK');
if (!$mask) { if (!$mask) {
$this->error = 'NotConfigured'; $this->error = 'NotConfigured';
@ -137,9 +137,10 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
// Get entities // Get entities
$entity = getEntity('invoicenumber', 1, $invoice); $entity = getEntity('invoicenumber', 1, $invoice);
$date = (empty($invoice->date) ? dol_now() : $invoice->date);
$pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0; $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0;
$mask = str_replace('{TN}', $pos_source, $mask); $mask = str_replace('{TN}', $pos_source, $mask);
$numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $invoice->date, $mode, false, null, $entity); $numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $date, $mode, false, null, $entity);
return $numFinal; return $numFinal;
} }

View File

@ -974,6 +974,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->trackid = 'tas'.$object->id; $object->trackid = 'tas'.$object->id;
} elseif (preg_match('/^TICKET_/', $action)) { } elseif (preg_match('/^TICKET_/', $action)) {
$object->trackid = 'tic'.$object->id; $object->trackid = 'tic'.$object->id;
} elseif (preg_match('/^USER_/', $action)) {
$object->trackid = 'use'.$object->id;
} else { } else {
$object->trackid = ''; $object->trackid = '';
} }

View File

@ -79,12 +79,12 @@ class Holiday extends CommonObject
public $statut = ''; // 1=draft, 2=validated, 3=approved public $statut = ''; // 1=draft, 2=validated, 3=approved
/** /**
* @var int ID of user that must approve. TODO: there is no date for validation (date_valid is used for approval), add one. * @var int ID of user that must approve. Real user for approval is fk_user_valid (old version) or fk_user_approve (new versions)
*/ */
public $fk_validator; public $fk_validator;
/** /**
* @var int Date of approval. TODO: Add a field for approval date and use date_valid instead for validation. * @var int Date of validation or approval. TODO: Use date_valid instead for validation.
*/ */
public $date_valid = ''; public $date_valid = '';

View File

@ -521,7 +521,7 @@ if ($id > 0 || $ref) {
print '</tr>'; print '</tr>';
// Availability // Availability
if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) { if (getDolGlobalInt('FOURN_PRODUCT_AVAILABILITY')) {
$langs->load("propal"); $langs->load("propal");
print '<tr><td>'.$langs->trans("Availability").'</td><td>'; print '<tr><td>'.$langs->trans("Availability").'</td><td>';
$form->selectAvailabilityDelay($object->fk_availability, "oselDispo", 1); $form->selectAvailabilityDelay($object->fk_availability, "oselDispo", 1);
@ -907,15 +907,15 @@ END;
$arrayfields = array( $arrayfields = array(
'pfp.datec'=>array('label'=>$langs->trans("AppliedPricesFrom"), 'checked'=>1, 'position'=>1), 'pfp.datec'=>array('label'=>$langs->trans("AppliedPricesFrom"), 'checked'=>1, 'position'=>1),
's.nom'=>array('label'=>$langs->trans("Suppliers"), 'checked'=>1, 'position'=>2), 's.nom'=>array('label'=>$langs->trans("Suppliers"), 'checked'=>1, 'position'=>2),
'pfp.fk_availability'=>array('label'=>$langs->trans("Availability"), 'enabled' => !empty($conf->global->FOURN_PRODUCT_AVAILABILITY), 'checked'=>0, 'position'=>4), 'pfp.fk_availability'=>array('label'=>$langs->trans("Availability"), 'enabled' => getDolGlobalInt('FOURN_PRODUCT_AVAILABILITY'), 'checked'=>0, 'position'=>4),
'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5), 'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5),
'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9), 'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9),
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => (!empty($conf->multicurrency->enabled)), 'checked'=>0, 'position'=>10), 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => isModEnabled('multicurrency'), 'checked'=>0, 'position'=>10),
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13), 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13),
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14), 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14),
'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15), 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15),
'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>16), 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>16),
'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => !empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING), 'checked'=>0, 'position'=>17), 'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked'=>0, 'position'=>17),
'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => isModEnabled('barcode'), 'checked'=>1, 'position'=>18), 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => isModEnabled('barcode'), 'checked'=>1, 'position'=>18),
); );

View File

@ -1454,7 +1454,7 @@ if ($action == 'create') {
// Date creation // Date creation
print '<tr><td class="titlefield">'.$langs->trans("DateCreation").'</td>'; print '<tr><td class="titlefield">'.$langs->trans("DateCreation").'</td>';
print '<td colspan="3">'.dol_print_date($object->date_creation, "dayhour")."</td>\n"; print '<td colspan="3">'.dol_print_date($object->date_creation, "dayhour", "tzuserrel")."</td>\n";
print '</tr>'; print '</tr>';
// Delivery date planned // Delivery date planned

View File

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

View File

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

View File

@ -27,7 +27,7 @@ require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.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'; 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')); llxHeader('', $langs->trans('SalariesSetup'));
$form = new Form($db); $form = new Form($db);
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
} }
@ -119,7 +119,7 @@ foreach ($list as $key) {
// Value // Value
print '<td>'; print '<td>';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
} else { } else {
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">'; 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.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.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.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
} }
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips")); $langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips"));
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
} }
@ -441,7 +441,7 @@ if ($action == "update_extras" && !empty($user->rights->salaries->read)) {
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($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'); $title = $langs->trans('Salary')." - ".$langs->trans('Card');
$help_url = ""; $help_url = "";
@ -559,7 +559,7 @@ if ($action == 'create') {
print '</tr>'; print '</tr>';
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
print '<tr><td>'.$langs->trans("Project").'</td><td>'; print '<tr><td>'.$langs->trans("Project").'</td><td>';
@ -794,7 +794,7 @@ if ($id) {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->salaries->write) { if ($user->rights->salaries->write) {
if ($action != 'classify') { if ($action != 'classify') {
@ -979,7 +979,7 @@ if ($id) {
$bankaccountstatic->number = $objp->banumber; $bankaccountstatic->number = $objp->banumber;
$bankaccountstatic->currency_code = $objp->bacurrency_code; $bankaccountstatic->currency_code = $objp->bacurrency_code;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$bankaccountstatic->account_number = $objp->account_number; $bankaccountstatic->account_number = $objp->account_number;
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);
@ -992,7 +992,7 @@ if ($id) {
print $bankaccountstatic->getNomUrl(1, 'transactions'); print $bankaccountstatic->getNomUrl(1, 'transactions');
print '</td>'; print '</td>';
} }
print '<td class="right">'.price($objp->amount)."</td>\n"; print '<td class="right nowrap amountcard">'.price($objp->amount)."</td>\n";
print "</tr>"; print "</tr>";
$totalpaid += $objp->amount; $totalpaid += $objp->amount;
$i++; $i++;
@ -1003,14 +1003,14 @@ if ($id) {
print '</tr>'; print '</tr>';
} }
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AlreadyPaid")." :</td><td class=\"right\">".price($totalpaid)."</td></tr>\n"; print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AlreadyPaid")." :</td><td class=\"right nowrap amountcard\">".price($totalpaid)."</td></tr>\n";
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AmountExpected")." :</td><td class=\"right\">".price($object->amount)."</td></tr>\n"; print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AmountExpected")." :</td><td class=\"right nowrap amountcard\">".price($object->amount)."</td></tr>\n";
$resteapayer = $object->amount - $totalpaid; $resteapayer = $object->amount - $totalpaid;
$cssforamountpaymentcomplete = 'amountpaymentcomplete'; $cssforamountpaymentcomplete = 'amountpaymentcomplete';
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("RemainderToPay")." :</td>"; print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("RemainderToPay")." :</td>";
print '<td class="right'.($resteapayer ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($resteapayer)."</td></tr>\n"; print '<td class="right nowrap'.($resteapayer ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($resteapayer)."</td></tr>\n";
print "</table>"; print "</table>";
print '</div>'; print '</div>';

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/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.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.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.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); $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'); $title = $langs->trans('Salary')." - ".$langs->trans('Documents');
$help_url = ""; $help_url = "";
@ -176,7 +176,7 @@ if ($object->id) {
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); $morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->salaries->write) { if ($user->rights->salaries->write) {
if ($action != 'classify') { 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.'/salaries/class/salary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.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.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.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 * View
*/ */
if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); if (isModEnabled('project')) $formproject = new FormProjets($db);
$title = $langs->trans('Salary')." - ".$langs->trans('Info'); $title = $langs->trans('Salary')." - ".$langs->trans('Info');
$help_url = ""; $help_url = "";
@ -139,7 +139,7 @@ if ($action != 'editlabel') {
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); $morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->salaries->write) { if ($user->rights->salaries->write) {
if ($action != 'classify') { if ($action != 'classify') {

View File

@ -27,7 +27,7 @@
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.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'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
} }
@ -591,7 +591,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
$accountstatic->account_number = $obj->account_number; $accountstatic->account_number = $obj->account_number;
$accountstatic->clos = $obj->clos; $accountstatic->clos = $obj->clos;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$accountstatic->account_number = $obj->account_number; $accountstatic->account_number = $obj->account_number;
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);

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.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.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/modules/facture/modules_facture.php';
if (isModEnabled("banque")) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('bills', 'banks', 'companies', 'salaries')); $langs->loadLangs(array('bills', 'banks', 'companies', 'salaries'));

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/salary.class.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.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'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
} }
@ -625,7 +625,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
$accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code); $accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code);
$accountstatic->clos = $obj->clos; $accountstatic->clos = $obj->clos;
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$accountstatic->account_number = $obj->account_number; $accountstatic->account_number = $obj->account_number;
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);

View File

@ -156,7 +156,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
$dataseries[] = array($langs->trans("Customers"), round($third['customer'])); $dataseries[] = array($langs->trans("Customers"), round($third['customer']));
} }
if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { if (((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
$dataseries[] = array($langs->trans("Suppliers"), round($third['supplier'])); $dataseries[] = array($langs->trans("Suppliers"), round($third['supplier']));
} }
if (isModEnabled('societe')) { if (isModEnabled('societe')) {

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -67,7 +68,7 @@ if (GETPOST('action', 'alpha') == 'set') {
} }
} }
if ($conf->global->TAKEPOS_ORDER_NOTES == 1) { if (getDolGlobalInt('TAKEPOS_ORDER_NOTES') == 1) {
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$extrafields->addExtraField('order_notes', 'Order notes', 'varchar', 0, 255, 'facturedet', 0, 0, '', '', 0, '', 0, 1); $extrafields->addExtraField('order_notes', 'Order notes', 'varchar', 0, 255, 'facturedet', 0, 0, '', '', 0, '', 0, 1);
} }
@ -79,6 +80,7 @@ if ($conf->global->TAKEPOS_ORDER_NOTES == 1) {
$form = new Form($db); $form = new Form($db);
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
$arrayofjs = array();
$arrayofcss = array("/takepos/css/colorbox.css"); $arrayofcss = array("/takepos/css/colorbox.css");
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, $arrayofjs, $arrayofcss); llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, $arrayofjs, $arrayofcss);
@ -112,7 +114,7 @@ print '</center>';
print '<br>'; print '<br>';
if ($conf->global->TAKEPOS_BAR_RESTAURANT) { if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
print '<br>'; print '<br>';
print '<a href="" onclick="Floors(); return false;"><span class="fa fa-glass-cheers"></span> '.$langs->trans("DefineTablePlan").'</a><br>'; print '<a href="" onclick="Floors(); return false;"><span class="fa fa-glass-cheers"></span> '.$langs->trans("DefineTablePlan").'</a><br>';
print '<br><br>'; print '<br><br>';
@ -171,12 +173,12 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0); print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>'; print '</td></tr>';
if ($conf->global->TAKEPOS_SUPPLEMENTS) { if (getDolGlobalInt('TAKEPOS_SUPPLEMENTS')) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("SupplementCategory"); print $langs->trans("SupplementCategory");
print '</td>'; print '</td>';
print '<td class="center">'; print '<td class="center">';
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0); print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY'), 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY'); print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
print "</td></tr>\n"; print "</td></tr>\n";
} }
@ -203,8 +205,8 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
print $form->buttonsSaveCancel("Save", ''); print $form->buttonsSaveCancel("Save", '');
} }
if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) { if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
if ($conf->global->TAKEPOS_QR_MENU) { if (getDolGlobalInt('TAKEPOS_QR_MENU')) {
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
print '<br>'; print '<br>';
@ -221,7 +223,7 @@ if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) {
print '</table>'; print '</table>';
} }
if ($conf->global->TAKEPOS_AUTO_ORDER) { if (getDolGlobalInt('TAKEPOS_AUTO_ORDER')) {
print '<br>'; print '<br>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';

View File

@ -17,7 +17,7 @@
*/ */
/** /**
* \file htdocs/takepos/admin/setup.php * \file htdocs/takepos/admin/other.php
* \ingroup takepos * \ingroup takepos
* \brief Setup page for TakePos module * \brief Setup page for TakePos module
*/ */

View File

@ -1,8 +1,9 @@
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Andreu Bisquerra Gaya <jove@bisquerra.com> * Copyright (C) 2019 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -19,7 +20,7 @@
*/ */
/** /**
* \file htdocs/takepos/admin/terminal.php * \file htdocs/takepos/admin/receipt.php
* \ingroup takepos * \ingroup takepos
* \brief Setup page for TakePos module * \brief Setup page for TakePos module
*/ */
@ -47,10 +48,7 @@ if (GETPOST('action', 'alpha') == 'set') {
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_PAYMENT_METHOD", GETPOST('TAKEPOS_PRINT_PAYMENT_METHOD', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, 'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', GETPOST('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', 'alphanohtml'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', GETPOST('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
@ -69,7 +67,7 @@ if (GETPOST('action', 'alpha') == 'set') {
} elseif (GETPOST('action', 'alpha') == 'setmethod') { } elseif (GETPOST('action', 'alpha') == 'setmethod') {
dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity);
// TakePOS connector require ReceiptPrinter module // TakePOS connector require ReceiptPrinter module
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && !$conf->receiptprinter->enabled) { if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && !isModEnabled('receiptprinter')) {
activateModule("modReceiptPrinter"); activateModule("modReceiptPrinter");
} }
} }
@ -119,15 +117,15 @@ print '<tr class="oddeven"><td>';
print $langs->trans('DolibarrReceiptPrinter'); print $langs->trans('DolibarrReceiptPrinter');
print '<td>'; print '<td>';
print $langs->trans('ReceiptPrinterMethodDescription'); print $langs->trans('ReceiptPrinterMethodDescription');
if ($conf->receiptprinter->enabled) { if (isModEnabled('receiptprinter')) {
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
print '<br>'; print '<br>';
print img_picto('', 'printer', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/admin/receiptprinter.php">'.$langs->trans("Setup").'</a>'; print img_picto('', 'printer', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/admin/receiptprinter.php">'.$langs->trans("Setup").'</a>';
} }
} }
print '</td><td class="right">'; print '</td><td class="right">';
if ($conf->receiptprinter->enabled) { if (isModEnabled('receiptprinter')) {
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} else { } else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmethod&token='.newToken().'&value=receiptprinter">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmethod&token='.newToken().'&value=receiptprinter">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
@ -148,7 +146,7 @@ print $langs->trans('TakeposConnectorMethodDescription');
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
print '<br>'; print '<br>';
print $langs->trans("URL")." / ".$langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector" target="_blank" rel="noopener noreferrer external">'.$langs->trans("TakeposConnectorNecesary").'</a>)'; print $langs->trans("URL")." / ".$langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector" target="_blank" rel="noopener noreferrer external">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print ' <input type="text" class="minwidth200" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">'; print ' <input type="text" class="minwidth200" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.getDolGlobalString('TAKEPOS_PRINT_SERVER').'">';
} }
print '</td><td class="right">'; print '</td><td class="right">';
@ -221,14 +219,14 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans('PrintCustomerOnReceipts'); print $langs->trans('PrintCustomerOnReceipts');
print '<td colspan="2">'; print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_SHOW_CUSTOMER", $conf->global->TAKEPOS_SHOW_CUSTOMER, 1); print ajax_constantonoff("TAKEPOS_SHOW_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n"; print "</td></tr>\n";
// Print payment method // Print payment method
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans('PrintPaymentMethodOnReceipts'); print $langs->trans('PrintPaymentMethodOnReceipts');
print '<td colspan="2">'; print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_PRINT_PAYMENT_METHOD", $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD, 1); print ajax_constantonoff("TAKEPOS_PRINT_PAYMENT_METHOD", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n"; print "</td></tr>\n";
} }
@ -236,7 +234,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("AutoPrintTickets"); print $langs->trans("AutoPrintTickets");
print '<td colspan="2">'; print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AUTO_PRINT_TICKETS, 1); print ajax_constantonoff("TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n"; print "</td></tr>\n";
@ -247,7 +245,7 @@ print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0); print ajax_constantonoff("TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n"; print "</td></tr>\n";
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans('WeighingScale'); print $langs->trans('WeighingScale');
print '<td colspan="2">'; print '<td colspan="2">';
@ -255,7 +253,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($con
print "</td></tr>\n"; print "</td></tr>\n";
} }
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans('CustomerDisplay'); print $langs->trans('CustomerDisplay');
print '<td colspan="2">'; print '<td colspan="2">';

View File

@ -1,7 +1,8 @@
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -78,7 +79,7 @@ if ($action == 'set') {
$res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_ADDON", GETPOST('TAKEPOS_ADDON', 'alpha'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ADDON", GETPOST('TAKEPOS_ADDON', 'alpha'), 'int', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
$res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity);
} }
@ -142,13 +143,13 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
print load_fiche_titre($langs->trans('CashDeskRefNumberingModules'), '', ''); print load_fiche_titre($langs->trans('CashDeskRefNumberingModules'), '', '');
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name")."</td>\n"; print '<td>'.$langs->trans("Name")."</td>\n";
print '<td>'.$langs->trans("Description")."</td>\n"; print '<td>'.$langs->trans("Description")."</td>\n";
print '<td class="nowrap">'.$langs->trans("Example")."</td>\n"; print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'; print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>'; print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
clearstatcache(); clearstatcache();
@ -195,8 +196,8 @@ foreach ($dirmodels as $reldir) {
} }
print '</td>'."\n"; print '</td>'."\n";
print '<td align="center">'; print '<td class="center">';
if ($conf->global->TAKEPOS_REF_ADDON == "$file") { if (getDolGlobalString('TAKEPOS_REF_ADDON') == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} else { } else {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setrefmod&token='.newToken().'&value='.urlencode($file).'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setrefmod&token='.newToken().'&value='.urlencode($file).'">';
@ -276,7 +277,7 @@ if (isModEnabled("service")) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc")); print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
print '<td colspan="2">'; print '<td colspan="2">';
print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0); print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID'); print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID');
print "</td></tr>\n"; print "</td></tr>\n";
@ -458,7 +459,7 @@ print '</div>';
// Sumup options // Sumup options
if ($conf->global->TAKEPOS_ENABLE_SUMUP) { if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
print '<br>'; print '<br>';
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';

View File

@ -1,7 +1,8 @@
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Thibault FOUCART <support@ptibogxiv.net> * Copyright (C) 2021 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -80,7 +81,7 @@ if (GETPOST('action', 'alpha') == 'set') {
if (!empty($conf->stripe->enabled) && !empty($conf->global->STRIPE_CARD_PRESENT)) { if (!empty($conf->stripe->enabled) && !empty($conf->global->STRIPE_CARD_PRESENT)) {
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL".$terminaltouse, GETPOST('CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL".$terminaltouse, GETPOST('CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
} }
if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
} }
foreach ($paiements as $modep) { foreach ($paiements as $modep) {
@ -157,7 +158,7 @@ print '</td></tr>';
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("CashDeskThirdPartyForSell").'</td>'; print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
print '<td>'; print '<td>';
print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0); print $form->select_company(getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$terminaltouse), 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0);
print '</td></tr>'; print '</td></tr>';
$atleastonefound = 0; $atleastonefound = 0;
@ -165,24 +166,24 @@ if (isModEnabled("banque")) {
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
print '<td>'; print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1); $form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1);
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse})) { if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse)) {
$atleastonefound++; $atleastonefound++;
} }
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
print '<td>'; print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1); $form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1);
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse})) { if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse)) {
$atleastonefound++; $atleastonefound++;
} }
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
print '<td>'; print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1); $form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1);
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse})) { if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse)) {
$atleastonefound++; $atleastonefound++;
} }
print '</td></tr>'; print '</td></tr>';
@ -224,12 +225,12 @@ if (isModEnabled("banque")) {
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->global->TAKEPOS_ENABLE_SUMUP) { if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSumup").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSumup").'</td>';
print '<td>'; print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0, "courant=1", 1); $form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0, "courant=1", 1);
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse})) { if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse)) {
$atleastonefound++; $atleastonefound++;
} }
print '</td></tr>'; print '</td></tr>';
@ -247,18 +248,18 @@ if (isModEnabled("banque")) {
} }
$cour = preg_match('/^LIQ.*/', $modep->code) ? 2 : 1; $cour = preg_match('/^LIQ.*/', $modep->code) ? 2 : 1;
print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1); $form->select_comptes(getDolGlobalInt($name), $name, 0, "courant=".$cour, 1);
print '</td></tr>'; print '</td></tr>';
} }
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value) print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
print '<td>'; print '<td>';
if (empty($conf->productbatch->enabled) || !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) { if (!isModEnabled('productbatch') || getDolGlobalInt('CASHDESK_FORCE_DECREASE_STOCK')) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1); print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal), 1);
} else { } else {
if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) { if (getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal)) {
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity);
} }
print $langs->trans("Yes").'<br>'; print $langs->trans("Yes").'<br>';
@ -280,7 +281,7 @@ if (!empty($conf->stock->enabled)) {
} }
print '</td></tr>'; print '</td></tr>';
if (!empty($conf->productbatch->enabled) && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK) && !$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) { if (isModEnabled('productbatch') && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK) && !$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) {
print '<tr class="oddeven"><td>'.$langs->trans('CashDeskForceDecreaseStockLabel').'</td>'; print '<tr class="oddeven"><td>'.$langs->trans('CashDeskForceDecreaseStockLabel').'</td>';
print '<td>'; print '<td>';
print '<span class="opacitymedium">'.$langs->trans('CashDeskForceDecreaseStockDesc').'</span>'; print '<span class="opacitymedium">'.$langs->trans('CashDeskForceDecreaseStockDesc').'</span>';
@ -288,11 +289,11 @@ if (!empty($conf->stock->enabled)) {
} }
} }
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
// Select printer to use with terminal // Select printer to use with terminal
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
$printer = new dolReceiptPrinter($db); $printer = new dolReceiptPrinter($db);
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
$printer->listprinters(); $printer->listprinters();
$printers = array(); $printers = array();
foreach ($printer->listprinters as $key => $value) { foreach ($printer->listprinters as $key => $value) {
@ -300,20 +301,20 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TA
} }
print '<tr class="oddeven"><td>'.$langs->trans("MainPrinterToUse").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("MainPrinterToUse").'</td>';
print '<td>'; print '<td>';
print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1); print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$terminal), 1);
print '</td></tr>'; print '</td></tr>';
if ($conf->global->TAKEPOS_ORDER_PRINTERS) { if (getDolGlobalInt('TAKEPOS_ORDER_PRINTERS')) {
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 1</td>'; print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 1</td>';
print '<td>'; print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}), 1); print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal), 1);
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 2</td>'; print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 2</td>';
print '<td>'; print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}), 1); print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal), 1);
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 3</td>'; print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 3</td>';
print '<td>'; print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}), 1); print $form->selectarray('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal), 1);
print '</td></tr>'; print '</td></tr>';
} }
} }
@ -324,23 +325,23 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TA
} }
print '<tr class="oddeven"><td>'.$langs->trans("MainTemplateToUse").' (<a href="'.DOL_URL_ROOT.'/admin/receiptprinter.php?mode=template">'.$langs->trans("SetupReceiptTemplate").'</a>)</td>'; print '<tr class="oddeven"><td>'.$langs->trans("MainTemplateToUse").' (<a href="'.DOL_URL_ROOT.'/admin/receiptprinter.php?mode=template">'.$langs->trans("SetupReceiptTemplate").'</a>)</td>';
print '<td>'; print '<td>';
print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal, $templates, (empty($conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal}), 1); print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal, $templates, getDolGlobalInt('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal), 1);
print '</td></tr>'; print '</td></tr>';
if ($conf->global->TAKEPOS_ORDER_PRINTERS) { if (getDolGlobalInt('TAKEPOS_ORDER_PRINTERS')) {
print '<tr class="oddeven"><td>'.$langs->trans("OrderTemplateToUse").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("OrderTemplateToUse").'</td>';
print '<td>'; print '<td>';
print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal, $templates, (empty($conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal}), 1); print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal, $templates, getDolGlobalInt('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal), 1);
print '</td></tr>'; print '</td></tr>';
} }
} }
print '<tr class="oddeven"><td>'.$langs->trans('CashDeskReaderKeyCodeForEnter').'</td>'; print '<tr class="oddeven"><td>'.$langs->trans('CashDeskReaderKeyCodeForEnter').'</td>';
print '<td>'; print '<td>';
print '<input type="text" name="CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse.'" value="'.$conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse}.'" />'; print '<input type="text" name="CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse.'" value="'.getDolGlobalString('CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse).'" />';
print '</td></tr>'; print '</td></tr>';
// Numbering module // Numbering module
if ($conf->global->TAKEPOS_ADDON == "terminal") { if (getDolGlobalString('TAKEPOS_ADDON') == "terminal") {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("BillsNumberingModule"); print $langs->trans("BillsNumberingModule");
print '<td colspan="2">'; print '<td colspan="2">';
@ -425,11 +426,11 @@ print $form->textwithpicto($langs->trans('Header'), $htmltext, 1, 'help', '', 0,
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$variablename = 'TAKEPOS_HEADER'.$terminaltouse; $variablename = 'TAKEPOS_HEADER'.$terminaltouse;
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { if (!getDolGlobalInt('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->{$variablename}.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->{$variablename}.'</textarea>';
} else { } else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();
} }
print '</td></tr>'; print '</td></tr>';
@ -441,11 +442,11 @@ print $form->textwithpicto($langs->trans('Footer'), $htmltext, 1, 'help', '', 0,
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$variablename = 'TAKEPOS_FOOTER'.$terminaltouse; $variablename = 'TAKEPOS_FOOTER'.$terminaltouse;
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { if (!getDolGlobalInt('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->{$variablename}.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->{$variablename}.'</textarea>';
} else { } else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -58,7 +58,7 @@ $setterminal = GETPOST('setterminal', 'int');
$setcurrency = GETPOST('setcurrency', 'aZ09'); $setcurrency = GETPOST('setcurrency', 'aZ09');
if (empty($_SESSION["takeposterminal"])) { if (empty($_SESSION["takeposterminal"])) {
if ($conf->global->TAKEPOS_NUM_TERMINALS == "1") { if (getDolGlobalInt('TAKEPOS_NUM_TERMINALS') == 1) {
$_SESSION["takeposterminal"] = 1; // Use terminal 1 if there is only 1 terminal $_SESSION["takeposterminal"] = 1; // Use terminal 1 if there is only 1 terminal
} elseif (!empty($_COOKIE["takeposterminal"])) { } elseif (!empty($_COOKIE["takeposterminal"])) {
$_SESSION["takeposterminal"] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE["takeposterminal"]); // Restore takeposterminal from previous session $_SESSION["takeposterminal"] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE["takeposterminal"]); // Restore takeposterminal from previous session
@ -964,7 +964,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
?> ?>
</a> </a>
<?php <?php
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
print '<a class="valignmiddle tdoverflowmax100" id="multicurrency" onclick="ModalBox(\'ModalCurrency\');" title=""><span class="fas fa-coins paddingrightonly"></span>'; print '<a class="valignmiddle tdoverflowmax100" id="multicurrency" onclick="ModalBox(\'ModalCurrency\');" title=""><span class="fas fa-coins paddingrightonly"></span>';
print '<span class="hideonsmartphone">'.$langs->trans("Currency").'</span>'; print '<span class="hideonsmartphone">'.$langs->trans("Currency").'</span>';
print '</a>'; print '</a>';
@ -978,7 +978,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
<!-- More info about customer --> <!-- More info about customer -->
<div class="inline-block valignmiddle tdoverflowmax150onsmartphone" id="moreinfo"></div> <div class="inline-block valignmiddle tdoverflowmax150onsmartphone" id="moreinfo"></div>
<?php <?php
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
?> ?>
<!-- More info about warehouse --> <!-- More info about warehouse -->
<div class="inline-block valignmiddle tdoverflowmax150onsmartphone" id="infowarehouse"></div> <div class="inline-block valignmiddle tdoverflowmax150onsmartphone" id="infowarehouse"></div>
@ -1028,7 +1028,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
</div> </div>
<!-- Modal multicurrency box --> <!-- Modal multicurrency box -->
<?php if (!empty($conf->multicurrency->enabled)) { ?> <?php if (isModEnabled('multicurrency')) { ?>
<div id="ModalCurrency" class="modal"> <div id="ModalCurrency" class="modal">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">

View File

@ -151,7 +151,7 @@ if ($invoice->socid > 0) {
} }
// Change the currency of invoice if it was modified // Change the currency of invoice if it was modified
if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"])) { if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"])) {
if ($invoice->multicurrency_code != $_SESSION["takeposcustomercurrency"]) { if ($invoice->multicurrency_code != $_SESSION["takeposcustomercurrency"]) {
$invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]); $invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]);
} }
@ -241,14 +241,14 @@ if (empty($reshook)) {
$error++; $error++;
dol_syslog('Sale without lines'); dol_syslog('Sale without lines');
dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1); dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1);
} elseif (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") { } elseif (isModEnabled('stock') && $conf->global->$constantforkey != "1") {
$savconst = $conf->global->STOCK_CALCULATE_ON_BILL; $savconst = $conf->global->STOCK_CALCULATE_ON_BILL;
$conf->global->STOCK_CALCULATE_ON_BILL = 1; $conf->global->STOCK_CALCULATE_ON_BILL = 1;
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".$conf->global->$constantforkey); dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".$conf->global->$constantforkey);
$batch_rule = 0; $batch_rule = 0;
if (!empty($conf->productbatch->enabled) && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) { if (isModEnabled('productbatch') && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
$batch_rule = Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST; $batch_rule = Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST;
} }
@ -437,13 +437,13 @@ if (empty($reshook)) {
$creditnote->update_price(1); $creditnote->update_price(1);
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
if (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") { if (isModEnabled('stock') && $conf->global->$constantforkey != "1") {
$savconst = $conf->global->STOCK_CALCULATE_ON_BILL; $savconst = $conf->global->STOCK_CALCULATE_ON_BILL;
$conf->global->STOCK_CALCULATE_ON_BILL = 1; $conf->global->STOCK_CALCULATE_ON_BILL = 1;
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".$conf->global->$constantforkey); dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".$conf->global->$constantforkey);
$batch_rule = 0; $batch_rule = 0;
if (!empty($conf->productbatch->enabled) && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) { if (isModEnabled('productbatch') && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
$batch_rule = Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST; $batch_rule = Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST;
} }
@ -1195,7 +1195,7 @@ $( document ).ready(function() {
$idwarehouse = 0; $idwarehouse = 0;
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
if (getDolGlobalString("$constantforkey") != "1") { if (getDolGlobalString("$constantforkey") != "1") {
$constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); $constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
$idwarehouse = getDolGlobalString($constantforkey); $idwarehouse = getDolGlobalString($constantforkey);
@ -1231,7 +1231,7 @@ $( document ).ready(function() {
// Module Adherent // Module Adherent
$s = ''; $s = '';
if (!empty($conf->adherent->enabled) && $invoice->socid > 0 && $invoice->socid != $conf->global->$constforcompanyid) { if (isModEnabled('adherent') && $invoice->socid > 0 && $invoice->socid != $conf->global->$constforcompanyid) {
$s = '<span class="small">'; $s = '<span class="small">';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$langs->load("members"); $langs->load("members");
@ -1352,7 +1352,7 @@ if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
// In phone version only show when it is invoice page // In phone version only show when it is invoice page
if (empty($mobilepage) || $mobilepage == "invoice") { if (empty($mobilepage) || $mobilepage == "invoice") {
print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '</span>'; print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '</span>';
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db); $multicurrency = new MultiCurrency($db);
@ -1368,7 +1368,7 @@ if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
// In phone version only show when it is invoice page // In phone version only show when it is invoice page
if (empty($mobilepage) || $mobilepage == "invoice") { if (empty($mobilepage) || $mobilepage == "invoice") {
print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</span>'; print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</span>';
if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db); $multicurrency = new MultiCurrency($db);
@ -1600,7 +1600,7 @@ if ($placeid > 0) {
$htmlforlines .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>'; $htmlforlines .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>';
$htmlforlines .= '<td class="right">'; $htmlforlines .= '<td class="right">';
if (!empty($conf->stock->enabled) && !empty($user->rights->stock->mouvement->lire)) { if (isModEnabled('stock') && !empty($user->rights->stock->mouvement->lire)) {
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
if (!empty($conf->global->$constantforkey) && $line->fk_product > 0 && empty($conf->global->TAKEPOS_HIDE_STOCK_ON_LINE)) { if (!empty($conf->global->$constantforkey) && $line->fk_product > 0 && empty($conf->global->TAKEPOS_HIDE_STOCK_ON_LINE)) {
$sql = "SELECT e.rowid, e.ref, e.lieu, e.fk_parent, e.statut, ps.reel, ps.rowid as product_stock_id, p.pmp"; $sql = "SELECT e.rowid, e.ref, e.lieu, e.fk_parent, e.statut, ps.reel, ps.rowid as product_stock_id, p.pmp";
@ -1637,7 +1637,7 @@ if ($placeid > 0) {
if (getDolGlobalString('TAKEPOS_SHOW_HT')) { if (getDolGlobalString('TAKEPOS_SHOW_HT')) {
$htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">'; $htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">';
$htmlforlines .= price($line->total_ht, 1, '', 1, -1, -1, $conf->currency); $htmlforlines .= price($line->total_ht, 1, '', 1, -1, -1, $conf->currency);
if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db); $multicurrency = new MultiCurrency($db);
@ -1648,7 +1648,7 @@ if ($placeid > 0) {
} }
$htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">'; $htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">';
$htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency); $htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency);
if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db); $multicurrency = new MultiCurrency($db);

View File

@ -226,7 +226,7 @@ if ($resql) {
$arrayOfValidBankAccount[$conf->global->$accountname] = $conf->global->$accountname; $arrayOfValidBankAccount[$conf->global->$accountname] = $conf->global->$accountname;
$arrayOfValidPaymentModes[] = $obj; $arrayOfValidPaymentModes[] = $obj;
} }
if (empty($conf->banque->enabled)) { if (!isModEnabled('banque')) {
if ($paycode == 'CASH' || $paycode == 'CB') $arrayOfValidPaymentModes[] = $obj; if ($paycode == 'CASH' || $paycode == 'CB') $arrayOfValidPaymentModes[] = $obj;
} }
} }
@ -650,8 +650,8 @@ if (!empty($conf->stripe->enabled) && isset($keyforstripeterminalbank) && !empty
} }
} }
if ($conf->global->TAKEPOS_ENABLE_SUMUP) { $keyforsumupbank = "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"];
$keyforsumupbank = "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"]; if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
if (!empty($conf->global->$keyforsumupbank)) { if (!empty($conf->global->$keyforsumupbank)) {
print '<button type="button" class="calcbutton2" onclick="ValidateSumup();">Sumup</button>'; print '<button type="button" class="calcbutton2" onclick="ValidateSumup();">Sumup</button>';
} else { } else {

View File

@ -257,7 +257,7 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER) {
} ?></td> } ?></td>
</tr> </tr>
<?php <?php
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db); $multicurrency = new MultiCurrency($db);
@ -287,7 +287,7 @@ if ($conf->global->TAKEPOS_PRINT_PAYMENT_METHOD) {
echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code); echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
echo '</td>'; echo '</td>';
echo '<td class="right">'; echo '<td class="right">';
$amount_payment = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount; $amount_payment = (isModEnabled('multicurrency') && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
if ($row->code == "LIQ") { if ($row->code == "LIQ") {
$amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment $amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment
} }

View File

@ -186,7 +186,7 @@ if (isModEnabled("societe")) {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project'); $morehtmlref .= '<br>'.$langs->trans('Project');
if ($user->rights->ticket->write) { 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.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.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.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.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.'/core/lib/contract.lib.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php';
@ -710,7 +710,7 @@ if (empty($reshook)) {
$userstat = new User($db); $userstat = new User($db);
$form = new Form($db); $form = new Form($db);
$formticket = new FormTicket($db); $formticket = new FormTicket($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
} }
@ -965,7 +965,7 @@ if ($action == 'create' || $action == 'presend') {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) { if ($user->rights->ticket->write) {
@ -1119,7 +1119,7 @@ if ($action == 'create' || $action == 'presend') {
print '</tr>'; print '</tr>';
// Timing (Duration sum of linked fichinter) // Timing (Duration sum of linked fichinter)
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$object->fetchObjectLinked(); $object->fetchObjectLinked();
$num = count($object->linkedObjects); $num = count($object->linkedObjects);
$timing = 0; $timing = 0;

View File

@ -1841,7 +1841,7 @@ class Ticket extends CommonObject
$error = 0; $error = 0;
// Valid and close fichinter linked // 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"); dol_syslog("We have closed the ticket, so we close all linked interventions");
$this->fetchObjectLinked($this->id, $this->element, null, 'fichinter'); $this->fetchObjectLinked($this->id, $this->element, null, 'fichinter');
if ($this->linkedObjectsIds) { if ($this->linkedObjectsIds) {

View File

@ -224,7 +224,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) { if ($user->rights->ticket->write) {

View File

@ -159,7 +159,7 @@ if ($object->id) {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) { if ($user->rights->ticket->write) {

View File

@ -185,7 +185,7 @@ if (isModEnabled("societe")) {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project'); $morehtmlref .= '<br>'.$langs->trans('Project');
if ($user->rights->ticket->write) { if ($user->rights->ticket->write) {