Merge pull request #5064 from aspangaro/4.0-p21
FIX: Accountancy - Road to stable version
This commit is contained in:
commit
7e047ada2b
@ -43,7 +43,9 @@ $search_pcgtype = GETPOST("search_pcgtype");
|
|||||||
$search_pcgsubtype = GETPOST("search_pcgsubtype");
|
$search_pcgsubtype = GETPOST("search_pcgsubtype");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (! $user->admin)
|
if ($user->societe_id > 0)
|
||||||
|
accessforbidden();
|
||||||
|
if (! $user->rights->accounting->chartofaccount)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
@ -145,8 +147,8 @@ if ($result) {
|
|||||||
print '<br/>';
|
print '<br/>';
|
||||||
|
|
||||||
print '<a class="butAction" href="./card.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 '<a class="butAction" href="./productaccount.php">' . $langs->trans("CheckProductAccountancyCode") . '</a>';
|
// print '<a class="butAction" href="./productaccount.php">' . $langs->trans("CheckProductAccountancyCode") . '</a>';
|
||||||
print '<br/><br/>';
|
print '<br/><br/>';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|||||||
@ -50,12 +50,14 @@ $main_option = array (
|
|||||||
|
|
||||||
$model_option = array (
|
$model_option = array (
|
||||||
'ACCOUNTING_EXPORT_SEPARATORCSV',
|
'ACCOUNTING_EXPORT_SEPARATORCSV',
|
||||||
'ACCOUNTING_EXPORT_DATE',
|
'ACCOUNTING_EXPORT_DATE'
|
||||||
|
/*
|
||||||
'ACCOUNTING_EXPORT_PIECE',
|
'ACCOUNTING_EXPORT_PIECE',
|
||||||
'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT',
|
'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT',
|
||||||
'ACCOUNTING_EXPORT_LABEL',
|
'ACCOUNTING_EXPORT_LABEL',
|
||||||
'ACCOUNTING_EXPORT_AMOUNT',
|
'ACCOUNTING_EXPORT_AMOUNT',
|
||||||
'ACCOUNTING_EXPORT_DEVISE'
|
'ACCOUNTING_EXPORT_DEVISE'
|
||||||
|
*/
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -385,7 +385,7 @@ else {
|
|||||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "bk_label_compte", "", $options, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "bk_label_compte", "", $options, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ else {
|
|||||||
print $langs->trans('From') . ': ';
|
print $langs->trans('From') . ': ';
|
||||||
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans('To') . ': ';
|
print $langs->trans('to') . ': ';
|
||||||
print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>';
|
print '<td><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>';
|
||||||
@ -404,14 +404,14 @@ else {
|
|||||||
print $langs->trans('From');
|
print $langs->trans('From');
|
||||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
|
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans('To');
|
print $langs->trans('to');
|
||||||
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
|
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans('From');
|
print $langs->trans('From');
|
||||||
print $formventilation->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
print $formventilation->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans('To');
|
print $langs->trans('to');
|
||||||
print $formventilation->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
|
print $formventilation->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ else {
|
|||||||
print '<td>' . $line->label_compte . '</td>';
|
print '<td>' . $line->label_compte . '</td>';
|
||||||
print '<td align="right">' . price($line->debit) . '</td>';
|
print '<td align="right">' . price($line->debit) . '</td>';
|
||||||
print '<td align="right">' . price($line->credit) . '</td>';
|
print '<td align="right">' . price($line->credit) . '</td>';
|
||||||
print '<td align="right">' . $line->code_journal . '</td>';
|
print '<td align="center">' . $line->code_journal . '</td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print '<a href="./card.php?piece_num=' . $line->piece_num . '">' . img_edit() . '</a> ';
|
print '<a href="./card.php?piece_num=' . $line->piece_num . '">' . img_edit() . '</a> ';
|
||||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $options . '&page=' . $page . '">' . img_delete() . '</a>';
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $options . '&page=' . $page . '">' . img_delete() . '</a>';
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class FormAccounting
|
|||||||
$sql = "SELECT c.rowid, c.label as type, c.range_account";
|
$sql = "SELECT c.rowid, c.label as type, c.range_account";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
|
||||||
$sql.= " WHERE c.active = 1";
|
$sql.= " WHERE c.active = 1";
|
||||||
$sql.= " AND c.account_type = 0";
|
$sql.= " AND c.category_type = 0";
|
||||||
$sql.= " AND c.fk_country = ".$mysoc->country_id;
|
$sql.= " AND c.fk_country = ".$mysoc->country_id;
|
||||||
$sql.= " ORDER BY c.label ASC";
|
$sql.= " ORDER BY c.label ASC";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
*
|
*
|
||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/modAccounting.class.php
|
* \file htdocs/core/modules/modAccounting.class.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Advanced accountancy
|
||||||
* \brief Module to activate Accounting Expert module
|
* \brief Module to activate Accounting Expert module
|
||||||
*/
|
*/
|
||||||
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||||
@ -157,16 +157,19 @@ class modAccounting extends DolibarrModules
|
|||||||
"yesno",
|
"yesno",
|
||||||
"1"
|
"1"
|
||||||
);
|
);
|
||||||
|
/*
|
||||||
$this->const[15] = array (
|
$this->const[15] = array (
|
||||||
"ACCOUNTING_GROUPBYACCOUNT",
|
"ACCOUNTING_GROUPBYACCOUNT",
|
||||||
"yesno",
|
"yesno",
|
||||||
"1"
|
"1"
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
$this->const[16] = array (
|
$this->const[16] = array (
|
||||||
"ACCOUNTING_EXPORT_DATE",
|
"ACCOUNTING_EXPORT_DATE",
|
||||||
"chaine",
|
"chaine",
|
||||||
"%d%m%Y"
|
"%d%m%Y"
|
||||||
);
|
);
|
||||||
|
/*
|
||||||
$this->const[17] = array (
|
$this->const[17] = array (
|
||||||
"ACCOUNTING_EXPORT_PIECE",
|
"ACCOUNTING_EXPORT_PIECE",
|
||||||
"yesno",
|
"yesno",
|
||||||
@ -192,6 +195,7 @@ class modAccounting extends DolibarrModules
|
|||||||
"yesno",
|
"yesno",
|
||||||
"1"
|
"1"
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
$this->const[22] = array(
|
$this->const[22] = array(
|
||||||
"ACCOUNTING_EXPENSEREPORT_JOURNAL",
|
"ACCOUNTING_EXPENSEREPORT_JOURNAL",
|
||||||
"chaine",
|
"chaine",
|
||||||
|
|||||||
@ -365,7 +365,7 @@ CREATE TABLE llx_c_accounting_category (
|
|||||||
|
|
||||||
ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code);
|
ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code);
|
||||||
UPDATE llx_accounting_account SET account_parent = '0' WHERE account_parent = '';
|
UPDATE llx_accounting_account SET account_parent = '0' WHERE account_parent = '';
|
||||||
ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer;
|
ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer DEFAULT 0;
|
||||||
|
|
||||||
|
|
||||||
DROP INDEX uk_bordereau_cheque ON llx_bordereau_cheque;
|
DROP INDEX uk_bordereau_cheque ON llx_bordereau_cheque;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user