Files
Cleo/docs/cleo-202512021157.sql
Pierre e96ad7a244 feat(v2.0.4): Corrections diverses et tri des tableaux devis
- Correction affichage email contact dans SAP (models/msap.php)
- Ajout fonctionnalité tri des tableaux devis (jsap.js, jdevis.js)
- Améliorations diverses vues devis et SAP
- Mise à jour contrôleurs et modèles export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 10:32:19 +01:00

1230 lines
47 KiB
SQL

/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.19-11.8.3-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: cleo
-- ------------------------------------------------------
-- Server version 11.4.8-MariaDB-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
--
-- Table structure for table `clients`
--
DROP TABLE IF EXISTS `clients`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `clients` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`code` int(11) NOT NULL,
`libelle` varchar(75) DEFAULT NULL,
`siret` char(14) DEFAULT NULL,
`adresse1` varchar(50) DEFAULT NULL,
`adresse2` varchar(50) DEFAULT NULL,
`adresse3` varchar(50) DEFAULT NULL,
`cp` char(5) DEFAULT NULL,
`ville` varchar(50) DEFAULT NULL,
`type_client` varchar(5) DEFAULT NULL,
`contact_nom` varchar(50) DEFAULT NULL,
`contact_prenom` varchar(50) DEFAULT NULL,
`contact_fonction` varchar(50) DEFAULT NULL,
`telephone` varchar(20) DEFAULT NULL,
`mobile` varchar(20) DEFAULT NULL,
`email` varchar(75) DEFAULT NULL,
`chk_import` tinyint(1) DEFAULT NULL,
`date_creat` datetime DEFAULT NULL,
`fk_user_creat` int(11) DEFAULT NULL,
`date_modif` datetime DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`),
UNIQUE KEY `code_UNIQUE` (`code`),
KEY `libelle` (`libelle`),
KEY `cp` (`cp`)
) ENGINE=InnoDB AUTO_INCREMENT=5309 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `clients_contacts`
--
DROP TABLE IF EXISTS `clients_contacts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `clients_contacts` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_client` int(11) NOT NULL,
`nom` varchar(50) DEFAULT NULL,
`prenom` varchar(50) DEFAULT NULL,
`fonction` varchar(50) DEFAULT NULL,
`telephone` varchar(20) DEFAULT NULL,
`mobile` varchar(20) DEFAULT NULL,
`email` varchar(75) DEFAULT NULL,
`principal` tinyint(1) DEFAULT 0 COMMENT 'Contact principal du client',
`active` tinyint(1) DEFAULT 1,
`date_creat` datetime DEFAULT NULL,
`fk_user_creat` int(11) DEFAULT NULL,
`date_modif` datetime DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`),
KEY `fk_client` (`fk_client`),
KEY `principal` (`fk_client`,`principal`),
KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=8199 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Contacts multiples par client' `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `clients_sites`
--
DROP TABLE IF EXISTS `clients_sites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `clients_sites` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_client` int(11) NOT NULL,
`libelle` varchar(75) DEFAULT NULL,
`adresse1` varchar(75) DEFAULT NULL,
`adresse2` varchar(75) DEFAULT NULL,
`adresse3` varchar(75) DEFAULT NULL,
`cp` varchar(9) DEFAULT NULL,
`ville` varchar(45) DEFAULT NULL,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`),
KEY `libelle` (`libelle`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `commerciaux`
--
DROP TABLE IF EXISTS `commerciaux`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `commerciaux` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_entite` int(11) DEFAULT 0,
`fk_region` int(11) DEFAULT 0,
`fk_role` int(11) DEFAULT 0,
`fk_parent` int(11) DEFAULT 0,
`fk_civilite` int(11) DEFAULT 1,
`libelle` varchar(50) DEFAULT '',
`prenom` varchar(50) DEFAULT '',
`adresse1` varchar(45) DEFAULT '',
`adresse2` varchar(45) DEFAULT '',
`adresse3` varchar(45) DEFAULT '',
`cp` varchar(5) DEFAULT '',
`ville` varchar(255) DEFAULT '',
`site` varchar(50) DEFAULT '',
`username` varchar(50) DEFAULT NULL,
`userpass` varchar(60) DEFAULT NULL,
`userpswd` varchar(60) DEFAULT NULL,
`date_debut` date DEFAULT NULL,
`date_fin` date DEFAULT NULL,
`phone` varchar(30) DEFAULT '',
`mobile` varchar(30) DEFAULT '',
`email` varchar(125) DEFAULT '',
`chk_grands_comptes` tinyint(1) DEFAULT 0,
`lst_depts` varchar(250) DEFAULT NULL COMMENT 'Liste de ses départements séparés par une ,',
`note` text DEFAULT NULL,
`sales_rep` varchar(250) DEFAULT '',
`date_creat` datetime DEFAULT NULL,
`fk_user_creat` int(11) DEFAULT 0,
`date_modif` datetime DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT 0,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
KEY `idx_fk_client` (`fk_region`),
KEY `fk_entite` (`fk_entite`),
KEY `fk_role` (`fk_role`),
KEY `libelle` (`libelle`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `commerciaux_entites`
--
DROP TABLE IF EXISTS `commerciaux_entites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `commerciaux_entites` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(45) DEFAULT NULL,
`adresse1` varchar(45) DEFAULT NULL,
`adresse2` varchar(45) DEFAULT NULL,
`adresse3` varchar(45) DEFAULT NULL,
`cp` varchar(5) DEFAULT NULL,
`ville` varchar(45) DEFAULT NULL,
`phone` varchar(15) DEFAULT NULL,
`mobile` varchar(15) DEFAULT NULL,
`email` varchar(75) DEFAULT NULL,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `commerciaux_params`
--
DROP TABLE IF EXISTS `commerciaux_params`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `commerciaux_params` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_commercial` int(11) DEFAULT NULL,
`annee_fiscale` int(11) DEFAULT NULL,
`vte0comm` decimal(5,2) DEFAULT NULL,
`vte0mini` decimal(5,2) DEFAULT NULL,
`vte0maxi` decimal(5,2) DEFAULT NULL,
`vte3mini` decimal(5,2) DEFAULT NULL,
`vte0per` varchar(1) DEFAULT NULL,
`vte0retro` tinyint(1) DEFAULT NULL,
`vte1comm` decimal(5,2) DEFAULT NULL,
`vte1mini` decimal(5,2) DEFAULT NULL,
`vte1maxi` decimal(5,2) DEFAULT NULL,
`vte1per` varchar(1) DEFAULT NULL,
`vte1retro` tinyint(1) DEFAULT NULL,
`vte2comm` decimal(5,2) DEFAULT NULL,
`vte2mini` decimal(5,2) DEFAULT NULL,
`vte2maxi` decimal(5,2) DEFAULT NULL,
`vte2per` varchar(1) DEFAULT NULL,
`vte2retro` tinyint(1) DEFAULT NULL,
`vte3comm` decimal(5,2) DEFAULT NULL,
`vte3maxi` decimal(5,2) DEFAULT NULL,
`vte3per` varchar(1) DEFAULT NULL,
`vte3retro` tinyint(1) DEFAULT NULL,
`vte4comm` decimal(5,2) DEFAULT NULL,
`vte4mini` decimal(5,2) DEFAULT NULL,
`vte4maxi` decimal(5,2) DEFAULT NULL,
`vte4per` varchar(1) DEFAULT NULL,
`vte4retro` tinyint(1) DEFAULT NULL,
`vte5comm` decimal(5,2) DEFAULT NULL,
`vte5mini` decimal(5,2) DEFAULT NULL,
`vte5maxi` decimal(5,2) DEFAULT NULL,
`vte5per` varchar(1) DEFAULT NULL,
`vte5retro` tinyint(1) DEFAULT NULL,
`vte6comm` decimal(5,2) DEFAULT NULL,
`vte6mini` decimal(5,2) DEFAULT NULL,
`vte6maxi` decimal(5,2) DEFAULT NULL,
`vte6per` varchar(1) DEFAULT NULL,
`vte6retro` tinyint(1) DEFAULT NULL,
`vte7comm` decimal(5,2) DEFAULT NULL,
`vte7mini` decimal(5,2) DEFAULT NULL,
`vte7maxi` decimal(5,2) DEFAULT NULL,
`vte7per` varchar(1) DEFAULT NULL,
`vte7retro` tinyint(1) DEFAULT NULL,
`vte8comm` decimal(5,2) DEFAULT NULL,
`vte8mini` decimal(5,2) DEFAULT NULL,
`vte8maxi` decimal(5,2) DEFAULT NULL,
`vte8per` varchar(1) DEFAULT NULL,
`vte8retro` tinyint(1) DEFAULT NULL,
`vte9comm` decimal(5,2) DEFAULT NULL,
`vte9mini` decimal(5,2) DEFAULT NULL,
`vte9maxi` decimal(5,2) DEFAULT NULL,
`vte9per` varchar(1) DEFAULT NULL,
`vte9retro` tinyint(1) DEFAULT NULL,
`objtrim1vte` int(11) DEFAULT NULL,
`objtrim2vte` int(11) DEFAULT NULL,
`objtrim3vte` int(11) DEFAULT NULL,
`objtrim4vte` int(11) DEFAULT NULL,
`objannvte` int(11) DEFAULT NULL,
`objannloc` int(11) DEFAULT NULL,
`objannmaint` int(11) DEFAULT NULL,
`objannmvivre` int(11) DEFAULT NULL,
`vtepalier1comm` decimal(5,2) DEFAULT NULL,
`vtepalier1mini` int(11) DEFAULT NULL,
`vtepalier1maxi` int(11) DEFAULT NULL,
`vtepalier2comm` decimal(5,2) DEFAULT NULL,
`vtepalier2mini` int(11) DEFAULT NULL,
`vtepalier2maxi` int(11) DEFAULT NULL,
`premiumcomm` decimal(5,2) DEFAULT NULL,
`locat1comm` decimal(5,2) DEFAULT NULL,
`locat2comm` decimal(5,2) DEFAULT NULL,
`locataphpcomm` decimal(5,2) DEFAULT NULL,
`maintenance1comm` decimal(5,2) DEFAULT NULL,
`maintenance2comm` decimal(5,2) DEFAULT NULL,
`gccomm` decimal(5,2) DEFAULT NULL,
`export1comm` decimal(5,2) DEFAULT NULL,
`export1mini` int(11) DEFAULT NULL,
`export2comm` decimal(5,2) DEFAULT NULL,
`export2mini` int(11) DEFAULT NULL,
`date_creat` datetime DEFAULT NULL,
`fk_user_creat` int(11) DEFAULT NULL,
`date_modif` datetime DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
`mvivre1comm` decimal(5,2) DEFAULT NULL,
`mvivre1mini` int(11) DEFAULT NULL,
`mvivre2comm` decimal(5,2) DEFAULT NULL,
`mvivre2mini` int(11) DEFAULT NULL,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `devis`
--
DROP TABLE IF EXISTS `devis`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `devis` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_user` int(11) NOT NULL DEFAULT 0,
`dossier` varchar(30) DEFAULT '/',
`date_demande` date NOT NULL DEFAULT '0000-00-00',
`date_remise` date DEFAULT NULL,
`num_opportunite` varchar(8) NOT NULL DEFAULT '',
`fk_client` int(11) NOT NULL DEFAULT 0,
`fk_contact` int(11) DEFAULT NULL,
`fk_marche` int(11) NOT NULL DEFAULT 0,
`fk_statut_devis` int(11) NOT NULL DEFAULT 0,
`chk_clients_secteur` tinyint(1) NOT NULL DEFAULT 1,
`chk_devis_photos` int(11) NOT NULL DEFAULT 0,
`chk_speciaux` tinyint(1) NOT NULL DEFAULT 0,
`montant_total_ht` decimal(10,2) DEFAULT 0.00,
`montant_total_ht_remise` decimal(10,2) DEFAULT 0.00,
`marge_totale` decimal(10,2) DEFAULT 0.00,
`seuil_marge_rr` int(11) NOT NULL DEFAULT 30,
`seuil_marge_dv` int(11) DEFAULT 20,
`commentaire` varchar(255) NOT NULL DEFAULT '',
`comment_devis` varchar(255) NOT NULL DEFAULT '',
`comment_geste_comm` varchar(255) DEFAULT '',
`comment_validat` varchar(255) NOT NULL DEFAULT '',
`chk_validat` tinyint(1) NOT NULL DEFAULT 0,
`fk_user_validat` int(11) NOT NULL DEFAULT 0,
`date_validat` datetime DEFAULT NULL,
`chk_new_statut` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Indique s''il y a eu une mise à jour du statut',
`lib_new_client` varchar(50) NOT NULL DEFAULT '',
`type_new_client` varchar(3) NOT NULL DEFAULT '',
`adresse1_new_client` varchar(50) NOT NULL DEFAULT '',
`adresse2_new_client` varchar(50) NOT NULL DEFAULT '',
`adresse3_new_client` varchar(50) NOT NULL DEFAULT '',
`cp_new_client` varchar(5) NOT NULL DEFAULT '',
`ville_new_client` varchar(50) NOT NULL DEFAULT '',
`contact_new_nom` varchar(50) NOT NULL DEFAULT '',
`contact_new_prenom` varchar(50) NOT NULL DEFAULT '',
`contact_new_fonction` varchar(50) NOT NULL DEFAULT '',
`new_telephone` varchar(20) NOT NULL DEFAULT '',
`new_mobile` varchar(20) NOT NULL DEFAULT '',
`new_email` varchar(75) NOT NULL DEFAULT '',
`chk_maj` tinyint(1) NOT NULL DEFAULT 0,
`date_creat` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`fk_user_creat` int(11) NOT NULL DEFAULT 0,
`date_modif` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`fk_user_modif` int(11) NOT NULL DEFAULT 0,
`active` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`rowid`),
KEY `fk_user` (`fk_user`),
KEY `fk_client` (`fk_client`),
KEY `fk_statut_devis` (`fk_statut_devis`),
KEY `date_demande` (`date_demande`),
KEY `dossier` (`fk_user`,`dossier`),
KEY `fk_contact` (`fk_contact`)
) ENGINE=InnoDB AUTO_INCREMENT=4624 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `devis_histo`
--
DROP TABLE IF EXISTS `devis_histo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `devis_histo` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_devis` int(11) DEFAULT NULL,
`fk_user` int(11) DEFAULT NULL,
`date_histo` datetime DEFAULT NULL,
`commentaire` varchar(255) NOT NULL DEFAULT '',
`chk_comment_devis` tinyint(1) NOT NULL DEFAULT 0,
`chk_comment_devis_pro` tinyint(1) NOT NULL DEFAULT 0,
`fk_statut_devis` int(11) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `devis_histo_fk_devis_index` (`fk_devis`)
) ENGINE=InnoDB AUTO_INCREMENT=22388 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `devis_produits`
--
DROP TABLE IF EXISTS `devis_produits`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `devis_produits` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_devis` int(11) NOT NULL,
`fk_produit` int(11) NOT NULL,
`ordre` tinyint(3) unsigned DEFAULT 0 COMMENT 'Ordre affichage des produits dans le devis et les exports',
`code` varchar(30) NOT NULL DEFAULT '' COMMENT 'code produit',
`libelle` varchar(100) NOT NULL DEFAULT '' COMMENT 'libelle produit',
`qte` int(11) NOT NULL DEFAULT 0,
`totalht` decimal(8,2) NOT NULL DEFAULT 0.00,
`remise` decimal(8,2) NOT NULL DEFAULT 0.00,
`marge` decimal(8,2) NOT NULL DEFAULT 0.00,
`prix_achat_net` decimal(8,2) NOT NULL DEFAULT 0.00,
`prix_vente` decimal(8,2) NOT NULL DEFAULT 0.00,
`pu_vente_remise` decimal(8,2) NOT NULL DEFAULT 0.00,
`prc_discount_1` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_1` int(11) NOT NULL DEFAULT 0,
`prc_discount_2` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_2` int(11) NOT NULL DEFAULT 0,
`prc_discount_3` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_3` int(11) NOT NULL DEFAULT 0,
`prc_discount_4` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_4` int(11) NOT NULL DEFAULT 0,
`prc_discount_5` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_5` int(11) NOT NULL DEFAULT 0,
`prc_discount_6` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_6` int(11) NOT NULL DEFAULT 0,
`chk_prix_net` tinyint(1) NOT NULL DEFAULT 0,
`commentaire` varchar(255) NOT NULL DEFAULT '',
`chk_variante` tinyint(1) DEFAULT 0,
PRIMARY KEY (`rowid`),
KEY `devis_produits__devis` (`fk_devis`),
KEY `devis_produits__produit` (`fk_produit`)
) ENGINE=InnoDB AUTO_INCREMENT=29314 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `devis_speciaux`
--
DROP TABLE IF EXISTS `devis_speciaux`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `devis_speciaux` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_devis` int(11) NOT NULL DEFAULT 0,
`chk_livr_multi` tinyint(1) NOT NULL DEFAULT 0,
`nb_livr` tinyint(4) NOT NULL DEFAULT 0,
`date_livr_1` date DEFAULT NULL,
`fk_produit_1` int(11) DEFAULT NULL,
`code_produit_1` varchar(30) NOT NULL DEFAULT '',
`lib_produit_1` varchar(45) NOT NULL DEFAULT '',
`qte_1` int(11) NOT NULL DEFAULT 0,
`surcout_1` decimal(8,2) NOT NULL DEFAULT 0.00,
`chk_echantillon_1` tinyint(1) NOT NULL DEFAULT 0,
`date_echantillon_1` date DEFAULT NULL,
`lib_concurrent_1` varchar(200) NOT NULL DEFAULT '',
`description_1` varchar(200) NOT NULL DEFAULT '',
`fk_produit_2` int(11) DEFAULT NULL,
`code_produit_2` varchar(30) NOT NULL DEFAULT '',
`lib_produit_2` varchar(45) NOT NULL DEFAULT '',
`qte_2` int(11) NOT NULL DEFAULT 0,
`surcout_2` decimal(8,2) NOT NULL DEFAULT 0.00,
`chk_echantillon_2` tinyint(1) NOT NULL DEFAULT 0,
`date_echantillon_2` date DEFAULT NULL,
`lib_concurrent_2` varchar(200) NOT NULL DEFAULT '',
`description_2` varchar(200) NOT NULL DEFAULT '',
`fk_produit_3` int(11) DEFAULT NULL,
`code_produit_3` varchar(30) NOT NULL DEFAULT '',
`lib_produit_3` varchar(45) NOT NULL DEFAULT '',
`qte_3` int(11) NOT NULL DEFAULT 0,
`surcout_3` decimal(8,2) NOT NULL DEFAULT 0.00,
`chk_echantillon_3` tinyint(1) NOT NULL DEFAULT 0,
`date_echantillon_3` date DEFAULT NULL,
`lib_concurrent_3` varchar(200) NOT NULL DEFAULT '',
`description_3` varchar(200) NOT NULL DEFAULT '',
`fk_produit_4` int(11) DEFAULT NULL,
`code_produit_4` varchar(30) NOT NULL DEFAULT '',
`lib_produit_4` varchar(45) NOT NULL DEFAULT '',
`qte_4` int(11) NOT NULL DEFAULT 0,
`surcout_4` decimal(8,2) NOT NULL DEFAULT 0.00,
`chk_echantillon_4` tinyint(1) NOT NULL DEFAULT 0,
`date_echantillon_4` date DEFAULT NULL,
`lib_concurrent_4` varchar(200) NOT NULL DEFAULT '',
`description_4` varchar(200) NOT NULL DEFAULT '',
`fk_produit_5` int(11) DEFAULT NULL,
`code_produit_5` varchar(30) NOT NULL DEFAULT '',
`lib_produit_5` varchar(45) NOT NULL DEFAULT '',
`qte_5` int(11) NOT NULL DEFAULT 0,
`surcout_5` decimal(8,2) NOT NULL DEFAULT 0.00,
`chk_echantillon_5` tinyint(1) NOT NULL DEFAULT 0,
`date_echantillon_5` date DEFAULT NULL,
`lib_concurrent_5` varchar(200) NOT NULL DEFAULT '',
`description_5` varchar(200) NOT NULL DEFAULT '',
`email` varchar(80) NOT NULL DEFAULT '',
`chk_email` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`rowid`),
UNIQUE KEY `devis_speciaux_fk_devis_uindex` (`fk_devis`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `entites`
--
DROP TABLE IF EXISTS `entites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `entites` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(45) DEFAULT '',
`http_host` varchar(150) DEFAULT '',
`adresse1` varchar(45) DEFAULT '',
`adresse2` varchar(45) DEFAULT '',
`cp` varchar(5) DEFAULT '',
`ville` varchar(45) DEFAULT '',
`type_entite` varchar(5) DEFAULT 'form',
`tva_intra` varchar(15) DEFAULT '',
`rcs` varchar(45) DEFAULT '',
`siret` varchar(17) DEFAULT NULL,
`ape` varchar(5) DEFAULT '',
`num_opca` varchar(15) DEFAULT '',
`logo` varchar(45) DEFAULT '',
`tel1` varchar(20) DEFAULT '',
`tel2` varchar(20) DEFAULT '',
`couleur` varchar(7) DEFAULT '#FFFAF0',
`prefecture` varchar(45) DEFAULT 'Bretagne',
`fk_titre_gerant` int(11) DEFAULT 1,
`gerant_prenom` varchar(45) DEFAULT '',
`gerant_nom` varchar(45) DEFAULT '',
`email` varchar(45) DEFAULT '',
`site_url` varchar(45) DEFAULT '',
`gerant_signature` varchar(45) DEFAULT '',
`tampon_signature` varchar(45) DEFAULT '',
`rib_banque` varchar(5) DEFAULT '',
`rib_guichet` varchar(5) DEFAULT '',
`rib_compte` varchar(11) DEFAULT '',
`rib_cle` varchar(2) DEFAULT '',
`rib_domiciliation` varchar(45) DEFAULT '',
`iban` varchar(33) DEFAULT '',
`bic` varchar(15) DEFAULT '',
`demo` tinyint(1) DEFAULT 0,
`genbase` varchar(45) DEFAULT '0',
`groupebase` varchar(45) DEFAULT '0',
`table_users_gen` varchar(50) DEFAULT '',
`appname` varchar(45) DEFAULT '',
`raz_num_devis` tinyint(1) DEFAULT 0,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `import_ventes`
--
DROP TABLE IF EXISTS `import_ventes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `import_ventes` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`source` varchar(15) DEFAULT '',
`serie` varchar(10) DEFAULT '',
`sales_order_number` int(11) DEFAULT 0,
`sales_order_posting_date` date DEFAULT NULL,
`delivery_note_number` int(11) DEFAULT 0,
`invoice_number` int(11) DEFAULT 0,
`invoice_posting_date` date DEFAULT NULL,
`customer_code` int(11) DEFAULT 0,
`customer` varchar(75) DEFAULT '',
`legal_status` varchar(5) DEFAULT '',
`legal_status_group` varchar(15) DEFAULT '',
`tender_name` varchar(45) DEFAULT '',
`tender` varchar(5) DEFAULT '',
`tender_nr` varchar(15) DEFAULT '',
`premium` varchar(5) DEFAULT '',
`ship_to_name` varchar(75) DEFAULT '',
`ship_to_city` varchar(45) DEFAULT '',
`sales_rep` varchar(75) DEFAULT '',
`market_segment` varchar(5) DEFAULT '',
`invoice_create_date` date DEFAULT NULL,
`delivery_date` date DEFAULT NULL,
`delivery_month` int(11) DEFAULT 0,
`delivery_year` int(11) DEFAULT 0,
`current_document` varchar(10) DEFAULT '',
`budget_eur` decimal(8,2) DEFAULT 0.00,
`sales_order_eur` decimal(8,2) DEFAULT 0.00,
`delivery_note_eur` decimal(8,2) DEFAULT 0.00,
`invoice_eur` decimal(8,2) DEFAULT 0.00,
`internal_comments` varchar(250) DEFAULT '',
`ship_to_code` varchar(75) DEFAULT '',
`opp_sales_force_id` varchar(45) DEFAULT '',
`infirmiere` varchar(45) DEFAULT '',
`f33` varchar(45) DEFAULT '',
PRIMARY KEY (`rowid`),
KEY `source` (`source`),
KEY `serie` (`serie`),
KEY `customer` (`customer`),
KEY `sales_rep` (`sales_rep`)
) ENGINE=InnoDB AUTO_INCREMENT=1486 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `infos`
--
DROP TABLE IF EXISTS `infos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `infos` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`date_infos` date DEFAULT NULL,
`titre_infos` varchar(200) DEFAULT NULL,
`text_infos` text DEFAULT NULL,
`chk_publie` tinyint(1) NOT NULL DEFAULT 1,
`fk_user_creat` int(11) DEFAULT NULL,
`date_creat` datetime DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
`date_modif` datetime DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `infos__date` (`date_infos` DESC)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `marches`
--
DROP TABLE IF EXISTS `marches`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `marches` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`numero` varchar(20) NOT NULL DEFAULT '',
`nom` varchar(50) NOT NULL DEFAULT '',
`libelle` varchar(50) NOT NULL DEFAULT '',
`chk_remise_sur_tg` tinyint(1) NOT NULL DEFAULT 0,
`chk_prix_nets` tinyint(1) NOT NULL DEFAULT 0,
`chk_marche_public` tinyint(1) NOT NULL DEFAULT 0,
`chk_marche_hybride` tinyint(1) DEFAULT 0 COMMENT 'Marché avec des tarifs spécifiques sur certains produits et le reste est pris sur le tarif général (hors marché)',
`taux_remise_trimestrielle` decimal(5,2) DEFAULT NULL,
`taux_remise_semestrielle` decimal(5,2) DEFAULT NULL,
`taux_remise_annuelle` decimal(5,2) DEFAULT NULL,
`date_debut` date DEFAULT NULL,
`date_fin` date DEFAULT NULL,
`date_validite_prix` date DEFAULT NULL,
`franco_de_port` varchar(30) DEFAULT NULL,
`garantie` varchar(150) DEFAULT NULL,
`delai_de_livraison` varchar(20) DEFAULT NULL COMMENT 'en jours ou semaines',
`remises_commerciales` varchar(150) DEFAULT NULL,
`remise_palier_1` tinyint(4) DEFAULT NULL COMMENT 'Palier en k€',
`remise_taux_1` tinyint(4) DEFAULT NULL COMMENT 'Taux en %',
`remise_palier_2` tinyint(4) DEFAULT NULL COMMENT 'Palier en k€',
`remise_taux_2` tinyint(4) DEFAULT NULL COMMENT 'Taux en %',
`remise_palier_3` tinyint(4) DEFAULT NULL COMMENT 'Palier en k€',
`remise_taux_3` tinyint(4) DEFAULT NULL COMMENT 'Taux en %',
`remise_palier_4` tinyint(4) DEFAULT NULL COMMENT 'Palier en k€',
`remise_taux_4` tinyint(4) DEFAULT NULL COMMENT 'Taux en %',
`commentaire` text DEFAULT NULL,
`chk_cache_commerciaux` tinyint(1) DEFAULT 0,
`latitude_marge_rr_max` tinyint(4) DEFAULT 34,
`latitude_marge_dv_max` tinyint(4) DEFAULT 24,
`chk_regle_seuils_marge` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Marché prend en compte les seuils de marge par famille de produits',
`date_import` date DEFAULT NULL,
`date_creat` datetime DEFAULT NULL,
`fk_user_creat` int(11) DEFAULT NULL,
`date_modif` datetime DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=1033 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `marches_listes`
--
DROP TABLE IF EXISTS `marches_listes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `marches_listes` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_marche` int(11) DEFAULT NULL,
`mot_cle` varchar(15) DEFAULT NULL,
`terme_achat` varchar(15) DEFAULT NULL,
`terme_vente` varchar(15) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `fk_marche` (`fk_marche`)
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `marches_produits`
--
DROP TABLE IF EXISTS `marches_produits`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `marches_produits` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_marche` int(11) DEFAULT 0,
`code` varchar(30) DEFAULT '',
`code_fournisseur` varchar(30) DEFAULT '',
`libelle` varchar(100) DEFAULT '',
`groupe` varchar(30) DEFAULT '',
`fk_famille_produit` int(11) NOT NULL DEFAULT 0,
`liste` varchar(45) DEFAULT '',
`prix_achat_brut_reel` decimal(8,2) DEFAULT 0.00,
`prix_achat_calcul_marge` decimal(8,2) DEFAULT 0.00,
`prix_achat_net` decimal(8,2) DEFAULT 0.00,
`prix_vente_public` decimal(8,2) DEFAULT 0.00,
`prc_discount_1` decimal(8,2) DEFAULT 0.00,
`quantite_1` int(11) DEFAULT 0,
`prc_discount_2` decimal(8,2) DEFAULT 0.00,
`quantite_2` int(11) DEFAULT 0,
`prc_discount_3` decimal(8,2) DEFAULT 0.00,
`quantite_3` int(11) DEFAULT 0,
`prc_discount_4` decimal(8,2) DEFAULT 0.00,
`quantite_4` int(11) DEFAULT 0,
`prc_discount_5` decimal(8,2) DEFAULT 0.00,
`quantite_5` int(11) DEFAULT 0,
`prc_discount_6` decimal(8,2) DEFAULT 0.00,
`quantite_6` int(11) DEFAULT 0,
`chk_prix_net` tinyint(1) NOT NULL DEFAULT 0,
`chk_import` tinyint(4) NOT NULL DEFAULT 0,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
KEY `code` (`code`),
KEY `fk_marche` (`fk_marche`),
KEY `libelle` (`libelle`)
) ENGINE=InnoDB AUTO_INCREMENT=246403 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `marches_versions`
--
DROP TABLE IF EXISTS `marches_versions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `marches_versions` (
`rowid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Id',
`libelle` varchar(75) DEFAULT NULL COMMENT 'Libellé',
`date_debut` date DEFAULT NULL COMMENT 'Libellé',
`date_fin` date DEFAULT NULL COMMENT 'Libellé',
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Version des marchés' `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `medias`
--
DROP TABLE IF EXISTS `medias`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `medias` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`dir0` varchar(150) DEFAULT NULL,
`support` varchar(45) DEFAULT NULL,
`support_rowid` int(11) DEFAULT 0,
`fichier` varchar(250) DEFAULT NULL,
`type_fichier` varchar(5) DEFAULT 'pdf',
`description` varchar(100) DEFAULT NULL,
`date_creat` datetime DEFAULT NULL,
`fk_user_creat` int(11) DEFAULT 0,
`date_modif` datetime DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT 0,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`),
KEY `support` (`support`,`support_rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=3878 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `notifications`
--
DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `notifications` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`dateheure` datetime DEFAULT NULL,
`action` varchar(45) DEFAULT '',
`theme` varchar(45) DEFAULT '',
`fk_user` int(11) DEFAULT 0,
`message` varchar(100) DEFAULT '',
`chk_lu` tinyint(1) DEFAULT 0,
PRIMARY KEY (`rowid`) USING BTREE,
UNIQUE KEY `rowid_UNIQUE` (`rowid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=34302 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='Notifications envoyées à l''admin' `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `produits`
--
DROP TABLE IF EXISTS `produits`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `produits` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_marche` int(11) NOT NULL DEFAULT 0,
`code` varchar(30) NOT NULL DEFAULT '0',
`libelle` varchar(100) NOT NULL DEFAULT '0',
`groupe` varchar(30) NOT NULL DEFAULT '',
`liste` varchar(45) DEFAULT '',
`prix_achat_brut_reel` decimal(8,2) NOT NULL DEFAULT 0.00,
`prix_achat_calcul_marge` decimal(8,2) NOT NULL DEFAULT 0.00,
`remise_fournisseur` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Remise en %',
`amplitude_remise_fournisseur` varchar(10) NOT NULL DEFAULT '0',
`prix_achat_net` decimal(8,2) NOT NULL DEFAULT 0.00,
`emballage` decimal(8,2) NOT NULL DEFAULT 0.00,
`transport` decimal(8,2) NOT NULL DEFAULT 0.00,
`total_cout_achat` decimal(8,2) NOT NULL DEFAULT 0.00,
`prix_vente` decimal(8,2) NOT NULL DEFAULT 0.00,
`prc_discount_1` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_1` int(11) NOT NULL DEFAULT 0,
`prc_discount_2` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_2` int(11) NOT NULL DEFAULT 0,
`prc_discount_3` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_3` int(11) NOT NULL DEFAULT 0,
`prc_discount_4` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_4` int(11) NOT NULL DEFAULT 0,
`prc_discount_5` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_5` int(11) NOT NULL DEFAULT 0,
`prc_discount_6` decimal(8,2) NOT NULL DEFAULT 0.00,
`quantite_6` int(11) NOT NULL DEFAULT 0,
`chk_import` tinyint(1) DEFAULT 0,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid` (`rowid`),
KEY `libelle` (`libelle`),
KEY `fk_marche` (`fk_marche`),
KEY `code` (`code`),
KEY `marchecode` (`fk_marche`,`code`)
) ENGINE=InnoDB AUTO_INCREMENT=97758 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `produits_familles`
--
DROP TABLE IF EXISTS `produits_familles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `produits_familles` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`groupe` varchar(30) NOT NULL,
`ordre` tinyint(3) unsigned DEFAULT 0,
`fk_famille` int(11) NOT NULL,
`code_maintenance` varchar(30) NOT NULL DEFAULT '' COMMENT 'code produit contrat maintenance',
`marge_rr` int(11) NOT NULL DEFAULT 30,
`marge_dv` int(11) NOT NULL DEFAULT 20,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `regions`
--
DROP TABLE IF EXISTS `regions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `regions` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(75) DEFAULT NULL,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `simul`
--
DROP TABLE IF EXISTS `simul`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `simul` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_import_vente` int(11) DEFAULT NULL,
`fk_commercial` int(11) DEFAULT NULL,
`invoice_number` int(11) DEFAULT NULL,
`invoice_date` date DEFAULT NULL,
`tender_name` varchar(45) DEFAULT NULL,
`premium` varchar(5) DEFAULT NULL,
`serie` varchar(10) DEFAULT NULL,
`market_segment` varchar(5) DEFAULT NULL,
`invoice_eur` decimal(8,2) DEFAULT NULL,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`),
KEY `invoice_number` (`invoice_number`),
KEY `invoice_eur` (`invoice_eur`)
) ENGINE=InnoDB AUTO_INCREMENT=1057 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`rowid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`fk_entite` int(11) DEFAULT NULL,
`fk_titre` int(11) DEFAULT NULL,
`libelle` varchar(91) DEFAULT NULL,
`prenom` varchar(45) DEFAULT NULL,
`telephone` varchar(25) DEFAULT NULL,
`mobile` varchar(25) DEFAULT NULL,
`username` varchar(50) DEFAULT NULL,
`userpswd` char(60) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`fk_role` int(11) DEFAULT NULL,
`fk_region` int(11) DEFAULT NULL,
`fk_parent` int(11) DEFAULT NULL,
`chk_grands_comptes` tinyint(1) DEFAULT 0,
`lst_depts` varchar(250) DEFAULT NULL,
`initiales` varchar(3) DEFAULT NULL,
`couleur` varchar(7) DEFAULT NULL,
`couleur_private` varchar(7) DEFAULT NULL,
`enligne` tinyint(4) DEFAULT NULL,
`pop3` tinyint(4) DEFAULT NULL,
`imap_host` varchar(45) DEFAULT NULL,
`imap_port` varchar(5) DEFAULT NULL,
`imap_auth` tinyint(4) DEFAULT NULL,
`imap_secure` varchar(5) DEFAULT NULL,
`imap_username` varchar(75) DEFAULT NULL,
`imap_userpass` varchar(60) DEFAULT NULL,
`smtp_host` varchar(45) DEFAULT NULL,
`smtp_port` varchar(5) DEFAULT NULL,
`smtp_auth` tinyint(4) DEFAULT NULL,
`smtp_secure` varchar(5) DEFAULT NULL,
`caldav` tinyint(4) DEFAULT NULL,
`google` tinyint(4) DEFAULT NULL,
`google_email` varchar(75) DEFAULT NULL,
`google_pass` varchar(60) DEFAULT NULL,
`google_calendar1` varchar(75) DEFAULT NULL,
`fk_new_demo` int(11) DEFAULT NULL,
`alert_email` tinyint(4) DEFAULT NULL,
`fk_user_creat` int(11) DEFAULT NULL,
`date_creat` datetime DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
`date_modif` datetime DEFAULT NULL,
`active` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users_entites`
--
DROP TABLE IF EXISTS `users_entites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `users_entites` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(45) DEFAULT '',
`http_host` varchar(150) DEFAULT '',
`adresse1` varchar(45) DEFAULT '',
`adresse2` varchar(45) DEFAULT '',
`cp` varchar(5) DEFAULT '',
`ville` varchar(45) DEFAULT '',
`type_entite` varchar(5) DEFAULT 'form',
`tva_intra` varchar(15) DEFAULT '',
`rcs` varchar(45) DEFAULT '',
`siret` varchar(17) DEFAULT NULL,
`ape` varchar(5) DEFAULT '',
`num_opca` varchar(15) DEFAULT '',
`logo` varchar(45) DEFAULT '',
`tel1` varchar(20) DEFAULT '',
`tel2` varchar(20) DEFAULT '',
`couleur` varchar(7) DEFAULT '#FFFAF0',
`prefecture` varchar(45) DEFAULT 'Bretagne',
`fk_titre_gerant` int(11) DEFAULT 1,
`gerant_prenom` varchar(45) DEFAULT '',
`gerant_nom` varchar(45) DEFAULT '',
`email` varchar(45) DEFAULT '',
`site_url` varchar(45) DEFAULT '',
`gerant_signature` varchar(45) DEFAULT '',
`tampon_signature` varchar(45) DEFAULT '',
`rib_banque` varchar(5) DEFAULT '',
`rib_guichet` varchar(5) DEFAULT '',
`rib_compte` varchar(11) DEFAULT '',
`rib_cle` varchar(2) DEFAULT '',
`rib_domiciliation` varchar(45) DEFAULT '',
`iban` varchar(33) DEFAULT '',
`bic` varchar(15) DEFAULT '',
`demo` tinyint(1) DEFAULT 0,
`genbase` varchar(45) DEFAULT '0',
`groupebase` varchar(45) DEFAULT '0',
`table_users_gen` varchar(50) DEFAULT '',
`appname` varchar(45) DEFAULT '',
`raz_num_devis` tinyint(1) DEFAULT 0,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ventes`
--
DROP TABLE IF EXISTS `ventes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `ventes` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`source` varchar(45) DEFAULT NULL,
`serie` varchar(45) DEFAULT NULL,
`num_commande` int(11) DEFAULT NULL,
`date_commande` date DEFAULT NULL,
`num_livraison` int(11) DEFAULT NULL,
`num_facture` int(11) DEFAULT NULL,
`date_facture` date DEFAULT NULL,
`fk_client` int(11) DEFAULT NULL,
`legal_status` varchar(3) DEFAULT NULL,
`legal_status_group` varchar(10) DEFAULT NULL,
`libelle_offre` varchar(75) DEFAULT NULL,
`chk_offre` tinyint(1) DEFAULT NULL,
`num_offre` varchar(15) DEFAULT NULL,
`chk_premium` tinyint(1) DEFAULT NULL,
`adresse_livraison` varchar(250) DEFAULT NULL,
`ville_livraion` varchar(150) DEFAULT NULL,
`fk_commercial` int(11) DEFAULT NULL,
`segment_marche` varchar(5) DEFAULT NULL,
`date_facture_creat` date DEFAULT NULL,
`date_livraison` date DEFAULT NULL,
`document_en_cours` varchar(20) DEFAULT NULL,
`montant_facture` decimal(10,2) DEFAULT 0.00,
`commentaires` text DEFAULT NULL,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `x_clients_types`
--
DROP TABLE IF EXISTS `x_clients_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `x_clients_types` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`code` char(3) DEFAULT NULL,
`libelle` varchar(20) DEFAULT NULL,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid` (`rowid`),
KEY `code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `x_familles`
--
DROP TABLE IF EXISTS `x_familles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `x_familles` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(20) NOT NULL DEFAULT '',
`ordre` int(11) DEFAULT 0,
`active` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`rowid`),
UNIQUE KEY `x_familles_libelle` (`libelle`),
UNIQUE KEY `x_familles_ordre` (`ordre`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `x_regions`
--
DROP TABLE IF EXISTS `x_regions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `x_regions` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_entite` int(11) DEFAULT 0,
`libelle` varchar(75) DEFAULT '',
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `x_roles`
--
DROP TABLE IF EXISTS `x_roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `x_roles` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(45) DEFAULT '',
`abreviation` varchar(3) DEFAULT '',
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Les différents rôles des utilisateurs' `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `x_statuts_devis`
--
DROP TABLE IF EXISTS `x_statuts_devis`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `x_statuts_devis` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(30) DEFAULT NULL,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`) USING BTREE,
UNIQUE KEY `rowid` (`rowid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `y_pages`
--
DROP TABLE IF EXISTS `y_pages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `y_pages` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_parent` int(11) DEFAULT 0,
`link` varchar(75) DEFAULT NULL,
`libelle` varchar(45) DEFAULT NULL,
`titre` varchar(75) DEFAULT NULL,
`tooltip` varchar(45) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`keywords` varchar(200) DEFAULT NULL,
`script` varchar(45) DEFAULT NULL,
`enmaintenance` tinyint(1) DEFAULT 0 COMMENT '0 libre d''accès, 1 en maintenance mais accès aux données, 2 en maintenance sans accès aux données',
`admin` tinyint(1) DEFAULT 0,
`mail` tinyint(1) DEFAULT 0,
`admtools` tinyint(1) DEFAULT 0,
`magazine` tinyint(1) DEFAULT 0,
`files` tinyint(1) DEFAULT 0,
`editor` tinyint(1) DEFAULT 0,
`autocomplete` tinyint(1) DEFAULT 0,
`print` tinyint(1) DEFAULT 0,
`form` tinyint(1) DEFAULT 0,
`sidebar` tinyint(1) DEFAULT 0,
`chart` tinyint(1) DEFAULT 0,
`agenda` tinyint(1) DEFAULT 0,
`scheduler` tinyint(1) DEFAULT 0,
`osm` tinyint(1) DEFAULT 0,
`layout` varchar(45) DEFAULT 'default.php',
`in_menu` tinyint(1) DEFAULT 1,
`ordre_menu` int(11) DEFAULT 0,
`active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`rowid`),
UNIQUE KEY `rowid_UNIQUE` (`rowid`),
KEY `script` (`script`),
KEY `admin` (`admin`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `z_history`
--
DROP TABLE IF EXISTS `z_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `z_history` (
`fk_user` int(11) NOT NULL,
`libelle` varchar(20) NOT NULL DEFAULT 'tiers',
`fk` int(11) NOT NULL,
`date` timestamp NOT NULL DEFAULT current_timestamp(),
KEY `user` (`fk_user`,`libelle`,`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `z_logs`
--
DROP TABLE IF EXISTS `z_logs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `z_logs` (
`date` datetime NOT NULL,
`ip` varchar(15) NOT NULL,
`host` varchar(50) NOT NULL,
`adrhost` varchar(50) NOT NULL,
`infos` varchar(100) DEFAULT '',
`fk_user` int(11) DEFAULT 0,
`page` varchar(200) NOT NULL,
`commentaire` text NOT NULL,
`chk_notif` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Table des logs' `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `z_sessions`
--
DROP TABLE IF EXISTS `z_sessions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `z_sessions` (
`sid` text NOT NULL,
`fk_user` int(11) NOT NULL,
`role` varchar(10) DEFAULT NULL,
`date_modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`ip` varchar(50) NOT NULL,
`browser` varchar(150) NOT NULL,
`data` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `z_stats`
--
DROP TABLE IF EXISTS `z_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `z_stats` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(75) DEFAULT NULL,
`fk_user` int(11) DEFAULT NULL,
`date` datetime DEFAULT NULL,
`ip` varchar(15) DEFAULT NULL,
`browser` varchar(75) DEFAULT NULL,
`origine` varchar(45) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL,
`active` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci `PAGE_COMPRESSED`='ON';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping routines for database 'cleo'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
-- Dump completed on 2025-12-02 11:57:09