Skip to content
Snippets Groups Projects
Commit d94dc96e authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Les fonctions de saisie/consultation des charges sociales et impots sont...

New: Les fonctions de saisie/consultation des charges sociales et impots sont mis dans un module à part nommé 'Taxes et charges sociales'. En effet ces fonctions ne sont pas des fonctions de compta pure mais des fonctions de trésoreries. Ceci afin d'avoir une meilleur indépendance du module compta.
parent 93dd22ee
Branches
Tags
No related merge requests found
......@@ -165,10 +165,10 @@ class Conf
// Module commercial
$this->commercial->enabled=defined("MAIN_MODULE_COMMERCIAL")?MAIN_MODULE_COMMERCIAL:0;
$this->commercial->dir_output=DOL_DATA_ROOT."/rapport";
// Module charges sociales
$this->charges->enabled=1;
$this->charges->dir_output=DOL_DATA_ROOT."/socialcontrib";
$this->charges->dir_images=DOL_DATA_ROOT."/socialcontrib/images";
// Module taxes et charges sociales
$this->tax->enabled=1;
$this->tax->dir_output=DOL_DATA_ROOT."/taxes";
$this->tax->dir_images=DOL_DATA_ROOT."/taxes/images";
// Module comptaexpert
$this->comptaexpert->enabled=defined("MAIN_MODULE_COMPTABILITE_EXPERT")?MAIN_MODULE_COMPTABILITE_EXPERT:0;
$this->comptaexpert->dir_output=DOL_DATA_ROOT."/comptaexpert";
......
......@@ -354,19 +354,19 @@ class MenuLeft {
$newmenu->add(DOL_URL_ROOT."/compta/deplacement/index.php?leftmenu=deplacement&mainmenu=accountancy", $langs->trans("Trips"), 0, $user->rights->deplacement->lire);
}
// Charges
if ($conf->charges->enabled)
// Charges sociales
if ($conf->tax->enabled)
{
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=charges&mainmenu=accountancy",$langs->trans("Charges"), 0, $user->rights->compta->charges->lire);
if ($leftmenu=="charges") $newmenu->add_submenu(DOL_URL_ROOT."/compta/sociales/index.php",$langs->trans("SocialContributions"), 1, $user->rights->compta->charges->creer);
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=charges&mainmenu=accountancy",$langs->trans("Charges"), 0, $user->rights->tax->charges->lire);
if ($leftmenu=="charges") $newmenu->add_submenu(DOL_URL_ROOT."/compta/sociales/index.php",$langs->trans("SocialContributions"), 1, $user->rights->tax->charges->creer);
}
// Compta tva
if (($conf->compta->enabled || $conf->comptaexpert->enabled) && $conf->compta->tva && $user->societe_id == 0)
// Charges tva
if ($conf->tax->enabled && $conf->compta->tva && $user->societe_id == 0)
{
$newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=vat&mainmenu=accountancy",$langs->trans("VAT"),0,$user->rights->compta->charges->lire);
if ($leftmenu=="vat") $newmenu->add_submenu(DOL_URL_ROOT."/compta/tva/fiche.php?action=create",$langs->trans("NewPayment"),1,$user->rights->compta->charges->creer);
if ($leftmenu=="vat") $newmenu->add_submenu(DOL_URL_ROOT."/compta/tva/reglement.php",$langs->trans("Payments"),1,$user->rights->compta->charges->lire);
$newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=vat&mainmenu=accountancy",$langs->trans("VAT"),0,$user->rights->tax->charges->lire);
if ($leftmenu=="vat") $newmenu->add_submenu(DOL_URL_ROOT."/compta/tva/fiche.php?action=create",$langs->trans("NewPayment"),1,$user->rights->tax->charges->creer);
if ($leftmenu=="vat") $newmenu->add_submenu(DOL_URL_ROOT."/compta/tva/reglement.php",$langs->trans("Payments"),1,$user->rights->tax->charges->lire);
}
// Compta simple
......
......@@ -373,23 +373,24 @@ class MenuLeft {
$newmenu->add(DOL_URL_ROOT."/compta/deplacement/index.php?leftmenu=deplacement&mainmenu=accountancy", $langs->trans("Trips"), 0, $user->rights->deplacement->lire);
}
// Charges
// Charges sociales
/*
if ($conf->charges->enabled)
if ($conf->tax->enabled)
{
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=charges&mainmenu=accountancy",$langs->trans("Charges"), 0, $user->rights->compta->charges->lire);
if ($leftmenu=="charges") $newmenu->add_submenu(DOL_URL_ROOT."/compta/sociales/index.php",$langs->trans("SocialContributions"), 1, $user->rights->compta->charges->creer);
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=charges&mainmenu=accountancy",$langs->trans("Charges"), 0, $user->rights->tax->charges->lire);
if ($leftmenu=="charges") $newmenu->add_submenu(DOL_URL_ROOT."/compta/sociales/index.php",$langs->trans("SocialContributions"), 1, $user->rights->tax->charges->creer);
}
*/
// Compa TVA
// Charges tva
/*
if (($conf->compta->enabled || $conf->comptaexpert->enabled) && $conf->compta->tva && $user->societe_id == 0)
if ($conf->tax->enabled && $conf->compta->tva && $user->societe_id == 0)
{
$newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=vat&mainmenu=accountancy",$langs->trans("VAT"),0,$user->rights->compta->charges->lire);
if ($leftmenu=="vat") $newmenu->add_submenu(DOL_URL_ROOT."/compta/tva/fiche.php?action=create",$langs->trans("NewPayment"),1,$user->rights->compta->charges->creer);
if ($leftmenu=="vat") $newmenu->add_submenu(DOL_URL_ROOT."/compta/tva/reglement.php",$langs->trans("Payments"),1,$user->rights->compta->charges->lire);
$newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=vat&mainmenu=accountancy",$langs->trans("VAT"),0,$user->rights->tax->charges->lire);
if ($leftmenu=="vat") $newmenu->add_submenu(DOL_URL_ROOT."/compta/tva/fiche.php?action=create",$langs->trans("NewPayment"),1,$user->rights->tax->charges->creer);
if ($leftmenu=="vat") $newmenu->add_submenu(DOL_URL_ROOT."/compta/tva/reglement.php",$langs->trans("Payments"),1,$user->rights->tax->charges->lire);
}
*/
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
......
......@@ -30,17 +30,15 @@
\ingroup categorie
\brief Fichier de description et activation du module Categorie
*/
include_once "DolibarrModules.class.php";
/**
\class modProduit
\brief Classe de description et activation du module Produit
\class modCategorie
\brief Classe de description et activation du module Categorie
*/
class modCategorie extends DolibarrModules
{
/**
* \brief Constructeur. définit les noms, constantes et boîtes
* \param DB handler d'accès base
......@@ -52,7 +50,7 @@ class modCategorie extends DolibarrModules
$this->numero = 1780;
$this->family = "products";
$this->name = "Catégorie";
$this->name = "Catégories de produit";
$this->description = "Gestion des catégories de produits";
$this->revision = explode(' ','$Revision$');
......@@ -135,5 +133,6 @@ class modCategorie extends DolibarrModules
return $this->_remove($sql);
}
}
?>
......@@ -31,13 +31,13 @@
\ingroup comptabilite
\brief Fichier de description et activation du module Comptabilite
*/
include_once "DolibarrModules.class.php";
/** \class modComptabilite
/**
\class modComptabilite
\brief Classe de description et activation du module Comptabilite
*/
class modComptabilite extends DolibarrModules
{
......@@ -62,6 +62,7 @@ class modComptabilite extends DolibarrModules
$this->const_name = 'MAIN_MODULE_COMPTABILITE';
$this->special = 0;
$this->picto='';
// Config pages
$this->config_page_url = "compta.php";
......@@ -90,30 +91,6 @@ class modComptabilite extends DolibarrModules
$this->rights_class = 'compta';
$r=0;
$r++;
$this->rights[$r][0] = 91;
$this->rights[$r][1] = 'Lire les charges';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'charges';
$this->rights[$r][5] = 'lire';
$r++;
$this->rights[$r][0] = 92;
$this->rights[$r][1] = 'Créer modifier les charges';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'charges';
$this->rights[$r][5] = 'creer';
$r++;
$this->rights[$r][0] = 93;
$this->rights[$r][1] = 'Supprimer les charges';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'charges';
$this->rights[$r][5] = 'supprimer';
$r++;
$this->rights[$r][0] = 95;
$this->rights[$r][1] = 'Lire CA, bilans, résultats';
......@@ -145,22 +122,6 @@ class modComptabilite extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'ventilation';
$this->rights[$r][5] = 'creer';
/*
Ce n'est pas un module en particulier qui doit conditionner l'accès à un espace
partagé par plusieurs module. C'est au sein de l'espace compta/tréso que chaque zone
est protégée par le droit adéquat.
Sinon on bloque aussi utilisation du module banque, tva, des commandes à facturer,
ou d'un autre module de compta.
$r++;
$this->rights[$r][0] = 98;
$this->rights[$r][1] = "Accès à l'espace compta/tréso";
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'general';
$this->rights[$r][5] = 'lire';
*/
}
......@@ -188,5 +149,6 @@ class modComptabilite extends DolibarrModules
return $this->_remove($sql);
}
}
?>
......@@ -32,7 +32,6 @@
\ingroup facture
\brief Fichier de la classe de description et activation du module Facture
*/
include_once "DolibarrModules.class.php";
......@@ -40,7 +39,6 @@ include_once "DolibarrModules.class.php";
\class modFacture
\brief Classe de description et activation du module Facture
*/
class modFacture extends DolibarrModules
{
......
......@@ -30,14 +30,13 @@
\ingroup prelevement
\brief Fichier de description et activation du module Prelevement
*/
include_once "DolibarrModules.class.php";
/**
\class modPrelevement
\brief Classe de description et activation du module Prelevement
*/
class modPrelevement extends DolibarrModules
{
......@@ -141,5 +140,6 @@ class modPrelevement extends DolibarrModules
return $this->_remove($sql);
}
}
?>
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/** \defgroup tax Module taxes
\brief Module pour inclure des fonctions de saisies des taxes et charges sociales
*/
/**
\file htdocs/includes/modules/modTax.class.php
\ingroup comptabilite
\brief Fichier de description et activation du module Taxe
*/
include_once "DolibarrModules.class.php";
/**
\class modTax
\brief Classe de description et activation du module Tax
*/
class modTax extends DolibarrModules
{
/**
* \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'accès base
*/
function modTax($DB)
{
global $conf;
$this->db = $DB ;
$this->id = 'tax'; // Same value xxx than in file modXxx.class.php file
$this->numero = 500 ;
$this->family = "financial";
$this->name = "Taxes et charges sociales";
$this->description = "Gestion des taxes et charges sociales";
$this->revision = explode(" ","$Revision$");
$this->version = $this->revision[1];
$this->const_name = 'MAIN_MODULE_TAX';
$this->special = 0;
$this->picto='bill';
// Config pages
$this->config_page_url = array();
// Dépendances
$this->depends = array();
$this->requiredby = array();
$this->conflictwith = array();
$this->langfiles = array("compta");
// Constantes
$this->const = array();
// Répertoires
$this->dirs = array();
$this->dirs[0] = $conf->tax->dir_output;
$this->dirs[1] = $conf->tax->dir_images;
// Boites
$this->boxes = array();
// Permissions
$this->rights = array();
$this->rights_class = 'tax';
$r=0;
$r++;
$this->rights[$r][0] = 91;
$this->rights[$r][1] = 'Lire les charges';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'charges';
$this->rights[$r][5] = 'lire';
$r++;
$this->rights[$r][0] = 92;
$this->rights[$r][1] = 'Créer modifier les charges';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'charges';
$this->rights[$r][5] = 'creer';
$r++;
$this->rights[$r][0] = 93;
$this->rights[$r][1] = 'Supprimer les charges';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'charges';
$this->rights[$r][5] = 'supprimer';
}
/**
* \brief Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module.
* Définit également les répertoires de données à créer pour ce module.
*/
function init()
{
global $conf;
// Nettoyage avant activation
$this->remove();
return $this->_init($sql);
}
/**
* \brief Fonction appelée lors de la désactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module.
*/
function remove()
{
$sql = array();
return $this->_remove($sql);
}
}
?>
......@@ -136,6 +136,8 @@ Module400Name=Projects
Module400Desc=Projects' management inside other modules
Module410Name=Webcalendar
Module410Desc=Webcalendar integration
Module500Name=Taxes and social contributions
Module500Desc=Taxes and social contributions' management
Module700Name=Donations
Module700Desc=Donations' management
Module800Name=OSCommerce 1
......@@ -182,9 +184,9 @@ Permission86=Send customers orders
Permission87=Close customers orders
Permission88=Cancel customers orders
Permission89=Delete customers orders
Permission91=Read charges and vat
Permission92=Create/modify charges and vat
Permission93=Delete charges and vat
Permission91=Read social contributions and vat
Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat
Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
......
......@@ -136,6 +136,8 @@ Module400Name=Projets
Module400Desc=Gestion des projets au sein des autres modules
Module410Name=Webcalendar
Module410Desc=Interface avec le calendrier Webcalendar
Module500Name=Taxes et charges sociales
Module500Desc=Gestion des taxes et charges sociales
Module700Name=Dons
Module700Desc=Gestion des dons
Module800Name=OSCommerce 1
......
......@@ -299,6 +299,8 @@ alter table llx_accountingsystem_det rename to llx_accountingaccount;
insert into llx_rights_def (id, libelle, module, type, bydefault, subperms, perms) values (262,'Consulter tous les clients','commercial','r',1,'voir','client');
-- V4.1 insert into llx_user_rights(fk_user,fk_id) select distinct fk_user, '262' from llx_user_rights where fk_id = 261;
update llx_rights_def set subperms='creer' where subperms='supprimer' AND module='user' AND perms='self' AND id=255;
update llx_rights_def set module='tax' where module='compta' AND id in ('91','92','93');
alter table llx_commandedet add column rang integer DEFAULT 0;
alter table llx_propaldet add column rang integer DEFAULT 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment