dolibarr/htdocs/includes/modules/modFacture.class.php

189 lines
5.3 KiB
PHP
Raw Normal View History

<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 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>
2003-04-12 17:56:59 +02:00
*
* 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 facture Module facture
\brief Module pour g<EFBFBD>rer les factures clients et/ou fournisseurs
*/
/** \file htdocs/includes/modules/modFacture.class.php
\ingroup facture
\brief Fichier de la classe de description et activation du module Facture
*/
2003-11-13 16:09:12 +01:00
include_once "DolibarrModules.class.php";
2003-04-12 17:56:59 +02:00
/** \class modFacture
\brief Classe de description et activation du module Facture
*/
2003-11-13 16:09:12 +01:00
class modFacture extends DolibarrModules
2003-05-16 14:48:12 +02:00
{
2003-04-12 17:56:59 +02:00
2004-11-23 21:04:19 +01:00
/**
* \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'acc<EFBFBD>s base
*/
function modFacture($DB)
2003-05-16 14:48:12 +02:00
{
2003-04-12 17:56:59 +02:00
$this->db = $DB ;
2003-11-13 16:09:12 +01:00
$this->numero = 30 ;
$this->family = "financial";
2003-11-13 16:09:12 +01:00
$this->name = "Factures";
$this->description = "Gestion des factures";
$this->const_name = "MAIN_MODULE_FACTURE";
$this->const_config = MAIN_MODULE_FACTURE;
2004-11-23 21:04:19 +01:00
$this->special = 0;
// Dir
$this->dirs = array();
2003-11-13 16:09:12 +01:00
// D<>pendances
2003-11-13 16:09:12 +01:00
$this->depends = array("modSociete","modComptabilite");
$this->requiredby = array();
2004-11-23 21:04:19 +01:00
// Config pages
2003-11-07 18:46:37 +01:00
$this->config_page_url = "facture.php";
2004-11-23 21:04:19 +01:00
// Constantes
2003-09-10 18:29:59 +02:00
$this->const = array();
$this->const[0][0] = "FAC_PDF_INTITULE";
$this->const[0][1] = "chaine";
$this->const[0][2] = "Facture Dolibarr";
$this->const[1][0] = "FAC_PDF_ADRESSE";
$this->const[1][1] = "texte";
$this->const[1][2] = "Adresse";
$this->const[2][0] = "FAC_PDF_TEL";
$this->const[2][1] = "chaine";
$this->const[2][2] = "02 97 42 42 42";
$this->const[3][0] = "FAC_PDF_FAX";
$this->const[3][1] = "chaine";
$this->const[3][2] = "02 97 00 00 00";
$this->const[4][0] = "FAC_PDF_INTITULE2";
2003-09-10 18:29:59 +02:00
$this->const[4][1] = "chaine";
$this->const[4][2] = "";
2003-09-10 18:29:59 +02:00
$this->const[5][0] = "FACTURE_ADDON_PDF";
2003-09-10 18:29:59 +02:00
$this->const[5][1] = "chaine";
$this->const[5][2] = "bulot";
2003-09-10 18:29:59 +02:00
$this->const[6][0] = "FACTURE_ADDON";
2003-09-10 18:29:59 +02:00
$this->const[6][1] = "chaine";
$this->const[6][2] = "pluton";
2003-09-10 18:29:59 +02:00
// Boites
2004-11-23 21:04:19 +01:00
$this->boxes = array();
$this->boxes[0][0] = "Factures clients r<>centes impay<61>es";
$this->boxes[0][1] = "box_factures_imp.php";
$this->boxes[1][0] = "Factures fournisseurs r<>centes impay<61>es";
$this->boxes[1][1] = "box_factures_fourn_imp.php";
$this->boxes[2][0] = "Derni<EFBFBD>res factures clients saisies";
$this->boxes[2][1] = "box_factures.php";
2003-09-11 17:19:56 +02:00
$this->boxes[3][0] = "Derni<EFBFBD>res factures fournisseurs saisies";
$this->boxes[3][1] = "box_factures_fourn.php";
// Permissions
$this->rights = array();
$this->rights_class = 'facture';
2003-04-12 17:56:59 +02:00
}
2004-11-23 21:04:19 +01:00
/**
* \brief Fonction appel<EFBFBD>e lors de l'activation du module. Ins<EFBFBD>re en base les constantes, boites, permissions du module.
2004-11-23 21:04:19 +01:00
* D<EFBFBD>finit <EFBFBD>galement les r<EFBFBD>pertoires de donn<EFBFBD>es <EFBFBD> cr<EFBFBD>er pour ce module.
*/
function init()
2003-05-16 14:48:12 +02:00
{
global $conf;
// Permissions
$this->remove();
$this->rights[0][0] = 10;
$this->rights[0][1] = 'Tous les droits sur les factures';
$this->rights[0][2] = 'a';
$this->rights[0][3] = 0;
$this->rights[1][0] = 11;
$this->rights[1][1] = 'Consulter les factures';
$this->rights[1][2] = 'a';
$this->rights[1][3] = 0;
2004-12-09 17:35:06 +01:00
$this->rights[2][0] = 12;
$this->rights[2][1] = 'Cr<43>er/modifier les factures';
$this->rights[2][2] = 'a';
$this->rights[2][3] = 0;
$this->rights[3][0] = 14;
$this->rights[3][1] = 'Valider les factures';
$this->rights[3][2] = 'a';
$this->rights[3][3] = 0;
$this->rights[4][0] = 15;
$this->rights[4][1] = 'Envoyer les factures aux clients';
$this->rights[4][2] = 'a';
$this->rights[4][3] = 0;
$this->rights[5][0] = 16;
$this->rights[5][1] = 'Emettre des paiements sur les factures';
$this->rights[5][2] = 'a';
$this->rights[5][3] = 0;
$this->rights[6][0] = 19;
$this->rights[6][1] = 'Supprimer les factures';
$this->rights[6][2] = 'a';
$this->rights[6][3] = 0;
// Dir
$this->dirs[0] = $conf->facture->dir_output;
$sql = array();
2003-09-11 17:19:56 +02:00
return $this->_init($sql);
2003-04-12 17:56:59 +02:00
}
2004-11-23 21:04:19 +01:00
/**
* \brief Fonction appel<EFBFBD>e lors de la d<EFBFBD>sactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module.
*/
function remove()
2003-07-23 15:58:58 +02:00
{
$sql = array();
2003-09-10 18:29:59 +02:00
return $this->_remove($sql);
2003-07-23 15:58:58 +02:00
}
2003-04-12 17:56:59 +02:00
}
?>