Merge pull request #14667 from TobiasSekan/FixWrongVisibleTaxMenuEntry

FIX wrong visible of tax menu entry
This commit is contained in:
Laurent Destailleur 2020-09-09 15:34:41 +02:00 committed by GitHub
commit b7dcd88192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1087,16 +1087,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
} }
// Taxes and social contributions // Taxes and social contributions
if (!empty($conf->tax->enabled) || !empty($conf->salaries->enabled) || !empty($conf->loan->enabled) || !empty($conf->banque->enabled))
{
global $mysoc;
$permtoshowmenu = ((!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) || (!empty($conf->loan->enabled) && $user->rights->loan->read) || (!empty($conf->banque->enabled) && $user->rights->banque->lire));
$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax');
// Social contributions
if (!empty($conf->tax->enabled)) if (!empty($conf->tax->enabled))
{ {
$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax');
$newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire); $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) { if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) {
$newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
@ -1106,6 +1100,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// VAT // VAT
if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
{ {
global $mysoc;
$newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) { if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) {
$newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer); $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer);
@ -1114,7 +1110,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
$newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
} }
global $mysoc;
//Local Taxes 1 //Local Taxes 1
if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1")) if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1"))
@ -1177,7 +1172,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
} }
} }
} }
}
/* /*
* Menu COMPTA-FINANCIAL * Menu COMPTA-FINANCIAL