Update Accounting Expert integration

This commit is contained in:
aspangaro 2014-08-28 06:30:01 +02:00
parent 71265558d2
commit d03763f6c3
34 changed files with 354 additions and 409 deletions

View File

@ -17,7 +17,7 @@
*/ */
/** /**
* \file accountingex/admin/account.php * \file htdocs/accountancy/admin/account.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief List accounting account * \brief List accounting account
*/ */
@ -35,12 +35,12 @@ if (! $res)
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
dol_include_once("/accountingex/class/accountingaccount.class.php"); dol_include_once("/accountancy/class/accountingaccount.class.php");
dol_include_once("/accountingex/class/html.formventilation.class.php"); dol_include_once("/accountancy/class/html.formventilation.class.php");
// Langs // Langs
$langs->load("compta"); $langs->load("compta");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$mesg = ''; $mesg = '';
$action = GETPOST('action'); $action = GETPOST('action');
@ -48,10 +48,8 @@ $id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'int'); $rowid = GETPOST('rowid', 'int');
// Security check // Security check
if ($user->societe_id > 0) if (!$user->admin)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->admin)
accessforbidden();
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
@ -130,7 +128,7 @@ if (strlen(trim($_GET["search_pcgsubtype"]))) {
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($limit + 1, $offset); $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); $result = $db->query($sql);
if ($result) { if ($result) {
@ -144,7 +142,7 @@ if ($result) {
print '<br/>'; 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 '<a class="butAction" href="./importaccounts.php">' . $langs->trans("ImportAccount") . '</a>';
print '<br/><br/>'; print '<br/><br/>';
@ -178,7 +176,7 @@ if ($result) {
$var = ! $var; $var = ! $var;
print '<tr ' . $bc[$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->label . '</td>';
print '<td>' . $obj->account_parent . '</td>'; print '<td>' . $obj->account_parent . '</td>';
print '<td>' . $obj->pcg_type . '</td>'; print '<td>' . $obj->pcg_type . '</td>';
@ -197,10 +195,10 @@ if ($result) {
print '<td>'; print '<td>';
if ($user->rights->accountingex->admin) { 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 img_edit();
print '</a>&nbsp;'; print '</a>&nbsp;';
print '<a href="./fiche.php?action=delete&id=' . $obj->rowid . '">'; print '<a href="./card.php?action=delete&id=' . $obj->rowid . '">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
} }

View File

@ -18,9 +18,9 @@
*/ */
/** /**
* \file accountingex/admin/fiche.php * \file htdocs/accountancy/admin/card.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page fiche de compte * \brief Card accounting account
*/ */
$res = @include ("../main.inc.php"); $res = @include ("../main.inc.php");
if (! $res && file_exists("../main.inc.php")) if (! $res && file_exists("../main.inc.php"))
@ -34,12 +34,12 @@ if (! $res)
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
dol_include_once("/accountingex/class/accountingaccount.class.php"); dol_include_once("/accountancy/class/accountingaccount.class.php");
dol_include_once("/accountingex/class/html.formventilation.class.php"); dol_include_once("/accountancy/class/html.formventilation.class.php");
// Langs // Langs
$langs->load("bills"); $langs->load("bills");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$mesg = ''; $mesg = '';
$action = GETPOST('action'); $action = GETPOST('action');
@ -47,17 +47,16 @@ $id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'int'); $rowid = GETPOST('rowid', 'int');
// Security check // Security check
if ($user->societe_id > 0) if (!$user->admin)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->admin)
accessforbidden();
$accounting = new AccountingAccount($db); $accounting = new AccountingAccount($db);
// action // Action
if ($action == 'add') { if ($action == 'add') {
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; $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); $result = $db->query($sql);
$obj = $db->fetch_object($result); $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; $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); $result2 = $db->query($sql);
$obj = $db->fetch_object($result2); $obj = $db->fetch_object($result2);

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file htdocs/accountingex/admin/export.php * \file htdocs/accountancy/admin/export.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Setup page to configure accounting expert module * \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("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load('admin'); $langs->load("admin");
$langs->load('accountingex@accountingex'); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if (!$user->admin)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->admin)
accessforbidden();
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
// Other parameters ACCOUNTINGEX_* // Other parameters ACCOUNTING_*
$list = array ( $list = array (
'ACCOUNTINGEX_SEPARATORCSV' 'ACCOUNTING_SEPARATORCSV'
); );
/* /*
@ -67,7 +65,7 @@ if ($action == 'update') {
if (! empty($modelcsv)) { 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 ++; $error ++;
} }
} else { } else {
@ -121,12 +119,12 @@ print "<td>" . $langs->trans("Selectmodelcsv") . "</td>";
print "<td>"; print "<td>";
print '<select class="flat" name="modelcsv" id="modelcsv">'; print '<select class="flat" name="modelcsv" id="modelcsv">';
print '<option value="0"'; print '<option value="0"';
if ($conf->global->ACCOUNTINGEX_MODELCSV == 0) { if ($conf->global->ACCOUNTING_MODELCSV == 0) {
print ' selected="selected"'; print ' selected="selected"';
} }
print '>' . $langs->trans("Modelcsv_normal") . '</option>'; print '>' . $langs->trans("Modelcsv_normal") . '</option>';
print '<option value="1"'; print '<option value="1"';
if ($conf->global->ACCOUNTINGEX_MODELCSV == 1) { if ($conf->global->ACCOUNTING_MODELCSV == 1) {
print ' selected="selected"'; print ' selected="selected"';
} }
print '>' . $langs->trans("Modelcsv_CEGID") . '</option>'; print '>' . $langs->trans("Modelcsv_CEGID") . '</option>';
@ -141,7 +139,7 @@ print "<br>\n";
* *
*/ */
$list = array ( $list = array (
'ACCOUNTINGEX_SEPARATORCSV' 'ACCOUNTING_SEPARATORCSV'
); );
$num = count($list); $num = count($list);

View File

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * 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> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -21,9 +21,9 @@
*/ */
/** /**
* \file htdocs/compta/accountingex/liste.php * \file htdocs/accountancy/admin/importaccounts.php
* \ingroup compta * \ingroup Accounting Expert
* \brief Page IMPORT COMPTE COMPTABLE * \brief Page import accounting account
*/ */
$res = @include ("../main.inc.php"); $res = @include ("../main.inc.php");
if (! $res && file_exists("../main.inc.php")) if (! $res && file_exists("../main.inc.php"))
@ -37,20 +37,18 @@ if (! $res)
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
dol_include_once("/accountingex/class/accountingaccount.class.php"); dol_include_once("/accountancy/class/accountingaccount.class.php");
dol_include_once("/accountingex/class/html.formventilation.class.php"); dol_include_once("/accountancy/class/html.formventilation.class.php");
// langs // langs
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if (!$user->admin)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->admin)
accessforbidden();
llxHeader('', $langs->trans("ImportAccount")); llxHeader('', $langs->trans("ImportAccount"));
@ -109,7 +107,7 @@ if ($_POST["action"] == 'import') {
$page = GETPOST("page"); $page = GETPOST("page");
if ($page < 0) if ($page < 0)
$page = 0; $page = 0;
$limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
$offset = $limit * $page; $offset = $limit * $page;
$sql = "(SELECT p.rowid as product_id, p.accountancy_code_sell as accounting "; $sql = "(SELECT p.rowid as product_id, p.accountancy_code_sell as accounting ";
@ -124,12 +122,12 @@ $sql .= " GROUP BY accounting ";
$sql .= ") "; $sql .= ") ";
$sql .= " ORDER BY accounting DESC " . $db->plimit($limit + 1, $offset); $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); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lignes = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $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 '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>' . $langs->trans("accountingaccount") . '</td>'; print '<tr class="liste_titre"><td>' . $langs->trans("accountingaccount") . '</td>';
@ -143,11 +141,11 @@ if ($result) {
$form = new Form($db); $form = new Form($db);
$htmlacc = new FormVentilation($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">'; print '<input type="hidden" name="action" value="import">';
$var = True; $var = True;
while ( $i < min($num_lignes, $limit) ) { while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";

View File

@ -21,7 +21,7 @@
*/ */
/** /**
* \file htdocs/accountingex/admin/index.php * \file htdocs/accountancy/admin/index.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Setup page to configure accounting expert module * \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("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load('admin'); $langs->load("admin");
$langs->load('accountingex@accountingex'); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if (!$user->admin)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->admin)
accessforbidden();
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
// Other parameters COMPTA_* & ACCOUNTINGEX_* // Other parameters COMPTA_* & ACCOUNTING_*
$list = array ( $list = array (
'ACCOUNTINGEX_LIMIT_LIST_VENTILATION', 'ACCOUNTING_LIMIT_LIST_VENTILATION',
'ACCOUNTINGEX_LENGTH_GACCOUNT', 'ACCOUNTING_LENGTH_GACCOUNT',
'ACCOUNTINGEX_LENGTH_AACCOUNT', 'ACCOUNTING_LENGTH_AACCOUNT',
'COMPTA_ACCOUNT_CUSTOMER', 'COMPTA_ACCOUNT_CUSTOMER',
'COMPTA_ACCOUNT_SUPPLIER', 'COMPTA_ACCOUNT_SUPPLIER',
'COMPTA_PRODUCT_BUY_ACCOUNT', 'COMPTA_PRODUCT_BUY_ACCOUNT',
'COMPTA_PRODUCT_SOLD_ACCOUNT', 'COMPTA_PRODUCT_SOLD_ACCOUNT',
'COMPTA_SERVICE_BUY_ACCOUNT', 'COMPTA_SERVICE_BUY_ACCOUNT',
'COMPTA_SERVICE_SOLD_ACCOUNT', 'COMPTA_SERVICE_SOLD_ACCOUNT',
'ACCOUNTINGEX_ACCOUNT_SUSPENSE', 'ACCOUNTING_ACCOUNT_SUSPENSE',
'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH' 'ACCOUNTING_ACCOUNT_TRANSFER_CASH'
); );
/* /*
@ -126,7 +124,7 @@ if ($action == 'update')
if ($action == 'setlistsorttodo') { if ($action == 'setlistsorttodo') {
$setlistsorttodo = GETPOST('value', 'int'); $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) if (! $res > 0)
$error ++; $error ++;
@ -139,7 +137,7 @@ if ($action == 'setlistsorttodo') {
if ($action == 'setlistsortdone') { if ($action == 'setlistsortdone') {
$setlistsortdone = GETPOST('value', 'int'); $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) if (! $res > 0)
$error ++; $error ++;
if (! $error) { if (! $error) {
@ -217,7 +215,7 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system";
$sql .= " WHERE active = 1"; $sql .= " WHERE active = 1";
$sql .= " AND fk_pays = " . $mysoc->country_id; $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); $resql = $db->query($sql);
$var = True; $var = True;
@ -267,8 +265,8 @@ foreach ($list as $key)
} }
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
print '<td width="80%">' . $langs->trans("ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO") . '</td>'; print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
if (! empty($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO)) { 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 '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>'; print '</a></td>';
@ -280,8 +278,8 @@ if (! empty($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO)) {
print '</tr>'; print '</tr>';
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
print '<td width="80%">' . $langs->trans("ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE") . '</td>'; print '<td width="80%">' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
if (! empty($conf->global->ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE)) { 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 '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>'; print '</a></td>';

View File

@ -20,9 +20,9 @@
*/ */
/** /**
* \file htdocs/accountingex/admin/journaux.php * \file htdocs/accountancy/admin/journaux.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Setup page to configure accounting expert module * \brief Setup page to configure accounting expert module
*/ */
// Dolibarr environment // Dolibarr environment
@ -42,23 +42,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
dol_include_once("/core/lib/bank.lib.php"); dol_include_once("/core/lib/bank.lib.php");
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load('accountingex@accountingex'); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if (!$user->admin)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->admin)
accessforbidden();
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
// Other parameters ACCOUNTINGEX_* // Other parameters ACCOUNTING_*
$list = array ( $list = array (
'ACCOUNTINGEX_SELL_JOURNAL', 'ACCOUNTING_SELL_JOURNAL',
'ACCOUNTINGEX_PURCHASE_JOURNAL', 'ACCOUNTING_PURCHASE_JOURNAL',
'ACCOUNTINGEX_SOCIAL_JOURNAL', 'ACCOUNTING_SOCIAL_JOURNAL',
'ACCOUNTINGEX_CASH_JOURNAL', 'ACCOUNTING_CASH_JOURNAL',
'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL' 'ACCOUNTING_MISCELLANEOUS_JOURNAL'
); );
/* /*
@ -134,7 +132,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."lx_bank_account as ba";
$sql .= " WHERE ba.clos = 0" ; $sql .= " WHERE ba.clos = 0" ;
$sql .= " ORDER BY label"; $sql .= " ORDER BY label";
dol_syslog('accountingex/admin/journaux.php:: $sql='.$sql); dol_syslog('accountancy/admin/journaux.php:: $sql='.$sql);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
/* /*
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * 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> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -19,9 +19,9 @@
*/ */
/** /**
* \file accountingex/admin/productaccount.php * \file htdocs/accountancy/admin/productaccount.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Onglet de gestion de parametrages des ventilations * \brief Onglet de gestion de parametrages des ventilations
*/ */
// Dolibarr environment // Dolibarr environment
@ -43,13 +43,11 @@ dol_include_once("/product/class/product.class.php");
$langs->load("companies"); $langs->load("companies");
$langs->load("compta"); $langs->load("compta");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if (!$user->admin)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->admin)
accessforbidden();
llxHeader('', $langs->trans("Accounts")); 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 .= " 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"; $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);

View File

@ -18,9 +18,9 @@
*/ */
/** /**
* \file accountingex/admin/thirdpartyaccount.php * \file htdocs/accountancy/admin/thirdpartyaccount.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Onglet de gestion de parametrages des ventilations * \brief Onglet de gestion de parametrages des ventilations
*/ */
// Dolibarr environment // Dolibarr environment
@ -41,13 +41,11 @@ dol_include_once("/core/lib/date.lib.php");
$langs->load("companies"); $langs->load("companies");
$langs->load("compta"); $langs->load("compta");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if (!$user->admin)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->admin)
accessforbidden();
// Date range // Date range
$year = GETPOST("year"); $year = GETPOST("year");
@ -164,7 +162,7 @@ $sql .= ")";
$sql .= "ORDER BY name ASC"; $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);

