Merge pull request #4268 from aspangaro/develop-a7
Accountancy Review page to init accountancy on product/service
This commit is contained in:
commit
095ee47724
@ -22,17 +22,18 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/admin/productaccount.php
|
* \file htdocs/accountancy/admin/productaccount.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Accounting Expert
|
||||||
* \brief Onglet de gestion de parametrages des ventilations
|
* \brief To define accounting account on product / service
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
// Class
|
// Class
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
// Langs
|
// Langs
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
@ -40,6 +41,10 @@ $langs->load("compta");
|
|||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("accountancy");
|
$langs->load("accountancy");
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (!$user->admin) accessforbidden();
|
||||||
|
if (empty($conf->accounting->enabled)) accessforbidden();
|
||||||
|
|
||||||
// search & action GETPOST
|
// search & action GETPOST
|
||||||
$action = GETPOST('action');
|
$action = GETPOST('action');
|
||||||
$codeventil_buy = GETPOST('codeventil_buy', 'array');
|
$codeventil_buy = GETPOST('codeventil_buy', 'array');
|
||||||
@ -77,7 +82,7 @@ if (! $sortfield)
|
|||||||
if (! $sortorder)
|
if (! $sortorder)
|
||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
|
|
||||||
// sales or purchase
|
// Sales or Purchase mode ?
|
||||||
if ($action == 'update') {
|
if ($action == 'update') {
|
||||||
if (! empty($btn_changetype)) {
|
if (! empty($btn_changetype)) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -129,9 +134,9 @@ if ($action == 'update') {
|
|||||||
|
|
||||||
dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG);
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$msg .= '<div><font color="green">' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
|
$msg .= '<div><font color="green">' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '</font></div>';
|
||||||
} else {
|
} else {
|
||||||
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $accounting->account_number . '<br/> <pre>' . $sql . '</pre></font></div>';
|
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,13 +150,6 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->societe_id > 0)
|
|
||||||
accessforbidden();
|
|
||||||
// TODO after adding menu
|
|
||||||
// if (! $user->rights->accounting->ventilation->dispatch)
|
|
||||||
// accessforbidden();
|
|
||||||
|
|
||||||
$form = new FormVentilation($db);
|
$form = new FormVentilation($db);
|
||||||
|
|
||||||
// Defaut AccountingAccount RowId Product / Service
|
// Defaut AccountingAccount RowId Product / Service
|
||||||
@ -177,13 +175,12 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_desc = '';
|
$search_desc = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// debug move header to top
|
|
||||||
llxHeader('', $langs->trans("Accounts"));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
llxHeader('', $langs->trans("Accounts"));
|
||||||
|
|
||||||
print '<script type="text/javascript">
|
print '<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
$(\'#select-all\').click(function(event) {
|
$(\'#select-all\').click(function(event) {
|
||||||
@ -207,7 +204,7 @@ $sql .= " WHERE (";
|
|||||||
|
|
||||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
|
|
||||||
IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
|
||||||
$sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL";
|
$sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL";
|
||||||
$sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN
|
$sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN
|
||||||
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
|
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
|
||||||
@ -239,10 +236,11 @@ if ($result) {
|
|||||||
$num_lines = $db->num_rows($result);
|
$num_lines = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
/*
|
print load_fiche_titre($langs->trans("InitAccountancy"),'','title_setup');
|
||||||
* View
|
print '<br>';
|
||||||
*/
|
|
||||||
print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
print $langs->trans("InitAccountancyDesc").'<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
@ -250,17 +248,17 @@ if ($result) {
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>' . $langs->trans('OptionMode') . '</td><td>' . $langs->trans('Description') . '</td>';
|
print '<td>' . $langs->trans('Options') . '</td><td>' . $langs->trans('Description') . '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '<tr ' . $bc[false] . '><td width="200"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('Accountancy_code_sell') . '</td>';
|
print '<tr ' . $bc[false] . '><td width="25%"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductSell') . '</td>';
|
||||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSell'));
|
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSellDesc'));
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print '<tr ' . $bc[true] . '><td width="200"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('Accountancy_code_buy') . '</td>';
|
print '<tr ' . $bc[true] . '><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductBuy') . '</td>';
|
||||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuy')) . "</td></tr>\n";
|
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuyDesc')) . "</td></tr>\n";
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print '<br /><div style="text-align:center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="changetype"></div>';
|
print '<br /><div align="right"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="changetype"></div>';
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
@ -268,33 +266,29 @@ if ($result) {
|
|||||||
print $msg;
|
print $msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
// print '<td align="left"><b>' . $langs->trans("DescProductAccountingAccount") . '</b></td> ';
|
|
||||||
// print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "p.rowid", "", $param, '', $sortfield, $sortorder);
|
|
||||||
print ' ';
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||||
|
/*
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
print '<th align="left">' . $langs->trans("Accountancy_code_buy") . '</td>';
|
print_liste_field_titre($langs->trans("Accountancy_code_buy"));
|
||||||
print '<th align="left">' . $langs->trans("Accountancy_code_buy_suggest") . '</td>';
|
|
||||||
} else {
|
} else {
|
||||||
print '<th align="left">' . $langs->trans("Accountancy_code_sell") . '</td>';
|
print_liste_field_titre($langs->trans("Accountancy_code_sell"));
|
||||||
print '<th align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
|
|
||||||
}
|
}
|
||||||
// print_liste_field_titre('');
|
*/
|
||||||
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label> / <label id="unselect-all">' . $langs->trans('None') . '</label>');
|
print_liste_field_titre($langs->trans("AccountAccounting"));
|
||||||
|
print_liste_field_titre($langs->trans("Modify") . '<br><label id="select-all">' . $langs->trans('All') . '</label> / <label id="unselect-all">' . $langs->trans('None') . '</label>','','','','','align="center"');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_ref" value="' . $search_ref . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>';
|
||||||
|
|
||||||
print '<td class="liste_titre" colspan="2"> </td>';
|
print '<td class=liste_titre"> </td>';
|
||||||
print '<td align="right" class="liste_titre">';
|
print '<td align="center" class="liste_titre">';
|
||||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||||
@ -347,13 +341,13 @@ if ($result) {
|
|||||||
// TODO ADJUST DESCRIPTION SIZE
|
// TODO ADJUST DESCRIPTION SIZE
|
||||||
// print '<td align="left">' . $obj->description . '</td>';
|
// print '<td align="left">' . $obj->description . '</td>';
|
||||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||||
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 64;
|
||||||
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
||||||
|
|
||||||
// acountingaccount buy
|
// Accounting account buy
|
||||||
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY')
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
{
|
||||||
print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
|
// print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
|
||||||
// TODO: replace by select
|
// TODO: replace by select
|
||||||
// print '<td align="left">' . $compta_prodbuy . '</td>';
|
// print '<td align="left">' . $compta_prodbuy . '</td>';
|
||||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||||
@ -361,10 +355,11 @@ if ($result) {
|
|||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1);
|
print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
// acountingaccount sel
|
{
|
||||||
print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
|
// Accounting account sell
|
||||||
|
// print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
|
||||||
// TODO: replace by select
|
// TODO: replace by select
|
||||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||||
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
||||||
@ -381,7 +376,7 @@ if ($result) {
|
|||||||
$i ++;
|
$i ++;
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br><div align="center"><input type="submit" class="butAction" name="changeaccount" value="' . $langs->trans("Change_Account") . '"></div>';
|
print '<br><div align="right"><input type="submit" class="butAction" name="changeaccount" value="' . $langs->trans("Validate") . '"></div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
|
|||||||
@ -58,7 +58,9 @@ 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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 310__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 310__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __ENTITY__);
|
||||||
-- Home - Module Tools
|
-- Home - Module Tools
|
||||||
-- Added by ???
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 700__+MAX_llx_menu__, 'home', 'modulesadmintools', 1__+MAX_llx_menu__, '/admin/tools/index.php?leftmenu=modulesadmintools', 'ModulesSystemTools', 0, 'admin', '', '', 2, 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 ('', '$leftmenu=="modulesadmintools"', __HANDLER__, 'left', 701__+MAX_llx_menu__, 'home', '', 700__+MAX_llx_menu__, '/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools', 'ProductVatMassChange', 1, 'products', '', '', 2, 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 || $leftmenu=="modulesadmintools"', __HANDLER__, 'left', 702__+MAX_llx_menu__, 'home', '', 700__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=home&leftmenu=modulesadmintools', 'InitAccountancy', 1, 'accountancy', '', '', 2, 0, __ENTITY__);
|
||||||
-- Home - Menu users and groups
|
-- Home - Menu users and groups
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 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 ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__);
|
||||||
|
|||||||
@ -108,48 +108,6 @@ class MenuManager
|
|||||||
$menuArbo = new Menubase($this->db,'auguria');
|
$menuArbo = new Menubase($this->db,'auguria');
|
||||||
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'auguria', $tabMenu);
|
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'auguria', $tabMenu);
|
||||||
|
|
||||||
// Modules system tools
|
|
||||||
// TODO Find a way to add parent menu only if child menu exists. For the moment, no other method than hard coded methods.
|
|
||||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) // TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on
|
|
||||||
|| ! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS))
|
|
||||||
{
|
|
||||||
if (empty($user->societe_id))
|
|
||||||
{
|
|
||||||
if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && ($leftmenu=="modulesadmintools" && $user->admin))
|
|
||||||
{
|
|
||||||
$langs->load("products");
|
|
||||||
$array_menu_product=array(
|
|
||||||
'url'=>"/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools",
|
|
||||||
'titre'=>$langs->trans("ProductVatMassChange"),
|
|
||||||
'enabled'=>($user->admin?true:false),
|
|
||||||
'perms'=>($user->admin?true:false),
|
|
||||||
'fk_mainmenu'=>'home',
|
|
||||||
'fk_leftmenu'=>'modulesadmintools',
|
|
||||||
'fk_menu'=>-1,
|
|
||||||
'mainmenu'=>'home',
|
|
||||||
'leftmenu'=>'modulesadmintools_massvat',
|
|
||||||
'type'=>'left',
|
|
||||||
'position'=>20
|
|
||||||
);
|
|
||||||
array_unshift($tabMenu,$array_menu_product); // add at beginning of array
|
|
||||||
}
|
|
||||||
// Main menu title
|
|
||||||
$array_menu_product=array(
|
|
||||||
'url'=>"/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools",
|
|
||||||
'titre'=>$langs->trans("ModulesSystemTools"),
|
|
||||||
'enabled'=>($user->admin?true:false),
|
|
||||||
'perms'=>($user->admin?true:false),
|
|
||||||
'fk_mainmenu'=>'home',
|
|
||||||
'fk_menu'=>-1,
|
|
||||||
'mainmenu'=>'home',
|
|
||||||
'leftmenu'=>'modulesadmintools',
|
|
||||||
'type'=>'left',
|
|
||||||
'position'=>20
|
|
||||||
);
|
|
||||||
array_unshift($tabMenu,$array_menu_product); // add at beginning of array
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->tabMenu=$tabMenu;
|
$this->tabMenu=$tabMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -561,6 +561,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
{
|
{
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);
|
$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);
|
||||||
|
|
||||||
|
if (! empty($conf->accounting->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("accountancy");
|
||||||
|
$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("InitAccountancy"), 1, $user->admin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,6 @@ Selectmodelcsv=Select a model of export
|
|||||||
Modelcsv_normal=Classic export
|
Modelcsv_normal=Classic export
|
||||||
Modelcsv_CEGID=Export towards CEGID Expert
|
Modelcsv_CEGID=Export towards CEGID Expert
|
||||||
BackToChartofaccounts=Return chart of accounts
|
BackToChartofaccounts=Return chart of accounts
|
||||||
Back=Return
|
|
||||||
|
|
||||||
Definechartofaccounts=Define a chart of accounts
|
Definechartofaccounts=Define a chart of accounts
|
||||||
Selectchartofaccounts=Select a chart of accounts
|
Selectchartofaccounts=Select a chart of accounts
|
||||||
@ -109,10 +108,6 @@ DelBookKeeping=Delete the records of the general ledger
|
|||||||
|
|
||||||
DescSellsJournal=Sales journal
|
DescSellsJournal=Sales journal
|
||||||
DescPurchasesJournal=Purchases journal
|
DescPurchasesJournal=Purchases journal
|
||||||
BankJournal=Bank journal
|
|
||||||
DescBankJournal=Bank journal including all the types of payments other than cash
|
|
||||||
CashJournal=Cash journal
|
|
||||||
DescCashJournal=Cash journal including the type of payment cash
|
|
||||||
FinanceJournal=Finance journal
|
FinanceJournal=Finance journal
|
||||||
DescFinanceJournal=Finance journal including all the types of payments by bank account
|
DescFinanceJournal=Finance journal including all the types of payments by bank account
|
||||||
|
|
||||||
@ -152,7 +147,7 @@ DescVentilDoneSupplier=Consult here the list of the lines of invoices supplier a
|
|||||||
ValidateHistory=Validate Automatically
|
ValidateHistory=Validate Automatically
|
||||||
|
|
||||||
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
|
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
|
||||||
|
MvtNotCorrectlyBalanced=Mouvement not correctly balanced. Credit = %s. Debit = %s
|
||||||
FicheVentilation=Breakdown card
|
FicheVentilation=Breakdown card
|
||||||
GeneralLedgerIsWritten=Operations are written in the general ledger
|
GeneralLedgerIsWritten=Operations are written in the general ledger
|
||||||
|
|
||||||
@ -167,7 +162,13 @@ Headername=Name in header
|
|||||||
Type=Type of fields
|
Type=Type of fields
|
||||||
Param=Additionnal parameters
|
Param=Additionnal parameters
|
||||||
EnabledProduct=In Product
|
EnabledProduct=In Product
|
||||||
EnabledTiers=In Tiers
|
EnabledTiers=In third party
|
||||||
EnabledVat=In Vat
|
EnabledVat=In Vat
|
||||||
|
## Tools - Init accounting account on product / service
|
||||||
MvtNotCorrectlyBalanced=Mouvement not correctly balanced. Credit = %s. Debit = %s
|
InitAccountancy=Init accountancy
|
||||||
|
InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accountancy account defined for sales and purchases. Check before that setup of module accountancy is complete.
|
||||||
|
Options=Options
|
||||||
|
OptionModeProductSell=Mode sales
|
||||||
|
OptionModeProductBuy=Mode purchases
|
||||||
|
OptionModeProductSellDesc=Show all products with no accounting account defined for sales.
|
||||||
|
OptionModeProductBuyDesc=Show all products with no accounting account defined for purchases.
|
||||||
Loading…
Reference in New Issue
Block a user