diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php index f758209858a..d31f3179fdb 100644 --- a/htdocs/conf/conf.class.php +++ b/htdocs/conf/conf.class.php @@ -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"; diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index b9e4720df6e..3134953a52f 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -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 diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index 007c713eef1..2543845a7ca 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -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) { diff --git a/htdocs/includes/modules/modCategorie.class.php b/htdocs/includes/modules/modCategorie.class.php index 3a74c1133c1..99daa74f078 100644 --- a/htdocs/includes/modules/modCategorie.class.php +++ b/htdocs/includes/modules/modCategorie.class.php @@ -30,110 +30,109 @@ \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 - */ - function modCategorie ($DB) - { - $this->db = $DB; - $this->id = 'categorie'; // Same value xxx than in file modXxx.class.php file - $this->numero = 1780; - - $this->family = "products"; - $this->name = "Catégorie"; - $this->description = "Gestion des catégories de produits"; - - $this->revision = explode(' ','$Revision$'); - $this->version = $this->revision[1]; - //$this->version = 'experimental'; // 'development' or 'experimental' or 'dolibarr' or version - - $this->const_name = 'MAIN_MODULE_CATEGORIE'; - $this->special = 0; - $this->picto = ''; - - // Dir - $this->dirs = array(); - - // Dépendances - $this->depends = array("modProduit"); - - // Constantes - $this->const = array(); - - // Boxes - $this->boxes = array(); - - // Permissions - $this->rights = array(); - $this->rights_class = 'categorie'; - - $r=0; - - $this->rights[$r][0] = 241; // id de la permission - $this->rights[$r][1] = 'Lire les catégories'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (déprécié à ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par défaut - $this->rights[$r][4] = 'lire'; - $r++; - - $this->rights[$r][0] = 242; // id de la permission - $this->rights[$r][1] = 'Créer/modifier les catégories'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (déprécié à ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par défaut - $this->rights[$r][4] = 'creer'; - $r++; + /** + * \brief Constructeur. définit les noms, constantes et boîtes + * \param DB handler d'accès base + */ + function modCategorie ($DB) + { + $this->db = $DB; + $this->id = 'categorie'; // Same value xxx than in file modXxx.class.php file + $this->numero = 1780; - $this->rights[$r][0] = 243; // id de la permission - $this->rights[$r][1] = 'Supprimer les catégories'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (déprécié à ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par défaut - $this->rights[$r][4] = 'supprimer'; - $r++; - - $this->rights[$r][0] = 244; // id de la permission - $this->rights[$r][1] = 'Voir le contenu des catégories cachées'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (déprécié à ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par défaut - $this->rights[$r][4] = 'voir'; - $r++; - } + $this->family = "products"; + $this->name = "Catégories de produit"; + $this->description = "Gestion des catégories de produits"; + + $this->revision = explode(' ','$Revision$'); + $this->version = $this->revision[1]; + //$this->version = 'experimental'; // 'development' or 'experimental' or 'dolibarr' or version + + $this->const_name = 'MAIN_MODULE_CATEGORIE'; + $this->special = 0; + $this->picto = ''; + + // Dir + $this->dirs = array(); + + // Dépendances + $this->depends = array("modProduit"); + + // Constantes + $this->const = array(); + + // Boxes + $this->boxes = array(); + + // Permissions + $this->rights = array(); + $this->rights_class = 'categorie'; + + $r=0; + + $this->rights[$r][0] = 241; // id de la permission + $this->rights[$r][1] = 'Lire les catégories'; // libelle de la permission + $this->rights[$r][2] = 'r'; // type de la permission (déprécié à ce jour) + $this->rights[$r][3] = 1; // La permission est-elle une permission par défaut + $this->rights[$r][4] = 'lire'; + $r++; + + $this->rights[$r][0] = 242; // id de la permission + $this->rights[$r][1] = 'Créer/modifier les catégories'; // libelle de la permission + $this->rights[$r][2] = 'w'; // type de la permission (déprécié à ce jour) + $this->rights[$r][3] = 0; // La permission est-elle une permission par défaut + $this->rights[$r][4] = 'creer'; + $r++; + + $this->rights[$r][0] = 243; // id de la permission + $this->rights[$r][1] = 'Supprimer les catégories'; // libelle de la permission + $this->rights[$r][2] = 'd'; // type de la permission (déprécié à ce jour) + $this->rights[$r][3] = 0; // La permission est-elle une permission par défaut + $this->rights[$r][4] = 'supprimer'; + $r++; + + $this->rights[$r][0] = 244; // id de la permission + $this->rights[$r][1] = 'Voir le contenu des catégories cachées'; // libelle de la permission + $this->rights[$r][2] = 'r'; // type de la permission (déprécié à ce jour) + $this->rights[$r][3] = 1; // La permission est-elle une permission par défaut + $this->rights[$r][4] = 'voir'; + $r++; + } - /** - * \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() - { - // Permissions - $this->remove(); + /** + * \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() + { + // Permissions + $this->remove(); + + $sql = array(); + + return $this->_init($sql); + } - $sql = array(); + /** + * \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); + } - 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); - } } ?> diff --git a/htdocs/includes/modules/modComptabilite.class.php b/htdocs/includes/modules/modComptabilite.class.php index fa65a83ecae..77727f6b7c1 100644 --- a/htdocs/includes/modules/modComptabilite.class.php +++ b/htdocs/includes/modules/modComptabilite.class.php @@ -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 { @@ -45,148 +45,110 @@ class modComptabilite extends DolibarrModules * \brief Constructeur. Definit les noms, constantes et boites * \param DB handler d'accès base */ - function modComptabilite($DB) - { - global $conf; - - $this->db = $DB ; - $this->id = 'comptabilite'; // Same value xxx than in file modXxx.class.php file - $this->numero = 10 ; - - $this->family = "financial"; - $this->name = "Comptabilite"; - $this->description = "Gestion sommaire de comptabilité"; - - $this->revision = explode(" ","$Revision$"); - $this->version = $this->revision[1]; - - $this->const_name = 'MAIN_MODULE_COMPTABILITE'; - $this->special = 0; - - // Config pages - $this->config_page_url = "compta.php"; - - // Dépendances - $this->depends = array("modFacture","modBanque"); - $this->requiredby = array(); - $this->conflictwith = array("modComptabiliteExpert"); - $this->langfiles = array("compta"); - - // Constantes - $this->const = array(); - - // Répertoires - $this->dirs = array(); - $this->dirs[0] = $conf->compta->dir_output; - $this->dirs[1] = $conf->compta->dir_output."/rapport"; - $this->dirs[2] = $conf->compta->dir_output."/export"; - $this->dirs[3] = $conf->compta->dir_images; - - // Boites - $this->boxes = array(); - - // Permissions - $this->rights = array(); - $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'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'resultat'; - $this->rights[$r][5] = 'lire'; - - $r++; - $this->rights[$r][0] = 96; - $this->rights[$r][1] = 'Paramétrer la ventilation'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'ventilation'; - $this->rights[$r][5] = 'parametrer'; - - $r++; - $this->rights[$r][0] = 97; - $this->rights[$r][1] = 'Lire les ventilations de factures'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'ventilation'; - $this->rights[$r][5] = 'lire'; - - $r++; - $this->rights[$r][0] = 98; - $this->rights[$r][1] = 'Ventiler les lignes de factures'; - $this->rights[$r][2] = 'r'; - $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'; - */ - - } + function modComptabilite($DB) + { + global $conf; + + $this->db = $DB ; + $this->id = 'comptabilite'; // Same value xxx than in file modXxx.class.php file + $this->numero = 10 ; + + $this->family = "financial"; + $this->name = "Comptabilite"; + $this->description = "Gestion sommaire de comptabilité"; + + $this->revision = explode(" ","$Revision$"); + $this->version = $this->revision[1]; + + $this->const_name = 'MAIN_MODULE_COMPTABILITE'; + $this->special = 0; + $this->picto=''; + + // Config pages + $this->config_page_url = "compta.php"; + + // Dépendances + $this->depends = array("modFacture","modBanque"); + $this->requiredby = array(); + $this->conflictwith = array("modComptabiliteExpert"); + $this->langfiles = array("compta"); + + // Constantes + $this->const = array(); + + // Répertoires + $this->dirs = array(); + $this->dirs[0] = $conf->compta->dir_output; + $this->dirs[1] = $conf->compta->dir_output."/rapport"; + $this->dirs[2] = $conf->compta->dir_output."/export"; + $this->dirs[3] = $conf->compta->dir_images; + + // Boites + $this->boxes = array(); + + // Permissions + $this->rights = array(); + $this->rights_class = 'compta'; + $r=0; + + $r++; + $this->rights[$r][0] = 95; + $this->rights[$r][1] = 'Lire CA, bilans, résultats'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'resultat'; + $this->rights[$r][5] = 'lire'; + + $r++; + $this->rights[$r][0] = 96; + $this->rights[$r][1] = 'Paramétrer la ventilation'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'ventilation'; + $this->rights[$r][5] = 'parametrer'; + + $r++; + $this->rights[$r][0] = 97; + $this->rights[$r][1] = 'Lire les ventilations de factures'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'ventilation'; + $this->rights[$r][5] = 'lire'; + + $r++; + $this->rights[$r][0] = 98; + $this->rights[$r][1] = 'Ventiler les lignes de factures'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'ventilation'; + $this->rights[$r][5] = 'creer'; + } /** * \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(); + function init() + { + global $conf; + + // Nettoyage avant activation + $this->remove(); + + return $this->_init($sql); + } - 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); + } - /** - * \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); - } } ?> diff --git a/htdocs/includes/modules/modFacture.class.php b/htdocs/includes/modules/modFacture.class.php index 080535d2112..5f1d5ac7866 100644 --- a/htdocs/includes/modules/modFacture.class.php +++ b/htdocs/includes/modules/modFacture.class.php @@ -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 { diff --git a/htdocs/includes/modules/modPrelevement.class.php b/htdocs/includes/modules/modPrelevement.class.php index b6511ad14db..48073d31687 100644 --- a/htdocs/includes/modules/modPrelevement.class.php +++ b/htdocs/includes/modules/modPrelevement.class.php @@ -26,18 +26,17 @@ */ /** - \file htdocs/includes/modules/modPrelevement.class.php - \ingroup prelevement - \brief Fichier de description et activation du module Prelevement + \file htdocs/includes/modules/modPrelevement.class.php + \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 + \brief Classe de description et activation du module Prelevement +*/ class modPrelevement extends DolibarrModules { @@ -45,101 +44,102 @@ class modPrelevement extends DolibarrModules * \brief Constructeur. Definit les noms, constantes et boites * \param DB handler d'accès base */ - function modPrelevement($DB) - { - global $conf; - - $this->db = $DB ; - $this->id = 'prelevement'; // Same value xxx than in file modXxx.class.php file - $this->numero = 57 ; - - $this->family = "financial"; - $this->name = "Prelevement"; - $this->description = "Gestion des Prélèvements"; - - $this->revision = explode(' ','$Revision$'); - $this->version = $this->revision[1]; - - $this->const_name = 'MAIN_MODULE_PRELEVEMENT'; - $this->special = 0; - - // Dir - $this->dirs = array(); - $this->data_directory = $conf->prelevement->dir_output . "/bon"; - - // Dépendances - $this->depends = array("modFacture"); - $this->requiredby = array(); - - // Constantes - $this->const = array(); - - // Boites - $this->boxes = array(); - - // Permissions - $this->rights = array(); - $this->rights_class = 'prelevement'; - - $this->rights[1][0] = 151; - $this->rights[1][1] = 'Consulter les prélèvements'; - $this->rights[1][2] = 'r'; - $this->rights[1][3] = 1; - $this->rights[1][4] = 'bons'; - $this->rights[1][5] = 'lire'; - - $this->rights[2][0] = 152; - $this->rights[2][1] = 'Configurer les prélèvements'; - $this->rights[2][2] = 'w'; - $this->rights[2][3] = 0; - $this->rights[2][4] = 'bons'; - $this->rights[2][5] = 'configurer'; - - $this->rights[3][0] = 153; - $this->rights[3][1] = 'Consulter les bons de prélèvements'; - $this->rights[3][2] = 'r'; - $this->rights[3][3] = 0; - $this->rights[3][4] = 'bons'; - $this->rights[3][5] = 'lire'; - - $this->rights[4][0] = 154; - $this->rights[4][1] = 'Créer un bon de prélèvement'; - $this->rights[4][2] = 'w'; - $this->rights[4][3] = 0; - $this->rights[4][4] = 'bons'; - $this->rights[4][5] = 'creer'; - } + function modPrelevement($DB) + { + global $conf; + + $this->db = $DB ; + $this->id = 'prelevement'; // Same value xxx than in file modXxx.class.php file + $this->numero = 57 ; + + $this->family = "financial"; + $this->name = "Prelevement"; + $this->description = "Gestion des Prélèvements"; + + $this->revision = explode(' ','$Revision$'); + $this->version = $this->revision[1]; + + $this->const_name = 'MAIN_MODULE_PRELEVEMENT'; + $this->special = 0; + + // Dir + $this->dirs = array(); + $this->data_directory = $conf->prelevement->dir_output . "/bon"; + + // Dépendances + $this->depends = array("modFacture"); + $this->requiredby = array(); + + // Constantes + $this->const = array(); + + // Boites + $this->boxes = array(); + + // Permissions + $this->rights = array(); + $this->rights_class = 'prelevement'; + + $this->rights[1][0] = 151; + $this->rights[1][1] = 'Consulter les prélèvements'; + $this->rights[1][2] = 'r'; + $this->rights[1][3] = 1; + $this->rights[1][4] = 'bons'; + $this->rights[1][5] = 'lire'; + + $this->rights[2][0] = 152; + $this->rights[2][1] = 'Configurer les prélèvements'; + $this->rights[2][2] = 'w'; + $this->rights[2][3] = 0; + $this->rights[2][4] = 'bons'; + $this->rights[2][5] = 'configurer'; + + $this->rights[3][0] = 153; + $this->rights[3][1] = 'Consulter les bons de prélèvements'; + $this->rights[3][2] = 'r'; + $this->rights[3][3] = 0; + $this->rights[3][4] = 'bons'; + $this->rights[3][5] = 'lire'; + + $this->rights[4][0] = 154; + $this->rights[4][1] = 'Créer un bon de prélèvement'; + $this->rights[4][2] = 'w'; + $this->rights[4][3] = 0; + $this->rights[4][4] = 'bons'; + $this->rights[4][5] = 'creer'; + } /** * \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; - - // Permissions - $this->remove(); + function init() + { + global $conf; + + // Permissions + $this->remove(); + + // Dir + $this->dirs[0] = $conf->prelevement->dir_output; + $this->dirs[1] = $conf->prelevement->dir_output."/bon" ; + + $sql = array(); + + return $this->_init($sql); + } - // Dir - $this->dirs[0] = $conf->prelevement->dir_output; - $this->dirs[1] = $conf->prelevement->dir_output."/bon" ; + /** + * \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); + } - $sql = array(); - - 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); - } } ?> diff --git a/htdocs/includes/modules/modTax.class.php b/htdocs/includes/modules/modTax.class.php new file mode 100644 index 00000000000..df2bf60faf6 --- /dev/null +++ b/htdocs/includes/modules/modTax.class.php @@ -0,0 +1,143 @@ + + * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * + * 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); + } +} +?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a8c33e4991d..106d50883ce 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -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 diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 0e8adc13581..11c18572ee3 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -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 diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 70f1616f6a8..0b3632f77d8 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -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;