2003-04-12 17:56:59 +02:00
|
|
|
|
<?PHP
|
|
|
|
|
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2004-06-26 19:15:28 +02:00
|
|
|
|
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
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$
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
2003-11-13 16:09:12 +01:00
|
|
|
|
include_once "DolibarrModules.class.php";
|
2003-04-12 17:56:59 +02:00
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Initialisation
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2003-05-16 14:48:12 +02:00
|
|
|
|
Function modFacture($DB)
|
|
|
|
|
|
{
|
2003-04-12 17:56:59 +02:00
|
|
|
|
$this->db = $DB ;
|
2003-11-13 16:09:12 +01:00
|
|
|
|
$this->numero = 30 ;
|
2004-06-26 19:15:28 +02:00
|
|
|
|
|
|
|
|
|
|
$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-06-26 19:15:28 +02:00
|
|
|
|
// D<>pendances
|
2003-11-13 16:09:12 +01:00
|
|
|
|
$this->depends = array("modSociete","modComptabilite");
|
2004-06-26 19:15:28 +02:00
|
|
|
|
$this->requiredby = array();
|
|
|
|
|
|
|
2003-11-07 18:46:37 +01:00
|
|
|
|
$this->config_page_url = "facture.php";
|
2004-06-26 19:15:28 +02:00
|
|
|
|
|
2003-09-10 18:29:59 +02:00
|
|
|
|
$this->const = array();
|
2003-09-11 17:19:56 +02:00
|
|
|
|
$this->boxes = array();
|
2003-09-10 18:29:59 +02:00
|
|
|
|
|
|
|
|
|
|
$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_SIREN";
|
|
|
|
|
|
$this->const[4][1] = "chaine";
|
|
|
|
|
|
$this->const[4][2] = "123 456 789";
|
|
|
|
|
|
|
|
|
|
|
|
$this->const[5][0] = "FAC_PDF_SIRET";
|
|
|
|
|
|
$this->const[5][1] = "chaine";
|
|
|
|
|
|
$this->const[5][2] = "123 456 789 012";
|
|
|
|
|
|
|
|
|
|
|
|
$this->const[6][0] = "FAC_PDF_INTITULE2";
|
|
|
|
|
|
$this->const[6][1] = "chaine";
|
|
|
|
|
|
|
|
|
|
|
|
$this->const[7][0] = "FACTURE_ADDON_PDF";
|
|
|
|
|
|
$this->const[7][1] = "chaine";
|
|
|
|
|
|
$this->const[7][2] = "bulot";
|
|
|
|
|
|
|
|
|
|
|
|
$this->const[8][0] = "FACTURE_ADDON";
|
|
|
|
|
|
$this->const[8][1] = "chaine";
|
|
|
|
|
|
$this->const[8][2] = "pluton";
|
|
|
|
|
|
|
2004-05-08 15:51:26 +02:00
|
|
|
|
// Boxes
|
|
|
|
|
|
$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";
|
|
|
|
|
|
|
2004-05-08 15:59:43 +02:00
|
|
|
|
$this->boxes[2][0] = "Derni<EFBFBD>res factures clients saisies";
|
2004-05-08 15:51:26 +02:00
|
|
|
|
$this->boxes[2][1] = "box_factures.php";
|
2003-09-11 17:19:56 +02:00
|
|
|
|
|
2004-05-08 15:59:43 +02:00
|
|
|
|
$this->boxes[3][0] = "Derni<EFBFBD>res factures fournisseurs saisies";
|
|
|
|
|
|
$this->boxes[3][1] = "box_factures_fourn.php";
|
|
|
|
|
|
|
2003-04-12 17:56:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
|
|
|
*
|
|
|
|
|
|
*
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2003-05-16 14:48:12 +02:00
|
|
|
|
Function init()
|
|
|
|
|
|
{
|
2003-08-10 14:27:07 +02:00
|
|
|
|
/*
|
|
|
|
|
|
* Permissions
|
|
|
|
|
|
*/
|
2003-08-12 15:27:27 +02:00
|
|
|
|
$sql = array(
|
2004-02-01 02:19:35 +01:00
|
|
|
|
"insert into ".MAIN_DB_PREFIX."rights_def values (10,'Tous les droits sur les factures','facture','a',0);",
|
|
|
|
|
|
"insert into ".MAIN_DB_PREFIX."rights_def values (11,'Lire les factures','facture','r',1);",
|
|
|
|
|
|
"insert into ".MAIN_DB_PREFIX."rights_def values (12,'Cr<43>er modifier les factures','facture','w',0);",
|
|
|
|
|
|
//"insert into ".MAIN_DB_PREFIX."rights_def values (13,'Modifier les factures d\'autrui','facture','m',0);",
|
|
|
|
|
|
"insert into ".MAIN_DB_PREFIX."rights_def values (14,'Valider les factures','facture','d',0);",
|
|
|
|
|
|
"insert into ".MAIN_DB_PREFIX."rights_def values (15,'Envoyer les factures aux clients','facture','d',0);",
|
|
|
|
|
|
"insert into ".MAIN_DB_PREFIX."rights_def values (16,'Emettre des paiements sur les factures','facture','d',0);",
|
|
|
|
|
|
"insert into ".MAIN_DB_PREFIX."rights_def values (19,'Supprimer les factures','facture','d',0);"
|
2003-08-12 15:27:27 +02:00
|
|
|
|
);
|
2003-08-10 14:27:07 +02:00
|
|
|
|
|
2003-09-11 17:19:56 +02:00
|
|
|
|
return $this->_init($sql);
|
2003-04-12 17:56:59 +02:00
|
|
|
|
}
|
2003-07-23 15:58:58 +02:00
|
|
|
|
/*
|
|
|
|
|
|
*
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
Function remove()
|
|
|
|
|
|
{
|
2003-09-11 17:19:56 +02:00
|
|
|
|
$sql = array(
|
2004-02-01 02:19:35 +01:00
|
|
|
|
"DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'facture';"
|
2003-09-11 17:19:56 +02:00
|
|
|
|
);
|
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
|
|
|
|
}
|
|
|
|
|
|
?>
|