View File

@ -19,9 +19,9 @@
*/ */
/** /**
* \file accountingex/bookkeeping/balancebymonth.php * \file htdocs/accountancy/bookkeeping/balancebymonth.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Balance by month * \brief Balance by month
*/ */
// Dolibarr environment // Dolibarr environment
@ -37,14 +37,14 @@ if (! $res)
// Class // Class
dol_include_once("/core/lib/date.lib.php"); 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
$langs->load("main"); $langs->load("main");
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
// Filter // Filter
$year = $_GET["year"]; $year = $_GET["year"];
@ -71,7 +71,7 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f";
$sql .= " WHERE fd.fk_code_ventilation = 0"; $sql .= " WHERE fd.fk_code_ventilation = 0";
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;"; $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); $result = $db->query($sql);
if ($result) { if ($result) {
$row = $db->fetch_row($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)=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(IF(MONTH(bk.doc_date)=12,bk.montant,0)),2) AS 'Decembre',";
$sql .= " ROUND(SUM(bk.montant),2) as 'Total'"; $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 .= " 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 .= " AND bk.doc_date <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " GROUP BY bk.numero_compte"; $sql .= " GROUP BY bk.numero_compte";

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* \file accountingex/bookkeeping/fiche.php * \file htdocs/accountancy/bookkeeping/card.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page to show account * \brief Page to show account
*/ */
@ -35,10 +35,10 @@ if (! $res)
die("Include of main fails"); die("Include of main fails");
// Class // Class
dol_include_once("accountingex/class/bookkeeping.class.php"); dol_include_once("accountancy/class/bookkeeping.class.php");
// Langs // Langs
$langs->load("accountingex@accountingex"); $langs->load("accounting");
// Security check // Security check
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -190,7 +190,6 @@ else if ($action == "confirm_create") {
llxHeader(); llxHeader();
$html = new Form($db); $html = new Form($db);
$nbligne = 0;
/* /*
* Confirmation to delete the command * Confirmation to delete the command
@ -205,16 +204,16 @@ if ($action == 'create') {
print_fiche_titre($langs->trans("CreateMvts")); print_fiche_titre($langs->trans("CreateMvts"));
$code_journal_array = array ( $code_journal_array = array (
$conf->global->ACCOUNTINGEX_SELL_JOURNAL => $conf->global->ACCOUNTINGEX_SELL_JOURNAL, $conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL,
$conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL => $conf->global->ACCOUNTINGEX_PURCHASE_JOURNAL, $conf->global->ACCOUNTING_PURCHASE_JOURNAL => $conf->global->ACCOUNTING_PURCHASE_JOURNAL,
$conf->global->ACCOUNTINGEX_BANK_JOURNAL => $conf->global->ACCOUNTINGEX_BANK_JOURNAL, $conf->global->ACCOUNTING_BANK_JOURNAL => $conf->global->ACCOUNTING_BANK_JOURNAL,
$conf->global->ACCOUNTINGEX_SOCIAL_JOURNAL => $conf->global->ACCOUNTINGEX_SOCIAL_JOURNAL $conf->global->ACCOUNTING_SOCIAL_JOURNAL => $conf->global->ACCOUNTING_SOCIAL_JOURNAL
); );
$book = new BookKeeping($db); $book = new BookKeeping($db);
$next_num_mvt = $book->next_num_mvt(); $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="action" value="confirm_create">' . "\n";
print '<input type="hidden" name="next_num_mvt" value="' . $next_num_mvt . '">' . "\n"; print '<input type="hidden" name="next_num_mvt" value="' . $next_num_mvt . '">' . "\n";
@ -337,10 +336,10 @@ if ($action == 'create') {
print '<td>'; print '<td>';
if ($user->rights->accoutingex->access) { 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 img_edit();
print '</a>&nbsp;'; print '</a>&nbsp;';
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 img_delete();
print '</a>'; print '</a>';
} }

View File

@ -19,8 +19,8 @@
*/ */
/** /**
* \file accountingex/bookkeeping/liste.php * \file htdocs/accountancy/bookkeeping/list.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief List operation of book keeping * \brief List operation of book keeping
*/ */
@ -36,8 +36,8 @@ if (! $res)
die("Include of main fails"); die("Include of main fails");
// Class // Class
dol_include_once("/accountingex/class/html.formventilation.class.php"); dol_include_once("/accountancy/class/html.formventilation.class.php");
dol_include_once("/accountingex/class/bookkeeping.class.php"); dol_include_once("/accountancy/class/bookkeeping.class.php");
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
$page = GETPOST("page"); $page = GETPOST("page");
@ -64,7 +64,7 @@ if ($action == 'delbookkeeping') {
if (! empty($import_key)) { if (! empty($import_key)) {
$object = new BookKeeping($db); $object = new BookKeeping($db);
$result = $object->delete_by_importkey($import_key); $result = $object->delete_by_importkey($import_key);
Header("Location: liste.php"); Header("Location: list.php");
if ($result < 0) { if ($result < 0) {
setEventMessage($object->errors, 'errors'); 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 = "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")))) { 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); $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $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 '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
@ -149,7 +149,7 @@ else {
print '</form>'; 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 '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
@ -174,7 +174,7 @@ else {
print "</tr>\n"; print "</tr>\n";
print '<tr class="liste_titre">'; 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><input type="text" name="search_doc_type" value="' . $_GET["search_doc_type"] . '"></td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td><input type="text" name="search_doc_ref" value="' . $_GET["search_doc_ref"] . '"></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 align="right">' . price($obj->montant) . '</td>';
print '<td>' . $obj->sens . '</td>'; print '<td>' . $obj->sens . '</td>';
print '<td>' . $obj->code_journal . '</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"; print "</tr>\n";
$i ++; $i ++;
} }

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file accountingex/bookkeeping/listebyyear.php * \file htdocs/accountancy/bookkeeping/listbyyear.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Book keeping by year * \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'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
// Langs // Langs
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$page = GETPOST("page"); $page = GETPOST("page");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder");
@ -65,8 +65,8 @@ $offset = $conf->liste_limit * $page;
llxHeader('', $langs->trans("Bookkeeping")); llxHeader('', $langs->trans("Bookkeeping"));
$textprevyear = "<a href=\"listebyyear.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>"; $textprevyear = "<a href=\"listbyyear.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>";
$textnextyear = " <a href=\"listebyyear.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>"; $textnextyear = " <a href=\"listbyyear.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>";
/* /*
* Mode Liste * 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 = "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 .= " 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 .= " 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); $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
@ -122,7 +122,7 @@ if ($resql) {
print '<td align="right">' . price($obj->montant) . '</td>'; print '<td align="right">' . price($obj->montant) . '</td>';
print '<td>' . $obj->sens . '</td>'; print '<td>' . $obj->sens . '</td>';
print '<td>' . $obj->code_journal . '</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"; print "</tr>\n";
$i ++; $i ++;

View File

@ -18,9 +18,9 @@
*/ */
/** /**
* \file accountingex/class/accountancysystem.class.php * \file htdocs/accountancy/class/accountancysystem.class.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief File of class to manage accountancy systems * \brief File of class to manage accountancy systems
*/ */
/** /**

View File

@ -18,9 +18,9 @@
*/ */
/** /**
* \file accountingex/class/Accountingaccount.class.php * \file htdocs/accountancy/class/Accountingaccount.class.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Fichier de la classe des comptes comptable * \brief Fichier de la classe des comptes comptable
*/ */
/** /**

View File

@ -19,9 +19,9 @@
*/ */
/** /**
* \file accountingex/class/bookkeeping.class.php * \file htdocs/accountancy/class/bookkeeping.class.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Fichier de la classe des comptes comptable * \brief Fichier de la classe des comptes comptable
*/ */
/** /**
@ -63,7 +63,7 @@ class BookKeeping {
* \brief Load record in memory * \brief Load record in memory
*/ */
function fetch_per_mvt($piecenum) { 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 . "'"; $sql .= " piece_num = '" . $piecenum . "'";
dol_syslog(get_class($this) . "fetch_per_mvt sql=" . $sql, LOG_DEBUG); 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 .= "doc_ref, fk_doc, fk_docdet, code_tiers, ";
$sql .= "numero_compte, label_compte, debit, credit, "; $sql .= "numero_compte, label_compte, debit, credit, ";
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num "; $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 . "'"; $sql .= " WHERE rowid = '" . $id . "'";
dol_syslog(get_class($this) . "fetch sql=" . $sql, LOG_DEBUG); dol_syslog(get_class($this) . "fetch sql=" . $sql, LOG_DEBUG);
@ -130,7 +130,7 @@ class BookKeeping {
* \brief Return next num mvt * \brief Return next num mvt
*/ */
function 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); dol_syslog(get_class($this) . "next_num_mvt sql=" . $sql, LOG_DEBUG);
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -153,7 +153,7 @@ class BookKeeping {
$sql .= "doc_ref, fk_doc, fk_docdet, code_tiers, "; $sql .= "doc_ref, fk_doc, fk_docdet, code_tiers, ";
$sql .= "numero_compte, label_compte, debit, credit, "; $sql .= "numero_compte, label_compte, debit, credit, ";
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num "; $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 . "'"; $sql .= " WHERE piece_num = '" . $piecenum . "'";
dol_syslog(get_class($this) . "fetch_all_per_mvt sql=" . $sql, LOG_DEBUG); 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 * \brief Insert line into bookkeeping
* \param user utilisateur qui effectue l'insertion * \param user User who inserted operation
*/ */
function create() { function create() {
global $conf, $user, $langs; global $conf, $user, $langs;
@ -203,7 +203,7 @@ class BookKeeping {
// first check if line not yet in bookkeeping // first check if line not yet in bookkeeping
$sql = "SELECT count(*)"; $sql = "SELECT count(*)";
$sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping ";
$sql .= " WHERE doc_type = '" . $this->doc_type . "'"; $sql .= " WHERE doc_type = '" . $this->doc_type . "'";
$sql .= " AND fk_docdet = " . $this->fk_docdet; $sql .= " AND fk_docdet = " . $this->fk_docdet;
$sql .= " AND numero_compte = '" . $this->numero_compte . "'"; $sql .= " AND numero_compte = '" . $this->numero_compte . "'";
@ -217,7 +217,7 @@ class BookKeeping {
// Determine piece_num // Determine piece_num
$sqlnum = "SELECT 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 .= " WHERE doc_type = '" . $this->doc_type . "'";
$sqlnum .= " AND fk_docdet = '" . $this->fk_docdet . "'"; $sqlnum .= " AND fk_docdet = '" . $this->fk_docdet . "'";
$sqlnum .= " AND doc_ref = '" . $this->doc_ref . "'"; $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); dol_syslog(get_class($this) . ":: create this->piece_num=" . $this->piece_num, LOG_DEBUG);
if (empty($this->piece_num)) { if (empty($this->piece_num)) {
$sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum"; $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); dol_syslog(get_class($this) . ":: create sqlnum=" . $sqlnum, LOG_DEBUG);
$resqlnum = $this->db->query($sqlnum); $resqlnum = $this->db->query($sqlnum);
@ -249,7 +249,7 @@ class BookKeeping {
if (empty($this->date_create)) if (empty($this->date_create))
$this->date_create = $now(); $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 .= "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 .= "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 . ","; $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); dol_syslog(get_class($this) . ":: create sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { 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) { if ($id > 0) {
$this->id = $id; $this->id = $id;
@ -293,7 +293,7 @@ class BookKeeping {
// first check if line not yet in bookkeeping // first check if line not yet in bookkeeping
$sql = "DELETE"; $sql = "DELETE";
$sql .= " FROM " . MAIN_DB_PREFIX . "bookkeeping "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping ";
$sql .= " WHERE import_key = '" . $importkey . "'"; $sql .= " WHERE import_key = '" . $importkey . "'";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -364,7 +364,7 @@ class BookKeeping {
// Put here code to add control on parameters values // Put here code to add control on parameters values
// Insert request // Insert request
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "bookkeeping("; $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping(";
$sql .= "doc_date,"; $sql .= "doc_date,";
$sql .= "doc_type,"; $sql .= "doc_type,";
@ -414,7 +414,7 @@ class BookKeeping {
} }
if (! $error) { 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) { if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you // 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 // Put here code to add a control on parameters values
// Update request // 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_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") . ","; $sql .= " doc_type=" . (isset($this->doc_type) ? "'" . $this->db->escape($this->doc_type) . "'" : "null") . ",";
@ -577,7 +577,7 @@ class BookKeeping {
} }
if (! $error) { if (! $error) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "bookkeeping"; $sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
$sql .= " WHERE rowid=" . $this->id; $sql .= " WHERE rowid=" . $this->id;
dol_syslog(get_class($this) . "::delete sql=" . $sql); dol_syslog(get_class($this) . "::delete sql=" . $sql);
@ -610,7 +610,7 @@ class BookKeeping {
$sql .= "doc_ref, fk_doc, fk_docdet, code_tiers, "; $sql .= "doc_ref, fk_doc, fk_docdet, code_tiers, ";
$sql .= "numero_compte, label_compte, debit, credit, "; $sql .= "numero_compte, label_compte, debit, credit, ";
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num "; $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); $resql = $this->db->query($sql);

View File

@ -18,8 +18,9 @@
*/ */
/** /**
* \file accountingex/class/html.formventilation.class.php * \file htdocs/accountancy/class/html.formventilation.class.php
* \brief Class for HML form * \ingroup Accounting Expert
* \brief Class for HML form
*/ */
class FormVentilation extends Form { class FormVentilation extends Form {
var $db; var $db;
@ -47,7 +48,7 @@ class FormVentilation extends Form {
$date_array = array (); $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'; $sql .= ' ORDER BY import_key DESC';
$out = '<SELECT name="' . $htmlname . '">'; $out = '<SELECT name="' . $htmlname . '">';

View File

@ -1,7 +1,7 @@
<?PHP <?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-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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -18,9 +18,9 @@
*/ */
/** /**
* \file accountingex/customer/fiche.php * \file htdocs/accountancy/customer/card.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page fiche ventilation * \brief Card customer ventilation
*/ */
// Dolibarr environment // Dolibarr environment
@ -36,11 +36,11 @@ if (! $res)
// Class // Class
dol_include_once("/compta/facture/class/facture.class.php"); 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
$langs->load("bills"); $langs->load("bills");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
$codeventil = GETPOST('codeventil'); $codeventil = GETPOST('codeventil');
@ -49,19 +49,19 @@ $id = GETPOST('id');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->access) if (! $user->rights->accounting->access)
accessforbidden(); accessforbidden();
/* /*
* Actions * Actions
*/ */
if ($action == 'ventil' && $user->rights->accountingex->access) { if ($action == 'ventil' && $user->rights->accounting->access) {
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet"; $sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql .= " SET fk_code_ventilation = " . $codeventil; $sql .= " SET fk_code_ventilation = " . $codeventil;
$sql .= " WHERE rowid = " . $id; $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); $resql = $db->query($sql);
if (! $resql) { if (! $resql) {
setEventMessage($db->lasterror(), 'errors'); setEventMessage($db->lasterror(), 'errors');
@ -95,14 +95,14 @@ if (! empty($id)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $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); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lignes = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
if ($num_lignes) { if ($num_lines) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file accountingex/customer/index.php * \file htdocs/accountancy/customer/index.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page accueil clients ventilation comptable * \brief Page accueil clients ventilation comptable
*/ */
@ -42,12 +42,12 @@ $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->access) if (! $user->rights->accounting->access)
accessforbidden(); accessforbidden();
// Filter // Filter
@ -82,7 +82,7 @@ if ($action == 'validatehistory') {
$sql1 .= " AND fd.fk_code_ventilation = 0"; $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); $resql1 = $db->query($sql1);
if (! $resql1) { if (! $resql1) {
$error ++; $error ++;
@ -112,7 +112,7 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f";
$sql .= " WHERE fd.fk_code_ventilation = 0"; $sql .= " WHERE fd.fk_code_ventilation = 0";
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;"; $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); $result = $db->query($sql);
if ($result) { if ($result) {
$row = $db->fetch_row($result); $row = $db->fetch_row($result);
@ -168,7 +168,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " GROUP BY fd.fk_code_ventilation"; $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$i = 0; $i = 0;
@ -197,7 +197,7 @@ if ($resql) {
} }
$db->free($resql); $db->free($resql);
} else { } else {
print $db->lasterror(); // affiche la derniere erreur sql print $db->lasterror(); // Show last sql error
} }
print "</table>\n"; print "</table>\n";
@ -241,7 +241,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$i = 0; $i = 0;
@ -269,7 +269,7 @@ if ($resql) {
} }
$db->free($resql); $db->free($resql);
} else { } else {
print $db->lasterror(); // affiche la derniere erreur sql print $db->lasterror(); // Show last sql error
} }
print "</table>\n"; print "</table>\n";
@ -314,7 +314,7 @@ if (! empty($conf->margin->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$i = 0; $i = 0;
@ -342,7 +342,7 @@ if (! empty($conf->margin->enabled)) {
} }
$db->free($resql); $db->free($resql);
} else { } else {
print $db->lasterror(); // affiche la derniere erreur sql print $db->lasterror(); // Show last sql error
} }
print "</table>\n"; print "</table>\n";
} }

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file accountingex/customer/lignes.php * \file htdocs/accountancy/customer/lines.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page of detail of the lines of ventilation of invoices customers * \brief Page of detail of the lines of ventilation of invoices customers
*/ */
@ -37,7 +37,7 @@ if (! $res)
die("Include of main fails"); die("Include of main fails");
// Class // 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("/compta/facture/class/facture.class.php");
dol_include_once("/product/class/product.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("bills");
$langs->load("compta"); $langs->load("compta");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$account_parent = GETPOST('account_parent'); $account_parent = GETPOST('account_parent');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->access) if (! $user->rights->accountancy->access)
accessforbidden(); accessforbidden();
$formventilation = new FormVentilation($db); $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 .= " SET l.fk_code_ventilation=" . $account_parent;
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; $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); $resql1 = $db->query($sql1);
if (! $resql1) { if (! $resql1) {
$error ++; $error ++;
@ -97,9 +97,9 @@ $page = GETPOST("page");
if ($page < 0) if ($page < 0)
$page = 0; $page = 0;
if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} elseif ($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION <= 0) { } elseif ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
@ -136,19 +136,19 @@ if (! empty($conf->multicompany->enabled)) {
} }
$sql .= " ORDER BY l.rowid"; $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 .= " DESC ";
} }
$sql .= $db->plimit($limit + 1, $offset); $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); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lignes = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... // 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>'; 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">' . price($objp->total_ht) . '</td>';
print '<td align="left">' . $codeCompta . '</td>'; print '<td align="left">' . $codeCompta . '</td>';
print '<td>' . $objp->rowid . '</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 img_edit();
print '</a></td>'; print '</a></td>';

View File

@ -19,9 +19,9 @@
*/ */
/** /**
* \file accountingex/customer/liste.php * \file htdocs/accountancy/customer/list.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page de ventilation des lignes de facture clients * \brief Ventilation page from customers invoices
*/ */
// Dolibarr environment // Dolibarr environment
@ -38,13 +38,13 @@ if (! $res)
// Class // Class
dol_include_once("/compta/facture/class/facture.class.php"); dol_include_once("/compta/facture/class/facture.class.php");
dol_include_once("/product/class/product.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
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$action = GETPOST('action'); $action = GETPOST('action');
$codeventil = GETPOST('codeventil', 'array'); $codeventil = GETPOST('codeventil', 'array');
@ -53,7 +53,7 @@ $mesCasesCochees = GETPOST('mesCasesCochees', 'array');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->access) if (! $user->rights->accounting->access)
accessforbidden(); accessforbidden();
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);
@ -81,7 +81,7 @@ if ($action == 'ventil') {
$sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " SET fk_code_ventilation = " . $monCompte;
$sql .= " WHERE rowid = " . $monId; $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)) { if ($db->query($sql)) {
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>'; print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
} else { } else {
@ -103,9 +103,9 @@ $page = GETPOST('page');
if ($page < 0) if ($page < 0)
$page = 0; $page = 0;
if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
@ -127,19 +127,19 @@ if (! empty($conf->multicompany->enabled)) {
} }
$sql .= " ORDER BY l.rowid"; $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 .= " DESC ";
} }
$sql .= $db->plimit($limit + 1, $offset); $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); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lignes = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... // 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>'; print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
@ -162,7 +162,7 @@ if ($result) {
$form = new Form($db); $form = new Form($db);
$var = True; $var = True;
while ( $i < min($num_lignes, $limit) ) { while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;

View File

@ -23,7 +23,7 @@
*/ */
/** /**
* \file accountingex/journal/bankjournal.php * \file htdocs/accountancy/journal/bankjournal.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page with sells journal * \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/paiementfourn.class.php");
dol_include_once("/fourn/class/fournisseur.facture.class.php"); dol_include_once("/fourn/class/fournisseur.facture.class.php");
dol_include_once("/fourn/class/fournisseur.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"); dol_include_once("/societe/class/client.class.php");
// Langs // Langs
@ -61,7 +61,7 @@ $langs->load("other");
$langs->load("compta"); $langs->load("compta");
$langs->load("bank"); $langs->load("bank");
$langs->load('bills'); $langs->load('bills');
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $date_startday = GETPOST('date_startday');
@ -123,7 +123,7 @@ $societestatic = new Societe($db);
$chargestatic = new ChargeSociales($db); $chargestatic = new ChargeSociales($db);
$paymentvatstatic = new TVA($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); $result = $db->query($sql);
if ($result) { if ($result) {
@ -131,8 +131,8 @@ if ($result) {
// Variables // Variables
$cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); $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")); $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")); $cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
$cptsociale = (! empty($conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); $cptsociale = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
$tabpay = array (); $tabpay = array ();
$tabbq = array (); $tabbq = array ();
@ -155,7 +155,7 @@ if ($result) {
if ($obj->label == '(CustomerInvoicePayment)') if ($obj->label == '(CustomerInvoicePayment)')
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli); $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli);
if ($obj->typeop == '(BankTransfert)') if ($obj->typeop == '(BankTransfert)')
$compta_soc = $conf->global->ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH; $compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH;
// Variable bookkeeping // Variable bookkeeping
$tabpay[$obj->rowid]["date"] = $obj->do; $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 .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($resultmid); $objmid = $db->fetch_object($resultmid);
@ -263,7 +263,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0) ? $mt : 0; $bookkeeping->debit = ($mt >= 0) ? $mt : 0;
$bookkeeping->credit = ($mt < 0 ? price - ($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') { 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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
$sqlmid .= " WHERE pay.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
$sqlmid .= " WHERE payf.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($resultmid); $objmid = $db->fetch_object($resultmid);
@ -313,7 +313,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0 ? price - ($mt) : 0); $bookkeeping->debit = ($mt < 0 ? price - ($mt) : 0);
$bookkeeping->credit = ($mt >= 0) ? $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') { if ($tabtype[$key] == 'sc') {
$bookkeeping->code_tiers = ''; $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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
$sqlmid .= " WHERE pay.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
$sqlmid .= " WHERE payf.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
$sqlmid .= " WHERE pay.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($resultmid); $objmid = $db->fetch_object($resultmid);
@ -383,14 +383,14 @@ if ($action == 'writeBookKeeping') {
} }
// export csv // export csv
if ($action == 'export_csv') { if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_banque.csv'); header('Content-Disposition: attachment;filename=journal_banque.csv');
$companystatic = new Client($db); $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 ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
@ -400,7 +400,7 @@ if ($action == 'export_csv') {
// Bank // Bank
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTINGEX_BANK_JOURNAL . $sep; print $conf->global->ACCOUNTING_BANK_JOURNAL . $sep;
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print length_accountg(html_entity_decode($k)) . $sep; print length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
@ -415,7 +415,7 @@ if ($action == 'export_csv') {
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTINGEX_BANK_JOURNAL . $sep; print $conf->global->ACCOUNTING_BANK_JOURNAL . $sep;
if ($val["lib"] == '(SupplierInvoicePayment)') { if ($val["lib"] == '(SupplierInvoicePayment)') {
print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep;
} else { } else {

View File

@ -23,9 +23,9 @@
*/ */
/** /**
* \file accountingex/journal/cashjournal.php * \file htdocs/accountancy/journal/cashjournal.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page with cash journal * \brief Page with cash journal
*/ */
// Dolibarr environment // 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/paiementfourn.class.php");
dol_include_once("/fourn/class/fournisseur.facture.class.php"); dol_include_once("/fourn/class/fournisseur.facture.class.php");
dol_include_once("/fourn/class/fournisseur.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
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("compta"); $langs->load("compta");
$langs->load("bank"); $langs->load("bank");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $date_startday = GETPOST('date_startday');
@ -124,7 +124,7 @@ $societestatic = new Societe($db);
$chargestatic = new ChargeSociales($db); $chargestatic = new ChargeSociales($db);
$paymentvatstatic = new TVA($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); $result = $db->query($sql);
if ($result) { if ($result) {
@ -132,8 +132,8 @@ if ($result) {
// les variables // les variables
$cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER) ? $conf->global->COMPTA_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); $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")); $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")); $cpttva = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
$cptsociale = (! empty($conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTINGEX_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef")); $cptsociale = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) ? $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE : $langs->trans("CodeNotDef"));
$tabpay = array (); $tabpay = array ();
$tabbq = array (); $tabbq = array ();
@ -152,7 +152,7 @@ if ($result) {
if ($obj->label == '(CustomerInvoicePayment)') if ($obj->label == '(CustomerInvoicePayment)')
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli); $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli);
if ($obj->typeop == '(BankTransfert)') if ($obj->typeop == '(BankTransfert)')
$compta_soc = $conf->global->ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH; $compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH;
// variable bookkeeping // 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 . "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 .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($resultmid); $objmid = $db->fetch_object($resultmid);
@ -258,7 +258,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0) ? $mt : 0; $bookkeeping->debit = ($mt >= 0) ? $mt : 0;
$bookkeeping->credit = ($mt < 0 ? price - ($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') { 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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
$sqlmid .= " WHERE pay.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
$sqlmid .= " WHERE payf.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($resultmid); $objmid = $db->fetch_object($resultmid);
@ -308,7 +308,7 @@ if ($action == 'writeBookKeeping') {
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0 ? price - ($mt) : 0); $bookkeeping->debit = ($mt < 0 ? price - ($mt) : 0);
$bookkeeping->credit = ($mt >= 0) ? $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') { if ($tabtype[$key] == 'sc') {
$bookkeeping->code_tiers = ''; $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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
$sqlmid .= " WHERE pay.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
$sqlmid .= " WHERE payf.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($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_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 .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
$sqlmid .= " WHERE pay.fk_bank=" . $key; $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); $resultmid = $db->query($sqlmid);
if ($resultmid) { if ($resultmid) {
$objmid = $db->fetch_object($resultmid); $objmid = $db->fetch_object($resultmid);
@ -378,19 +378,19 @@ if ($action == 'writeBookKeeping') {
} }
// export csv // export csv
if ($action == 'export_csv') { if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition:attachment;filename=journal_caisse.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 ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
// Cash // Cash
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTINGEX_CASH_JOURNAL . $sep; print $conf->global->ACCOUNTING_CASH_JOURNAL . $sep;
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print length_accountg(html_entity_decode($k)) . $sep; print length_accountg(html_entity_decode($k)) . $sep;
@ -406,7 +406,7 @@ if ($action == 'export_csv') {
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTINGEX_CASH_JOURNAL . $sep; print $conf->global->ACCOUNTING_CASH_JOURNAL . $sep;
if ($obj->label == '(SupplierInvoicePayment)') { if ($obj->label == '(SupplierInvoicePayment)') {
print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep; print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep;
} else { } else {

View File

@ -19,9 +19,9 @@
*/ */
/** /**
* \file accountingex/journal/index.php * \file htdocs/accountancy/journal/index.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Index * \brief Index
*/ */
// Dolibarr environment // Dolibarr environment
@ -40,7 +40,7 @@ $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
@ -54,5 +54,4 @@ $form = new Form($db);
// End of page // End of page
$db->close(); $db->close();
llxFooter(); llxFooter();
?>

View File

@ -22,7 +22,7 @@
*/ */
/** /**
* \file accountingex/journal/purchasesjournal.php * \file htdocs/accountancy/journal/purchasesjournal.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page with purchases journal * \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'; 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.facture.class.php");
dol_include_once("/fourn/class/fournisseur.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("/accountingex/class/accountingaccount.class.php"); dol_include_once("/accountancy/class/accountingaccount.class.php");
// Langs // Langs
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $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 .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
$sql .= " ORDER BY f.datef"; $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); $result = $db->query($sql);
if ($result) { if ($result) {
$num = $db->num_rows($result); $num = $db->num_rows($result);
@ -188,7 +188,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt <= 0) ? $mt : 0; $bookkeeping->debit = ($mt <= 0) ? $mt : 0;
$bookkeeping->credit = ($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(); $bookkeeping->create();
} }
@ -213,7 +213,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($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(); $bookkeeping->create();
} }
@ -240,7 +240,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($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(); $bookkeeping->create();
} }
@ -251,12 +251,12 @@ if ($action == 'writebookkeeping') {
// export csv // export csv
if ($action == 'export_csv') { if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_achats.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 ) { foreach ( $tabfac as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
@ -269,7 +269,7 @@ if ($action == 'export_csv') {
if ($mt) { if ($mt) {
print $date . $sep; 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 length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
@ -285,7 +285,7 @@ if ($action == 'export_csv') {
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; 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 length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
@ -296,7 +296,7 @@ if ($action == 'export_csv') {
} }
} }
print $date . $sep; 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; print length_accountg($conf->global->COMPTA_ACCOUNT_SUPPLIER) . $sep;
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {

View File

@ -23,7 +23,7 @@
*/ */
/** /**
* \file accountingex/journal/sellsjournal.php * \file htdocs/accountancy/journal/sellsjournal.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page with sells journal * \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'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
dol_include_once("/compta/facture/class/facture.class.php"); dol_include_once("/compta/facture/class/facture.class.php");
dol_include_once("/societe/class/client.class.php"); dol_include_once("/societe/class/client.class.php");
dol_include_once("/accountingex/class/bookkeeping.class.php"); dol_include_once("/accountancy/class/bookkeeping.class.php");
dol_include_once("/accountingex/class/accountingaccount.class.php"); dol_include_once("/accountancy/class/accountingaccount.class.php");
// Langs // Langs
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $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 .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
$sql .= " ORDER BY f.datef"; $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); $result = $db->query($sql);
if ($result) { if ($result) {
$tabfac = array (); $tabfac = array ();
@ -130,7 +130,7 @@ if ($result) {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
$resligne = array ();
while ( $i < $num ) { while ( $i < $num ) {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
// les variables // les variables
@ -147,7 +147,7 @@ if ($result) {
$cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)) ? $conf->global->COMPTA_VAT_ACCOUNT : $langs->trans("CodeNotDef"); $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); $compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
// la ligne facture // Invoice lines
$tabfac[$obj->rowid]["date"] = $obj->df; $tabfac[$obj->rowid]["date"] = $obj->df;
$tabfac[$obj->rowid]["ref"] = $obj->facnumber; $tabfac[$obj->rowid]["ref"] = $obj->facnumber;
$tabfac[$obj->rowid]["type"] = $obj->type; $tabfac[$obj->rowid]["type"] = $obj->type;
@ -198,7 +198,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0) ? $mt : 0; $bookkeeping->debit = ($mt >= 0) ? $mt : 0;
$bookkeeping->credit = ($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(); $bookkeeping->create();
} }
@ -223,7 +223,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->debit = ($mt < 0) ? $mt : 0;
$bookkeeping->credit = ($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(); $bookkeeping->create();
} }
@ -249,7 +249,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->debit = ($mt < 0) ? $mt : 0;
$bookkeeping->credit = ($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(); $bookkeeping->create();
} }
@ -258,14 +258,14 @@ if ($action == 'writebookkeeping') {
} }
// export csv // export csv
if ($action == 'export_csv') { if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTINGEX_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_ventes.csv'); header('Content-Disposition: attachment;filename=journal_ventes.csv');
$companystatic = new Client($db); $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 ) { foreach ( $tabfac as $key => $val ) {
$companystatic->id = $tabcompany[$key]['id']; $companystatic->id = $tabcompany[$key]['id'];
@ -275,7 +275,7 @@ if ($action == 'export_csv') {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
print $date . $sep; 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; print length_accountg($conf->global->COMPTA_ACCOUNT_CUSTOMER) . $sep;
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print length_accounta(html_entity_decode($k)) . $sep; print length_accounta(html_entity_decode($k)) . $sep;
@ -290,7 +290,7 @@ if ($action == 'export_csv') {
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; 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 length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;
@ -304,7 +304,7 @@ if ($action == 'export_csv') {
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; 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 length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;

View File

@ -3,7 +3,7 @@
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 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 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,9 +20,9 @@
* *
*/ */
/** /**
* \file accountingex/supplier/fiche.php * \file htdocs/accountancy/supplier/card.php
* \ingroup Accountign Expert * \ingroup Accounting Expert
* \brief Page fiche ventilation * \brief Card supplier ventilation
*/ */
// Dolibarr environment // Dolibarr environment
@ -38,14 +38,14 @@ if (! $res)
// Class // Class
dol_include_once("/fourn/class/fournisseur.facture.class.php"); 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
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$action = GETPOST('action'); $action = GETPOST('action');
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -54,15 +54,15 @@ $codeventil = GETPOST('codeventil');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->access) if (! $user->rights->accounting->access)
accessforbidden(); accessforbidden();
if ($action == 'ventil' && $user->rights->accountingex->access) { if ($action == 'ventil' && $user->rights->accounting->access) {
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
$sql .= " SET fk_code_ventilation = " . $codeventil; $sql .= " SET fk_code_ventilation = " . $codeventil;
$sql .= " WHERE rowid = " . $id; $sql .= " WHERE rowid = " . $id;
dol_syslog('accountingex/journal/sellsjournal.php:: $sql=' . $sql); dol_syslog('accountancy/journal/sellsjournal.php:: $sql=' . $sql);
$resql = $db->query($sql); $resql = $db->query($sql);
if (! $resql) { if (! $resql) {
@ -101,10 +101,10 @@ if ($_GET["id"]) {
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lignes = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
if ($num_lignes) { if ($num_lines) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '" method="post">' . "\n"; print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '" method="post">' . "\n";

View File

@ -1,8 +1,5 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* 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 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
@ -21,8 +18,8 @@
*/ */
/** /**
* \file accountingex/supplier/index.php * \file htdocs/accountancy/supplier/index.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page accueil ventilation * \brief Page accueil ventilation
*/ */
@ -45,12 +42,12 @@ $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accountingex->access) if (! $user->rights->accounting->access)
accessforbidden(); accessforbidden();
// Filter // Filter
@ -159,7 +156,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " GROUP BY ffd.fk_code_ventilation"; $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$i = 0; $i = 0;
@ -189,7 +186,7 @@ if ($resql) {
} }
$db->free($resql); $db->free($resql);
} else { } else {
print $db->lasterror(); // affiche la derniere erreur sql print $db->lasterror(); // Show last sql error
} }
print "</table>\n"; print "</table>\n";
@ -234,7 +231,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " AND ff.entity = '" . $conf->entity . "'"; $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); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$i = 0; $i = 0;
@ -264,7 +261,7 @@ if ($resql) {
$db->free($resql); $db->free($resql);
} else { } else {
print $db->lasterror(); // show last sql error print $db->lasterror(); // Show last sql error
} }
print "</table>\n"; print "</table>\n";

View File

@ -21,7 +21,7 @@
*/ */
/** /**
* \file accountingex/supplier/lignes.php * \file htdocs/accountancy/supplier/lines.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page of detail of the lines of ventilation of invoices suppliers * \brief Page of detail of the lines of ventilation of invoices suppliers
*/ */
@ -38,7 +38,7 @@ if (! $res)
die("Include of main fails"); die("Include of main fails");
// Class // 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("/fourn/class/fournisseur.facture.class.php");
dol_include_once("/product/class/product.class.php"); dol_include_once("/product/class/product.class.php");
dol_include_once("/core/lib/date.lib.php"); dol_include_once("/core/lib/date.lib.php");
@ -48,7 +48,7 @@ $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
// Security check // Security check
if ($user->societe_id > 0) 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 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent');
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; $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); $resql1 = $db->query($sql1);
if (! $resql1) { if (! $resql1) {
$error ++; $error ++;
@ -96,9 +96,9 @@ $page = $_GET["page"];
if ($page < 0) if ($page < 0)
$page = 0; $page = 0;
if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
@ -134,24 +134,24 @@ if (! empty($conf->multicompany->enabled)) {
} }
$sql .= " ORDER BY l.rowid"; $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 .= " DESC ";
} }
$sql .= $db->plimit($limit + 1, $offset); $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); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lignes = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... // 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 '<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 '<table class="noborder" width="100%">';
print '<br><br><div class="inline-block divButAction">'. $langs->trans("ChangeAccount"); print '<br><br><div class="inline-block divButAction">'. $langs->trans("ChangeAccount");
@ -185,7 +185,7 @@ if ($result) {
$product_static = new Product($db); $product_static = new Product($db);
$var = True; $var = True;
while ( $i < min($num_lignes, $limit) ) { while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
$codeCompta = $objp->account_number . ' ' . $objp->label; $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">' . price($objp->total_ht) . '</td>';
print '<td align="left">' . $codeCompta . '</td>'; print '<td align="left">' . $codeCompta . '</td>';
print '<td>' . $objp->rowid . '</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 img_edit();
print '</a></td>'; print '</a></td>';

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -19,9 +19,9 @@
*/ */
/** /**
* \file accountingex/supplier/liste.php * \file htdocs/accountancy/supplier/list.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page de ventilation des lignes de facture * \brief Page de ventilation des lignes de facture
*/ */
// Dolibarr environment // Dolibarr environment
@ -38,14 +38,14 @@ if (! $res)
// Class // Class
dol_include_once("/fourn/class/fournisseur.facture.class.php"); dol_include_once("/fourn/class/fournisseur.facture.class.php");
dol_include_once("/fourn/class/fournisseur.product.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
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountingex@accountingex"); $langs->load("accountancy");
$action = GETPOST('action'); $action = GETPOST('action');
$codeventil = GETPOST('codeventil', 'array'); $codeventil = GETPOST('codeventil', 'array');
@ -83,7 +83,7 @@ if ($action == 'ventil') {
$sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " SET fk_code_ventilation = " . $monCompte;
$sql .= " WHERE rowid = " . $monId; $sql .= " WHERE rowid = " . $monId;
dol_syslog('accountingext/supplier/liste.php:: sql=' . $sql); dol_syslog('accountancy/supplier/list.php:: sql=' . $sql);
if ($db->query($sql)) { if ($db->query($sql)) {
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>'; print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
} else { } else {
@ -106,9 +106,9 @@ $page = GETPOST('page');
if ($page < 0) if ($page < 0)
$page = 0; $page = 0;
if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
@ -129,23 +129,23 @@ if (! empty($conf->multicompany->enabled)) {
} }
$sql .= " ORDER BY l.rowid"; $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 .= " DESC ";
} }
$sql .= $db->plimit($limit + 1, $offset); $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); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lignes = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... // 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 '<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 '<input type="hidden" name="action" value="ventil">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -164,7 +164,7 @@ if ($result) {
$form = new Form($db); $form = new Form($db);
$var = True; $var = True;
while ( $i < min($num_lignes, $limit) ) { while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";

View File

@ -70,7 +70,7 @@ $hookmanager->initHooks(array('admin'));
// Put here declaration of dictionaries properties // 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. // 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 // Name of SQL tables of dictionaries
$tabname=array(); $tabname=array();
@ -96,10 +96,8 @@ $tabname[19]= MAIN_DB_PREFIX."c_effectif";
$tabname[20]= MAIN_DB_PREFIX."c_input_method"; $tabname[20]= MAIN_DB_PREFIX."c_input_method";
$tabname[21]= MAIN_DB_PREFIX."c_availability"; $tabname[21]= MAIN_DB_PREFIX."c_availability";
$tabname[22]= MAIN_DB_PREFIX."c_input_reason"; $tabname[22]= MAIN_DB_PREFIX."c_input_reason";
$tabname[23]= MAIN_DB_PREFIX."accountingaccount"; $tabname[23]= MAIN_DB_PREFIX."c_revenuestamp";
$tabname[24]= MAIN_DB_PREFIX."accounting_system"; $tabname[24]= MAIN_DB_PREFIX."c_type_resource";
$tabname[25]= MAIN_DB_PREFIX."c_revenuestamp";
$tabname[26]= MAIN_DB_PREFIX."c_type_resource";
// Dictionary labels // Dictionary labels
$tablib=array(); $tablib=array();
@ -125,10 +123,8 @@ $tablib[19]= "DictionaryStaff";
$tablib[20]= "DictionaryOrderMethods"; $tablib[20]= "DictionaryOrderMethods";
$tablib[21]= "DictionaryAvailability"; $tablib[21]= "DictionaryAvailability";
$tablib[22]= "DictionarySource"; $tablib[22]= "DictionarySource";
$tablib[23]= "DictionaryAccountancyplan"; $tablib[23]= "DictionaryRevenueStamp";
$tablib[24]= "DictionaryAccountancysystem"; $tablib[24]= "DictionaryResourceType";
$tablib[25]= "DictionaryRevenueStamp";
$tablib[26]= "DictionaryResourceType";
// Requests to extract data // Requests to extract data
$tabsql=array(); $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[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[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[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[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 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[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
$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";
// Criteria to sort dictionaries // Criteria to sort dictionaries
$tabsqlsort=array(); $tabsqlsort=array();
@ -183,10 +177,8 @@ $tabsqlsort[19]="id ASC";
$tabsqlsort[20]="code ASC, libelle ASC"; $tabsqlsort[20]="code ASC, libelle ASC";
$tabsqlsort[21]="code ASC, label ASC"; $tabsqlsort[21]="code ASC, label ASC";
$tabsqlsort[22]="code ASC, label ASC"; $tabsqlsort[22]="code ASC, label ASC";
$tabsqlsort[23]="fk_pcg_version ASC, accountancy_code ASC"; $tabsqlsort[23]="country ASC, taux ASC";
$tabsqlsort[24]="pcg_version ASC"; $tabsqlsort[24]="code ASC,label ASC";
$tabsqlsort[25]="country ASC, taux ASC";
$tabsqlsort[26]="code ASC,label ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire // Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield=array(); $tabfield=array();
@ -212,10 +204,8 @@ $tabfield[19]= "code,libelle";
$tabfield[20]= "code,libelle"; $tabfield[20]= "code,libelle";
$tabfield[21]= "code,label"; $tabfield[21]= "code,label";
$tabfield[22]= "code,label"; $tabfield[22]= "code,label";
$tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; $tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[24]= "pcg_version,country_id,country,label"; $tabfield[24]= "code,label";
$tabfield[25]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[26]= "code,label";
// Nom des champs d'edition pour modification d'un enregistrement // Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue=array(); $tabfieldvalue=array();
@ -241,10 +231,8 @@ $tabfieldvalue[19]= "code,libelle";
$tabfieldvalue[20]= "code,libelle"; $tabfieldvalue[20]= "code,libelle";
$tabfieldvalue[21]= "code,label"; $tabfieldvalue[21]= "code,label";
$tabfieldvalue[22]= "code,label"; $tabfieldvalue[22]= "code,label";
$tabfieldvalue[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; $tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[24]= "pcg_version,country,label"; $tabfieldvalue[24]= "code,label";
$tabfieldvalue[25]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[26]= "code,label";
// Nom des champs dans la table pour insertion d'un enregistrement // Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array(); $tabfieldinsert=array();
@ -270,10 +258,8 @@ $tabfieldinsert[19]= "code,libelle";
$tabfieldinsert[20]= "code,libelle"; $tabfieldinsert[20]= "code,libelle";
$tabfieldinsert[21]= "code,label"; $tabfieldinsert[21]= "code,label";
$tabfieldinsert[22]= "code,label"; $tabfieldinsert[22]= "code,label";
$tabfieldinsert[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label"; $tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[24]= "pcg_version,fk_pays,label"; $tabfieldinsert[24]= "code,label";
$tabfieldinsert[25]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[26]= "code,label";
// Nom du rowid si le champ n'est pas de type autoincrement // Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on // Example: "" if id field is "rowid" and has autoincrement on
@ -302,9 +288,7 @@ $tabrowid[20]= "";
$tabrowid[21]= "rowid"; $tabrowid[21]= "rowid";
$tabrowid[22]= "rowid"; $tabrowid[22]= "rowid";
$tabrowid[23]= ""; $tabrowid[23]= "";
$tabrowid[24]= ""; $tabrowid[23]= "";
$tabrowid[25]= "";
$tabrowid[25]= "";
// Condition to show dictionary in setup page // Condition to show dictionary in setup page
$tabcond=array(); $tabcond=array();
@ -330,10 +314,8 @@ $tabcond[19]= ! empty($conf->societe->enabled);
$tabcond[20]= ! empty($conf->fournisseur->enabled); $tabcond[20]= ! empty($conf->fournisseur->enabled);
$tabcond[21]= ! empty($conf->propal->enabled); $tabcond[21]= ! empty($conf->propal->enabled);
$tabcond[22]= (! empty($conf->commande->enabled) || ! 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[23]= true;
$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[24]= ! empty($conf->resource->enabled);
$tabcond[25]= true;
$tabcond[26]= ! empty($conf->resource->enabled);
// List of help for fields // List of help for fields
$tabhelp=array(); $tabhelp=array();
@ -361,8 +343,6 @@ $tabhelp[21] = array();
$tabhelp[22] = array(); $tabhelp[22] = array();
$tabhelp[23] = array(); $tabhelp[23] = array();
$tabhelp[24] = array(); $tabhelp[24] = array();
$tabhelp[25] = array();
$tabhelp[26] = array();
// List of check for fields (NOT USED YET) // List of check for fields (NOT USED YET)
$tabfieldcheck=array(); $tabfieldcheck=array();
@ -390,8 +370,6 @@ $tabfieldcheck[21] = array();
$tabfieldcheck[22] = array(); $tabfieldcheck[22] = array();
$tabfieldcheck[23] = array(); $tabfieldcheck[23] = array();
$tabfieldcheck[24] = array(); $tabfieldcheck[24] = array();
$tabfieldcheck[25] = array();
$tabfieldcheck[26] = array();
// Complete all arrays with entries found into modules // Complete all arrays with entries found into modules
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);

View File

@ -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) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r ++; $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 // Main menu entries
$this->menus = array (); $this->menus = array ();
$r = 0; $r = 0;