From d03763f6c37ed9a1fa9bfe56906c4092a146f87b Mon Sep 17 00:00:00 2001 From: aspangaro <alexandre.spangaro@gmail.com> Date: Thu, 28 Aug 2014 06:30:01 +0200 Subject: [PATCH] Update Accounting Expert integration --- htdocs/accountancy/admin/account.php | 24 ++++---- .../accountancy/admin/{fiche.php => card.php} | 25 ++++---- htdocs/accountancy/admin/export.php | 24 ++++---- htdocs/accountancy/admin/importaccounts.php | 32 +++++----- htdocs/accountancy/admin/index.php | 38 ++++++------ htdocs/accountancy/admin/journaux.php | 28 +++++---- htdocs/accountancy/admin/productaccount.php | 18 +++--- .../accountancy/admin/thirdpartyaccount.php | 16 +++-- .../bookkeeping/balancebymonth.php | 14 ++--- .../bookkeeping/{fiche.php => card.php} | 21 ++++--- .../bookkeeping/{liste.php => list.php} | 22 +++---- .../{listebyyear.php => listbyyear.php} | 14 ++--- .../class/accountancysystem.class.php | 6 +- .../class/accountingaccount.class.php | 6 +- .../accountancy/class/bookkeeping.class.php | 40 ++++++------- .../class/html.formventilation.class.php | 7 ++- .../customer/{fiche.php => card.php} | 28 ++++----- htdocs/accountancy/customer/index.php | 22 +++---- .../customer/{lignes.php => lines.php} | 26 ++++----- .../customer/{liste.php => list.php} | 30 +++++----- htdocs/accountancy/journal/bankjournal.php | 38 ++++++------ htdocs/accountancy/journal/cashjournal.php | 42 +++++++------- htdocs/accountancy/journal/index.php | 11 ++-- .../accountancy/journal/purchasesjournal.php | 26 ++++----- htdocs/accountancy/journal/sellsjournal.php | 30 +++++----- .../supplier/{fiche.php => card.php} | 22 +++---- htdocs/accountancy/supplier/index.php | 21 +++---- .../supplier/{lignes.php => lines.php} | 28 ++++----- .../supplier/{liste.php => list.php} | 32 +++++----- htdocs/admin/dict.php | 58 ++++++------------- htdocs/core/modules/modAccounting.class.php | 14 ----- .../{accounting.lang => accountancy.lang} | 0 .../{accounting.lang => accountancy.lang} | 0 .../{accounting.lang => accountancy.lang} | 0 34 files changed, 354 insertions(+), 409 deletions(-) rename htdocs/accountancy/admin/{fiche.php => card.php} (94%) rename htdocs/accountancy/bookkeeping/{fiche.php => card.php} (93%) rename htdocs/accountancy/bookkeeping/{liste.php => list.php} (91%) rename htdocs/accountancy/bookkeeping/{listebyyear.php => listbyyear.php} (90%) rename htdocs/accountancy/customer/{fiche.php => card.php} (85%) rename htdocs/accountancy/customer/{lignes.php => lines.php} (90%) rename htdocs/accountancy/customer/{liste.php => list.php} (90%) rename htdocs/accountancy/supplier/{fiche.php => card.php} (89%) rename htdocs/accountancy/supplier/{lignes.php => lines.php} (89%) rename htdocs/accountancy/supplier/{liste.php => list.php} (88%) rename htdocs/langs/en_US/{accounting.lang => accountancy.lang} (100%) rename htdocs/langs/es_ES/{accounting.lang => accountancy.lang} (100%) rename htdocs/langs/fr_FR/{accounting.lang => accountancy.lang} (100%) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index f0bbd02f330..d8a26ca1ec5 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -17,7 +17,7 @@ */ /** - * \file accountingex/admin/account.php + * \file htdocs/accountancy/admin/account.php * \ingroup Accounting Expert * \brief List accounting account */ @@ -35,12 +35,12 @@ if (! $res) // Class require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -dol_include_once("/accountingex/class/accountingaccount.class.php"); -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/accountingaccount.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); // Langs $langs->load("compta"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $mesg = ''; $action = GETPOST('action'); @@ -48,10 +48,8 @@ $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); // Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accountingex->admin) - accessforbidden(); +if (!$user->admin) + accessforbidden(); $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); @@ -130,7 +128,7 @@ if (strlen(trim($_GET["search_pcgsubtype"]))) { $sql .= $db->order($sortfield, $sortorder); $sql .= $db->plimit($limit + 1, $offset); -dol_syslog('accountingex/admin/account.php:: $sql=' . $sql); +dol_syslog('accountancy/admin/account.php:: $sql=' . $sql); $result = $db->query($sql); if ($result) { @@ -144,7 +142,7 @@ if ($result) { print '<br/>'; - print '<a class="butAction" href="./fiche.php?action=create">' . $langs->trans("Addanaccount") . '</a>'; + print '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>'; print '<a class="butAction" href="./importaccounts.php">' . $langs->trans("ImportAccount") . '</a>'; print '<br/><br/>'; @@ -178,7 +176,7 @@ if ($result) { $var = ! $var; print '<tr ' . $bc[$var] . '>'; - print '<td><a href="./fiche.php?id=' . $obj->rowid . '">' . $obj->account_number . '</td>'; + print '<td><a href="./card.php?id=' . $obj->rowid . '">' . $obj->account_number . '</td>'; print '<td>' . $obj->label . '</td>'; print '<td>' . $obj->account_parent . '</td>'; print '<td>' . $obj->pcg_type . '</td>'; @@ -197,10 +195,10 @@ if ($result) { print '<td>'; if ($user->rights->accountingex->admin) { - print '<a href="./fiche.php?action=update&id=' . $obj->rowid . '">'; + print '<a href="./card.php?action=update&id=' . $obj->rowid . '">'; print img_edit(); print '</a> '; - print '<a href="./fiche.php?action=delete&id=' . $obj->rowid . '">'; + print '<a href="./card.php?action=delete&id=' . $obj->rowid . '">'; print img_delete(); print '</a>'; } diff --git a/htdocs/accountancy/admin/fiche.php b/htdocs/accountancy/admin/card.php similarity index 94% rename from htdocs/accountancy/admin/fiche.php rename to htdocs/accountancy/admin/card.php index 76fc955fca2..68cdaf704a4 100644 --- a/htdocs/accountancy/admin/fiche.php +++ b/htdocs/accountancy/admin/card.php @@ -18,9 +18,9 @@ */ /** - * \file accountingex/admin/fiche.php - * \ingroup Accounting Expert - * \brief Page fiche de compte + * \file htdocs/accountancy/admin/card.php + * \ingroup Accounting Expert + * \brief Card accounting account */ $res = @include ("../main.inc.php"); if (! $res && file_exists("../main.inc.php")) @@ -34,12 +34,12 @@ if (! $res) // Class require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -dol_include_once("/accountingex/class/accountingaccount.class.php"); -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/accountingaccount.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); // Langs $langs->load("bills"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $mesg = ''; $action = GETPOST('action'); @@ -47,17 +47,16 @@ $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); // Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accountingex->admin) - accessforbidden(); +if (!$user->admin) + accessforbidden(); + $accounting = new AccountingAccount($db); -// action +// Action if ($action == 'add') { $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; - dol_syslog('accountingex/admin/fiche.php:: $sql=' . $sql); + dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result = $db->query($sql); $obj = $db->fetch_object($result); @@ -89,7 +88,7 @@ if ($action == 'add') { $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; - dol_syslog('accountingex/admin/fiche.php:: $sql=' . $sql); + dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result2 = $db->query($sql); $obj = $db->fetch_object($result2); diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index a326b7058ad..2b042720b60 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/accountingex/admin/export.php + * \file htdocs/accountancy/admin/export.php * \ingroup Accounting Expert * \brief Setup page to configure accounting expert module */ @@ -41,20 +41,18 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $langs->load("compta"); $langs->load("bills"); -$langs->load('admin'); -$langs->load('accountingex@accountingex'); +$langs->load("admin"); +$langs->load("accountancy"); // Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accountingex->admin) - accessforbidden(); +if (!$user->admin) + accessforbidden(); $action = GETPOST('action', 'alpha'); -// Other parameters ACCOUNTINGEX_* +// Other parameters ACCOUNTING_* $list = array ( - 'ACCOUNTINGEX_SEPARATORCSV' + 'ACCOUNTING_SEPARATORCSV' ); /* @@ -67,7 +65,7 @@ if ($action == 'update') { if (! empty($modelcsv)) { - if (! dolibarr_set_const($db, 'ACCOUNTINGEX_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { + if (! dolibarr_set_const($db, 'ACCOUNTING_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { $error ++; } } else { @@ -121,12 +119,12 @@ print "<td>" . $langs->trans("Selectmodelcsv") . "</td>"; print "<td>"; print '<select class="flat" name="modelcsv" id="modelcsv">'; print '<option value="0"'; -if ($conf->global->ACCOUNTINGEX_MODELCSV == 0) { +if ($conf->global->ACCOUNTING_MODELCSV == 0) { print ' selected="selected"'; } print '>' . $langs->trans("Modelcsv_normal") . '</option>'; print '<option value="1"'; -if ($conf->global->ACCOUNTINGEX_MODELCSV == 1) { +if ($conf->global->ACCOUNTING_MODELCSV == 1) { print ' selected="selected"'; } print '>' . $langs->trans("Modelcsv_CEGID") . '</option>'; @@ -141,7 +139,7 @@ print "<br>\n"; * */ $list = array ( - 'ACCOUNTINGEX_SEPARATORCSV' + 'ACCOUNTING_SEPARATORCSV' ); $num = count($list); diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index d9d255dad99..633bf41301a 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -1,7 +1,7 @@ <?php /* * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> - * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@fidurex.fr> + * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * * This program is free software; you can redistribute it and/or modify @@ -21,9 +21,9 @@ */ /** - * \file htdocs/compta/accountingex/liste.php - * \ingroup compta - * \brief Page IMPORT COMPTE COMPTABLE + * \file htdocs/accountancy/admin/importaccounts.php + * \ingroup Accounting Expert + * \brief Page import accounting account */ $res = @include ("../main.inc.php"); if (! $res && file_exists("../main.inc.php")) @@ -37,20 +37,18 @@ if (! $res) // Class require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -dol_include_once("/accountingex/class/accountingaccount.class.php"); -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/accountingaccount.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); // langs $langs->load("compta"); $langs->load("bills"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); // Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accountingex->admin) - accessforbidden(); +if (!$user->admin) + accessforbidden(); llxHeader('', $langs->trans("ImportAccount")); @@ -109,7 +107,7 @@ if ($_POST["action"] == 'import') { $page = GETPOST("page"); if ($page < 0) $page = 0; -$limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; +$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $offset = $limit * $page; $sql = "(SELECT p.rowid as product_id, p.accountancy_code_sell as accounting "; @@ -124,12 +122,12 @@ $sql .= " GROUP BY accounting "; $sql .= ") "; $sql .= " ORDER BY accounting DESC " . $db->plimit($limit + 1, $offset); -dol_syslog('accountingex/admin/importaccounts.php:: $sql=' . $sql); +dol_syslog('accountancy/admin/importaccounts.php:: $sql=' . $sql); $result = $db->query($sql); if ($result) { - $num_lignes = $db->num_rows($result); + $num_lines = $db->num_rows($result); $i = 0; - print_barre_liste($langs->trans("ImportAccount"), $page, "importaccounts.php", "", $sortfield, $sortorder, '', $num_lignes); + print_barre_liste($langs->trans("ImportAccount"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td>' . $langs->trans("accountingaccount") . '</td>'; @@ -143,11 +141,11 @@ if ($result) { $form = new Form($db); $htmlacc = new FormVentilation($db); - print '<form action="importaccounts.php" method="post">' . "\n"; + print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n"; print '<input type="hidden" name="action" value="import">'; $var = True; - while ( $i < min($num_lignes, $limit) ) { + while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); $var = ! $var; print "<tr $bc[$var]>"; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index d25dffe4c25..83fb8820f08 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/accountingex/admin/index.php + * \file htdocs/accountancy/admin/index.php * \ingroup Accounting Expert * \brief Setup page to configure accounting expert module */ @@ -43,30 +43,28 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $langs->load("compta"); $langs->load("bills"); -$langs->load('admin'); -$langs->load('accountingex@accountingex'); +$langs->load("admin"); +$langs->load("accountancy"); // Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accountingex->admin) - accessforbidden(); +if (!$user->admin) + accessforbidden(); $action = GETPOST('action', 'alpha'); -// Other parameters COMPTA_* & ACCOUNTINGEX_* +// Other parameters COMPTA_* & ACCOUNTING_* $list = array ( - 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION', - 'ACCOUNTINGEX_LENGTH_GACCOUNT', - 'ACCOUNTINGEX_LENGTH_AACCOUNT', + 'ACCOUNTING_LIMIT_LIST_VENTILATION', + 'ACCOUNTING_LENGTH_GACCOUNT', + 'ACCOUNTING_LENGTH_AACCOUNT', 'COMPTA_ACCOUNT_CUSTOMER', 'COMPTA_ACCOUNT_SUPPLIER', 'COMPTA_PRODUCT_BUY_ACCOUNT', 'COMPTA_PRODUCT_SOLD_ACCOUNT', 'COMPTA_SERVICE_BUY_ACCOUNT', 'COMPTA_SERVICE_SOLD_ACCOUNT', - 'ACCOUNTINGEX_ACCOUNT_SUSPENSE', - 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH' + 'ACCOUNTING_ACCOUNT_SUSPENSE', + 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' ); /* @@ -126,7 +124,7 @@ if ($action == 'update') if ($action == 'setlistsorttodo') { $setlistsorttodo = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity); if (! $res > 0) $error ++; @@ -139,7 +137,7 @@ if ($action == 'setlistsorttodo') { if ($action == 'setlistsortdone') { $setlistsortdone = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity); if (! $res > 0) $error ++; if (! $error) { @@ -217,7 +215,7 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system"; $sql .= " WHERE active = 1"; $sql .= " AND fk_pays = " . $mysoc->country_id; -dol_syslog('accountingex/admin/index.php:: $sql=' . $sql); +dol_syslog('accountancy/admin/index.php:: $sql=' . $sql); $resql = $db->query($sql); $var = True; @@ -267,8 +265,8 @@ foreach ($list as $key) } print "<tr " . $bc[$var] . ">"; -print '<td width="80%">' . $langs->trans("ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO") . '</td>'; -if (! empty($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO)) { +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>'; @@ -280,8 +278,8 @@ if (! empty($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO)) { print '</tr>'; print "<tr " . $bc[$var] . ">"; -print '<td width="80%">' . $langs->trans("ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE") . '</td>'; -if (! empty($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE)) { +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>'; diff --git a/htdocs/accountancy/admin/journaux.php b/htdocs/accountancy/admin/journaux.php index f7b354090e9..139b8b37ae8 100644 --- a/htdocs/accountancy/admin/journaux.php +++ b/htdocs/accountancy/admin/journaux.php @@ -20,9 +20,9 @@ */ /** - * \file htdocs/accountingex/admin/journaux.php - * \ingroup Accounting Expert - * \brief Setup page to configure accounting expert module + * \file htdocs/accountancy/admin/journaux.php + * \ingroup Accounting Expert + * \brief Setup page to configure accounting expert module */ // Dolibarr environment @@ -42,23 +42,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; dol_include_once("/core/lib/bank.lib.php"); require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -$langs->load('accountingex@accountingex'); +$langs->load("accountancy"); // Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accountingex->admin) - accessforbidden(); +if (!$user->admin) + accessforbidden(); $action = GETPOST('action', 'alpha'); -// Other parameters ACCOUNTINGEX_* +// Other parameters ACCOUNTING_* $list = array ( - 'ACCOUNTINGEX_SELL_JOURNAL', - 'ACCOUNTINGEX_PURCHASE_JOURNAL', - 'ACCOUNTINGEX_SOCIAL_JOURNAL', - 'ACCOUNTINGEX_CASH_JOURNAL', - 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL' + 'ACCOUNTING_SELL_JOURNAL', + 'ACCOUNTING_PURCHASE_JOURNAL', + 'ACCOUNTING_SOCIAL_JOURNAL', + 'ACCOUNTING_CASH_JOURNAL', + 'ACCOUNTING_MISCELLANEOUS_JOURNAL' ); /* @@ -134,7 +132,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."lx_bank_account as ba"; $sql .= " WHERE ba.clos = 0" ; $sql .= " ORDER BY label"; -dol_syslog('accountingex/admin/journaux.php:: $sql='.$sql); +dol_syslog('accountancy/admin/journaux.php:: $sql='.$sql); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 89bc1996771..55e7b54031e 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -1,7 +1,7 @@ <?PHP /* * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> - * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@fidurex.fr> + * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * * This program is free software; you can redistribute it and/or modify @@ -19,9 +19,9 @@ */ /** - * \file accountingex/admin/productaccount.php - * \ingroup Accounting Expert - * \brief Onglet de gestion de parametrages des ventilations + * \file htdocs/accountancy/admin/productaccount.php + * \ingroup Accounting Expert + * \brief Onglet de gestion de parametrages des ventilations */ // Dolibarr environment @@ -43,13 +43,11 @@ dol_include_once("/product/class/product.class.php"); $langs->load("companies"); $langs->load("compta"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); // Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accountingex->admin) - accessforbidden(); +if (!$user->admin) + accessforbidden(); llxHeader('', $langs->trans("Accounts")); @@ -70,7 +68,7 @@ $sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell $sql .= " FROM " . MAIN_DB_PREFIX . "product as p"; $sql .= " WHERE p.accountancy_code_sell IS NULL AND p.tosell = 1 OR p.accountancy_code_buy IS NULL AND p.tobuy = 1"; -dol_syslog('accountingex/admin/productaccount.php:: $sql=' . $sql); +dol_syslog('accountancy/admin/productaccount.php:: $sql=' . $sql); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/accountancy/admin/thirdpartyaccount.php b/htdocs/accountancy/admin/thirdpartyaccount.php index c9af52fcc51..7c4745aac86 100644 --- a/htdocs/accountancy/admin/thirdpartyaccount.php +++ b/htdocs/accountancy/admin/thirdpartyaccount.php @@ -18,9 +18,9 @@ */ /** - * \file accountingex/admin/thirdpartyaccount.php - * \ingroup Accounting Expert - * \brief Onglet de gestion de parametrages des ventilations + * \file htdocs/accountancy/admin/thirdpartyaccount.php + * \ingroup Accounting Expert + * \brief Onglet de gestion de parametrages des ventilations */ // Dolibarr environment @@ -41,13 +41,11 @@ dol_include_once("/core/lib/date.lib.php"); $langs->load("companies"); $langs->load("compta"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); // Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accountingex->admin) - accessforbidden(); +if (!$user->admin) + accessforbidden(); // Date range $year = GETPOST("year"); @@ -164,7 +162,7 @@ $sql .= ")"; $sql .= "ORDER BY name ASC"; -dol_syslog('accountingex/admin/thirdpartyaccount.php:: $sql=' . $sql); +dol_syslog('accountancy/admin/thirdpartyaccount.php:: $sql=' . $sql); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 5ce55fef7f6..7506ad27a39 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -19,9 +19,9 @@ */ /** - * \file accountingex/bookkeeping/balancebymonth.php - * \ingroup Accounting Expert - * \brief Balance by month + * \file htdocs/accountancy/bookkeeping/balancebymonth.php + * \ingroup Accounting Expert + * \brief Balance by month */ // Dolibarr environment @@ -37,14 +37,14 @@ if (! $res) // Class dol_include_once("/core/lib/date.lib.php"); -dol_include_once("accountingex/core/lib/account.lib.php"); +dol_include_once("accountancy/core/lib/account.lib.php"); // Langs $langs->load("main"); $langs->load("compta"); $langs->load("bills"); $langs->load("other"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); // Filter $year = $_GET["year"]; @@ -71,7 +71,7 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f"; $sql .= " WHERE fd.fk_code_ventilation = 0"; $sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;"; -dol_syslog('accountingex/bookkeeping/balancebymonth.php:: $sql=' . $sql); +dol_syslog('accountancy/bookkeeping/balancebymonth.php:: $sql=' . $sql); $result = $db->query($sql); if ($result) { $row = $db->fetch_row($result); @@ -101,7 +101,7 @@ $sql .= " ROUND(SUM(IF(MONTH(bk.doc_date)=10,bk.montant,0)),2) AS 'Octobre',"; $sql .= " ROUND(SUM(IF(MONTH(bk.doc_date)=11,bk.montant,0)),2) AS 'Novembre',"; $sql .= " ROUND(SUM(IF(MONTH(bk.doc_date)=12,bk.montant,0)),2) AS 'Decembre',"; $sql .= " ROUND(SUM(bk.montant),2) as 'Total'"; -$sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping as bk"; +$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; $sql .= " WHERE bk.doc_date >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'"; $sql .= " AND bk.doc_date <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'"; $sql .= " GROUP BY bk.numero_compte"; diff --git a/htdocs/accountancy/bookkeeping/fiche.php b/htdocs/accountancy/bookkeeping/card.php similarity index 93% rename from htdocs/accountancy/bookkeeping/fiche.php rename to htdocs/accountancy/bookkeeping/card.php index b558f70e480..f6a9f347dc0 100644 --- a/htdocs/accountancy/bookkeeping/fiche.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -18,7 +18,7 @@ */ /** - * \file accountingex/bookkeeping/fiche.php + * \file htdocs/accountancy/bookkeeping/card.php * \ingroup Accounting Expert * \brief Page to show account */ @@ -35,10 +35,10 @@ if (! $res) die("Include of main fails"); // Class -dol_include_once("accountingex/class/bookkeeping.class.php"); +dol_include_once("accountancy/class/bookkeeping.class.php"); // Langs -$langs->load("accountingex@accountingex"); +$langs->load("accounting"); // Security check $id = GETPOST('id', 'int'); @@ -190,7 +190,6 @@ else if ($action == "confirm_create") { llxHeader(); $html = new Form($db); -$nbligne = 0; /* * Confirmation to delete the command @@ -205,16 +204,16 @@ if ($action == 'create') { print_fiche_titre($langs->trans("CreateMvts")); $code_journal_array = array ( - $conf->global->ACCOUNTINGEX_SELL_JOURNAL => $conf->global->ACCOUNTINGEX_SELL_JOURNAL, - $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL => $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL, - $conf->global->ACCOUNTINGEX_BANK_JOURNAL => $conf->global->ACCOUNTINGEX_BANK_JOURNAL, - $conf->global->ACCOUNTINGEX_SOCIAL_JOURNAL => $conf->global->ACCOUNTINGEX_SOCIAL_JOURNAL + $conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL, + $conf->global->ACCOUNTING_PURCHASE_JOURNAL => $conf->global->ACCOUNTING_PURCHASE_JOURNAL, + $conf->global->ACCOUNTING_BANK_JOURNAL => $conf->global->ACCOUNTING_BANK_JOURNAL, + $conf->global->ACCOUNTING_SOCIAL_JOURNAL => $conf->global->ACCOUNTING_SOCIAL_JOURNAL ); $book = new BookKeeping($db); $next_num_mvt = $book->next_num_mvt(); - print '<form action="' . $_SERVER["PHP_SELF"] . '" name="create_mvt" method="post">'; + print '<form action="' . $_SERVER["PHP_SELF"] . '" name="create_mvt" method="POST">'; print '<input type="hidden" name="action" value="confirm_create">' . "\n"; print '<input type="hidden" name="next_num_mvt" value="' . $next_num_mvt . '">' . "\n"; @@ -337,10 +336,10 @@ if ($action == 'create') { print '<td>'; if ($user->rights->accoutingex->access) { - print '<a href="./fiche.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; + print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; print img_edit(); print '</a> '; - print '<a href="./fiche.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; + print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; print img_delete(); print '</a>'; } diff --git a/htdocs/accountancy/bookkeeping/liste.php b/htdocs/accountancy/bookkeeping/list.php similarity index 91% rename from htdocs/accountancy/bookkeeping/liste.php rename to htdocs/accountancy/bookkeeping/list.php index f587663e71c..5826256db51 100644 --- a/htdocs/accountancy/bookkeeping/liste.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -19,8 +19,8 @@ */ /** - * \file accountingex/bookkeeping/liste.php - * \ingroup Accounting Expert + * \file htdocs/accountancy/bookkeeping/list.php + * \ingroup Accounting Expert * \brief List operation of book keeping */ @@ -36,8 +36,8 @@ if (! $res) die("Include of main fails"); // Class -dol_include_once("/accountingex/class/html.formventilation.class.php"); -dol_include_once("/accountingex/class/bookkeeping.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/bookkeeping.class.php"); require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $page = GETPOST("page"); @@ -64,7 +64,7 @@ if ($action == 'delbookkeeping') { if (! empty($import_key)) { $object = new BookKeeping($db); $result = $object->delete_by_importkey($import_key); - Header("Location: liste.php"); + Header("Location: list.php"); if ($result < 0) { setEventMessage($object->errors, 'errors'); } @@ -106,7 +106,7 @@ else { */ $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num "; - $sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping as bk"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; if (dol_strlen(trim(GETPOST("search_doc_type")))) { @@ -131,13 +131,13 @@ else { $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit + 1, $offset); - dol_syslog('accountingex/bookkeeping/liste.php:: $sql=' . $sql); + dol_syslog('accountancy/bookkeeping/list.php:: $sql=' . $sql); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; - print_barre_liste($langs->trans("Bookkeeping"), $page, "liste.php", "", $sortfield, $sortorder, '', $num); + print_barre_liste($langs->trans("Bookkeeping"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num); print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; @@ -149,7 +149,7 @@ else { print '</form>'; - print '<a href="./fiche.php?action=create" class="butAction">Nouveau mouvement comptable</a>'; + print '<a href="./card.php?action=create" class="butAction">' . $langs->trans("NewAccountingMvt") . '</a>'; print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; @@ -174,7 +174,7 @@ else { print "</tr>\n"; print '<tr class="liste_titre">'; - print '<form action="liste.php" method="GET">'; + print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">'; print '<td><input type="text" name="search_doc_type" value="' . $_GET["search_doc_type"] . '"></td>'; print '<td> </td>'; print '<td><input type="text" name="search_doc_ref" value="' . $_GET["search_doc_ref"] . '"></td>'; @@ -211,7 +211,7 @@ else { print '<td align="right">' . price($obj->montant) . '</td>'; print '<td>' . $obj->sens . '</td>'; print '<td>' . $obj->code_journal . '</td>'; - print '<td><a href="./fiche.php?piece_num=' . $obj->piece_num . '">' . img_edit() . '</a></td>'; + print '<td><a href="./card.php?piece_num=' . $obj->piece_num . '">' . img_edit() . '</a></td>'; print "</tr>\n"; $i ++; } diff --git a/htdocs/accountancy/bookkeeping/listebyyear.php b/htdocs/accountancy/bookkeeping/listbyyear.php similarity index 90% rename from htdocs/accountancy/bookkeeping/listebyyear.php rename to htdocs/accountancy/bookkeeping/listbyyear.php index 2e17e1205ab..45c25f72fbe 100644 --- a/htdocs/accountancy/bookkeeping/listebyyear.php +++ b/htdocs/accountancy/bookkeeping/listbyyear.php @@ -19,7 +19,7 @@ */ /** - * \file accountingex/bookkeeping/listebyyear.php + * \file htdocs/accountancy/bookkeeping/listbyyear.php * \ingroup Accounting Expert * \brief Book keeping by year */ @@ -40,7 +40,7 @@ dol_include_once("/core/lib/date.lib.php"); require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; // Langs -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); @@ -65,8 +65,8 @@ $offset = $conf->liste_limit * $page; llxHeader('', $langs->trans("Bookkeeping")); -$textprevyear = "<a href=\"listebyyear.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>"; -$textnextyear = " <a href=\"listebyyear.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>"; +$textprevyear = "<a href=\"listbyyear.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>"; +$textnextyear = " <a href=\"listbyyear.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>"; /* * Mode Liste @@ -74,12 +74,12 @@ $textnextyear = " <a href=\"listebyyear.php?year=" . ($year_current + 1) . "\">" */ $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens, bk.code_journal"; -$sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping as bk"; +$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; // $sql .= " WHERE bk.doc_date >= '".$db->idate(dol_get_first_day($y,1,false))."'"; // $sql .= " AND bk.doc_date <= '".$db->idate(dol_get_last_day($y,12,false))."'"; $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit + 1, $offset); -dol_syslog('accountingex/bookkeeping/listebyyear.php:: $sql=' . $sql); +dol_syslog('accountancy/bookkeeping/listbyyear.php:: $sql=' . $sql); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -122,7 +122,7 @@ if ($resql) { print '<td align="right">' . price($obj->montant) . '</td>'; print '<td>' . $obj->sens . '</td>'; print '<td>' . $obj->code_journal . '</td>'; - print '<td><a href="./fiche.php?action=update&id=' . $obj->rowid . '">' . img_edit() . '</a></td>'; + print '<td><a href="./card.php?action=update&id=' . $obj->rowid . '">' . img_edit() . '</a></td>'; print "</tr>\n"; $i ++; diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index 63b59a95aaf..08d195aedcf 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -18,9 +18,9 @@ */ /** - * \file accountingex/class/accountancysystem.class.php - * \ingroup Accounting Expert - * \brief File of class to manage accountancy systems + * \file htdocs/accountancy/class/accountancysystem.class.php + * \ingroup Accounting Expert + * \brief File of class to manage accountancy systems */ /** diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 9cb29dc1e0b..34c23cb0a51 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -18,9 +18,9 @@ */ /** - * \file accountingex/class/Accountingaccount.class.php - * \ingroup Accounting Expert - * \brief Fichier de la classe des comptes comptable + * \file htdocs/accountancy/class/Accountingaccount.class.php + * \ingroup Accounting Expert + * \brief Fichier de la classe des comptes comptable */ /** diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 0ea235599b6..b1bc5b158f1 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -19,9 +19,9 @@ */ /** - * \file accountingex/class/bookkeeping.class.php - * \ingroup Accounting Expert - * \brief Fichier de la classe des comptes comptable + * \file htdocs/accountancy/class/bookkeeping.class.php + * \ingroup Accounting Expert + * \brief Fichier de la classe des comptes comptable */ /** @@ -63,7 +63,7 @@ class BookKeeping { * \brief Load record in memory */ function fetch_per_mvt($piecenum) { - $sql = "SELECT piece_num,doc_date,code_journal,doc_ref,doc_type FROM " . MAIN_DB_PREFIX . "bookkeeping WHERE "; + $sql = "SELECT piece_num,doc_date,code_journal,doc_ref,doc_type FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE "; $sql .= " piece_num = '" . $piecenum . "'"; dol_syslog(get_class($this) . "fetch_per_mvt sql=" . $sql, LOG_DEBUG); @@ -93,7 +93,7 @@ class BookKeeping { $sql .= "doc_ref, fk_doc, fk_docdet, code_tiers, "; $sql .= "numero_compte, label_compte, debit, credit, "; $sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num "; - $sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping "; $sql .= " WHERE rowid = '" . $id . "'"; dol_syslog(get_class($this) . "fetch sql=" . $sql, LOG_DEBUG); @@ -130,7 +130,7 @@ class BookKeeping { * \brief Return next num mvt */ function next_num_mvt() { - $sql = "SELECT MAX(piece_num)+1 as max FROM " . MAIN_DB_PREFIX . "bookkeeping"; + $sql = "SELECT MAX(piece_num)+1 as max FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping"; dol_syslog(get_class($this) . "next_num_mvt sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); @@ -153,7 +153,7 @@ class BookKeeping { $sql .= "doc_ref, fk_doc, fk_docdet, code_tiers, "; $sql .= "numero_compte, label_compte, debit, credit, "; $sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num "; - $sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping "; $sql .= " WHERE piece_num = '" . $piecenum . "'"; dol_syslog(get_class($this) . "fetch_all_per_mvt sql=" . $sql, LOG_DEBUG); @@ -193,8 +193,8 @@ class BookKeeping { } /** - * \brief Insere une ligne dans bookkeeping - * \param user utilisateur qui effectue l'insertion + * \brief Insert line into bookkeeping + * \param user User who inserted operation */ function create() { global $conf, $user, $langs; @@ -203,7 +203,7 @@ class BookKeeping { // first check if line not yet in bookkeeping $sql = "SELECT count(*)"; - $sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping "; $sql .= " WHERE doc_type = '" . $this->doc_type . "'"; $sql .= " AND fk_docdet = " . $this->fk_docdet; $sql .= " AND numero_compte = '" . $this->numero_compte . "'"; @@ -217,7 +217,7 @@ class BookKeeping { // Determine piece_num $sqlnum = "SELECT piece_num"; - $sqlnum .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; + $sqlnum .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping "; $sqlnum .= " WHERE doc_type = '" . $this->doc_type . "'"; $sqlnum .= " AND fk_docdet = '" . $this->fk_docdet . "'"; $sqlnum .= " AND doc_ref = '" . $this->doc_ref . "'"; @@ -231,7 +231,7 @@ class BookKeeping { dol_syslog(get_class($this) . ":: create this->piece_num=" . $this->piece_num, LOG_DEBUG); if (empty($this->piece_num)) { $sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum"; - $sqlnum .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; + $sqlnum .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping "; dol_syslog(get_class($this) . ":: create sqlnum=" . $sqlnum, LOG_DEBUG); $resqlnum = $this->db->query($sqlnum); @@ -249,7 +249,7 @@ class BookKeeping { if (empty($this->date_create)) $this->date_create = $now(); - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "bookkeeping (doc_date, "; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping (doc_date, "; $sql .= "doc_type, doc_ref,fk_doc,fk_docdet,code_tiers,numero_compte,label_compte,"; $sql .= "debit,credit,montant,sens,fk_user_author,import_key,code_journal,piece_num)"; $sql .= " VALUES ('" . $this->doc_date . "','" . $this->doc_type . "','" . $this->doc_ref . "'," . $this->fk_doc . ","; @@ -260,7 +260,7 @@ class BookKeeping { dol_syslog(get_class($this) . ":: create sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX . "bookkeeping"); + $id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_bookkeeping"); if ($id > 0) { $this->id = $id; @@ -293,7 +293,7 @@ class BookKeeping { // first check if line not yet in bookkeeping $sql = "DELETE"; - $sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping "; $sql .= " WHERE import_key = '" . $importkey . "'"; $resql = $this->db->query($sql); @@ -364,7 +364,7 @@ class BookKeeping { // Put here code to add control on parameters values // Insert request - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "bookkeeping("; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping("; $sql .= "doc_date,"; $sql .= "doc_type,"; @@ -414,7 +414,7 @@ class BookKeeping { } if (! $error) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "bookkeeping"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_bookkeeping"); if (! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you @@ -491,7 +491,7 @@ class BookKeeping { // Put here code to add a control on parameters values // Update request - $sql = "UPDATE " . MAIN_DB_PREFIX . "bookkeeping SET"; + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping SET"; $sql .= " doc_date=" . (dol_strlen($this->doc_date) != 0 ? "'" . $this->db->idate($this->doc_date) . "'" : 'null') . ","; $sql .= " doc_type=" . (isset($this->doc_type) ? "'" . $this->db->escape($this->doc_type) . "'" : "null") . ","; @@ -577,7 +577,7 @@ class BookKeeping { } if (! $error) { - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "bookkeeping"; + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping"; $sql .= " WHERE rowid=" . $this->id; dol_syslog(get_class($this) . "::delete sql=" . $sql); @@ -610,7 +610,7 @@ class BookKeeping { $sql .= "doc_ref, fk_doc, fk_docdet, code_tiers, "; $sql .= "numero_compte, label_compte, debit, credit, "; $sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num "; - $sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping "; $resql = $this->db->query($sql); diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php index 16aeb01dd02..d6f5ce17404 100644 --- a/htdocs/accountancy/class/html.formventilation.class.php +++ b/htdocs/accountancy/class/html.formventilation.class.php @@ -18,8 +18,9 @@ */ /** - * \file accountingex/class/html.formventilation.class.php - * \brief Class for HML form + * \file htdocs/accountancy/class/html.formventilation.class.php + * \ingroup Accounting Expert + * \brief Class for HML form */ class FormVentilation extends Form { var $db; @@ -47,7 +48,7 @@ class FormVentilation extends Form { $date_array = array (); - $sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'bookkeeping '; + $sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping'; $sql .= ' ORDER BY import_key DESC'; $out = '<SELECT name="' . $htmlname . '">'; diff --git a/htdocs/accountancy/customer/fiche.php b/htdocs/accountancy/customer/card.php similarity index 85% rename from htdocs/accountancy/customer/fiche.php rename to htdocs/accountancy/customer/card.php index 4cb05ccb019..3aac6f61da6 100644 --- a/htdocs/accountancy/customer/fiche.php +++ b/htdocs/accountancy/customer/card.php @@ -1,7 +1,7 @@ <?PHP -/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com> +/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> - * Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@fidurex.fr> + * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * * 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 @@ -18,9 +18,9 @@ */ /** - * \file accountingex/customer/fiche.php - * \ingroup Accounting Expert - * \brief Page fiche ventilation + * \file htdocs/accountancy/customer/card.php + * \ingroup Accounting Expert + * \brief Card customer ventilation */ // Dolibarr environment @@ -36,11 +36,11 @@ if (! $res) // Class dol_include_once("/compta/facture/class/facture.class.php"); -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); // Langs $langs->load("bills"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $action = GETPOST('action', 'alpha'); $codeventil = GETPOST('codeventil'); @@ -49,19 +49,19 @@ $id = GETPOST('id'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accountingex->access) +if (! $user->rights->accounting->access) accessforbidden(); - /* +/* * Actions */ -if ($action == 'ventil' && $user->rights->accountingex->access) { +if ($action == 'ventil' && $user->rights->accounting->access) { $sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet"; $sql .= " SET fk_code_ventilation = " . $codeventil; $sql .= " WHERE rowid = " . $id; - dol_syslog("/accountingex/customer/fiche.php sql=" . $sql, LOG_DEBUG); + dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { setEventMessage($db->lasterror(), 'errors'); @@ -95,14 +95,14 @@ if (! empty($id)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; } - dol_syslog("/accountingex/customer/fiche.php sql=" . $sql, LOG_DEBUG); + dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { - $num_lignes = $db->num_rows($result); + $num_lines = $db->num_rows($result); $i = 0; - if ($num_lignes) { + if ($num_lines) { $objp = $db->fetch_object($result); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 55287abef4d..4a6b5dc4fc6 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -19,7 +19,7 @@ */ /** - * \file accountingex/customer/index.php + * \file htdocs/accountancy/customer/index.php * \ingroup Accounting Expert * \brief Page accueil clients ventilation comptable */ @@ -42,12 +42,12 @@ $langs->load("compta"); $langs->load("bills"); $langs->load("other"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accountingex->access) +if (! $user->rights->accounting->access) accessforbidden(); // Filter @@ -82,7 +82,7 @@ if ($action == 'validatehistory') { $sql1 .= " AND fd.fk_code_ventilation = 0"; } - dol_syslog("/accountingex/customer/index.php sql=" . $sql, LOG_DEBUG); + dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG); $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -112,7 +112,7 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f"; $sql .= " WHERE fd.fk_code_ventilation = 0"; $sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;"; -dol_syslog("/accountingex/customer/index.php sql=" . $sql, LOG_DEBUG); +dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { $row = $db->fetch_row($result); @@ -168,7 +168,7 @@ if (! empty($conf->multicompany->enabled)) { $sql .= " GROUP BY fd.fk_code_ventilation"; -dol_syslog("/accountingex/customer/index.php sql=" . $sql, LOG_DEBUG); +dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $i = 0; @@ -197,7 +197,7 @@ if ($resql) { } $db->free($resql); } else { - print $db->lasterror(); // affiche la derniere erreur sql + print $db->lasterror(); // Show last sql error } print "</table>\n"; @@ -241,7 +241,7 @@ if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; } -dol_syslog('accountingext/customer/index.php:: $sql=' . $sql); +dol_syslog('accountancy/customer/index.php:: $sql=' . $sql); $resql = $db->query($sql); if ($resql) { $i = 0; @@ -269,7 +269,7 @@ if ($resql) { } $db->free($resql); } else { - print $db->lasterror(); // affiche la derniere erreur sql + print $db->lasterror(); // Show last sql error } print "</table>\n"; @@ -314,7 +314,7 @@ if (! empty($conf->margin->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; } - dol_syslog('accountingext/customer/index.php:: $sql=' . $sql); + dol_syslog('accountancy/customer/index.php:: $sql=' . $sql); $resql = $db->query($sql); if ($resql) { $i = 0; @@ -342,7 +342,7 @@ if (! empty($conf->margin->enabled)) { } $db->free($resql); } else { - print $db->lasterror(); // affiche la derniere erreur sql + print $db->lasterror(); // Show last sql error } print "</table>\n"; } diff --git a/htdocs/accountancy/customer/lignes.php b/htdocs/accountancy/customer/lines.php similarity index 90% rename from htdocs/accountancy/customer/lignes.php rename to htdocs/accountancy/customer/lines.php index c0929f1fed5..8c3a590b4b5 100644 --- a/htdocs/accountancy/customer/lignes.php +++ b/htdocs/accountancy/customer/lines.php @@ -20,7 +20,7 @@ */ /** - * \file accountingex/customer/lignes.php + * \file htdocs/accountancy/customer/lines.php * \ingroup Accounting Expert * \brief Page of detail of the lines of ventilation of invoices customers */ @@ -37,7 +37,7 @@ if (! $res) die("Include of main fails"); // Class -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); dol_include_once("/compta/facture/class/facture.class.php"); dol_include_once("/product/class/product.class.php"); @@ -45,14 +45,14 @@ dol_include_once("/product/class/product.class.php"); $langs->load("bills"); $langs->load("compta"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $account_parent = GETPOST('account_parent'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accountingex->access) +if (! $user->rights->accountancy->access) accessforbidden(); $formventilation = new FormVentilation($db); @@ -72,7 +72,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search)) $sql1 .= " SET l.fk_code_ventilation=" . $account_parent; $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; - dol_syslog('accountingex/customer/lignes.php::changeaccount sql= ' . $sql1); + dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1); $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -97,9 +97,9 @@ $page = GETPOST("page"); if ($page < 0) $page = 0; -if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { - $limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; -} elseif ($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION <= 0) { +if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; +} elseif ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { $limit = $conf->liste_limit; } else { $limit = $conf->liste_limit; @@ -136,19 +136,19 @@ if (! empty($conf->multicompany->enabled)) { } $sql .= " ORDER BY l.rowid"; -if ($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE > 0) { +if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) { $sql .= " DESC "; } $sql .= $db->plimit($limit + 1, $offset); -dol_syslog("/accountingex/customer/linges.php sql=" . $sql, LOG_DEBUG); +dol_syslog("/accountancy/customer/linges.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { - $num_lignes = $db->num_rows($result); + $num_lines = $db->num_rows($result); $i = 0; // TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... - print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lignes); + print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); print '<td align="left"><b>' . $langs->trans("DescVentilDoneCustomer") . '</b></td>'; @@ -213,7 +213,7 @@ if ($result) { print '<td align="left">' . price($objp->total_ht) . '</td>'; print '<td align="left">' . $codeCompta . '</td>'; print '<td>' . $objp->rowid . '</td>'; - print '<td><a href="./fiche.php?id=' . $objp->rowid . '">'; + print '<td><a href="./card.php?id=' . $objp->rowid . '">'; print img_edit(); print '</a></td>'; diff --git a/htdocs/accountancy/customer/liste.php b/htdocs/accountancy/customer/list.php similarity index 90% rename from htdocs/accountancy/customer/liste.php rename to htdocs/accountancy/customer/list.php index f0363918b0a..1cf8d672f11 100644 --- a/htdocs/accountancy/customer/liste.php +++ b/htdocs/accountancy/customer/list.php @@ -19,9 +19,9 @@ */ /** - * \file accountingex/customer/liste.php - * \ingroup Accounting Expert - * \brief Page de ventilation des lignes de facture clients + * \file htdocs/accountancy/customer/list.php + * \ingroup Accounting Expert + * \brief Ventilation page from customers invoices */ // Dolibarr environment @@ -38,13 +38,13 @@ if (! $res) // Class dol_include_once("/compta/facture/class/facture.class.php"); dol_include_once("/product/class/product.class.php"); -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); // Langs $langs->load("compta"); $langs->load("bills"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $action = GETPOST('action'); $codeventil = GETPOST('codeventil', 'array'); @@ -53,7 +53,7 @@ $mesCasesCochees = GETPOST('mesCasesCochees', 'array'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accountingex->access) +if (! $user->rights->accounting->access) accessforbidden(); $formventilation = new FormVentilation($db); @@ -81,7 +81,7 @@ if ($action == 'ventil') { $sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " WHERE rowid = " . $monId; - dol_syslog("/accountingex/customer/liste.php sql=" . $sql, LOG_DEBUG); + dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG); if ($db->query($sql)) { print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>'; } else { @@ -103,9 +103,9 @@ $page = GETPOST('page'); if ($page < 0) $page = 0; -if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { - $limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; -} else if ($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION <= 0) { +if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; +} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { $limit = $conf->liste_limit; } else { $limit = $conf->liste_limit; @@ -127,19 +127,19 @@ if (! empty($conf->multicompany->enabled)) { } $sql .= " ORDER BY l.rowid"; -if ($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO > 0) { +if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) { $sql .= " DESC "; } $sql .= $db->plimit($limit + 1, $offset); -dol_syslog("/accountingex/customer/liste.php sql=" . $sql, LOG_DEBUG); +dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { - $num_lignes = $db->num_rows($result); + $num_lines = $db->num_rows($result); $i = 0; // TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... - print_barre_liste($langs->trans("InvoiceLines"), $page, "liste.php", "", $sortfield, $sortorder, '', $num_lignes); + print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>'; @@ -162,7 +162,7 @@ if ($result) { $form = new Form($db); $var = True; - while ( $i < min($num_lignes, $limit) ) { + while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); $var = ! $var; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 493aa24b5ea..6444c8d5fbe 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -23,7 +23,7 @@ */ /** - * \file accountingex/journal/bankjournal.php + * \file htdocs/accountancy/journal/bankjournal.php * \ingroup Accounting Expert * \brief Page with sells journal */ @@ -52,7 +52,7 @@ dol_include_once("/compta/tva/class/tva.class.php"); dol_include_once("/fourn/class/paiementfourn.class.php"); dol_include_once("/fourn/class/fournisseur.facture.class.php"); dol_include_once("/fourn/class/fournisseur.class.php"); -dol_include_once("/accountingex/class/bookkeeping.class.php"); +dol_include_once("/accountancy/class/bookkeeping.class.php"); dol_include_once("/societe/class/client.class.php"); // Langs @@ -61,7 +61,7 @@ $langs->load("other"); $langs->load("compta"); $langs->load("bank"); $langs->load('bills'); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $date_startmonth = GETPOST('date_startmonth'); $date_startday = GETPOST('date_startday'); @@ -123,7 +123,7 @@ $societestatic = new Societe($db); $chargestatic = new ChargeSociales($db); $paymentvatstatic = new TVA($db); -dol_syslog("accountingex/journal/bankjournal.php:: sql=" . $sql, LOG_DEBUG); +dol_syslog("accountancy/journal/bankjournal.php:: sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -131,8 +131,8 @@ if ($result) { // Variables $cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); $cptcli = (! empty($conf->global->COMPTA_ACCOUNT_CUSTOMER) ? $conf->global->COMPTA_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef")); - $cpttva = (! empty($conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); - $cptsociale = (! empty($conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); + $cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); + $cptsociale = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); $tabpay = array (); $tabbq = array (); @@ -155,7 +155,7 @@ if ($result) { if ($obj->label == '(CustomerInvoicePayment)') $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli); if ($obj->typeop == '(BankTransfert)') - $compta_soc = $conf->global->ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH; + $compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH; // Variable bookkeeping $tabpay[$obj->rowid]["date"] = $obj->do; @@ -209,7 +209,7 @@ if ($result) { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid"; $sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid; - dol_syslog("accountingex/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -263,7 +263,7 @@ if ($action == 'writeBookKeeping') { $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt < 0 ? price - ($mt) : 0); - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_BANK_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL; if ($tabtype[$key] == 'payment') { @@ -272,7 +272,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid"; $sqlmid .= " WHERE pay.fk_bank=" . $key; - dol_syslog("accountingex/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -285,7 +285,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid"; $sqlmid .= " WHERE payf.fk_bank=" . $key; - dol_syslog("accountingex/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -313,7 +313,7 @@ if ($action == 'writeBookKeeping') { $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt < 0 ? price - ($mt) : 0); $bookkeeping->credit = ($mt >= 0) ? $mt : 0; - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_BANK_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL; if ($tabtype[$key] == 'sc') { $bookkeeping->code_tiers = ''; @@ -325,7 +325,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid"; $sqlmid .= " WHERE pay.fk_bank=" . $key; - dol_syslog("accountingex/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -340,7 +340,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid"; $sqlmid .= " WHERE payf.fk_bank=" . $key; - dol_syslog("accountingex/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -355,7 +355,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid"; $sqlmid .= " WHERE pay.fk_bank=" . $key; - dol_syslog("accountingex/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -383,14 +383,14 @@ if ($action == 'writeBookKeeping') { } // export csv if ($action == 'export_csv') { - $sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV; + $sep = $conf->global->ACCOUNTING_SEPARATORCSV; header('Content-Type: text/csv'); header('Content-Disposition: attachment;filename=journal_banque.csv'); $companystatic = new Client($db); - if ($conf->global->ACCOUNTINGEX_MODELCSV == 1) // Modèle Export Cegid Expert + if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert { foreach ( $tabpay as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); @@ -400,7 +400,7 @@ if ($action == 'export_csv') { // Bank print $date . $sep; - print $conf->global->ACCOUNTINGEX_BANK_JOURNAL . $sep; + print $conf->global->ACCOUNTING_BANK_JOURNAL . $sep; foreach ( $tabbq[$key] as $k => $mt ) { print length_accountg(html_entity_decode($k)) . $sep; print $sep; @@ -415,7 +415,7 @@ if ($action == 'export_csv') { foreach ( $tabtp[$key] as $k => $mt ) { if ($mt) { print $date . $sep; - print $conf->global->ACCOUNTINGEX_BANK_JOURNAL . $sep; + print $conf->global->ACCOUNTING_BANK_JOURNAL . $sep; if ($val["lib"] == '(SupplierInvoicePayment)') { print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; } else { diff --git a/htdocs/accountancy/journal/cashjournal.php b/htdocs/accountancy/journal/cashjournal.php index c5e0b74543d..0abd1c95cd3 100644 --- a/htdocs/accountancy/journal/cashjournal.php +++ b/htdocs/accountancy/journal/cashjournal.php @@ -23,9 +23,9 @@ */ /** - * \file accountingex/journal/cashjournal.php - * \ingroup Accounting Expert - * \brief Page with cash journal + * \file htdocs/accountancy/journal/cashjournal.php + * \ingroup Accounting Expert + * \brief Page with cash journal */ // Dolibarr environment @@ -52,14 +52,14 @@ dol_include_once("/compta/tva/class/tva.class.php"); dol_include_once("/fourn/class/paiementfourn.class.php"); dol_include_once("/fourn/class/fournisseur.facture.class.php"); dol_include_once("/fourn/class/fournisseur.class.php"); -dol_include_once("/accountingex/class/bookkeeping.class.php"); +dol_include_once("/accountancy/class/bookkeeping.class.php"); // Langs $langs->load("companies"); $langs->load("other"); $langs->load("compta"); $langs->load("bank"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $date_startmonth = GETPOST('date_startmonth'); $date_startday = GETPOST('date_startday'); @@ -124,7 +124,7 @@ $societestatic = new Societe($db); $chargestatic = new ChargeSociales($db); $paymentvatstatic = new TVA($db); -dol_syslog("accountingex/journal/cashjournal.php:: sql=" . $sql, LOG_DEBUG); +dol_syslog("accountancy/journal/cashjournal.php:: sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -132,8 +132,8 @@ if ($result) { // les variables $cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); $cptcli = (! empty($conf->global->COMPTA_ACCOUNT_CUSTOMER) ? $conf->global->COMPTA_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef")); - $cpttva = (! empty($conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); - $cptsociale = (! empty($conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); + $cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); + $cptsociale = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); $tabpay = array (); $tabbq = array (); @@ -152,7 +152,7 @@ if ($result) { if ($obj->label == '(CustomerInvoicePayment)') $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli); if ($obj->typeop == '(BankTransfert)') - $compta_soc = $conf->global->ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH; + $compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH; // variable bookkeeping @@ -205,7 +205,7 @@ if ($result) { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid"; $sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid; - dol_syslog("accountingex/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -258,7 +258,7 @@ if ($action == 'writeBookKeeping') { $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt < 0 ? price - ($mt) : 0); - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_CASH_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_CASH_JOURNAL; if ($tabtype[$key] == 'payment') { @@ -267,7 +267,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid"; $sqlmid .= " WHERE pay.fk_bank=" . $key; - dol_syslog("accountingex/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -280,7 +280,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid"; $sqlmid .= " WHERE payf.fk_bank=" . $key; - dol_syslog("accountingex/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -308,7 +308,7 @@ if ($action == 'writeBookKeeping') { $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt < 0 ? price - ($mt) : 0); $bookkeeping->credit = ($mt >= 0) ? $mt : 0; - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_CASH_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_CASH_JOURNAL; if ($tabtype[$key] == 'sc') { $bookkeeping->code_tiers = ''; @@ -320,7 +320,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid"; $sqlmid .= " WHERE pay.fk_bank=" . $key; - dol_syslog("accountingex/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -335,7 +335,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid"; $sqlmid .= " WHERE payf.fk_bank=" . $key; - dol_syslog("accountingex/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -350,7 +350,7 @@ if ($action == 'writeBookKeeping') { $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid"; $sqlmid .= " WHERE pay.fk_bank=" . $key; - dol_syslog("accountingex/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); + dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { $objmid = $db->fetch_object($resultmid); @@ -378,19 +378,19 @@ if ($action == 'writeBookKeeping') { } // export csv if ($action == 'export_csv') { - $sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV; + $sep = $conf->global->ACCOUNTING_SEPARATORCSV; header('Content-Type: text/csv'); header('Content-Disposition:attachment;filename=journal_caisse.csv'); - if ($conf->global->ACCOUNTINGEX_MODELCSV == 1) // Modèle Export Cegid Expert + if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert { foreach ( $tabpay as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); // Cash print $date . $sep; - print $conf->global->ACCOUNTINGEX_CASH_JOURNAL . $sep; + print $conf->global->ACCOUNTING_CASH_JOURNAL . $sep; foreach ( $tabbq[$key] as $k => $mt ) { print length_accountg(html_entity_decode($k)) . $sep; @@ -406,7 +406,7 @@ if ($action == 'export_csv') { foreach ( $tabtp[$key] as $k => $mt ) { if ($mt) { print $date . $sep; - print $conf->global->ACCOUNTINGEX_CASH_JOURNAL . $sep; + print $conf->global->ACCOUNTING_CASH_JOURNAL . $sep; if ($obj->label == '(SupplierInvoicePayment)') { print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; } else { diff --git a/htdocs/accountancy/journal/index.php b/htdocs/accountancy/journal/index.php index 74e53e4076b..254c98a9fb8 100644 --- a/htdocs/accountancy/journal/index.php +++ b/htdocs/accountancy/journal/index.php @@ -19,9 +19,9 @@ */ /** - * \file accountingex/journal/index.php - * \ingroup Accounting Expert - * \brief Index + * \file htdocs/accountancy/journal/index.php + * \ingroup Accounting Expert + * \brief Index */ // Dolibarr environment @@ -40,7 +40,7 @@ $langs->load("compta"); $langs->load("bills"); $langs->load("other"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); // Security check if ($user->societe_id > 0) @@ -54,5 +54,4 @@ $form = new Form($db); // End of page $db->close(); -llxFooter(); -?> \ No newline at end of file +llxFooter(); \ No newline at end of file diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 01dbc0a28c2..83f4fcbf88e 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -22,7 +22,7 @@ */ /** - * \file accountingex/journal/purchasesjournal.php + * \file htdocs/accountancy/journal/purchasesjournal.php * \ingroup Accounting Expert * \brief Page with purchases journal */ @@ -44,15 +44,15 @@ dol_include_once("/core/lib/date.lib.php"); require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; dol_include_once("/fourn/class/fournisseur.facture.class.php"); dol_include_once("/fourn/class/fournisseur.class.php"); -dol_include_once("/accountingex/class/bookkeeping.class.php"); -dol_include_once("/accountingex/class/accountingaccount.class.php"); +dol_include_once("/accountancy/class/bookkeeping.class.php"); +dol_include_once("/accountancy/class/accountingaccount.class.php"); // Langs $langs->load("compta"); $langs->load("bills"); $langs->load("other"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $date_startmonth = GETPOST('date_startmonth'); $date_startday = GETPOST('date_startday'); @@ -115,7 +115,7 @@ if ($date_start && $date_end) $sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'"; $sql .= " ORDER BY f.datef"; -dol_syslog('accountingex/journal/purchasesjournal.php:: $sql=' . $sql); +dol_syslog('accountancy/journal/purchasesjournal.php:: $sql=' . $sql); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -188,7 +188,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt > 0) ? $mt : 0; - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->create(); } @@ -213,7 +213,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0; - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->create(); } @@ -240,7 +240,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0; - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->create(); } @@ -251,12 +251,12 @@ if ($action == 'writebookkeeping') { // export csv if ($action == 'export_csv') { - $sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV; + $sep = $conf->global->ACCOUNTING_SEPARATORCSV; header('Content-Type: text/csv'); header('Content-Disposition: attachment;filename=journal_achats.csv'); - if ($conf->global->ACCOUNTINGEX_MODELCSV == 1) // Modèle Export Cegid Expert + if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert { foreach ( $tabfac as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); @@ -269,7 +269,7 @@ if ($action == 'export_csv') { if ($mt) { print $date . $sep; - print $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL . $sep; + print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep; print length_accountg(html_entity_decode($k)) . $sep; print $sep; print ($mt < 0 ? 'C' : 'D') . $sep; @@ -285,7 +285,7 @@ if ($action == 'export_csv') { foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { print $date . $sep; - print $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL . $sep; + print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep; print length_accountg(html_entity_decode($k)) . $sep; print $sep; print ($mt < 0 ? 'C' : 'D') . $sep; @@ -296,7 +296,7 @@ if ($action == 'export_csv') { } } print $date . $sep; - print $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL . $sep; + print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep; print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; foreach ( $tabttc[$key] as $k => $mt ) { diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index dd249db3b13..fc7b57509ac 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -23,7 +23,7 @@ */ /** - * \file accountingex/journal/sellsjournal.php + * \file htdocs/accountancy/journal/sellsjournal.php * \ingroup Accounting Expert * \brief Page with sells journal */ @@ -45,15 +45,15 @@ dol_include_once("/core/lib/date.lib.php"); require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; dol_include_once("/compta/facture/class/facture.class.php"); dol_include_once("/societe/class/client.class.php"); -dol_include_once("/accountingex/class/bookkeeping.class.php"); -dol_include_once("/accountingex/class/accountingaccount.class.php"); +dol_include_once("/accountancy/class/bookkeeping.class.php"); +dol_include_once("/accountancy/class/accountingaccount.class.php"); // Langs $langs->load("compta"); $langs->load("bills"); $langs->load("other"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $date_startmonth = GETPOST('date_startmonth'); $date_startday = GETPOST('date_startday'); @@ -119,7 +119,7 @@ if ($date_start && $date_end) $sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'"; $sql .= " ORDER BY f.datef"; -dol_syslog('accountingex/journal/sellsjournal.php:: $sql=' . $sql); +dol_syslog('accountancy/journal/sellsjournal.php:: $sql=' . $sql); $result = $db->query($sql); if ($result) { $tabfac = array (); @@ -130,7 +130,7 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - $resligne = array (); + while ( $i < $num ) { $obj = $db->fetch_object($result); // les variables @@ -147,7 +147,7 @@ if ($result) { $cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)) ? $conf->global->COMPTA_VAT_ACCOUNT : $langs->trans("CodeNotDef"); $compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva); - // la ligne facture + // Invoice lines $tabfac[$obj->rowid]["date"] = $obj->df; $tabfac[$obj->rowid]["ref"] = $obj->facnumber; $tabfac[$obj->rowid]["type"] = $obj->type; @@ -198,7 +198,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt < 0) ? $mt : 0; - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_SELL_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->create(); } @@ -223,7 +223,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0; - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_SELL_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->create(); } @@ -249,7 +249,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0; - $bookkeeping->code_journal = $conf->global->ACCOUNTINGEX_SELL_JOURNAL; + $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->create(); } @@ -258,14 +258,14 @@ if ($action == 'writebookkeeping') { } // export csv if ($action == 'export_csv') { - $sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV; + $sep = $conf->global->ACCOUNTING_SEPARATORCSV; header('Content-Type: text/csv'); header('Content-Disposition: attachment;filename=journal_ventes.csv'); $companystatic = new Client($db); - if ($conf->global->ACCOUNTINGEX_MODELCSV == 1) // Modèle Export Cegid Expert + if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert { foreach ( $tabfac as $key => $val ) { $companystatic->id = $tabcompany[$key]['id']; @@ -275,7 +275,7 @@ if ($action == 'export_csv') { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); print $date . $sep; - print $conf->global->ACCOUNTINGEX_SELL_JOURNAL . $sep; + print $conf->global->ACCOUNTING_SELL_JOURNAL . $sep; print length_accountg($conf->global->COMPTA_ACCOUNT_CUSTOMER) . $sep; foreach ( $tabttc[$key] as $k => $mt ) { print length_accounta(html_entity_decode($k)) . $sep; @@ -290,7 +290,7 @@ if ($action == 'export_csv') { foreach ( $tabht[$key] as $k => $mt ) { if ($mt) { print $date . $sep; - print $conf->global->ACCOUNTINGEX_SELL_JOURNAL . $sep; + print $conf->global->ACCOUNTING_SELL_JOURNAL . $sep; print length_accountg(html_entity_decode($k)) . $sep; print $sep; print ($mt < 0 ? 'D' : 'C') . $sep; @@ -304,7 +304,7 @@ if ($action == 'export_csv') { foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { print $date . $sep; - print $conf->global->ACCOUNTINGEX_SELL_JOURNAL . $sep; + print $conf->global->ACCOUNTING_SELL_JOURNAL . $sep; print length_accountg(html_entity_decode($k)) . $sep; print $sep; print ($mt < 0 ? 'D' : 'C') . $sep; diff --git a/htdocs/accountancy/supplier/fiche.php b/htdocs/accountancy/supplier/card.php similarity index 89% rename from htdocs/accountancy/supplier/fiche.php rename to htdocs/accountancy/supplier/card.php index 1ad626e136f..3aa7f9f430f 100644 --- a/htdocs/accountancy/supplier/fiche.php +++ b/htdocs/accountancy/supplier/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> - * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> + * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * * 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 @@ -20,9 +20,9 @@ * */ /** - * \file accountingex/supplier/fiche.php - * \ingroup Accountign Expert - * \brief Page fiche ventilation + * \file htdocs/accountancy/supplier/card.php + * \ingroup Accounting Expert + * \brief Card supplier ventilation */ // Dolibarr environment @@ -38,14 +38,14 @@ if (! $res) // Class dol_include_once("/fourn/class/fournisseur.facture.class.php"); -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); // Langs $langs->load("compta"); $langs->load("bills"); $langs->load("other"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $action = GETPOST('action'); $id = GETPOST('id', 'int'); @@ -54,15 +54,15 @@ $codeventil = GETPOST('codeventil'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accountingex->access) +if (! $user->rights->accounting->access) accessforbidden(); -if ($action == 'ventil' && $user->rights->accountingex->access) { +if ($action == 'ventil' && $user->rights->accounting->access) { $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sql .= " SET fk_code_ventilation = " . $codeventil; $sql .= " WHERE rowid = " . $id; - dol_syslog('accountingex/journal/sellsjournal.php:: $sql=' . $sql); + dol_syslog('accountancy/journal/sellsjournal.php:: $sql=' . $sql); $resql = $db->query($sql); if (! $resql) { @@ -101,10 +101,10 @@ if ($_GET["id"]) { $result = $db->query($sql); if ($result) { - $num_lignes = $db->num_rows($result); + $num_lines = $db->num_rows($result); $i = 0; - if ($num_lignes) { + if ($num_lines) { $objp = $db->fetch_object($result); print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '" method="post">' . "\n"; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a108415aa56..bb0aea5c8ea 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,8 +1,5 @@ <?php -/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> - * Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com> +/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * @@ -21,8 +18,8 @@ */ /** - * \file accountingex/supplier/index.php - * \ingroup Accounting Expert + * \file htdocs/accountancy/supplier/index.php + * \ingroup Accounting Expert * \brief Page accueil ventilation */ @@ -45,12 +42,12 @@ $langs->load("compta"); $langs->load("bills"); $langs->load("other"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accountingex->access) +if (! $user->rights->accounting->access) accessforbidden(); // Filter @@ -159,7 +156,7 @@ if (! empty($conf->multicompany->enabled)) { $sql .= " GROUP BY ffd.fk_code_ventilation"; -dol_syslog('/accountingex/supplier/index.php:: sql=' . $sql); +dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql); $resql = $db->query($sql); if ($resql) { $i = 0; @@ -189,7 +186,7 @@ if ($resql) { } $db->free($resql); } else { - print $db->lasterror(); // affiche la derniere erreur sql + print $db->lasterror(); // Show last sql error } print "</table>\n"; @@ -234,7 +231,7 @@ if (! empty($conf->multicompany->enabled)) { $sql .= " AND ff.entity = '" . $conf->entity . "'"; } -dol_syslog('/accountingex/supplier/index.php:: sql=' . $sql); +dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql); $resql = $db->query($sql); if ($resql) { $i = 0; @@ -264,7 +261,7 @@ if ($resql) { $db->free($resql); } else { - print $db->lasterror(); // show last sql error + print $db->lasterror(); // Show last sql error } print "</table>\n"; diff --git a/htdocs/accountancy/supplier/lignes.php b/htdocs/accountancy/supplier/lines.php similarity index 89% rename from htdocs/accountancy/supplier/lignes.php rename to htdocs/accountancy/supplier/lines.php index d3d47b6b371..1273ff8660c 100644 --- a/htdocs/accountancy/supplier/lignes.php +++ b/htdocs/accountancy/supplier/lines.php @@ -21,7 +21,7 @@ */ /** - * \file accountingex/supplier/lignes.php + * \file htdocs/accountancy/supplier/lines.php * \ingroup Accounting Expert * \brief Page of detail of the lines of ventilation of invoices suppliers */ @@ -38,7 +38,7 @@ if (! $res) die("Include of main fails"); // Class -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); dol_include_once("/fourn/class/fournisseur.facture.class.php"); dol_include_once("/product/class/product.class.php"); dol_include_once("/core/lib/date.lib.php"); @@ -48,7 +48,7 @@ $langs->load("compta"); $langs->load("bills"); $langs->load("other"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); // Security check if ($user->societe_id > 0) @@ -71,7 +71,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search)) $sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent'); $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; - dol_syslog('accountingex/supplier/lignes.php::changeaccount sql= ' . $sql1); + dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1); $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -96,9 +96,9 @@ $page = $_GET["page"]; if ($page < 0) $page = 0; -if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { - $limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; -} else if ($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION <= 0) { +if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; +} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { $limit = $conf->liste_limit; } else { $limit = $conf->liste_limit; @@ -134,24 +134,24 @@ if (! empty($conf->multicompany->enabled)) { } $sql .= " ORDER BY l.rowid"; -if ($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE > 0) { +if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) { $sql .= " DESC "; } $sql .= $db->plimit($limit + 1, $offset); -dol_syslog('accountingex/supplier/lignes.php::list sql= ' . $sql1); +dol_syslog('accountancy/supplier/lines.php::list sql= ' . $sql1); $result = $db->query($sql); if ($result) { - $num_lignes = $db->num_rows($result); + $num_lines = $db->num_rows($result); $i = 0; // TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... - print_barre_liste($langs->trans("InvoiceLinesDone"), $page, "lignes.php", "", $sortfield, $sortorder, '', $num_lignes); + print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); print '<td align="left"><b>' . $langs->trans("DescVentilDoneSupplier") . '</b></td>'; - print '<form method="GET" action="lignes.php">'; + print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">'; print '<table class="noborder" width="100%">'; print '<br><br><div class="inline-block divButAction">'. $langs->trans("ChangeAccount"); @@ -185,7 +185,7 @@ if ($result) { $product_static = new Product($db); $var = True; - while ( $i < min($num_lignes, $limit) ) { + while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); $var = ! $var; $codeCompta = $objp->account_number . ' ' . $objp->label; @@ -213,7 +213,7 @@ if ($result) { print '<td align="left">' . price($objp->total_ht) . '</td>'; print '<td align="left">' . $codeCompta . '</td>'; print '<td>' . $objp->rowid . '</td>'; - print '<td><a href="./fiche.php?id=' . $objp->rowid . '">'; + print '<td><a href="./card.php?id=' . $objp->rowid . '">'; print img_edit(); print '</a></td>'; diff --git a/htdocs/accountancy/supplier/liste.php b/htdocs/accountancy/supplier/list.php similarity index 88% rename from htdocs/accountancy/supplier/liste.php rename to htdocs/accountancy/supplier/list.php index cbb7e06dab0..de6914b1fdc 100644 --- a/htdocs/accountancy/supplier/liste.php +++ b/htdocs/accountancy/supplier/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> - * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> + * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * * 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 @@ -19,9 +19,9 @@ */ /** - * \file accountingex/supplier/liste.php - * \ingroup Accounting Expert - * \brief Page de ventilation des lignes de facture + * \file htdocs/accountancy/supplier/list.php + * \ingroup Accounting Expert + * \brief Page de ventilation des lignes de facture */ // Dolibarr environment @@ -38,14 +38,14 @@ if (! $res) // Class dol_include_once("/fourn/class/fournisseur.facture.class.php"); dol_include_once("/fourn/class/fournisseur.product.class.php"); -dol_include_once("/accountingex/class/html.formventilation.class.php"); +dol_include_once("/accountancy/class/html.formventilation.class.php"); // Langs $langs->load("compta"); $langs->load("bills"); $langs->load("other"); $langs->load("main"); -$langs->load("accountingex@accountingex"); +$langs->load("accountancy"); $action = GETPOST('action'); $codeventil = GETPOST('codeventil', 'array'); @@ -83,7 +83,7 @@ if ($action == 'ventil') { $sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " WHERE rowid = " . $monId; - dol_syslog('accountingext/supplier/liste.php:: sql=' . $sql); + dol_syslog('accountancy/supplier/list.php:: sql=' . $sql); if ($db->query($sql)) { print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>'; } else { @@ -106,9 +106,9 @@ $page = GETPOST('page'); if ($page < 0) $page = 0; -if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { - $limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; -} else if ($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION <= 0) { +if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; +} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { $limit = $conf->liste_limit; } else { $limit = $conf->liste_limit; @@ -129,23 +129,23 @@ if (! empty($conf->multicompany->enabled)) { } $sql .= " ORDER BY l.rowid"; -if ($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO > 0) { +if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) { $sql .= " DESC "; } $sql .= $db->plimit($limit + 1, $offset); -dol_syslog('accountingext/supplier/liste.php:: $sql=' . $sql); +dol_syslog('accountancy/supplier/list.php:: $sql=' . $sql); $result = $db->query($sql); if ($result) { - $num_lignes = $db->num_rows($result); + $num_lines = $db->num_rows($result); $i = 0; // TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... - print_barre_liste($langs->trans("InvoiceLines"), $page, "liste.php", "", $sortfield, $sortorder, '', $num_lignes); + print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); print '<td align="left"><br><b>' . $langs->trans("DescVentilTodoSupplier") . '</b></br></td>'; - print '<form action="liste.php" method="post">' . "\n"; + print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n"; print '<input type="hidden" name="action" value="ventil">'; print '<table class="noborder" width="100%">'; @@ -164,7 +164,7 @@ if ($result) { $form = new Form($db); $var = True; - while ( $i < min($num_lignes, $limit) ) { + while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); $var = ! $var; print "<tr $bc[$var]>"; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 28573c63677..11c3eb3f80b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -70,7 +70,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,25,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,23,0,26); +$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,23,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24); // Name of SQL tables of dictionaries $tabname=array(); @@ -96,10 +96,8 @@ $tabname[19]= MAIN_DB_PREFIX."c_effectif"; $tabname[20]= MAIN_DB_PREFIX."c_input_method"; $tabname[21]= MAIN_DB_PREFIX."c_availability"; $tabname[22]= MAIN_DB_PREFIX."c_input_reason"; -$tabname[23]= MAIN_DB_PREFIX."accountingaccount"; -$tabname[24]= MAIN_DB_PREFIX."accounting_system"; -$tabname[25]= MAIN_DB_PREFIX."c_revenuestamp"; -$tabname[26]= MAIN_DB_PREFIX."c_type_resource"; +$tabname[23]= MAIN_DB_PREFIX."c_revenuestamp"; +$tabname[24]= MAIN_DB_PREFIX."c_type_resource"; // Dictionary labels $tablib=array(); @@ -125,10 +123,8 @@ $tablib[19]= "DictionaryStaff"; $tablib[20]= "DictionaryOrderMethods"; $tablib[21]= "DictionaryAvailability"; $tablib[22]= "DictionarySource"; -$tablib[23]= "DictionaryAccountancyplan"; -$tablib[24]= "DictionaryAccountancysystem"; -$tablib[25]= "DictionaryRevenueStamp"; -$tablib[26]= "DictionaryResourceType"; +$tablib[23]= "DictionaryRevenueStamp"; +$tablib[24]= "DictionaryResourceType"; // Requests to extract data $tabsql=array(); @@ -154,10 +150,8 @@ $tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREF $tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_input_method"; $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c"; $tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; -$tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount"; -$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1"; -$tabsql[25]= "SELECT t.rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; -$tabsql[26]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; +$tabsql[23]= "SELECT t.rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; +$tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -183,10 +177,8 @@ $tabsqlsort[19]="id ASC"; $tabsqlsort[20]="code ASC, libelle ASC"; $tabsqlsort[21]="code ASC, label ASC"; $tabsqlsort[22]="code ASC, label ASC"; -$tabsqlsort[23]="fk_pcg_version ASC, accountancy_code ASC"; -$tabsqlsort[24]="pcg_version ASC"; -$tabsqlsort[25]="country ASC, taux ASC"; -$tabsqlsort[26]="code ASC,label ASC"; +$tabsqlsort[23]="country ASC, taux ASC"; +$tabsqlsort[24]="code ASC,label ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); @@ -212,10 +204,8 @@ $tabfield[19]= "code,libelle"; $tabfield[20]= "code,libelle"; $tabfield[21]= "code,label"; $tabfield[22]= "code,label"; -$tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; -$tabfield[24]= "pcg_version,country_id,country,label"; -$tabfield[25]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note"; -$tabfield[26]= "code,label"; +$tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note"; +$tabfield[24]= "code,label"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); @@ -241,10 +231,8 @@ $tabfieldvalue[19]= "code,libelle"; $tabfieldvalue[20]= "code,libelle"; $tabfieldvalue[21]= "code,label"; $tabfieldvalue[22]= "code,label"; -$tabfieldvalue[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; -$tabfieldvalue[24]= "pcg_version,country,label"; -$tabfieldvalue[25]= "country,taux,accountancy_code_sell,accountancy_code_buy,note"; -$tabfieldvalue[26]= "code,label"; +$tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note"; +$tabfieldvalue[24]= "code,label"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); @@ -270,10 +258,8 @@ $tabfieldinsert[19]= "code,libelle"; $tabfieldinsert[20]= "code,libelle"; $tabfieldinsert[21]= "code,label"; $tabfieldinsert[22]= "code,label"; -$tabfieldinsert[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label"; -$tabfieldinsert[24]= "pcg_version,fk_pays,label"; -$tabfieldinsert[25]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note"; -$tabfieldinsert[26]= "code,label"; +$tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note"; +$tabfieldinsert[24]= "code,label"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on @@ -302,9 +288,7 @@ $tabrowid[20]= ""; $tabrowid[21]= "rowid"; $tabrowid[22]= "rowid"; $tabrowid[23]= ""; -$tabrowid[24]= ""; -$tabrowid[25]= ""; -$tabrowid[25]= ""; +$tabrowid[23]= ""; // Condition to show dictionary in setup page $tabcond=array(); @@ -330,10 +314,8 @@ $tabcond[19]= ! empty($conf->societe->enabled); $tabcond[20]= ! empty($conf->fournisseur->enabled); $tabcond[21]= ! empty($conf->propal->enabled); $tabcond[22]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled)); -$tabcond[23]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy plan should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionary editor. -$tabcond[24]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy system should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionary editor. -$tabcond[25]= true; -$tabcond[26]= ! empty($conf->resource->enabled); +$tabcond[23]= true; +$tabcond[24]= ! empty($conf->resource->enabled); // List of help for fields $tabhelp=array(); @@ -361,8 +343,6 @@ $tabhelp[21] = array(); $tabhelp[22] = array(); $tabhelp[23] = array(); $tabhelp[24] = array(); -$tabhelp[25] = array(); -$tabhelp[26] = array(); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); @@ -390,8 +370,6 @@ $tabfieldcheck[21] = array(); $tabfieldcheck[22] = array(); $tabfieldcheck[23] = array(); $tabfieldcheck[24] = array(); -$tabfieldcheck[25] = array(); -$tabfieldcheck[26] = array(); // Complete all arrays with entries found into modules complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 7a83486f286..49d137a014f 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -204,20 +204,6 @@ class modAccounting extends DolibarrModules $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r ++; - $this->rights[$r][0] = 150002; // Permission id (must not be already used) - $this->rights[$r][1] = 'Administration_module'; // Permission label - $this->rights[$r][3] = 0; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'admin'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $r ++; - - $this->rights[$r][0] = 150010; // Permission id (must not be already used) - $this->rights[$r][1] = 'Développement'; // Permission label - $this->rights[$r][3] = 0; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'dev'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $r ++; - // Main menu entries $this->menus = array (); $r = 0; diff --git a/htdocs/langs/en_US/accounting.lang b/htdocs/langs/en_US/accountancy.lang similarity index 100% rename from htdocs/langs/en_US/accounting.lang rename to htdocs/langs/en_US/accountancy.lang diff --git a/htdocs/langs/es_ES/accounting.lang b/htdocs/langs/es_ES/accountancy.lang similarity index 100% rename from htdocs/langs/es_ES/accounting.lang rename to htdocs/langs/es_ES/accountancy.lang diff --git a/htdocs/langs/fr_FR/accounting.lang b/htdocs/langs/fr_FR/accountancy.lang similarity index 100% rename from htdocs/langs/fr_FR/accounting.lang rename to htdocs/langs/fr_FR/accountancy.lang -- GitLab