dolibarr  19.0.0-dev
modComptabilite.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
5  * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
30 include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
31 
32 
37 {
38 
44  public function __construct($db)
45  {
46  global $conf;
47 
48  $this->db = $db;
49  $this->numero = 10;
50 
51  $this->family = "financial";
52  $this->module_position = '60';
53  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
54  $this->name = preg_replace('/^mod/i', '', get_class($this));
55  $this->description = "Gestion sommaire de comptabilite";
56 
57  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
58  $this->version = 'dolibarr';
59 
60  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
61  $this->picto = 'accountancy';
62 
63  // Config pages
64  $this->config_page_url = array("compta.php");
65 
66  // Dependencies
67  $this->depends = array("modFacture", "modBanque");
68  $this->requiredby = array();
69  $this->conflictwith = array("modAccounting");
70  $this->langfiles = array("compta");
71 
72  // Constants
73  $this->const = array();
74 
75  // Data directories to create when module is enabled
76  $this->dirs = array(
77  "/comptabilite/temp",
78  "/comptabilite/rapport",
79  "/comptabilite/export",
80  "/comptabilite/bordereau"
81  );
82 
83  // Boxes
84  $this->boxes = array();
85 
86  // Permissions
87  $this->rights = array();
88  $this->rights_class = 'compta';
89  $r = 0;
90 
91  $r++;
92  $this->rights[$r][0] = 95;
93  $this->rights[$r][1] = 'Lire CA, bilans, resultats';
94  $this->rights[$r][2] = 'r';
95  $this->rights[$r][3] = 0;
96  $this->rights[$r][4] = 'resultat';
97  $this->rights[$r][5] = 'lire';
98 
99 
100  // Menus
101  //-------
102  $this->menu = 1; // This module add menu entries. They are coded into menu manager.
103  }
104 
105 
114  public function init($options = '')
115  {
116  global $conf;
117 
118  // Nettoyage avant activation
119  $this->remove($options);
120 
121  $sql = array();
122 
123  return $this->_init($sql, $options);
124  }
125 }
Class DolibarrModules.
_init($array_sql, $options='')
Enables a module.
Class to describe and enable module Comptabilite.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:746
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:123