mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Debug accountancy module
This commit is contained in:
@@ -38,8 +38,10 @@ $langs->load("admin");
|
||||
$langs->load("accountancy");
|
||||
|
||||
// Security check
|
||||
if (! $user->admin)
|
||||
if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
@@ -135,31 +137,14 @@ $var = true;
|
||||
/*
|
||||
* Main Options
|
||||
*/
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">' . $langs->trans('MainOptions') . '</td>';
|
||||
print '<td colspan="3">' . $langs->trans('Options') . '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td width="50%">' . $langs->trans("Selectformat") . '</td>';
|
||||
if (! $conf->use_javascript_ajax) {
|
||||
print '<td class="nowrap">';
|
||||
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
||||
print "</td>";
|
||||
} else {
|
||||
print '<td>';
|
||||
$listformat = array (
|
||||
'csv' => $langs->trans("csv"),
|
||||
'txt' => $langs->trans("txt")
|
||||
);
|
||||
print $form->selectarray("format", $listformat, $conf->global->ACCOUNTING_EXPORT_FORMAT, 0);
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
$num = count($main_option);
|
||||
if ($num) {
|
||||
foreach ( $main_option as $key ) {
|
||||
@@ -221,8 +206,29 @@ if ($num2) {
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV > 1)
|
||||
{
|
||||
print '<tr><td colspan="2" bgcolor="red"><b>' . $langs->trans('OptionsDeactivatedForThisExportModel') . '</b></td></tr>';
|
||||
}
|
||||
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td width="50%">' . $langs->trans("Selectformat") . '</td>';
|
||||
if (! $conf->use_javascript_ajax) {
|
||||
print '<td class="nowrap">';
|
||||
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
||||
print "</td>";
|
||||
} else {
|
||||
print '<td>';
|
||||
$listformat = array (
|
||||
'csv' => $langs->trans("csv"),
|
||||
'txt' => $langs->trans("txt")
|
||||
);
|
||||
print $form->selectarray("format", $listformat, $conf->global->ACCOUNTING_EXPORT_FORMAT, 0);
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
foreach ( $model_option as $key ) {
|
||||
$var = ! $var;
|
||||
|
||||
@@ -41,8 +41,10 @@ $langs->load("accountancy");
|
||||
$langs->load("salaries");
|
||||
|
||||
// Security check
|
||||
if (! $user->admin)
|
||||
if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
@@ -51,6 +53,7 @@ $list = array (
|
||||
'ACCOUNTING_LIMIT_LIST_VENTILATION',
|
||||
'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
|
||||
'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
|
||||
'ACCOUNTING_MANAGE_ZERO',
|
||||
'ACCOUNTING_LENGTH_GACCOUNT',
|
||||
'ACCOUNTING_LENGTH_AACCOUNT'
|
||||
);
|
||||
@@ -71,6 +74,7 @@ $list_account = array (
|
||||
'DONATION_ACCOUNTINGACCOUNT'
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -180,6 +184,7 @@ if ($action == 'setdisabledirectinput') {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -200,6 +205,8 @@ print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Configuration"), 0, 'cron');
|
||||
|
||||
if (! empty($user->admin))
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Cas du parametre ACCOUNTING_MODE
|
||||
@@ -227,10 +234,14 @@ print '<td colspan="2">' . nl2br($langs->trans('OptionModeVirtualDesc')) . "</td
|
||||
print "</table>\n";
|
||||
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Define Chart of accounts
|
||||
*/
|
||||
if (! empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
$var = true;
|
||||
|
||||
@@ -272,18 +283,71 @@ print "</td></tr>";
|
||||
print "</table>";
|
||||
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Others params
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>';
|
||||
print '<td colspan="2">' . $langs->trans('OtherOptions') . '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if (! empty($user->admin))
|
||||
{
|
||||
// TO DO Mutualize code for yes/no constants
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
||||
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Param a user $user->rights->accountancy->chartofaccount can access
|
||||
if (! empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
foreach ( $list as $key ) {
|
||||
$var = ! $var;
|
||||
|
||||
if ($key != 'ACCOUNTING_MANAGE_ZERO')
|
||||
{
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
// Param
|
||||
@@ -295,6 +359,23 @@ foreach ( $list as $key ) {
|
||||
print '<input type="text" size="20" id="' . $key . '" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
if ($key == 'ACCOUNTING_MANAGE_ZERO')
|
||||
{
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $list_account as $key ) {
|
||||
$var = ! $var;
|
||||
@@ -310,63 +391,7 @@ foreach ( $list_account as $key ) {
|
||||
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// TO DO Mutualize code for yes/no constants
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td width="80%">' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td width="80%">' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
||||
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
@@ -38,8 +38,10 @@ require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||
$langs->load("accountancy");
|
||||
|
||||
// Security check
|
||||
if (! $user->admin)
|
||||
if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ $langs->load("accountancy");
|
||||
if (empty($conf->accounting->enabled)) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (! $user->rights->accounting->ventilation->read)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// search & action GETPOST
|
||||
|
||||
@@ -225,7 +225,7 @@ if ($action == 'delbookkeepingyearconfirm') {
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages("NothingDeleted", null, 'warnings');
|
||||
setEventMessages("NoRecordDeleted", null, 'warnings');
|
||||
Header("Location: list.php");
|
||||
exit;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ if ($action == 'delbookkeepingyear') {
|
||||
'default' => $deljournal
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ if ($action == 'delbookkeepingyear') {
|
||||
'default' => $delyear
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ if ($user->societe_id > 0)
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
|
||||
if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
if (! GETPOST('cancel', 'alpha')) {
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||
$sql .= " SET fk_code_ventilation = " . $codeventil;
|
||||
|
||||
@@ -43,7 +43,7 @@ if (empty($conf->accounting->enabled)) {
|
||||
}
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->ventilation->read)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// Filter
|
||||
|
||||
@@ -82,7 +82,7 @@ if (! $sortorder) {
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->ventilation->dispatch)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
@@ -84,7 +84,7 @@ if (! $sortorder) {
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->ventilation->dispatch)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
@@ -75,10 +75,6 @@ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step,
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
//$textlink='<strong>'.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Modules")."-".$langs->transnoentitiesnoconv("Accountancy").'</strong>';
|
||||
$textlink='<strong>'.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("MenuBankCash").'</strong>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, $textlink);
|
||||
@@ -121,6 +117,9 @@ print '<hr>';
|
||||
print "<br>\n";
|
||||
$step = 0;
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>')."<br>\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@@ -44,7 +44,7 @@ $id = GETPOST('id');
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
|
||||
if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
if (! GETPOST('cancel', 'alpha')) {
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sql .= " SET fk_code_ventilation = " . $codeventil;
|
||||
|
||||
@@ -41,7 +41,7 @@ if (empty($conf->accounting->enabled)) {
|
||||
}
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->ventilation->read)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// Filter
|
||||
|
||||
@@ -80,7 +80,7 @@ if (! $sortorder) {
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->ventilation->dispatch)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
@@ -84,7 +84,7 @@ if (! $sortorder) {
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->ventilation->dispatch)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
@@ -1693,7 +1693,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
// Wrapping for accounting exports
|
||||
else if ($modulepart == 'export_compta')
|
||||
{
|
||||
if ($fuser->rights->accounting->ventilation->dispatch || preg_match('/^specimen/i',$original_file))
|
||||
if ($fuser->rights->accounting->bind->write || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
$accessallowed=1;
|
||||
}
|
||||
|
||||
@@ -210,15 +210,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__);
|
||||
-- Accounting Expert
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/index.php?leftmenu=accounting', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->ventilation->read || $user->rights->accounting->ventilation->dispatch || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/index.php?leftmenu=accounting', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__);
|
||||
-- Binding
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2415__+MAX_llx_menu__, 'home', '', 2400__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=home&leftmenu=admintools', 'ProductsBinding', 1, 'accountancy', '', '', 0, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'ventil_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?leftmenu=dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 6, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'ventil_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?leftmenu=dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__);
|
||||
-- Journals
|
||||
-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'journal', 2400__+MAX_llx_menu__, '/accountancy/journal/index.php?leftmenu=journal', 'Journaux', 1, 'accountancy', '$user->rights->accounting->comptarapport->lire', '', 0, 7, __ENTITY__);
|
||||
-- General Ledger
|
||||
|
||||
@@ -938,20 +938,24 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("accountancy");
|
||||
|
||||
$permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->ventilation->read || $user->rights->accounting->ventilation->dispatch || $user->rights->compta->resultat->lire);
|
||||
$permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire);
|
||||
$newmenu->add("/accountancy/index.php?leftmenu=accountancy",$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
|
||||
|
||||
// Chart of account
|
||||
$langs->load("admin");
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'chartofaccount');
|
||||
|
||||
// Binding
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy", $langs->trans("ProductsBinding"), 1, $user->admin);
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->ventilation->read, '', $mainmenu, 'dispatch_customer');
|
||||
if (preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->ventilation->dispatch);
|
||||
if (preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->ventilation->read);
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
|
||||
if (preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write);
|
||||
if (preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write);
|
||||
|
||||
if (! empty($conf->supplier_invoice->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->ventilation->read, '', $mainmenu, 'dispatch_supplier');
|
||||
if (preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->ventilation->dispatch);
|
||||
if (preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->ventilation->read);
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier');
|
||||
if (preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write);
|
||||
if (preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->bind->write);
|
||||
}
|
||||
|
||||
// Journals
|
||||
@@ -1006,9 +1010,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report",$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire);
|
||||
|
||||
// Admin
|
||||
$langs->load("admin");
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'chartofaccount');
|
||||
// Fiscal year
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // Not yet used. In a future will lock some periods.
|
||||
{
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Fiscalyear"),1,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
|
||||
|
||||
@@ -231,24 +231,34 @@ class modAccounting extends DolibarrModules
|
||||
$this->rights = array(); // Permission array used by this module
|
||||
$r = 0;
|
||||
|
||||
$this->rights[$r][0] = 50401;
|
||||
$this->rights[$r][1] = 'Read ventilation';
|
||||
$this->rights[$r][0] = 50440;
|
||||
$this->rights[$r][1] = 'Manage chart of accounts, setup of accountancy';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'ventilation';
|
||||
$this->rights[$r][5] = 'read';
|
||||
$this->rights[$r][4] = 'chartofaccount';
|
||||
$this->rights[$r][5] = '';
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 50401;
|
||||
$this->rights[$r][1] = 'Bind products and invoices with accounting accounts';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'bind';
|
||||
$this->rights[$r][5] = 'write';
|
||||
$r++;
|
||||
|
||||
/*
|
||||
$this->rights[$r][0] = 50402;
|
||||
$this->rights[$r][1] = 'Dispatched ventilation';
|
||||
$this->rights[$r][1] = 'Make binding with products and invoices';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'ventilation';
|
||||
$this->rights[$r][5] = 'dispatch';
|
||||
$this->rights[$r][5] = 'dispatch_advanced';
|
||||
$r++;
|
||||
*/
|
||||
|
||||
$this->rights[$r][0] = 50411;
|
||||
$this->rights[$r][1] = 'Lire les mouvements comptables';
|
||||
$this->rights[$r][1] = 'Read operations in General Ledger';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'mouvements';
|
||||
@@ -256,7 +266,7 @@ class modAccounting extends DolibarrModules
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 50412;
|
||||
$this->rights[$r][1] = 'Creer/modifier/annuler les mouvements comptables';
|
||||
$this->rights[$r][1] = 'Write/Edit operations in General Ledger';
|
||||
$this->rights[$r][2] = 'w';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'mouvements';
|
||||
@@ -264,7 +274,7 @@ class modAccounting extends DolibarrModules
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 50420;
|
||||
$this->rights[$r][1] = 'Lire CA, bilans, resultats, journaux, grands livres';
|
||||
$this->rights[$r][1] = 'Report and export reports (turnover, balance, journals, general ledger)';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'comptarapport';
|
||||
@@ -279,14 +289,6 @@ class modAccounting extends DolibarrModules
|
||||
$this->rights[$r][5] = '';
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 50440;
|
||||
$this->rights[$r][1] = 'Manage chart of accounts';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'chartofaccount';
|
||||
$this->rights[$r][5] = '';
|
||||
$r++;
|
||||
|
||||
|
||||
// Menus
|
||||
//-------
|
||||
|
||||
@@ -419,6 +419,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
||||
|
||||
// Reload modules (this must be always and only into last targeted version)
|
||||
$listofmodule=array(
|
||||
'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly',
|
||||
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
|
||||
'MAIN_MODULE_CRON'=>'newboxdefonly',
|
||||
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
|
||||
|
||||
@@ -72,7 +72,7 @@ ACCOUNTING_LENGTH_DESCRIPTION=Length for displaying product & services descripti
|
||||
ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Length for displaying product & services account description form in listings (Best = 50)
|
||||
ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounting accounts
|
||||
ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounting accounts
|
||||
ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disable by default. Be careful with the function "length of the accounts".
|
||||
ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disabled by default. If set to on, you must also set the 2 following parameters (or it is ignored)
|
||||
BANK_DISABLE_DIRECT_INPUT=Disable free input of bank transactions (Enabled by default with this module).
|
||||
|
||||
ACCOUNTING_SELL_JOURNAL=Sell journal
|
||||
@@ -103,7 +103,7 @@ NotMatch=Not Set
|
||||
DeleteMvt=Delete general ledger lines
|
||||
DelYear=Year to delete
|
||||
DelJournal=Journal to delete
|
||||
ConfirmDeleteMvt=This will delete all lines of the general ledger for year and/or from a specifics journal
|
||||
ConfirmDeleteMvt=This will delete all lines of the general ledger for year and/or from a specific journal. At least one criteria is required.
|
||||
ConfirmDeleteMvtPartial=This will delete the selected line(s) of the general ledger
|
||||
DelBookKeeping=Delete the record of the general ledger
|
||||
FinanceJournal=Finance journal
|
||||
|
||||
@@ -28,6 +28,7 @@ NoTemplateDefined=No template defined for this email type
|
||||
AvailableVariables=Available substitution variables
|
||||
NoTranslation=No translation
|
||||
NoRecordFound=No record found
|
||||
NoRecordDeleted=No record deleted
|
||||
NotEnoughDataYet=Not enough data
|
||||
NoError=No error
|
||||
Error=Error
|
||||
|
||||
Reference in New Issue
Block a user