CREATE TABLE `article_modele_abreviation` (
  `article_modele_abreviation_id` int(11) NOT NULL,
  `article_modele_abreviation_modele_id` int(11) NOT NULL,
  `article_modele_abreviation_full_name` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `article_modele_abreviation`
--

INSERT INTO `article_modele_abreviation` (`article_modele_abreviation_id`, `article_modele_abreviation_modele_id`, `article_modele_abreviation_full_name`) VALUES
(1, 1507, 'Remorque Randon'),
(11, 677, 'NISSAN CABSTAR 3.0 122CV DCI'),
(21, 1512, 'MITSUBISHI CANTER'),
(31, 520, 'JMC GL 2.2 112CV'),
(41, 1286, 'HYUNDAI TRACTEUR HD 450 340CV'),
(51, 1285, 'HYUNDAI TRACTEUR HD 170 12T'),
(61, 1283, 'HYUNDAI HD 65 2.6 100CV'),
(71, 1280, 'HYUNDAI HD 35 PLATEAU 100CV '),
(81, 1282, 'HYUNDAI H100 2.6 79CV'),
(91, 1272, 'HINO PLATEAU 300 DUTRO 125CV'),
(101, 1277, 'HINO MALAXEUR 500  410CV'),
(111, 1510, 'CLARK HELI - Chariots 2t5 à 3t5 Série H'),
(121, 464, 'HYUNDAI I 10 I 1.2i 80'),
(131, 818, 'PEUGEOT PARTNER (B9) II 1.6HDI 110 16V Turbo AV FAP'),
(141, 531, 'KIA PICANTO I 1.1i 65 12V'),
(151, 983, 'RENAULT THALIA/SYMBOL I 1.4i 75 8V'),
(161, 913, 'RENAULT KANGOO I 1.9DTI 80 8V Turbo AV'),
(171, 267, 'DACIA SANDERO I 1.5DCI 85 8V Turbo'),
(181, 452, 'HYUNDAI ATOS 1.0i 60 12V'),
(191, 1509, 'MOTO VMS ESTATE'),
(201, 1506, 'MOTO SYM ORBIT 2'),
(211, 458, 'HYUNDAI L1 H1 2.2 HDI 130CV'),
(221, 1286, 'TRACTEUR HD 450'),
(231, 1285, 'TRACTEUR HD 170'),
(241, 1521, 'Remorque Robuste');

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement`
--

CREATE TABLE `article_mouvement` (
  `article_mouvement_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `founisseur_id` bigint(20) DEFAULT NULL,
  `article_id` bigint(20) DEFAULT NULL,
  `article_reference_id` bigint(20) DEFAULT NULL,
  `article_bar_code` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_qr_code` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_date` datetime DEFAULT NULL,
  `article_mouvement_date_day` date DEFAULT NULL,
  `article_production_date` datetime DEFAULT NULL,
  `article_production_date_day` date DEFAULT NULL,
  `article_expiration_date` datetime DEFAULT NULL,
  `article_expiration_date_day` date DEFAULT NULL,
  `article_etat_id` bigint(20) DEFAULT NULL,
  `article_serial_number` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_id_source` bigint(20) DEFAULT NULL,
  `depot_id_destination` bigint(20) DEFAULT NULL,
  `rangement_id` bigint(20) DEFAULT NULL,
  `rangement_path` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_unite_id` int(11) DEFAULT NULL,
  `article_mouvement_quantite` double DEFAULT NULL,
  `article_mouvement_vente_operation_type_id` tinyint(4) DEFAULT NULL,
  `article_mouvement_quantite_restante` double DEFAULT NULL,
  `article_mouvement_quantite_totale` double DEFAULT '0',
  `article_mouvement_epuise` tinyint(1) DEFAULT NULL,
  `article_mouvement_operation_type_id` bigint(20) DEFAULT NULL,
  `article_mouvement_created_by` bigint(20) DEFAULT NULL,
  `article_mouvement_created_date` datetime DEFAULT NULL,
  `article_mouvement_created_date_day` date DEFAULT NULL,
  `article_mouvement_id_destoquage` bigint(20) DEFAULT NULL,
  `article_mouvement_lot_debut` bigint(20) DEFAULT NULL,
  `article_mouvement_lot_fin` bigint(20) DEFAULT NULL,
  `article_mouvement_ordre` bigint(20) DEFAULT NULL,
  `mouvement_id_aquisition` bigint(20) DEFAULT NULL,
  `mouvement_ligne_id_aquisition` bigint(20) DEFAULT NULL,
  `mouvement_ligne_aquisition_date` datetime DEFAULT NULL,
  `mouvement_ligne_aquisition_date_day` date DEFAULT NULL,
  `mouvement_id_destockage` bigint(20) DEFAULT NULL,
  `mouvement_ligne_id_destockage` bigint(20) DEFAULT NULL,
  `montant_achat_unitaire` double DEFAULT NULL,
  `montant_achat_total` double DEFAULT NULL,
  `montant_achat_monnaie` double DEFAULT NULL,
  `cout_commande` double DEFAULT NULL,
  `cout_stockage` double DEFAULT NULL,
  `cout_emballage` double DEFAULT NULL,
  `cout_livraison` double DEFAULT NULL,
  `validated_stock_by` bigint(20) DEFAULT NULL,
  `validated_stock_date` datetime DEFAULT NULL,
  `validated_stock_date_day` date DEFAULT NULL,
  `is_packaged` tinyint(1) DEFAULT NULL,
  `package_type_id` bigint(20) DEFAULT NULL,
  `archived` tinyint(1) DEFAULT NULL,
  `ressource` tinyint(1) DEFAULT NULL,
  `ressource_id` bigint(20) DEFAULT NULL,
  `ressource_magasinage_by` bigint(20) DEFAULT NULL,
  `article_mouvement_stock_entree_date` datetime DEFAULT NULL,
  `article_mouvement_stock_entree_date_day` date DEFAULT NULL,
  `article_mouvement_stock_sortie_date` datetime DEFAULT NULL,
  `article_mouvement_stock_sortie_date_day` date DEFAULT NULL,
  `article_mouvement_stock_sortie` tinyint(1) DEFAULT NULL,
  `lang_id` bigint(20) DEFAULT NULL,
  `article_mouvement_designation_lang_text_id` bigint(20) DEFAULT NULL,
  `article_mouvement_show_quantity` tinyint(1) DEFAULT NULL,
  `article_mouvement_show_supplier` tinyint(1) DEFAULT NULL,
  `article_mouvement_hidden` tinyint(1) DEFAULT NULL,
  `article_mouvement_weight` double DEFAULT NULL,
  `article_mouvement_volume` double DEFAULT NULL,
  `logistique_tracking_number` bigint(20) DEFAULT NULL,
  `logistique_next_depot_id` bigint(20) DEFAULT NULL,
  `logistique_final_depot_id` bigint(20) DEFAULT NULL,
  `logistique_is_delivered` tinyint(1) DEFAULT NULL,
  `logistique_deliver_validated_customer` tinyint(1) DEFAULT NULL,
  `logistique_deliver_validated_date` datetime DEFAULT NULL,
  `logistique_deliver_validated_date_day` date DEFAULT NULL,
  `logistique_deliver_validated_signature` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `logistique_customer_notified` tinyint(1) DEFAULT NULL,
  `comptabilite_type` bigint(20) DEFAULT NULL,
  `entrepot_source` bigint(20) DEFAULT NULL,
  `entrepot_destination` bigint(20) DEFAULT NULL,
  `stock_operation_type` int(11) DEFAULT NULL,
  `montant_achat_unit_pondere` double DEFAULT NULL,
  `montant_achat_valeur_total_stock` double DEFAULT NULL,
  `montant_vente_unitaire` double DEFAULT NULL,
  `montant_vente_total` double DEFAULT NULL,
  `article_mouvement_couleur` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_taille` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_version` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_commentaire` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `article_mouvement_position` varchar(56) COLLATE utf8_unicode_ci DEFAULT NULL,
  `package_cost` double DEFAULT NULL,
  `relation_etat_id` tinyint(4) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déclencheurs `article_mouvement`
--
DELIMITER $$
CREATE TRIGGER `quantite_stock_par_depot` AFTER INSERT ON `article_mouvement` FOR EACH ROW BEGIN
DECLARE qte double;
if(new.article_mouvement_quantite_restante is not null and 
  new.depot_id_destination is not null 
  and new.stock_operation_type=1) then
insert into  article_article_unite_depot values(new.article_id,new.article_mouvement_unite_id,new.depot_id_destination,new.article_mouvement_quantite_restante,0) on duplicate key update
  quantite=quantite+(new.stock_operation_type*new.article_mouvement_quantite_restante);

select sum(aaud.quantite) into qte 
from  article_article_unite_depot aaud
where aaud.article_id = new.article_id
   and aaud.unite_id = new.article_mouvement_unite_id;
update article_article_unite  
      set article_unite_quantite = qte
      where article_unite_id =  new.article_mouvement_unite_id
         and article_id = new.article_id ;
end if;


END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `relation_article_mouvement` AFTER UPDATE ON `article_mouvement` FOR EACH ROW BEGIN
if(new.article_mouvement_quantite_restante <>old.article_mouvement_quantite_restante
 
  and new.stock_operation_type=1
  and new.depot_id_destination is not null)
THEN
 update article_article_unite_depot 
 set   quantite=quantite+(new.article_mouvement_quantite_restante-   old.article_mouvement_quantite_restante)
 where  article_id=new.article_id
 and new.article_mouvement_unite_id=unite_id
 and depot_id=new.depot_id_destination;
 
update article_article_unite  
      set article_unite_quantite  =   article_unite_quantite + (new.article_mouvement_quantite_restante-   old.article_mouvement_quantite_restante)
      where article_unite_id =  new.article_mouvement_unite_id
 and article_id = new.article_id ;
end if;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trigger_maj_quantite_totale` BEFORE INSERT ON `article_mouvement` FOR EACH ROW begin 
 Declare  a ,c,t double;
 Declare b int ;
 Declare type int;

     set c = new.article_mouvement_quantite;
     set b = new.stock_operation_type;
     select
           COALESCE(aau.article_unite_quantite,0)
     into a from article_article_unite aau where aau.article_id=new.article_id and aau.article_unite_id=new.article_mouvement_unite_id ;
      if(a is null)THEN
      set a = 0;
      end if;
  

    if(new.stock_operation_type=1)THEN
    select m.mouvement_type_id into type from mouvement m where m.mouvement_id=NEW.mouvement_id_aquisition ;
    else 
    select m.mouvement_type_id into type from mouvement m where m.mouvement_id=NEW.mouvement_id_destockage ;
    end if ;
    if(new.stock_operation_type=1)THEN
    	set t=a+(b*c);    	 
    ELSE 
    	set t=a;
    end if;
   
    
    set NEW.article_mouvement_quantite_totale=t;


end
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_07`
--

CREATE TABLE `article_mouvement_07` (
  `article_mouvement_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `founisseur_id` bigint(20) DEFAULT NULL,
  `article_id` bigint(20) DEFAULT NULL,
  `article_reference_id` bigint(20) DEFAULT NULL,
  `article_bar_code` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_qr_code` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_date` datetime DEFAULT NULL,
  `article_mouvement_date_day` date DEFAULT NULL,
  `article_production_date` datetime DEFAULT NULL,
  `article_production_date_day` date DEFAULT NULL,
  `article_expiration_date` datetime DEFAULT NULL,
  `article_expiration_date_day` date DEFAULT NULL,
  `article_etat_id` bigint(20) DEFAULT NULL,
  `article_serial_number` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_id_source` bigint(20) DEFAULT NULL,
  `depot_id_destination` bigint(20) DEFAULT NULL,
  `rangement_id` bigint(20) DEFAULT NULL,
  `rangement_path` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_unite_id` int(11) DEFAULT NULL,
  `article_mouvement_quantite` double DEFAULT NULL,
  `article_mouvement_vente_operation_type_id` tinyint(4) DEFAULT NULL,
  `article_mouvement_quantite_restante` double DEFAULT NULL,
  `article_mouvement_quantite_totale` double DEFAULT '0',
  `article_mouvement_epuise` tinyint(1) DEFAULT NULL,
  `article_mouvement_operation_type_id` bigint(20) DEFAULT NULL,
  `article_mouvement_created_by` bigint(20) DEFAULT NULL,
  `article_mouvement_created_date` datetime DEFAULT NULL,
  `article_mouvement_created_date_day` date DEFAULT NULL,
  `article_mouvement_id_destoquage` bigint(20) DEFAULT NULL,
  `article_mouvement_lot_debut` bigint(20) DEFAULT NULL,
  `article_mouvement_lot_fin` bigint(20) DEFAULT NULL,
  `article_mouvement_ordre` bigint(20) DEFAULT NULL,
  `mouvement_id_aquisition` bigint(20) DEFAULT NULL,
  `mouvement_ligne_id_aquisition` bigint(20) DEFAULT NULL,
  `mouvement_ligne_aquisition_date` datetime DEFAULT NULL,
  `mouvement_ligne_aquisition_date_day` date DEFAULT NULL,
  `mouvement_id_destockage` bigint(20) DEFAULT NULL,
  `mouvement_ligne_id_destockage` bigint(20) DEFAULT NULL,
  `montant_achat_unitaire` double DEFAULT NULL,
  `montant_achat_total` double DEFAULT NULL,
  `montant_achat_monnaie` double DEFAULT NULL,
  `cout_commande` double DEFAULT NULL,
  `cout_stockage` double DEFAULT NULL,
  `cout_emballage` double DEFAULT NULL,
  `cout_livraison` double DEFAULT NULL,
  `validated_stock_by` bigint(20) DEFAULT NULL,
  `validated_stock_date` datetime DEFAULT NULL,
  `validated_stock_date_day` date DEFAULT NULL,
  `is_packaged` tinyint(1) DEFAULT NULL,
  `package_type_id` bigint(20) DEFAULT NULL,
  `archived` tinyint(1) DEFAULT NULL,
  `ressource` tinyint(1) DEFAULT NULL,
  `ressource_id` bigint(20) DEFAULT NULL,
  `ressource_magasinage_by` bigint(20) DEFAULT NULL,
  `article_mouvement_stock_entree_date` datetime DEFAULT NULL,
  `article_mouvement_stock_entree_date_day` date DEFAULT NULL,
  `article_mouvement_stock_sortie_date` datetime DEFAULT NULL,
  `article_mouvement_stock_sortie_date_day` date DEFAULT NULL,
  `article_mouvement_stock_sortie` tinyint(1) DEFAULT NULL,
  `lang_id` bigint(20) DEFAULT NULL,
  `article_mouvement_designation_lang_text_id` bigint(20) DEFAULT NULL,
  `article_mouvement_show_quantity` tinyint(1) DEFAULT NULL,
  `article_mouvement_show_supplier` tinyint(1) DEFAULT NULL,
  `article_mouvement_hidden` tinyint(1) DEFAULT NULL,
  `article_mouvement_weight` double DEFAULT NULL,
  `article_mouvement_volume` double DEFAULT NULL,
  `logistique_tracking_number` bigint(20) DEFAULT NULL,
  `logistique_next_depot_id` bigint(20) DEFAULT NULL,
  `logistique_final_depot_id` bigint(20) DEFAULT NULL,
  `logistique_is_delivered` tinyint(1) DEFAULT NULL,
  `logistique_deliver_validated_customer` tinyint(1) DEFAULT NULL,
  `logistique_deliver_validated_date` datetime DEFAULT NULL,
  `logistique_deliver_validated_date_day` date DEFAULT NULL,
  `logistique_deliver_validated_signature` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `logistique_customer_notified` tinyint(1) DEFAULT NULL,
  `comptabilite_type` bigint(20) DEFAULT NULL,
  `entrepot_source` bigint(20) DEFAULT NULL,
  `entrepot_destination` bigint(20) DEFAULT NULL,
  `stock_operation_type` int(11) DEFAULT NULL,
  `montant_achat_unit_pondere` double DEFAULT NULL,
  `montant_achat_valeur_total_stock` double DEFAULT NULL,
  `montant_vente_unitaire` double DEFAULT NULL,
  `montant_vente_total` double DEFAULT NULL,
  `article_mouvement_couleur` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_taille` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_version` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_commentaire` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_article_mouvement`
--

CREATE TABLE `article_mouvement_article_mouvement` (
  `article_mouvement_id` bigint(20) NOT NULL DEFAULT '0',
  `article_mouvement_id2` bigint(20) NOT NULL DEFAULT '0',
  `article_mouvement_operation_type` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_caracteristique`
--

CREATE TABLE `article_mouvement_caracteristique` (
  `article_caracteristique_id` bigint(20) NOT NULL DEFAULT '0',
  `article_mouvement_id` bigint(20) NOT NULL DEFAULT '0',
  `article_valeur` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_mouvement_caracteristique_online_show` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_documentfile`
--

CREATE TABLE `article_mouvement_documentfile` (
  `article_mouvement_id` bigint(20) NOT NULL,
  `document_file_id` bigint(20) NOT NULL,
  `document_type_id` int(11) DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT NULL,
  `document_ordre` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_frais`
--

CREATE TABLE `article_mouvement_frais` (
  `article_mouvement_frais_id` bigint(20) NOT NULL DEFAULT '0',
  `article_mouvement_type_frais_id` bigint(20) DEFAULT NULL,
  `article_mouvement_id` bigint(20) DEFAULT NULL,
  `etat_paiement_id` bigint(20) DEFAULT NULL,
  `montant_frais` double DEFAULT NULL,
  `montant_monnaie_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_frais_documentfile`
--

CREATE TABLE `article_mouvement_frais_documentfile` (
  `article_mouvement_frais_id` bigint(20) NOT NULL,
  `document_file_id` bigint(20) NOT NULL,
  `document_type_id` varchar(4) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT NULL,
  `document_ordre` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_mouvement_ligne`
--

CREATE TABLE `article_mouvement_mouvement_ligne` (
  `article_mouvement_id` bigint(20) NOT NULL DEFAULT '0',
  `mouvement_ligne_id` bigint(20) NOT NULL DEFAULT '0',
  `mouvement_operation_type_id` bigint(20) DEFAULT NULL,
  `mouvement_operation_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_mouvement_ligne_reservation`
--

CREATE TABLE `article_mouvement_mouvement_ligne_reservation` (
  `mouvement_ligne_id` bigint(20) NOT NULL,
  `article_mouvement_id` bigint(20) NOT NULL,
  `quantite` int(11) NOT NULL,
  `commentaire` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `position` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `taille` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `version` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `couleur` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_operation_type`
--

CREATE TABLE `article_mouvement_operation_type` (
  `article_mouvement_operation_type_id` tinyint(4) NOT NULL,
  `article_mouvement_operation_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `article_mouvement_operation_type`
--

INSERT INTO `article_mouvement_operation_type` (`article_mouvement_operation_type_id`, `article_mouvement_operation_type_designation`) VALUES
(1, 'Entrée (Stockage)'),
(2, 'Sortie (Déstockage)');

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_packaging`
--

CREATE TABLE `article_mouvement_packaging` (
  `article_mouvement_id` bigint(20) NOT NULL DEFAULT '0',
  `article_mouvement_packaging_article_mouvement_id` bigint(20) NOT NULL DEFAULT '0',
  `article_mouvement_packaging_pack_date` datetime NOT NULL,
  `article_mouvement_packaging_pack_date_day` date DEFAULT NULL,
  `article_mouvement_packaging_unpack_date` datetime DEFAULT NULL,
  `article_mouvement_packaging_unpack_date_day` bigint(20) DEFAULT NULL,
  `article_mouvement_packaging_pack_by` bigint(20) DEFAULT NULL,
  `article_mouvement_packaging_pack_depot_id` bigint(20) DEFAULT NULL,
  `article_mouvement_packaging_unpack_by` bigint(20) DEFAULT NULL,
  `article_mouvement_packaging_unpack_depot_id` bigint(20) DEFAULT NULL,
  `packaging_biggest_parent_article_mouvement_id` bigint(20) DEFAULT NULL,
  `packaging_biggest_parent_pack_date` datetime DEFAULT NULL,
  `packaging_biggest_parent_pack_date_day` date DEFAULT NULL,
  `packaging_biggest_parent_unpack_date` datetime DEFAULT NULL,
  `packaging_biggest_parent_unpack_date_day` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_rangement`
--

CREATE TABLE `article_mouvement_rangement` (
  `article_mouvement_rangement_id` bigint(20) NOT NULL DEFAULT '0',
  `article_mouvement_id` bigint(20) NOT NULL DEFAULT '0',
  `article_id` bigint(20) NOT NULL DEFAULT '0',
  `article_quantite` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_mouvement_type_frais`
--

CREATE TABLE `article_mouvement_type_frais` (
  `article_mouvement_type_frais_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `article_mouvement_type_frais_designation` text COLLATE utf8_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `article_mouvement_type_frais`
--

INSERT INTO `article_mouvement_type_frais` (`article_mouvement_type_frais_id`, `entreprise_id`, `article_mouvement_type_frais_designation`) VALUES
(1, 122, 'Salaire'),
(2, 122, 'Location'),
(3, 122, 'Consommation'),
(4, 122, 'Production (Matière première)'),
(5, 122, 'Impôts'),
(6, 122, 'Amendes'),
(7, 305, 'Salaire'),
(8, 305, 'Location'),
(9, 305, 'Consommation'),
(10, 305, 'Production (Matière première)'),
(11, 305, 'Impôts'),
(12, 305, 'Amendes');

-- --------------------------------------------------------

--
-- Structure de la table `article_parfume`
--

CREATE TABLE `article_parfume` (
  `article_parfume_id` bigint(20) NOT NULL,
  `article_parfume_designation` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `article_parfume`
--

INSERT INTO `article_parfume` (`article_parfume_id`, `article_parfume_designation`) VALUES
(1, 'Orange'),
(2, 'Mandarine'),
(3, 'Orange abricot'),
(4, 'Ananas');

-- --------------------------------------------------------

--
-- Structure de la table `article_production_project`
--

CREATE TABLE `article_production_project` (
  `project_id` bigint(20) NOT NULL DEFAULT '0',
  `article_id` bigint(20) NOT NULL DEFAULT '0',
  `project_type_id` bigint(20) DEFAULT NULL,
  `project_departement_id` bigint(20) DEFAULT NULL,
  `quantite_article_used` double DEFAULT NULL,
  `quantite_article_producted` double DEFAULT NULL,
  `project_date_debut` datetime DEFAULT NULL,
  `project_date_debut_day` date DEFAULT NULL,
  `project_date_fin` datetime DEFAULT NULL,
  `project_date_fin_day` date DEFAULT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `is_finished` tinyint(1) DEFAULT NULL,
  `prix_revient_unitaire` double DEFAULT NULL,
  `prix_revient_total` double DEFAULT NULL,
  `quality_validated_by` bigint(20) DEFAULT NULL,
  `quality_validated_date` datetime DEFAULT NULL,
  `article_stocked_depot_id` bigint(20) DEFAULT NULL,
  `article_stocked_by` bigint(20) DEFAULT NULL,
  `article_stocked_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_production_task`
--

CREATE TABLE `article_production_task` (
  `article_id` bigint(20) NOT NULL DEFAULT '0',
  `entreprise_id` bigint(20) NOT NULL DEFAULT '0',
  `task_id` bigint(20) NOT NULL DEFAULT '0',
  `article_production_task_quantite` double DEFAULT NULL,
  `article_production_task_date` datetime DEFAULT NULL,
  `article_stock_in_date` datetime DEFAULT NULL,
  `article_mouvement_id` bigint(20) DEFAULT NULL,
  `stock_cost_unit` double DEFAULT NULL,
  `stock_request_cost_unit` double DEFAULT NULL,
  `prix_revient_unitaire` double DEFAULT NULL,
  `prix_revient_total` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `article_taxe`
--

CREATE TABLE `article_taxe` (
  `article_id` bigint(20) NOT NULL DEFAULT '0',
  `taxe_id` bigint(20) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `article_taxe`
--

INSERT INTO `article_taxe` (`article_id`, `taxe_id`) VALUES
(434, 5),
(435, 5),
(436, 5),
(440, 5),
(441, 5),
(442, 5),
(443, 5),
(444, 5),
(445, 5);

-- --------------------------------------------------------

--
-- Structure de la table `article_tmp`
--

CREATE TABLE `article_tmp` (
  `article_id` bigint(20) NOT NULL,
  `article_ref` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `quantite` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `article_tmp1`
--

CREATE TABLE `article_tmp1` (
  `article_id` bigint(20) NOT NULL,
  `article_ref` varchar(10) NOT NULL,
  `quantite` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `article_type`
--

CREATE TABLE `article_type` (
  `article_type_id` bigint(10) NOT NULL,
  `article_type_designation` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `article_type`
--

INSERT INTO `article_type` (`article_type_id`, `article_type_designation`) VALUES
(1, 'Jus'),
(2, 'Gazéifiée'),
(3, 'Maltée'),
(4, 'énergétiques'),
(5, 'Sec'),
(6, 'Sandwich');

-- --------------------------------------------------------

--
-- Structure de la table `article_unite`
--

CREATE TABLE `article_unite` (
  `article_unite_id` int(11) NOT NULL,
  `article_unite_designation` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_unite_abreviation` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `article_unite`
--

INSERT INTO `article_unite` (`article_unite_id`, `article_unite_designation`, `article_unite_abreviation`, `entreprise_id`) VALUES
(1, 'Unité', 'Unité', 122),
(2, 'Boite', 'Boite', 122),
(3, 'Bouteille', 'Bouteille', 122),
(4, 'Carton', 'Carton', 122),
(5, 'Ensemble', 'Ensemble', 122),
(6, 'Fardeau', 'Fardeau', 122),
(7, 'Sachet', 'Sachet', 122),
(8, 'Jeu', 'Jeu', 122),
(9, 'Page', 'Page', 122),
(10, 'Feuille', 'Feuille', 122),
(11, 'Heure', 'Heure', 122),
(12, 'Jour', 'Jour', 122),
(13, 'Semaine', 'Semaine', 122),
(14, 'Mois', 'Mois', 122),
(15, 'Année', 'Année', 122),
(16, 'Litre', 'L', 122),
(17, 'Gramme', 'Gr', 122),
(18, 'Kilogramme', 'Kg', 122),
(19, 'Tonne', 't', 122),
(20, 'Centimètre', 'Cm', 122),
(21, 'Mètre', 'Mètre', 122),
(22, 'Mètre carré', 'Mètre carr', 122),
(23, 'Metre cube', 'M3', 122),
(24, 'Kilomètre', 'Km', 122),
(25, 'Unité', 'Unité', 305),
(26, 'Boite', 'Boite', 305),
(27, 'Bouteille', 'Bouteille', 305),
(28, 'Carton', 'Carton', 305),
(29, 'Ensemble', 'Ensemble', 305),
(30, 'Fardeau', 'Fardeau', 305),
(31, 'Sachet', 'Sachet', 305),
(32, 'Jeu', 'Jeu', 305),
(33, 'Page', 'Page', 305),
(34, 'Feuille', 'Feuille', 305),
(35, 'Heure', 'Heure', 305),
(36, 'Jour', 'Jour', 305),
(37, 'Semaine', 'Semaine', 305),
(38, 'Mois', 'Mois', 305),
(39, 'Année', 'Année', 305),
(40, 'Litre', 'L', 305),
(41, 'Gramme', 'Gr', 305),
(42, 'Kilogramme', 'Kg', 305),
(43, 'Tonne', 't', 305),
(44, 'Centimètre', 'Cm', 305),
(45, 'Mètre', 'Mètre', 305),
(46, 'Mètre carré', 'Mètre carr', 305),
(47, 'Metre cube', 'M3', 305),
(48, 'Kilomètre', 'Km', 305),
(49, 'Bidon', 'Bidon', 305),
(50, 'Paquet', 'Paquet', 305),
(51, 'Rame', 'Rame', 305);

-- --------------------------------------------------------

--
-- Structure de la table `article_unite2`
--

CREATE TABLE `article_unite2` (
  `article_unite_id` tinyint(4) NOT NULL,
  `article_unite_designation` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_unite_abreviation` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `assurance_document`
--

CREATE TABLE `assurance_document` (
  `assurance_id` bigint(20) NOT NULL,
  `document_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `authorization_tag`
--

CREATE TABLE `authorization_tag` (
  `authorization_tag_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) NOT NULL,
  `authorization_tag_designation` varchar(256) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `authorization_tag`
--

INSERT INTO `authorization_tag` (`authorization_tag_id`, `entreprise_id`, `authorization_tag_designation`) VALUES
(1, 122, 'Toute la flotte'),
(2, 122, 'Camion Centre A'),
(3, 122, 'Camion Centre B'),
(4, 122, 'Camion Centre C'),
(5, 122, 'Camion Centre C');

-- --------------------------------------------------------

--
-- Structure de la table `authorization_tag_ressource`
--

CREATE TABLE `authorization_tag_ressource` (
  `authorization_tag_id` bigint(20) NOT NULL,
  `ressource_id` bigint(20) NOT NULL,
  `authorization_read` tinyint(1) DEFAULT NULL,
  `authorization_create` tinyint(1) DEFAULT NULL,
  `authorization_update` tinyint(1) DEFAULT NULL,
  `authorization_delete` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `authorization_tag_user`
--

CREATE TABLE `authorization_tag_user` (
  `authorization_tag_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `is_authorized` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `authorization_tag_user`
--

INSERT INTO `authorization_tag_user` (`authorization_tag_id`, `user_id`, `is_authorized`) VALUES
(1, 4, 1),
(2, 5, NULL),
(2, 6, NULL),
(3, 4, 1),
(3, 7, NULL),
(4, 4, 0),
(4, 8, NULL),
(5, 9, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `autorisation`
--

CREATE TABLE `autorisation` (
  `autorisation_id` int(20) NOT NULL,
  `autorisation_designation` varchar(256) CHARACTER SET latin1 DEFAULT NULL,
  `autorisation_mobile` tinyint(1) DEFAULT NULL,
  `autorisation_client` tinyint(1) DEFAULT NULL,
  `autorisation_vendeur` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `autorisation`
--

INSERT INTO `autorisation` (`autorisation_id`, `autorisation_designation`, `autorisation_mobile`, `autorisation_client`, `autorisation_vendeur`) VALUES
(1, 'Demande de devis', 1, 1, 0),
(2, 'Activer le partage de données au client', 1, 1, 0),
(3, 'respect planning des passage de client ', 0, 0, 1),
(4, 'devis', 1, 0, 1),
(5, 'Le client peut inviter de nouveaux partenaires', 1, 1, 0),
(6, 'Commandes', 1, 1, 0),
(7, 'Retours', 1, 1, 0),
(8, 'Relevé quantité et prix', 1, 1, 0),
(9, 'Promotions', 1, 1, 0),
(10, 'Suivi GPS des livraisons', 1, 1, 0),
(11, 'Impression documents', 1, 1, 0),
(12, 'Recommander de nouveaux clients', 1, 1, 0),
(13, 'Insertion de nouveaux clients', 0, 0, 1),
(14, 'Scanner le SQ-Code Client + distance minimale en Km (Champs de saisie)', 0, 0, 1),
(15, 'Saisir KM véhicule début et fin mission', 0, 0, 1),
(16, 'Suivi GPS du smartphone', 0, 0, 1),
(17, 'Suivi GPS du camion livreur', 0, 0, 1),
(18, 'Consulter l’état du stock mobile', 0, 0, 1),
(19, 'Impression des documents (bons de commandes, et bons de livraison, Encaissement)', 0, 0, 1),
(20, 'Afficher stock dépôt', 0, 0, 1),
(21, 'Dépôt consultation (ComboBox liste des dépôts)', 0, 0, 1),
(22, 'Autorisé les encaissements des livraisons', 0, 0, 1),
(23, 'Autoriser les remises', 0, 0, 1),
(24, 'Commandes clients', 1, 0, 1),
(25, 'Vente mobile', 1, 0, 1),
(26, 'Livraison', 1, 0, 1),
(27, 'Retours', 1, 0, 1),
(28, 'Règlements', 1, 0, 1),
(29, 'Relevé quantité et prix', 1, 0, 1),
(30, 'Promotions', 1, 0, 1),
(31, 'Annuler les visites', 1, 0, 1),
(32, 'Enquêtes', 1, 0, 1);

-- --------------------------------------------------------

--
-- Structure de la table `autorisation_contact`
--

CREATE TABLE `autorisation_contact` (
  `contact_id` bigint(20) NOT NULL,
  `autorisation_id` int(11) NOT NULL,
  `authorized` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `autorite`
--

CREATE TABLE `autorite` (
  `autorite_id` bigint(20) NOT NULL,
  `autorite_designation` varchar(50) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `autorite`
--

INSERT INTO `autorite` (`autorite_id`, `autorite_designation`) VALUES
(1, 'Police'),
(2, 'Gendarmerie'),
(3, 'Douane');

-- --------------------------------------------------------

--
-- Structure de la table `balance_caissier`
--

CREATE TABLE `balance_caissier` (
  `id` int(11) NOT NULL,
  `caissier_id` bigint(20) NOT NULL,
  `reglement_caisse_id` bigint(20) DEFAULT NULL,
  `type_id` int(10) NOT NULL,
  `date` datetime NOT NULL,
  `montant` double DEFAULT NULL,
  `total_credit` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `balance_caissier_mouvement_typre`
--

CREATE TABLE `balance_caissier_mouvement_typre` (
  `mouvement_type_id` bigint(20) NOT NULL,
  `mouvement_designation` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `balance_caissier_mouvement_typre`
--

INSERT INTO `balance_caissier_mouvement_typre` (`mouvement_type_id`, `mouvement_designation`) VALUES
(0, 'Solde initiale'),
(1, 'Ecart apres le physique de caisse'),
(2, 'Ecart apres le physique de caisse principale'),
(3, 'Reglement d\'ecart caissier');

-- --------------------------------------------------------

--
-- Structure de la table `balance_fournisseur`
--

CREATE TABLE `balance_fournisseur` (
  `id` bigint(20) NOT NULL,
  `fournisseur_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `type_id` tinyint(2) NOT NULL,
  `montant` double DEFAULT NULL,
  `total_dettes` double DEFAULT NULL,
  `date_day` date NOT NULL,
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `balance_fournisseur`
--

INSERT INTO `balance_fournisseur` (`id`, `fournisseur_id`, `mouvement_id`, `type_id`, `montant`, `total_dettes`, `date_day`, `date`) VALUES
(1, 556, 1241, 3, 0, 0, '2023-12-13', '2023-12-13 15:33:06');

--
-- Déclencheurs `balance_fournisseur`
--
DELIMITER $$
CREATE TRIGGER `Montant_total_insert` BEFORE INSERT ON `balance_fournisseur` FOR EACH ROW BEGIN
 




end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `Montant_total_update` BEFORE UPDATE ON `balance_fournisseur` FOR EACH ROW BEGIN



	


end
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Structure de la table `balance_fournisseur_mouvement_type`
--

CREATE TABLE `balance_fournisseur_mouvement_type` (
  `mouvement_type_id` bigint(20) NOT NULL,
  `mouvement_designation` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `balance_fournisseur_mouvement_type`
--

INSERT INTO `balance_fournisseur_mouvement_type` (`mouvement_type_id`, `mouvement_designation`) VALUES
(0, 'Solde initial'),
(1, 'Réception'),
(2, 'Retour fournisseur'),
(3, 'Réglement fournisseur');

-- --------------------------------------------------------

--
-- Structure de la table `carburant_bon`
--

CREATE TABLE `carburant_bon` (
  `bon_type_id` int(11) NOT NULL,
  `bon_carb_designation` varchar(256) DEFAULT NULL,
  `bon_montant` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `carburant_bon`
--

INSERT INTO `carburant_bon` (`bon_type_id`, `bon_carb_designation`, `bon_montant`) VALUES
(1, 'Bon Naftal', 690);

-- --------------------------------------------------------

--
-- Structure de la table `carburant_remplissage_balance`
--

CREATE TABLE `carburant_remplissage_balance` (
  `id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) NOT NULL,
  `montant` double DEFAULT NULL,
  `montant_total` double DEFAULT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `indice_km_debut` double DEFAULT '0',
  `indice_km_fin` bigint(20) DEFAULT NULL,
  `date_day` date NOT NULL,
  `station` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `carburant_remplissage_balance`
--

INSERT INTO `carburant_remplissage_balance` (`id`, `vehicule_id`, `montant`, `montant_total`, `mouvement_id`, `indice_km_debut`, `indice_km_fin`, `date_day`, `station`) VALUES
(121, 119, 1000, 1000, 1141, 10000, 10400, '2023-04-06', 'STATION 01'),
(131, 119, 1000, 2000, 1151, 10400, NULL, '2023-04-06', 'STATION 02'),
(141, 4151, 0, 0, 46731, 0, NULL, '2023-11-28', NULL),
(151, 4151, 0, 0, 46741, 0, NULL, '2023-11-28', NULL),
(161, 10, 1000, 1000, 49261, 150000, 6, '2024-01-14', 'st1'),
(171, 6, 1000, 1000, 49311, 156600, NULL, '2024-01-15', 'st2'),
(181, 3, 1500, 1500, 49321, 589000, 12, '2024-01-15', 'st4'),
(191, 2251, 1250, 1250, 49331, 7800300, NULL, '2024-01-15', 'st5'),
(201, 49, 650, 650, 49341, 125000, NULL, '2024-01-15', 'st'),
(211, 3, 5000, 6500, 49611, 12, NULL, '2024-02-13', 'test'),
(221, 241, 580.2, 580.2, 49891, 0, 25875, '2024-03-04', NULL),
(231, 641, 1015.35, 1015.35, 49901, 0, 123, '2024-03-04', 'station a'),
(241, 4251, 58.02, 58.02, 49941, 20000, NULL, '2024-03-05', 'kach blasa'),
(251, 241, 16100.55, 16680.75, 49951, 25875, NULL, '2024-03-05', 'kach blasa'),
(261, 261, 451250.55, 451250.55, 49961, 52225252, NULL, '2024-03-05', 'yyyyyyy'),
(271, 2911, 2901, 2901, 49971, 258258, 2145, '2024-03-05', 'tgvtgv'),
(281, 641, 3568.23, 4583.58, 49981, 123, NULL, '2024-03-05', '123rty'),
(291, 2911, 62226.45, 65127.45, 49991, 2145, NULL, '2024-03-05', 'qwerty'),
(301, 2221, 13228.56, 13228.56, 50001, 456, NULL, '2024-03-05', 'fgfg'),
(311, 3, 0, 5000, 50031, 0, NULL, '2024-03-17', NULL),
(321, 10, 20000, 21000, 50041, 6, NULL, '2024-03-17', 'Station Essence Naftal'),
(331, 9, 0, 0, 50131, 0, NULL, '2024-04-21', NULL),
(341, 9, 0, 0, 50141, 0, NULL, '2024-04-21', NULL),
(351, 9, 0, 0, 50151, 0, NULL, '2024-04-21', NULL),
(361, 9, 0, 0, 50161, 0, NULL, '2024-04-21', NULL),
(371, 9, 0, 0, 50171, 0, NULL, '2024-04-21', NULL),
(381, 3, 0, 0, 50181, 0, NULL, '2024-04-21', NULL),
(391, 3, 0, 0, 50191, 0, NULL, '2024-04-21', NULL),
(401, 27, 100, 100, 50371, 100000, 100100, '2024-06-03', 'S1'),
(411, 27, 1200, 1300, 50381, 100100, NULL, '2024-06-03', 'A2'),
(421, 27, 500, 1700, 50391, 0, 100160, '2024-06-03', '100150'),
(431, 27, 1200, 1700, 50401, 100160, NULL, '2024-06-03', 'S2'),
(441, 1601, 1000, 1000, 50411, 220000, NULL, '2024-06-03', 's2'),
(451, 21, 450, 450, 61, 0, 326, '2024-10-07', NULL),
(461, 11, 333, 333, 71, 0, NULL, '2024-10-08', NULL),
(471, 11, 222, 555, 91, 0, NULL, '2024-10-10', NULL),
(481, 11, 33, 255, 101, 0, NULL, '2024-10-10', NULL),
(491, 1, 2222, 2222, 111, 0, NULL, '2024-10-10', NULL),
(501, 41, 222, 222, 121, 0, NULL, '2024-10-10', NULL),
(511, 41, 666, 888, 131, 0, NULL, '2024-10-10', NULL),
(521, 41, 667, 1333, 141, 0, NULL, '2024-10-10', NULL),
(531, 31, 378, 378, 151, 0, NULL, '2024-10-10', NULL),
(541, 21, 323, 773, 161, 326, NULL, '2024-10-28', NULL),
(551, 21, 33, 356, 171, 326, NULL, '2024-10-30', NULL);

--
-- Déclencheurs `carburant_remplissage_balance`
--
DELIMITER $$
CREATE TRIGGER `Total_ecart_update` BEFORE UPDATE ON `carburant_remplissage_balance` FOR EACH ROW BEGIN
DECLARE cpt date;



end
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Structure de la table `cause_inactivite`
--

CREATE TABLE `cause_inactivite` (
  `cause_inactivite_id` int(11) NOT NULL,
  `cause_inactivite_designation` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `cause_inactivite`
--

INSERT INTO `cause_inactivite` (`cause_inactivite_id`, `cause_inactivite_designation`) VALUES
(1, 'Problème de cash'),
(2, 'Achat D’autre sources'),
(3, 'Problème avec la société (Commercial.Qualité.Retou'),
(4, 'Prix trop élevé'),
(5, 'Demande de contrepartie OAV'),
(6, 'Livraison non conforme au bon de commande'),
(7, 'Produits faible rotation');

-- --------------------------------------------------------

--
-- Structure de la table `cheque_documentFile`
--

CREATE TABLE `cheque_documentFile` (
  `document_id` bigint(20) NOT NULL,
  `cheque_id` int(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `client_planning`
--

CREATE TABLE `client_planning` (
  `client_planning_id` bigint(20) NOT NULL,
  `client_id` bigint(20) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `date_debut` datetime DEFAULT NULL,
  `date_debut_day` date DEFAULT NULL,
  `date_fin` datetime DEFAULT NULL,
  `date_fin_day` date DEFAULT NULL,
  `client_planning_status_id` int(11) DEFAULT NULL,
  `contact_is_in_work` tinyint(1) DEFAULT NULL,
  `is_end_date_defined` tinyint(4) DEFAULT NULL,
  `note` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `client_planning`
--

INSERT INTO `client_planning` (`client_planning_id`, `client_id`, `entreprise_id`, `date_debut`, `date_debut_day`, `date_fin`, `date_fin_day`, `client_planning_status_id`, `contact_is_in_work`, `is_end_date_defined`, `note`) VALUES
(1, 380, 305, '2020-06-28 13:52:40', '2020-06-28', '2020-06-30 13:52:40', '2020-06-30', 1, 1, 1, '111111111111');

-- --------------------------------------------------------

--
-- Structure de la table `client_planning_status`
--

CREATE TABLE `client_planning_status` (
  `client_planning_status_id` int(11) NOT NULL,
  `client_planning_status_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `client_planning_status`
--

INSERT INTO `client_planning_status` (`client_planning_status_id`, `client_planning_status_designation`) VALUES
(1, 'Tournée'),
(2, 'Achat'),
(3, 'communication');

-- --------------------------------------------------------

--
-- Structure de la table `colis`
--

CREATE TABLE `colis` (
  `colis_id` bigint(20) NOT NULL,
  `colis_type_id` int(11) DEFAULT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `colis_designation` varchar(50) DEFAULT NULL,
  `colis_order` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `colis_article_mouvement`
--

CREATE TABLE `colis_article_mouvement` (
  `colis_id` bigint(20) NOT NULL,
  `article_mouvement_id` bigint(20) NOT NULL,
  `quantite` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `colis_type`
--

CREATE TABLE `colis_type` (
  `colis_type_id` int(11) NOT NULL,
  `colis_type_designation` varchar(50) DEFAULT NULL,
  `colis_type_volume` double DEFAULT NULL,
  `colis_type_largeur` double DEFAULT NULL,
  `colis_type_longeur` double DEFAULT NULL,
  `colis_type_article_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `colis_type_article`
--

CREATE TABLE `colis_type_article` (
  `colis_type_id` int(11) NOT NULL,
  `article_id` bigint(20) NOT NULL,
  `nb_max` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `communication_client`
--

CREATE TABLE `communication_client` (
  `communication_client_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL,
  `communication_client_type_id` bigint(20) NOT NULL,
  `date` datetime DEFAULT NULL,
  `resume` varchar(256) DEFAULT NULL,
  `action` text,
  `date_action` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `communication_client`
--

INSERT INTO `communication_client` (`communication_client_id`, `contact_id`, `communication_client_type_id`, `date`, `resume`, `action`, `date_action`) VALUES
(1, 380, 0, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `communication_client_type`
--

CREATE TABLE `communication_client_type` (
  `communication_client_type_id` bigint(20) NOT NULL,
  `communication_client_type_designation` varchar(56) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `communication_client_type`
--

INSERT INTO `communication_client_type` (`communication_client_type_id`, `communication_client_type_designation`) VALUES
(1, 'Réclamation'),
(2, 'Commande'),
(3, 'Demande d\'informations'),
(4, 'Autres');

-- --------------------------------------------------------

--
-- Structure de la table `comptable_compte`
--

CREATE TABLE `comptable_compte` (
  `comptable_compte_id` bigint(20) NOT NULL,
  `comptable_compte_parent_id` bigint(20) DEFAULT NULL,
  `comptable_compte_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `comptable_journal`
--

CREATE TABLE `comptable_journal` (
  `comptable_journal_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `comptable_journal_annee_exercice` int(20) DEFAULT NULL,
  `comptable_plan_id` bigint(20) DEFAULT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `article_mouvement_id` bigint(20) DEFAULT NULL,
  `article_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `comptable_compte_id` bigint(20) DEFAULT NULL,
  `montant_debit` double DEFAULT NULL,
  `montant_credit` double DEFAULT NULL,
  `monnaie_id` bigint(20) DEFAULT NULL,
  `compte_taxe_id` bigint(20) DEFAULT NULL,
  `comptable_journal_etat` tinyint(1) DEFAULT NULL,
  `comptable_journal_date` datetime DEFAULT NULL,
  `comptable_journal_date_day` date DEFAULT NULL,
  `comptable_journal_by` bigint(20) DEFAULT NULL,
  `comptable_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `comptable_plan`
--

CREATE TABLE `comptable_plan` (
  `comptable_plan_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `comptable_plan_exercice_annee` int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `comptes`
--

CREATE TABLE `comptes` (
  `compte_id` bigint(20) NOT NULL,
  `compte_reference` varchar(16) DEFAULT NULL,
  `date_debut` date DEFAULT NULL,
  `date_fin` date DEFAULT NULL,
  `is_archived` tinyint(1) DEFAULT NULL,
  `is_actif` tinyint(1) DEFAULT NULL,
  `created_by` bigint(20) DEFAULT NULL,
  `suggested_by` bigint(20) DEFAULT NULL,
  `methode_contact` varchar(256) DEFAULT NULL,
  `envoi_raport` tinyint(1) DEFAULT NULL,
  `notification` tinyint(1) DEFAULT NULL,
  `date_fin_test` date DEFAULT NULL,
  `created_date` date DEFAULT NULL,
  `type_compte` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `compte_module`
--

CREATE TABLE `compte_module` (
  `compte_id` bigint(20) NOT NULL,
  `module_id` bigint(20) NOT NULL,
  `date_debut` date NOT NULL,
  `date_fin` date NOT NULL,
  `actif` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `compte_operation_mouvement`
--

CREATE TABLE `compte_operation_mouvement` (
  `compte_operation_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(20) NOT NULL,
  `montant_regle` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact`
--

CREATE TABLE `contact` (
  `contact_id` bigint(20) NOT NULL,
  `contact_genre_id` tinyint(4) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_parent_id` bigint(20) DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL,
  `invited_by` bigint(20) DEFAULT NULL,
  `contact_civilite_id` int(11) DEFAULT NULL,
  `contact_nom` varchar(25) DEFAULT NULL,
  `contact_prenom` varchar(25) DEFAULT NULL,
  `contact_raison_sociale` varchar(100) DEFAULT NULL,
  `contact_date_naissance` date DEFAULT NULL,
  `contact_adresse` varchar(256) DEFAULT NULL,
  `contact_commune_id` int(11) DEFAULT NULL,
  `contact_wilaya_id` int(11) DEFAULT NULL,
  `contact_active` tinyint(1) DEFAULT '1',
  `contact_groupe_id` bigint(20) DEFAULT NULL,
  `point_id` bigint(20) DEFAULT NULL,
  `contact_reference_interne` varchar(256) DEFAULT NULL,
  `contact_reference_old_software` varchar(256) DEFAULT NULL,
  `contact_reference_other_software` varchar(256) DEFAULT NULL,
  `contact_default_bank_account` tinyint(4) DEFAULT NULL,
  `contact_pays_id` int(4) DEFAULT NULL,
  `contact_created_by` bigint(20) DEFAULT NULL,
  `contact_capital_sociale` varchar(256) DEFAULT NULL,
  `contact_registre_commerce` varchar(256) DEFAULT NULL,
  `contact_identification_fiscal` varchar(256) DEFAULT NULL,
  `contact_article_imposition` varchar(256) DEFAULT NULL,
  `contact_prefered_payment_method` bigint(20) DEFAULT NULL,
  `contact_remise_percent` double DEFAULT NULL,
  `contact_note` varchar(256) DEFAULT NULL,
  `contact_info_date_naissance` date DEFAULT NULL,
  `contact_info_lieu_naissance` varchar(256) DEFAULT NULL,
  `contact_info_pi_genre` varchar(256) DEFAULT NULL,
  `contact_info_pi_numero` varchar(256) DEFAULT NULL,
  `contact_info_pi_delivre_daira` varchar(256) DEFAULT NULL,
  `contact_info_pi_delivre_date` date DEFAULT NULL,
  `contact_date_start` date DEFAULT NULL,
  `contact_date_finish` date DEFAULT NULL,
  `contact_raison_to_finish` varchar(256) DEFAULT NULL,
  `contact_photo` varchar(256) DEFAULT NULL,
  `contact_blood_type` varchar(256) DEFAULT NULL,
  `contact_etat_civil` varchar(256) DEFAULT NULL,
  `contact_nombre_enfant` tinyint(2) DEFAULT NULL,
  `contact_permis_numero` varchar(256) DEFAULT NULL,
  `contact_permis_date_creation` date DEFAULT NULL,
  `contact_permis_date_fin` date DEFAULT NULL,
  `contact_permis_delivre_par` varchar(256) DEFAULT NULL,
  `contact_permis_a` tinyint(1) DEFAULT NULL,
  `contact_permis_a1` tinyint(1) DEFAULT NULL,
  `contact_permis_b` tinyint(1) DEFAULT NULL,
  `contact_permis_c` tinyint(1) DEFAULT NULL,
  `contact_permis_d` tinyint(1) DEFAULT NULL,
  `contact_permis_e` tinyint(1) DEFAULT NULL,
  `contact_permis_f` tinyint(1) DEFAULT NULL,
  `contact_numero_identification_nationale` varchar(256) DEFAULT NULL,
  `contact_numero_passeport` varchar(256) DEFAULT NULL,
  `contact_monthly_cost` varchar(256) DEFAULT NULL,
  `contact_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_after_timework_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_week_end_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_deleted` tinyint(1) DEFAULT NULL,
  `contact_hidden` tinyint(1) DEFAULT '0',
  `contact_certified` tinyint(1) DEFAULT NULL,
  `contact_km_cost` varchar(256) DEFAULT NULL,
  `contact_cost_type` varchar(256) DEFAULT NULL,
  `societe_secteur_activite_id` bigint(20) DEFAULT NULL,
  `taxe_tva_status_id` tinyint(1) DEFAULT NULL,
  `taux_remise` double DEFAULT NULL,
  `montant_max_credit` double DEFAULT NULL,
  `montant_credit_en_cours` double DEFAULT NULL,
  `delai_paiement_max` double DEFAULT NULL,
  `montant_total_creances_versees` double DEFAULT NULL,
  `contact_password` varchar(256) DEFAULT NULL,
  `contact_planning_status_id` int(11) DEFAULT NULL,
  `relation_travail_current` tinyint(1) DEFAULT NULL,
  `work_in_service` bigint(20) DEFAULT NULL,
  `demande_moyens_in_service` bigint(20) DEFAULT NULL,
  `default_route_id` int(10) DEFAULT NULL,
  `code_client` varchar(20) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `parrainage_id` int(11) DEFAULT NULL,
  `type_commerce_id` int(11) DEFAULT NULL,
  `contact_daira_id` int(11) DEFAULT NULL,
  `position_gps_latitude` varchar(25) DEFAULT NULL,
  `position_gps_longitude` varchar(25) DEFAULT NULL,
  `email` varchar(25) DEFAULT NULL,
  `site_web` varchar(255) DEFAULT NULL,
  `doublons` int(11) DEFAULT NULL,
  `repertoire` varchar(255) DEFAULT NULL,
  `telephone` varchar(15) DEFAULT NULL,
  `num_rc` int(11) DEFAULT NULL,
  `num_nif` int(11) DEFAULT NULL,
  `num_nis` int(11) DEFAULT NULL,
  `num_ai` int(11) DEFAULT NULL,
  `credit_authorized` tinyint(1) DEFAULT '0',
  `is_pet` tinyint(2) DEFAULT NULL,
  `is_pack` tinyint(2) DEFAULT NULL,
  `is_plf` tinyint(2) DEFAULT NULL,
  `new_code` varchar(256) DEFAULT NULL,
  `classement_id` int(10) DEFAULT NULL,
  `is_bisc` tinyint(4) DEFAULT NULL,
  `cause_inactivite_pet_id` tinyint(4) DEFAULT NULL,
  `cause_inactivite_pack_id` tinyint(4) DEFAULT NULL,
  `cause_inactivite_plf_id` tinyint(4) DEFAULT NULL,
  `cause_inactivite_bisc_id` tinyint(4) DEFAULT NULL,
  `article_groupe_prix_id` int(11) DEFAULT NULL,
  `groupe_prevendeur_id` int(10) DEFAULT NULL,
  `total_ecart` double DEFAULT '0',
  `total_credit` double DEFAULT NULL,
  `solde_initial` double DEFAULT NULL,
  `solde_initiale_date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contact`
--

INSERT INTO `contact` (`contact_id`, `contact_genre_id`, `entreprise_id`, `contact_parent_id`, `departement_id`, `invited_by`, `contact_civilite_id`, `contact_nom`, `contact_prenom`, `contact_raison_sociale`, `contact_date_naissance`, `contact_adresse`, `contact_commune_id`, `contact_wilaya_id`, `contact_active`, `contact_groupe_id`, `point_id`, `contact_reference_interne`, `contact_reference_old_software`, `contact_reference_other_software`, `contact_default_bank_account`, `contact_pays_id`, `contact_created_by`, `contact_capital_sociale`, `contact_registre_commerce`, `contact_identification_fiscal`, `contact_article_imposition`, `contact_prefered_payment_method`, `contact_remise_percent`, `contact_note`, `contact_info_date_naissance`, `contact_info_lieu_naissance`, `contact_info_pi_genre`, `contact_info_pi_numero`, `contact_info_pi_delivre_daira`, `contact_info_pi_delivre_date`, `contact_date_start`, `contact_date_finish`, `contact_raison_to_finish`, `contact_photo`, `contact_blood_type`, `contact_etat_civil`, `contact_nombre_enfant`, `contact_permis_numero`, `contact_permis_date_creation`, `contact_permis_date_fin`, `contact_permis_delivre_par`, `contact_permis_a`, `contact_permis_a1`, `contact_permis_b`, `contact_permis_c`, `contact_permis_d`, `contact_permis_e`, `contact_permis_f`, `contact_numero_identification_nationale`, `contact_numero_passeport`, `contact_monthly_cost`, `contact_hourly_cost`, `contact_after_timework_hourly_cost`, `contact_week_end_hourly_cost`, `contact_deleted`, `contact_hidden`, `contact_certified`, `contact_km_cost`, `contact_cost_type`, `societe_secteur_activite_id`, `taxe_tva_status_id`, `taux_remise`, `montant_max_credit`, `montant_credit_en_cours`, `delai_paiement_max`, `montant_total_creances_versees`, `contact_password`, `contact_planning_status_id`, `relation_travail_current`, `work_in_service`, `demande_moyens_in_service`, `default_route_id`, `code_client`, `sync_data`, `sync_id`, `parrainage_id`, `type_commerce_id`, `contact_daira_id`, `position_gps_latitude`, `position_gps_longitude`, `email`, `site_web`, `doublons`, `repertoire`, `telephone`, `num_rc`, `num_nif`, `num_nis`, `num_ai`, `credit_authorized`, `is_pet`, `is_pack`, `is_plf`, `new_code`, `classement_id`, `is_bisc`, `cause_inactivite_pet_id`, `cause_inactivite_pack_id`, `cause_inactivite_plf_id`, `cause_inactivite_bisc_id`, `article_groupe_prix_id`, `groupe_prevendeur_id`, `total_ecart`, `total_credit`, `solde_initial`, `solde_initiale_date`) VALUES
(1, 1, 305, NULL, NULL, NULL, NULL, 'larbi', 'bochra', NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'femelle', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(11, 1, 305, NULL, NULL, NULL, NULL, 'haddad', 'salah', NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'mâle', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(21, 2, 305, NULL, NULL, NULL, NULL, NULL, NULL, 'fournisseur', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(546, 2, 305, NULL, NULL, NULL, NULL, NULL, NULL, 'CAAT ASSURANCES ROUIBA - 145', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(547, 2, 305, NULL, NULL, NULL, NULL, NULL, NULL, 'ALLIANCE ASSURANCES El Madania - 16013', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(548, 2, 305, NULL, NULL, NULL, NULL, NULL, NULL, 'SALAMA ASSURANCES ALGERIE Dellys - 13370', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(692, 2, 305, NULL, NULL, NULL, NULL, NULL, NULL, 'SARL UNIVERS DÉTERGENT', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(1023, 2, 305, NULL, NULL, NULL, NULL, NULL, NULL, 'SAA Assurance', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(1031, 1, 305, NULL, NULL, NULL, NULL, 'controlleur', 'test', NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'mâle', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL),
(1041, 1, 305, NULL, NULL, NULL, NULL, 'test', 'pompiste', NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'mâle', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `contact_07`
--

CREATE TABLE `contact_07` (
  `contact_id` bigint(20) NOT NULL,
  `contact_genre_id` tinyint(4) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_parent_id` bigint(20) DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL,
  `invited_by` bigint(20) DEFAULT NULL,
  `contact_civilite_id` int(11) DEFAULT NULL,
  `contact_nom` varchar(25) DEFAULT NULL,
  `contact_prenom` varchar(25) DEFAULT NULL,
  `contact_raison_sociale` varchar(100) DEFAULT NULL,
  `contact_date_naissance` date DEFAULT NULL,
  `contact_adresse` varchar(256) DEFAULT NULL,
  `contact_commune_id` int(11) DEFAULT NULL,
  `contact_wilaya_id` int(11) DEFAULT NULL,
  `contact_active` tinyint(1) DEFAULT NULL,
  `contact_groupe_id` bigint(20) DEFAULT NULL,
  `point_id` bigint(20) DEFAULT NULL,
  `contact_reference_interne` varchar(256) DEFAULT NULL,
  `contact_reference_old_software` varchar(256) DEFAULT NULL,
  `contact_reference_other_software` varchar(256) DEFAULT NULL,
  `contact_default_bank_account` tinyint(4) DEFAULT NULL,
  `contact_pays_id` int(4) DEFAULT NULL,
  `contact_created_by` bigint(20) DEFAULT NULL,
  `contact_capital_sociale` varchar(256) DEFAULT NULL,
  `contact_registre_commerce` varchar(256) DEFAULT NULL,
  `contact_identification_fiscal` varchar(256) DEFAULT NULL,
  `contact_article_imposition` varchar(256) DEFAULT NULL,
  `contact_prefered_payment_method` bigint(20) DEFAULT NULL,
  `contact_remise_percent` double DEFAULT NULL,
  `contact_note` varchar(256) DEFAULT NULL,
  `contact_info_date_naissance` date DEFAULT NULL,
  `contact_info_lieu_naissance` varchar(256) DEFAULT NULL,
  `contact_info_pi_genre` varchar(256) DEFAULT NULL,
  `contact_info_pi_numero` varchar(256) DEFAULT NULL,
  `contact_info_pi_delivre_daira` varchar(256) DEFAULT NULL,
  `contact_info_pi_delivre_date` date DEFAULT NULL,
  `contact_date_start` date DEFAULT NULL,
  `contact_date_finish` date DEFAULT NULL,
  `contact_raison_to_finish` varchar(256) DEFAULT NULL,
  `contact_photo` varchar(256) DEFAULT NULL,
  `contact_blood_type` varchar(256) DEFAULT NULL,
  `contact_etat_civil` varchar(256) DEFAULT NULL,
  `contact_nombre_enfant` tinyint(2) DEFAULT NULL,
  `contact_permis_numero` varchar(256) DEFAULT NULL,
  `contact_permis_date_creation` date DEFAULT NULL,
  `contact_permis_date_fin` date DEFAULT NULL,
  `contact_permis_delivre_par` varchar(256) DEFAULT NULL,
  `contact_permis_a` tinyint(1) DEFAULT NULL,
  `contact_permis_a1` tinyint(1) DEFAULT NULL,
  `contact_permis_b` tinyint(1) DEFAULT NULL,
  `contact_permis_c` tinyint(1) DEFAULT NULL,
  `contact_permis_d` tinyint(1) DEFAULT NULL,
  `contact_permis_e` tinyint(1) DEFAULT NULL,
  `contact_permis_f` tinyint(1) DEFAULT NULL,
  `contact_numero_identification_nationale` varchar(256) DEFAULT NULL,
  `contact_numero_passeport` varchar(256) DEFAULT NULL,
  `contact_monthly_cost` varchar(256) DEFAULT NULL,
  `contact_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_after_timework_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_week_end_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_deleted` tinyint(1) DEFAULT NULL,
  `contact_hidden` tinyint(1) DEFAULT NULL,
  `contact_certified` tinyint(1) DEFAULT NULL,
  `contact_km_cost` varchar(256) DEFAULT NULL,
  `contact_cost_type` varchar(256) DEFAULT NULL,
  `taxe_tva_status_id` tinyint(1) DEFAULT NULL,
  `taux_remise` double DEFAULT NULL,
  `montant_max_credit` double DEFAULT NULL,
  `montant_credit_en_cours` double DEFAULT NULL,
  `delai_paiement_max` double DEFAULT NULL,
  `montant_total_creances_versees` double DEFAULT NULL,
  `contact_password` varchar(256) DEFAULT NULL,
  `contact_planning_status_id` int(11) DEFAULT NULL,
  `relation_travail_current` tinyint(1) DEFAULT NULL,
  `work_in_service` bigint(20) DEFAULT NULL,
  `demande_moyens_in_service` bigint(20) DEFAULT NULL,
  `default_route_id` int(10) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_2`
--

CREATE TABLE `contact_2` (
  `contact_id` bigint(20) NOT NULL,
  `contact_genre_id` tinyint(4) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_parent_id` bigint(20) DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL,
  `invited_by` bigint(20) DEFAULT NULL,
  `contact_civilite_id` int(11) DEFAULT NULL,
  `contact_nom` varchar(25) DEFAULT NULL,
  `contact_prenom` varchar(25) DEFAULT NULL,
  `contact_raison_sociale` varchar(100) DEFAULT NULL,
  `contact_date_naissance` date DEFAULT NULL,
  `contact_adresse` varchar(256) DEFAULT NULL,
  `contact_commune_id` int(11) DEFAULT NULL,
  `contact_wilaya_id` int(11) DEFAULT NULL,
  `contact_active` tinyint(1) DEFAULT NULL,
  `contact_groupe_id` bigint(20) DEFAULT NULL,
  `point_id` bigint(20) DEFAULT NULL,
  `contact_reference_interne` varchar(256) DEFAULT NULL,
  `contact_reference_old_software` varchar(256) DEFAULT NULL,
  `contact_reference_other_software` varchar(256) DEFAULT NULL,
  `contact_default_bank_account` tinyint(4) DEFAULT NULL,
  `contact_pays_id` int(4) DEFAULT NULL,
  `contact_created_by` bigint(20) DEFAULT NULL,
  `contact_capital_sociale` varchar(256) DEFAULT NULL,
  `contact_registre_commerce` varchar(256) DEFAULT NULL,
  `contact_identification_fiscal` varchar(256) DEFAULT NULL,
  `contact_article_imposition` varchar(256) DEFAULT NULL,
  `contact_prefered_payment_method` bigint(20) DEFAULT NULL,
  `contact_remise_percent` double DEFAULT NULL,
  `contact_note` varchar(256) DEFAULT NULL,
  `contact_info_date_naissance` date DEFAULT NULL,
  `contact_info_lieu_naissance` varchar(256) DEFAULT NULL,
  `contact_info_pi_genre` varchar(256) DEFAULT NULL,
  `contact_info_pi_numero` varchar(256) DEFAULT NULL,
  `contact_info_pi_delivre_daira` varchar(256) DEFAULT NULL,
  `contact_info_pi_delivre_date` date DEFAULT NULL,
  `contact_date_start` date DEFAULT NULL,
  `contact_date_finish` date DEFAULT NULL,
  `contact_raison_to_finish` varchar(256) DEFAULT NULL,
  `contact_photo` varchar(256) DEFAULT NULL,
  `contact_blood_type` varchar(256) DEFAULT NULL,
  `contact_etat_civil` varchar(256) DEFAULT NULL,
  `contact_nombre_enfant` tinyint(2) DEFAULT NULL,
  `contact_permis_numero` varchar(256) DEFAULT NULL,
  `contact_permis_date_creation` date DEFAULT NULL,
  `contact_permis_date_fin` date DEFAULT NULL,
  `contact_permis_delivre_par` varchar(256) DEFAULT NULL,
  `contact_permis_a` tinyint(1) DEFAULT NULL,
  `contact_permis_a1` tinyint(1) DEFAULT NULL,
  `contact_permis_b` tinyint(1) DEFAULT NULL,
  `contact_permis_c` tinyint(1) DEFAULT NULL,
  `contact_permis_d` tinyint(1) DEFAULT NULL,
  `contact_permis_e` tinyint(1) DEFAULT NULL,
  `contact_permis_f` tinyint(1) DEFAULT NULL,
  `contact_numero_identification_nationale` varchar(256) DEFAULT NULL,
  `contact_numero_passeport` varchar(256) DEFAULT NULL,
  `contact_monthly_cost` varchar(256) DEFAULT NULL,
  `contact_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_after_timework_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_week_end_hourly_cost` varchar(256) DEFAULT NULL,
  `contact_deleted` tinyint(1) DEFAULT NULL,
  `contact_hidden` tinyint(1) DEFAULT NULL,
  `contact_certified` tinyint(1) DEFAULT NULL,
  `contact_km_cost` varchar(256) DEFAULT NULL,
  `contact_cost_type` varchar(256) DEFAULT NULL,
  `societe_secteur_activite_id` bigint(20) DEFAULT NULL,
  `taxe_tva_status_id` tinyint(1) DEFAULT NULL,
  `taux_remise` double DEFAULT NULL,
  `montant_max_credit` double DEFAULT NULL,
  `montant_credit_en_cours` double DEFAULT NULL,
  `delai_paiement_max` double DEFAULT NULL,
  `montant_total_creances_versees` double DEFAULT NULL,
  `contact_password` varchar(256) DEFAULT NULL,
  `contact_planning_status_id` int(11) DEFAULT NULL,
  `relation_travail_current` tinyint(1) DEFAULT NULL,
  `work_in_service` bigint(20) DEFAULT NULL,
  `demande_moyens_in_service` bigint(20) DEFAULT NULL,
  `default_route_id` int(10) DEFAULT NULL,
  `code_client` varchar(20) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `parrainage_id` int(11) DEFAULT NULL,
  `type_commerce_id` int(11) DEFAULT NULL,
  `contact_daira_id` int(11) DEFAULT NULL,
  `position_gps_latitude` varchar(25) DEFAULT NULL,
  `position_gps_longitude` varchar(25) DEFAULT NULL,
  `email` varchar(25) DEFAULT NULL,
  `site_web` varchar(255) DEFAULT NULL,
  `doublons` int(11) DEFAULT NULL,
  `repertoire` varchar(255) DEFAULT NULL,
  `telephone` varchar(15) DEFAULT NULL,
  `num_rc` int(11) DEFAULT NULL,
  `num_nif` int(11) DEFAULT NULL,
  `num_nis` int(11) DEFAULT NULL,
  `num_ai` int(11) DEFAULT NULL,
  `credit_authorized` tinyint(1) DEFAULT '0',
  `is_pet` tinyint(2) DEFAULT NULL,
  `is_pack` tinyint(2) DEFAULT NULL,
  `is_plf` tinyint(2) DEFAULT NULL,
  `new_code` varchar(256) DEFAULT NULL,
  `classement_id` int(10) DEFAULT NULL,
  `is_bisc` tinyint(4) DEFAULT NULL,
  `cause_inactivite_pet_id` tinyint(4) DEFAULT NULL,
  `cause_inactivite_pack_id` tinyint(4) DEFAULT NULL,
  `cause_inactivite_plf_id` tinyint(4) DEFAULT NULL,
  `cause_inactivite_bisc_id` tinyint(4) DEFAULT NULL,
  `article_groupe_prix_id` int(11) DEFAULT NULL,
  `groupe_prevendeur_id` int(10) DEFAULT NULL,
  `total_ecart` double DEFAULT '0',
  `total_credit` double DEFAULT NULL,
  `solde_initial` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_attribute`
--

CREATE TABLE `contact_attribute` (
  `contact_attribute_id` bigint(20) NOT NULL DEFAULT '0',
  `contact_attribute_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_attribute_groupe` int(11) DEFAULT NULL,
  `contact_attribute_ordre` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_attribute`
--

INSERT INTO `contact_attribute` (`contact_attribute_id`, `contact_attribute_designation`, `contact_attribute_groupe`, `contact_attribute_ordre`) VALUES
(1, 'Description', 1, 1),
(2, 'Capital social', 1, 2),
(3, 'Physique / Moral', 1, 3),
(4, 'Type de la société', 1, 4),
(5, 'Secteur d\'activité', 1, 5),
(6, 'Gérée par', 1, 6),
(7, 'Logo', 1, 7),
(8, 'Adresse', 2, 1),
(9, 'Code postal', 2, 2),
(10, 'Commune', 2, 3),
(11, 'Wilaya', 2, 4),
(12, 'Téléphone 1', 2, 5),
(13, 'Téléphone 2', 2, 6),
(14, 'Téléphone 3', 2, 7),
(15, 'Fax', 2, 8),
(16, 'Mobile', 2, 9),
(17, 'Email', 2, 10),
(18, 'Site Web', 2, 11),
(19, 'Page Facebook', 2, 12),
(20, 'Page Twitter', 2, 13),
(21, 'Page Google+', 2, 14),
(22, 'Localisation géographique', 2, 15),
(23, 'Longitude', 2, 16),
(24, 'Latitude', 2, 17),
(25, 'N° du Registre de Commerce', 3, 1),
(26, 'N° d\'identification Fiscale', 3, 2),
(27, 'N° d\'Article d\'Imposition', 3, 3),
(28, 'Numéro d’Identification Statistiques', 3, 4),
(29, 'Banque', 3, 5),
(30, 'Agence bancaire', 3, 6),
(31, 'Numéro de compte', 3, 7),
(32, 'Numéro RIB', 3, 8);

-- --------------------------------------------------------

--
-- Structure de la table `contact_attribute_value`
--

CREATE TABLE `contact_attribute_value` (
  `contact_attribute_id` bigint(20) NOT NULL DEFAULT '0',
  `contact_id` bigint(20) NOT NULL DEFAULT '0',
  `contact_attribute_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `share_business` tinyint(1) DEFAULT NULL,
  `share_online` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_bank_info`
--

CREATE TABLE `contact_bank_info` (
  `contact_id` bigint(20) NOT NULL,
  `bank_id` bigint(20) NOT NULL,
  `bank_account_number` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `bank_account_key` int(11) DEFAULT NULL,
  `bank_account_monnaie_id` bigint(20) DEFAULT NULL,
  `bank_account_rib` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `bank_account_creation_date` date DEFAULT NULL,
  `bank_account_closure_date` date DEFAULT NULL,
  `bank_account_is_active` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_can_use`
--

CREATE TABLE `contact_can_use` (
  `contact_id` bigint(20) NOT NULL,
  `ressource_id` bigint(20) NOT NULL,
  `is_time_limited` tinyint(4) DEFAULT NULL,
  `is_weekend_limited` tinyint(4) DEFAULT NULL,
  `hour_start` time DEFAULT NULL,
  `hour_end` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_can_use_limitedday`
--

CREATE TABLE `contact_can_use_limitedday` (
  `contact_id` bigint(11) NOT NULL,
  `ressource_id` bigint(11) NOT NULL,
  `day_of_week` int(1) NOT NULL,
  `hour_start` time DEFAULT NULL,
  `hour_end` time DEFAULT NULL,
  `day_authorized` int(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contact_can_use_limitedday`
--

INSERT INTO `contact_can_use_limitedday` (`contact_id`, `ressource_id`, `day_of_week`, `hour_start`, `hour_end`, `day_authorized`) VALUES
(264, 618, 1, '11:00:00', '17:00:00', 1),
(243, 621, 1, '09:00:00', '18:00:00', 1),
(243, 621, 2, '06:30:00', '18:00:00', 1),
(243, 621, 3, '08:00:00', '17:00:00', 1);

-- --------------------------------------------------------

--
-- Structure de la table `contact_certificate`
--

CREATE TABLE `contact_certificate` (
  `contact_id` bigint(20) NOT NULL,
  `contact_certificate_type_id` int(11) NOT NULL,
  `contact_certificate_date` date NOT NULL,
  `document_file_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_certificate_type`
--

CREATE TABLE `contact_certificate_type` (
  `contact_certificate_type_id` int(11) NOT NULL,
  `contact_certificate_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_certificate_type`
--

INSERT INTO `contact_certificate_type` (`contact_certificate_type_id`, `contact_certificate_type_designation`) VALUES
(1, 'Driver Certificate');

-- --------------------------------------------------------

--
-- Structure de la table `contact_civilite`
--

CREATE TABLE `contact_civilite` (
  `contact_civilite_id` int(11) NOT NULL DEFAULT '0',
  `contact_civilite_designation` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_civilite`
--

INSERT INTO `contact_civilite` (`contact_civilite_id`, `contact_civilite_designation`) VALUES
(3, 'Mlle'),
(2, 'Mme'),
(1, 'Mr');

-- --------------------------------------------------------

--
-- Structure de la table `contact_classement`
--

CREATE TABLE `contact_classement` (
  `contact_classement_id` int(10) NOT NULL,
  `contact_classement_value` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contact_classement`
--

INSERT INTO `contact_classement` (`contact_classement_id`, `contact_classement_value`) VALUES
(1, 'Platinum (Plus de 100 000'),
(2, 'Gold (De 50 001 à 100 000'),
(3, 'Silver (De 30 001 à 50 00'),
(4, 'Bronze (De 15 001 à 30 00'),
(5, 'Classique (De 0 à 15 000 ');

-- --------------------------------------------------------

--
-- Structure de la table `contact_contact_classement`
--

CREATE TABLE `contact_contact_classement` (
  `contact_classement _id` int(10) NOT NULL,
  `contact_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_contact_fonction`
--

CREATE TABLE `contact_contact_fonction` (
  `contact_contact_fonction_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `contact_fonction_id` int(11) DEFAULT NULL,
  `contact_departement_id` bigint(20) DEFAULT NULL,
  `fonction_date_debut` date DEFAULT NULL,
  `fonction_date_fin` date DEFAULT NULL,
  `contact_group_id` bigint(20) DEFAULT NULL,
  `remuneration` double DEFAULT NULL,
  `is_current` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_contact_fonction`
--

INSERT INTO `contact_contact_fonction` (`contact_contact_fonction_id`, `contact_id`, `contact_fonction_id`, `contact_departement_id`, `fonction_date_debut`, `fonction_date_fin`, `contact_group_id`, `remuneration`, `is_current`) VALUES
(1, 11, 32, NULL, NULL, NULL, NULL, NULL, 1),
(11, 1, 35, NULL, NULL, NULL, NULL, NULL, 1),
(21, 1031, 61, NULL, NULL, NULL, NULL, NULL, 1),
(31, 1041, 62, NULL, NULL, NULL, NULL, NULL, 1);

--
-- Déclencheurs `contact_contact_fonction`
--
DELIMITER $$
CREATE TRIGGER `contact_contact_type_insert` AFTER UPDATE ON `contact_contact_fonction` FOR EACH ROW BEGIN
 declare functionCode varchar(20);
 if(new.contact_fonction_id is not null)then
      SELECT cf.contact_fonction_note  into functionCode FROM contact_fonction cf where cf.contact_fonction_id = new.contact_fonction_id ;
      if(functionCode like 'MC') then
		insert ignore into contact_contact_type value(new.contact_id,19);
      end if;
     if(functionCode like 'MG') then
		insert ignore into contact_contact_type value(new.contact_id,1);
      end if;
 end if;
if(new.contact_fonction_id=8)THEN
insert ignore into contact_contact_type value(new.contact_id,28);
insert ignore into contact_contact_type value(new.contact_id,29);
end if ;
if(new.contact_fonction_id=11)THEN
insert ignore into contact_contact_type value(new.contact_id,28);
end if ;
if(new.contact_fonction_id=12)THEN
insert ignore into contact_contact_type value(new.contact_id,29);
end if ;
if(new.contact_fonction_id=12)THEN
insert ignore into contact_contact_type value(new.contact_id,29);
end if ;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `insert_type` AFTER INSERT ON `contact_contact_fonction` FOR EACH ROW BEGIN
 declare functionCode varchar(20);
 if(new.contact_fonction_id is not null)then
      SELECT cf.contact_fonction_note  into functionCode FROM contact_fonction cf where cf.contact_fonction_id = new.contact_fonction_id ;
      if(functionCode like 'MC') then
		insert ignore into contact_contact_type value(new.contact_id,19);
      end if;
        if(functionCode like 'MG') then
		insert ignore into contact_contact_type value(new.contact_id,1);
      end if;
 end if;
if(new.contact_fonction_id=8)THEN
insert ignore into contact_contact_type value(new.contact_id,28);
insert ignore into contact_contact_type value(new.contact_id,29);
end if ;
if(new.contact_fonction_id=11)THEN
insert ignore into contact_contact_type value(new.contact_id,28);
end if ;
if(new.contact_fonction_id=12)THEN
insert ignore into contact_contact_type value(new.contact_id,29);
end if ;
END
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Structure de la table `contact_contact_group`
--

CREATE TABLE `contact_contact_group` (
  `contact_group_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_contact_groupe_client`
--

CREATE TABLE `contact_contact_groupe_client` (
  `groupe_id` bigint(20) NOT NULL,
  `client_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_contact_parametre`
--

CREATE TABLE `contact_contact_parametre` (
  `parametre_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL,
  `parametre_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_contact_type`
--

CREATE TABLE `contact_contact_type` (
  `contact_id` bigint(20) NOT NULL,
  `contact_type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_contact_type`
--

INSERT INTO `contact_contact_type` (`contact_id`, `contact_type_id`) VALUES
(126, 1),
(288, 1),
(126, 2),
(283, 2),
(284, 2),
(285, 2),
(297, 2),
(298, 2),
(2, 6),
(6, 6),
(29, 6),
(121, 6),
(162, 6),
(199, 6),
(297, 8),
(289, 10),
(292, 11),
(299, 11),
(199, 12),
(291, 12),
(290, 13),
(293, 13),
(294, 13),
(217, 14),
(220, 14),
(117, 15),
(132, 15),
(510, 19),
(511, 19),
(512, 19),
(513, 19),
(514, 19),
(515, 19),
(516, 19),
(517, 19),
(518, 19),
(519, 19),
(520, 19),
(521, 19),
(525, 19),
(526, 19),
(668, 19),
(736, 19),
(790, 19),
(832, 19),
(860, 19),
(949, 19),
(991, 19),
(992, 19),
(1005, 19),
(1006, 19),
(1007, 19),
(1008, 19),
(1031, 19),
(1101, 19),
(1111, 19),
(1121, 19),
(1131, 19),
(1141, 19),
(1151, 19),
(1161, 19),
(1171, 19),
(1181, 19),
(1191, 19),
(1201, 19),
(1211, 19),
(1221, 19),
(1271, 19),
(1301, 19),
(1321, 19),
(1341, 19),
(1351, 19),
(1371, 19),
(1411, 19),
(1, 21),
(11, 21),
(313, 21),
(314, 21),
(315, 21),
(316, 21),
(317, 21),
(318, 21),
(319, 21),
(320, 21),
(321, 21),
(322, 21),
(323, 21),
(324, 21),
(325, 21),
(326, 21),
(327, 21),
(328, 21),
(329, 21),
(330, 21),
(331, 21),
(332, 21),
(333, 21),
(334, 21),
(335, 21),
(336, 21),
(337, 21),
(338, 21),
(339, 21),
(340, 21),
(341, 21),
(342, 21),
(343, 21),
(344, 21),
(345, 21),
(346, 21),
(347, 21),
(348, 21),
(349, 21),
(350, 21),
(351, 21),
(352, 21),
(353, 21),
(354, 21),
(355, 21),
(356, 21),
(357, 21),
(358, 21),
(359, 21),
(360, 21),
(361, 21),
(362, 21),
(363, 21),
(364, 21),
(365, 21),
(366, 21),
(367, 21),
(368, 21),
(369, 21),
(370, 21),
(371, 21),
(372, 21),
(373, 21),
(374, 21),
(375, 21),
(376, 21),
(377, 21),
(378, 21),
(379, 21),
(380, 21),
(381, 21),
(382, 21),
(383, 21),
(384, 21),
(385, 21),
(386, 21),
(387, 21),
(388, 21),
(389, 21),
(390, 21),
(391, 21),
(392, 21),
(393, 21),
(394, 21),
(395, 21),
(396, 21),
(397, 21),
(398, 21),
(399, 21),
(400, 21),
(401, 21),
(402, 21),
(403, 21),
(404, 21),
(405, 21),
(406, 21),
(407, 21),
(408, 21),
(409, 21),
(410, 21),
(411, 21),
(412, 21),
(413, 21),
(414, 21),
(415, 21),
(416, 21),
(417, 21),
(418, 21),
(419, 21),
(420, 21),
(421, 21),
(422, 21),
(423, 21),
(424, 21),
(425, 21),
(426, 21),
(427, 21),
(428, 21),
(429, 21),
(430, 21),
(431, 21),
(432, 21),
(433, 21),
(434, 21),
(435, 21),
(436, 21),
(437, 21),
(438, 21),
(439, 21),
(440, 21),
(441, 21),
(442, 21),
(443, 21),
(444, 21),
(445, 21),
(446, 21),
(447, 21),
(448, 21),
(449, 21),
(450, 21),
(451, 21),
(452, 21),
(453, 21),
(454, 21),
(455, 21),
(456, 21),
(457, 21),
(458, 21),
(459, 21),
(460, 21),
(461, 21),
(462, 21),
(463, 21),
(464, 21),
(465, 21),
(466, 21),
(467, 21),
(468, 21),
(469, 21),
(470, 21),
(471, 21),
(472, 21),
(473, 21),
(474, 21),
(475, 21),
(476, 21),
(477, 21),
(478, 21),
(479, 21),
(480, 21),
(481, 21),
(482, 21),
(483, 21),
(484, 21),
(485, 21),
(486, 21),
(487, 21),
(488, 21),
(489, 21),
(490, 21),
(491, 21),
(492, 21),
(493, 21),
(494, 21),
(495, 21),
(496, 21),
(497, 21),
(498, 21),
(499, 21),
(500, 21),
(501, 21),
(502, 21),
(503, 21),
(504, 21),
(505, 21),
(506, 21),
(507, 21),
(508, 21),
(509, 21),
(510, 21),
(511, 21),
(512, 21),
(513, 21),
(514, 21),
(515, 21),
(516, 21),
(517, 21),
(518, 21),
(519, 21),
(520, 21),
(521, 21),
(522, 21),
(523, 21),
(524, 21),
(525, 21),
(526, 21),
(527, 21),
(528, 21),
(529, 21),
(530, 21),
(531, 21),
(532, 21),
(533, 21),
(534, 21),
(535, 21),
(536, 21),
(537, 21),
(538, 21),
(539, 21),
(540, 21),
(541, 21),
(542, 21),
(543, 21),
(544, 21),
(545, 21),
(549, 21),
(550, 21),
(551, 21),
(552, 21),
(553, 21),
(554, 21),
(555, 21),
(557, 21),
(558, 21),
(559, 21),
(560, 21),
(561, 21),
(562, 21),
(563, 21),
(564, 21),
(565, 21),
(566, 21),
(567, 21),
(568, 21),
(569, 21),
(570, 21),
(571, 21),
(572, 21),
(573, 21),
(574, 21),
(575, 21),
(576, 21),
(577, 21),
(578, 21),
(579, 21),
(581, 21),
(582, 21),
(583, 21),
(584, 21),
(585, 21),
(586, 21),
(587, 21),
(589, 21),
(591, 21),
(592, 21),
(593, 21),
(594, 21),
(595, 21),
(596, 21),
(597, 21),
(598, 21),
(599, 21),
(600, 21),
(601, 21),
(602, 21),
(603, 21),
(604, 21),
(605, 21),
(606, 21),
(607, 21),
(608, 21),
(609, 21),
(610, 21),
(611, 21),
(612, 21),
(613, 21),
(614, 21),
(615, 21),
(616, 21),
(617, 21),
(618, 21),
(619, 21),
(620, 21),
(621, 21),
(622, 21),
(623, 21),
(624, 21),
(625, 21),
(626, 21),
(627, 21),
(628, 21),
(629, 21),
(630, 21),
(631, 21),
(632, 21),
(633, 21),
(634, 21),
(635, 21),
(636, 21),
(637, 21),
(638, 21),
(639, 21),
(640, 21),
(641, 21),
(642, 21),
(643, 21),
(644, 21),
(645, 21),
(646, 21),
(647, 21),
(648, 21),
(649, 21),
(650, 21),
(651, 21),
(652, 21),
(653, 21),
(654, 21),
(655, 21),
(656, 21),
(657, 21),
(658, 21),
(659, 21),
(660, 21),
(661, 21),
(662, 21),
(663, 21),
(664, 21),
(665, 21),
(666, 21),
(667, 21),
(668, 21),
(669, 21),
(670, 21),
(671, 21),
(672, 21),
(673, 21),
(674, 21),
(675, 21),
(676, 21),
(677, 21),
(678, 21),
(679, 21),
(680, 21),
(681, 21),
(682, 21),
(683, 21),
(684, 21),
(685, 21),
(686, 21),
(687, 21),
(688, 21),
(689, 21),
(690, 21),
(691, 21),
(693, 21),
(694, 21),
(695, 21),
(696, 21),
(697, 21),
(698, 21),
(699, 21),
(700, 21),
(701, 21),
(702, 21),
(703, 21),
(704, 21),
(705, 21),
(706, 21),
(707, 21),
(708, 21),
(709, 21),
(712, 21),
(713, 21),
(714, 21),
(715, 21),
(716, 21),
(717, 21),
(718, 21),
(719, 21),
(720, 21),
(721, 21),
(722, 21),
(723, 21),
(724, 21),
(725, 21),
(726, 21),
(727, 21),
(728, 21),
(729, 21),
(730, 21),
(731, 21),
(732, 21),
(733, 21),
(734, 21),
(735, 21),
(736, 21),
(737, 21),
(738, 21),
(739, 21),
(740, 21),
(741, 21),
(742, 21),
(743, 21),
(744, 21),
(745, 21),
(746, 21),
(747, 21),
(748, 21),
(749, 21),
(750, 21),
(751, 21),
(752, 21),
(753, 21),
(754, 21),
(755, 21),
(756, 21),
(757, 21),
(758, 21),
(759, 21),
(760, 21),
(761, 21),
(762, 21),
(763, 21),
(764, 21),
(765, 21),
(766, 21),
(767, 21),
(768, 21),
(769, 21),
(770, 21),
(771, 21),
(772, 21),
(773, 21),
(774, 21),
(775, 21),
(776, 21),
(777, 21),
(778, 21),
(779, 21),
(781, 21),
(782, 21),
(783, 21),
(784, 21),
(785, 21),
(786, 21),
(787, 21),
(788, 21),
(789, 21),
(790, 21),
(791, 21),
(792, 21),
(793, 21),
(794, 21),
(795, 21),
(796, 21),
(797, 21),
(798, 21),
(799, 21),
(800, 21),
(801, 21),
(802, 21),
(803, 21),
(804, 21),
(805, 21),
(806, 21),
(807, 21),
(808, 21),
(809, 21),
(810, 21),
(811, 21),
(812, 21),
(813, 21),
(814, 21),
(815, 21),
(816, 21),
(817, 21),
(818, 21),
(819, 21),
(820, 21),
(821, 21),
(822, 21),
(823, 21),
(824, 21),
(825, 21),
(826, 21),
(827, 21),
(828, 21),
(829, 21),
(830, 21),
(831, 21),
(832, 21),
(833, 21),
(834, 21),
(835, 21),
(836, 21),
(837, 21),
(838, 21),
(839, 21),
(840, 21),
(841, 21),
(842, 21),
(843, 21),
(844, 21),
(845, 21),
(846, 21),
(847, 21),
(848, 21),
(849, 21),
(850, 21),
(851, 21),
(853, 21),
(859, 21),
(860, 21),
(861, 21),
(862, 21),
(863, 21),
(864, 21),
(865, 21),
(866, 21),
(867, 21),
(868, 21),
(869, 21),
(870, 21),
(871, 21),
(872, 21),
(873, 21),
(874, 21),
(875, 21),
(876, 21),
(877, 21),
(878, 21),
(879, 21),
(880, 21),
(881, 21),
(882, 21),
(883, 21),
(884, 21),
(885, 21),
(886, 21),
(887, 21),
(888, 21),
(889, 21),
(890, 21),
(891, 21),
(892, 21),
(893, 21),
(894, 21),
(895, 21),
(896, 21),
(897, 21),
(898, 21),
(899, 21),
(900, 21),
(901, 21),
(902, 21),
(903, 21),
(904, 21),
(905, 21),
(906, 21),
(907, 21),
(908, 21),
(909, 21),
(910, 21),
(911, 21),
(912, 21),
(913, 21),
(914, 21),
(915, 21),
(916, 21),
(917, 21),
(918, 21),
(919, 21),
(920, 21),
(921, 21),
(922, 21),
(923, 21),
(924, 21),
(925, 21),
(926, 21),
(927, 21),
(928, 21),
(929, 21),
(930, 21),
(931, 21),
(932, 21),
(933, 21),
(934, 21),
(935, 21),
(937, 21),
(938, 21),
(939, 21),
(940, 21),
(941, 21),
(942, 21),
(943, 21),
(944, 21),
(945, 21),
(946, 21),
(947, 21),
(948, 21),
(949, 21),
(950, 21),
(952, 21),
(953, 21),
(954, 21),
(955, 21),
(956, 21),
(957, 21),
(958, 21),
(959, 21),
(960, 21),
(961, 21),
(962, 21),
(963, 21),
(964, 21),
(965, 21),
(966, 21),
(967, 21),
(968, 21),
(969, 21),
(970, 21),
(971, 21),
(972, 21),
(973, 21),
(974, 21),
(975, 21),
(976, 21),
(977, 21),
(978, 21),
(979, 21),
(980, 21),
(981, 21),
(982, 21),
(983, 21),
(984, 21),
(985, 21),
(986, 21),
(987, 21),
(988, 21),
(989, 21),
(990, 21),
(991, 21),
(992, 21),
(993, 21),
(994, 21),
(995, 21),
(996, 21),
(997, 21),
(998, 21),
(999, 21),
(1000, 21),
(1001, 21),
(1002, 21),
(1003, 21),
(1004, 21),
(1005, 21),
(1006, 21),
(1007, 21),
(1008, 21),
(1009, 21),
(1010, 21),
(1011, 21),
(1012, 21),
(1013, 21),
(1014, 21),
(1015, 21),
(1016, 21),
(1017, 21),
(1018, 21),
(1019, 21),
(1020, 21),
(1021, 21),
(1024, 21),
(1041, 21),
(1101, 21),
(1111, 21),
(1121, 21),
(1131, 21),
(1141, 21),
(1151, 21),
(1161, 21),
(1171, 21),
(1181, 21),
(1191, 21),
(1201, 21),
(1211, 21),
(1221, 21),
(1231, 21),
(1241, 21),
(1251, 21),
(1261, 21),
(1271, 21),
(1281, 21),
(1291, 21),
(1301, 21),
(1311, 21),
(1321, 21),
(1331, 21),
(1341, 21),
(1351, 21),
(1361, 21),
(1371, 21),
(1381, 21),
(1391, 21),
(1401, 21),
(1411, 21),
(1421, 21),
(1431, 21),
(693, 22),
(710, 22),
(711, 22),
(883, 22),
(21, 24),
(556, 24),
(590, 24),
(780, 24),
(852, 24),
(854, 24),
(855, 24),
(856, 24),
(857, 24),
(858, 24),
(936, 24),
(951, 24),
(1022, 24),
(1025, 24),
(305, 27),
(306, 27),
(307, 27),
(308, 27),
(309, 27),
(310, 27),
(311, 27),
(312, 27),
(546, 27),
(547, 27),
(548, 27),
(692, 27),
(1023, 27);

--
-- Déclencheurs `contact_contact_type`
--
DELIMITER $$
CREATE TRIGGER `add_client_point` AFTER INSERT ON `contact_contact_type` FOR EACH ROW begin
 
 insert into localisation_point select 
									null as point_id ,
									entreprise_id,
                                    contact_id,
                                    contact_raison_sociale as point_designation,
                                    position_gps_latitude as  point_latitude ,
									position_gps_longitude as  point_longitude ,
                                    null,null,null,80,null,1,null,
                                    contact_adresse as point_address ,
									null,null,null
									 
								from contact where contact_id=new.contact_id;

 end
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Structure de la table `contact_departement`
--

CREATE TABLE `contact_departement` (
  `departement_id` bigint(20) NOT NULL,
  `departement_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `departement_responsable_id` bigint(20) DEFAULT NULL,
  `departement_parent_id` bigint(20) DEFAULT NULL,
  `departement_note` text COLLATE utf8_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_documentfile`
--

CREATE TABLE `contact_documentfile` (
  `contact_id` bigint(20) NOT NULL,
  `document_file_id` bigint(20) NOT NULL,
  `document_type_id` int(11) DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT NULL,
  `document_ordre` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_ecart_historique`
--

CREATE TABLE `contact_ecart_historique` (
  `id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL,
  `montant` double DEFAULT '0',
  `montant_ecart` double DEFAULT '0',
  `total_ecart` double DEFAULT '0',
  `date_day` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déclencheurs `contact_ecart_historique`
--
DELIMITER $$
CREATE TRIGGER `Total_ecart_insert` BEFORE INSERT ON `contact_ecart_historique` FOR EACH ROW BEGIN
set new.total_ecart =new.montant_ecart+ COALESCE(( select total_ecart	 from contact_ecart_historique 
where contact_id=new.contact_id  and date_day<new.date_day
ORDER by date_day desc limit 1),0) ;
end
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Structure de la table `contact_fonction`
--

CREATE TABLE `contact_fonction` (
  `contact_fonction_id` int(11) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL,
  `contact_fonction_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_fonction_note` text COLLATE utf8_unicode_ci,
  `nombre_ideal_postes` int(11) NOT NULL DEFAULT '0',
  `salaire_net` double NOT NULL DEFAULT '0',
  `securite_sociale` double DEFAULT NULL,
  `irg` double DEFAULT NULL,
  `stablilite_anuelle` int(11) DEFAULT NULL,
  `nombre_actuel` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_fonction`
--

INSERT INTO `contact_fonction` (`contact_fonction_id`, `entreprise_id`, `departement_id`, `contact_fonction_designation`, `contact_fonction_note`, `nombre_ideal_postes`, `salaire_net`, `securite_sociale`, `irg`, `stablilite_anuelle`, `nombre_actuel`) VALUES
(2, 4, 2, 'chef de services', NULL, 0, 0, NULL, NULL, NULL, NULL),
(25, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL),
(26, 122, 10, 'Vendeur', NULL, 5, 1000, 50, 500, NULL, NULL),
(27, 122, 3, 'Chef de service', NULL, 1, 3000, 300, 1500, NULL, NULL),
(28, 122, 3, 'Comptable', NULL, 2, 2000, 100, 1000, NULL, NULL),
(31, 122, 10, 'Chauffeur', 'dsgsq', 3, 1500, 200, 750, NULL, NULL),
(32, 305, 10, 'Chef de parc', NULL, 5, 0, 0, 0, NULL, NULL),
(33, 305, 61, 'Chef de zone', NULL, 1, 1000000, 0, 0, NULL, NULL),
(34, 305, 10, 'Directeur logistique', NULL, 1, 1000000, 0, 0, NULL, NULL),
(35, 305, 10, 'Magasiner PDR', NULL, 2, 33000, 0, 0, NULL, NULL),
(36, 305, 10, 'Chef d\'atelier', NULL, 1, 100000, 0, 0, NULL, NULL),
(37, 305, 10, 'Mécanicien', 'MC', 0, 45000, 0, 0, NULL, NULL),
(38, 305, 10, 'Pré-vendeur', NULL, 100, 100000, 0, 0, NULL, NULL),
(39, 305, 61, 'Directeur des ventes', NULL, 1, 200000, 0, 0, NULL, NULL),
(40, 305, 10, 'Chauffeur', NULL, 150, 40000, 0, 0, NULL, NULL),
(41, 305, 10, 'Tollier', 'MC', 1, 40000, 0, 0, NULL, NULL),
(43, 305, 10, 'Électricien Auto', 'MC', 2, 3000, 0, 0, NULL, NULL),
(44, 305, 10, 'AIDE MÉCANICIEN', 'MC', 6, 45000, 0, 0, NULL, NULL),
(45, 305, 10, 'Agent polyvalent', NULL, 2, 24000, 0, 0, NULL, NULL),
(46, 305, 10, 'Soudeur', 'MC', 2, 30000, 0, 0, NULL, NULL),
(47, 305, 10, 'Acheteur Démarcheur', NULL, 2, 33000, 0, 0, NULL, NULL),
(48, 305, 10, 'Secrétaire', NULL, 1, 0, 0, 0, NULL, NULL),
(49, 305, 10, 'Gestionnaire administratif', NULL, 3, 0, 0, 0, NULL, NULL),
(50, 305, 10, 'Chef de parc principale', NULL, 1, 600000, 0, 0, NULL, NULL),
(51, 305, 61, 'Chef dépôt marchandise', NULL, 1, 0, 0, 0, NULL, NULL),
(52, 305, 61, 'Superviseur', NULL, 20, 50000, 0, 0, NULL, NULL),
(53, 305, 61, 'Caissier', NULL, 1, 80000, 1, 1, NULL, NULL),
(54, 305, 61, 'CHEF WILAYA', NULL, 10, 0, 0, 0, NULL, NULL),
(55, 305, 10, 'Mécanicien Moto', 'MC', 0, 0, 0, 0, NULL, NULL),
(56, 305, 10, 'Agent Lavage', NULL, 2, 0, 0, 0, NULL, NULL),
(57, 305, 10, 'Agent de sécurité', NULL, 35, 30000, 0, 0, NULL, NULL),
(58, 305, 10, 'Chef de groupe d\'agent de sécurité', NULL, 7, 30000, 0, 0, NULL, NULL),
(59, 305, 10, 'Chef de site sécurité', NULL, 1, 30000, 0, 0, NULL, NULL),
(60, 305, 10, 'Hygiène Sécurité Environnement', NULL, 1, 0, 0, 0, NULL, NULL),
(61, 305, 10, 'Contrôleur Matérielle Roulant', NULL, 4, 0, 0, 0, NULL, NULL),
(62, 305, 10, 'Pompiste', NULL, 3, 0, 0, 0, NULL, NULL),
(63, 305, 10, 'Électricien Batiment', NULL, 1, 0, 0, 0, NULL, NULL),
(64, 305, 10, 'Frigoriste Technicien', 'MC', 2, 40000, 0, 0, NULL, NULL),
(65, 305, 10, 'Agent Nettoyage', NULL, 5, 0, 0, 0, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `contact_genre`
--

CREATE TABLE `contact_genre` (
  `contact_genre_id` tinyint(4) NOT NULL,
  `contact_genre_designation` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_genre`
--

INSERT INTO `contact_genre` (`contact_genre_id`, `contact_genre_designation`) VALUES
(1, 'Personne'),
(2, 'Entreprise');

-- --------------------------------------------------------

--
-- Structure de la table `contact_group`
--

CREATE TABLE `contact_group` (
  `contact_group_id` bigint(20) NOT NULL,
  `contact_group_name` varchar(40) DEFAULT NULL,
  `contact_group_type_id` int(11) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='groupe de contact';

--
-- Déchargement des données de la table `contact_group`
--

INSERT INTO `contact_group` (`contact_group_id`, `contact_group_name`, `contact_group_type_id`, `entreprise_id`) VALUES
(1, 'Employés', NULL, 122),
(2, 'Employés', NULL, 305);

-- --------------------------------------------------------

--
-- Structure de la table `contact_groupe_client`
--

CREATE TABLE `contact_groupe_client` (
  `groupe_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `groupe_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `groupe_codification` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_groupe_client`
--

INSERT INTO `contact_groupe_client` (`groupe_id`, `entreprise_id`, `groupe_designation`, `groupe_codification`) VALUES
(1, 305, 'Alimentation G', NULL),
(2, 305, 'Bureau Tabac', NULL),
(3, 305, 'Cafeteria', NULL),
(4, 305, 'Cremerie', NULL),
(5, 305, 'Demi Gros', NULL),
(6, 305, 'Fast-Food', NULL),
(7, 305, 'Foyer', NULL),
(8, 305, 'Hammam', NULL),
(9, 305, 'Hotel', NULL),
(10, 305, 'Pâtissier', NULL),
(11, 305, 'Pizzeria', NULL),
(12, 305, 'Produits Pâtissier', NULL),
(13, 305, 'Restaurant', NULL),
(14, 305, 'Snacks', NULL),
(15, 305, 'Superette', NULL),
(121, 305, 'Salle de Sport', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `contact_groupe_vendeur`
--

CREATE TABLE `contact_groupe_vendeur` (
  `groupe_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `groupe_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_groupe_vendeur_article`
--

CREATE TABLE `contact_groupe_vendeur_article` (
  `entreprise_id` bigint(20) NOT NULL,
  `groupe_id` bigint(20) NOT NULL,
  `article_id` bigint(20) NOT NULL,
  `prix_vente` double DEFAULT NULL,
  `prix_min_autorise` double DEFAULT NULL,
  `is_prix_change_autorised` tinyint(4) DEFAULT NULL,
  `is_validated_before_sell` tinyint(4) DEFAULT NULL,
  `validator_user_id_before_sell` bigint(20) DEFAULT NULL,
  `is_validated_after_sell` tinyint(4) DEFAULT NULL,
  `validator_user_id_after_sell` bigint(20) DEFAULT NULL,
  `show_article` tinyint(4) DEFAULT NULL,
  `show_supplier` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_groupe_vendeur_famille_article`
--

CREATE TABLE `contact_groupe_vendeur_famille_article` (
  `entreprise_id` bigint(20) NOT NULL DEFAULT '0',
  `groupe_id` bigint(20) NOT NULL DEFAULT '0',
  `famille_article_id` bigint(20) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_group_planning`
--

CREATE TABLE `contact_group_planning` (
  `contact_group_id` int(20) NOT NULL,
  `poste_id` int(11) NOT NULL,
  `date_day` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_info`
--

CREATE TABLE `contact_info` (
  `contact_info_id` bigint(20) NOT NULL,
  `contact_info_type_id` bigint(20) DEFAULT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `contact_info_value` varchar(256) DEFAULT NULL,
  `contact_is_default` tinyint(1) DEFAULT NULL,
  `contact_info_ordre` tinyint(4) DEFAULT NULL,
  `online_show` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contact_info`
--

INSERT INTO `contact_info` (`contact_info_id`, `contact_info_type_id`, `contact_id`, `contact_info_value`, `contact_is_default`, `contact_info_ordre`, `online_show`) VALUES
(1, 123, 11, '0665411258', NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `contact_info_type`
--

CREATE TABLE `contact_info_type` (
  `contact_info_type_id` bigint(20) NOT NULL,
  `contact_info_type_designation` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contact_info_type`
--

INSERT INTO `contact_info_type` (`contact_info_type_id`, `contact_info_type_designation`) VALUES
(121, 'Email'),
(123, 'Téléphone mobile'),
(124, 'Fax'),
(125, 'Telephone Personnel'),
(126, 'Site web'),
(127, 'Adress'),
(128, 'Facebook');

-- --------------------------------------------------------

--
-- Structure de la table `contact_infraction`
--

CREATE TABLE `contact_infraction` (
  `infraction_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL,
  `contact_infracton_type_id` int(11) NOT NULL,
  `sinistre` tinyint(1) NOT NULL,
  `sinistre_id` bigint(20) NOT NULL,
  `infraction_degre` tinyint(4) NOT NULL,
  `contact_infracton_date` datetime NOT NULL,
  `contact_infracton_date_day` date NOT NULL,
  `ressource_id` bigint(20) DEFAULT NULL,
  `lieu_id` bigint(20) NOT NULL,
  `point_id` bigint(20) NOT NULL,
  `autorite_declarante_id` bigint(20) NOT NULL,
  `contact_infracton_notified_by` bigint(20) DEFAULT NULL,
  `contact_infracton_remarque` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_infracton_valeur` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_infraction_type`
--

CREATE TABLE `contact_infraction_type` (
  `contact_infracton_type_id` int(11) NOT NULL,
  `contact_infracton_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_infraction_type`
--

INSERT INTO `contact_infraction_type` (`contact_infracton_type_id`, `contact_infracton_type_designation`) VALUES
(1, 'Abus de confiance, usage non professionnelle des outils de travail'),
(2, 'Non respect du code de la route'),
(3, 'Non respect des heures de travail'),
(4, 'Absences injustifiées ou abandon de poste'),
(5, 'Non respect du préavis'),
(6, 'Refus d\'effectuer une tâche de travail'),
(7, 'Harcèlement, violences ou injures envers l\'employeur ou d\'autres salariés'),
(8, 'Vols dans l\'entreprise'),
(9, 'Etat d\'ivresse pendant les heures de travail'),
(10, 'Publier des informations confidentielles'),
(11, 'Détérioration des biens');

-- --------------------------------------------------------

--
-- Structure de la table `contact_label`
--

CREATE TABLE `contact_label` (
  `contact_label_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_label_list`
--

CREATE TABLE `contact_label_list` (
  `contact_label_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_label_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_label_value`
--

CREATE TABLE `contact_label_value` (
  `contact_label_id` bigint(20) NOT NULL DEFAULT '0',
  `contact_id` bigint(20) NOT NULL DEFAULT '0',
  `contact_label_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_mission_planning`
--

CREATE TABLE `contact_mission_planning` (
  `contact_id` bigint(20) NOT NULL,
  `poste_id` int(11) NOT NULL,
  `mission_date_day` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_parametre`
--

CREATE TABLE `contact_parametre` (
  `parametre_id` bigint(20) NOT NULL,
  `parametre_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_parametre`
--

INSERT INTO `contact_parametre` (`parametre_id`, `parametre_designation`) VALUES
(1, 'Registre de commerce'),
(2, 'Couleur'),
(3, 'Droits de consultation des fournisseurs'),
(4, 'Droits de consultation des clients'),
(5, 'Droits de consultation des prix d\'achats'),
(6, 'Droits de consultation des prix de ventes'),
(7, 'Délai de livraison'),
(8, 'travail_heure_debut'),
(9, 'travail_heure_fin'),
(10, 'travail_jour_weekend1_deb'),
(11, 'travail_jour_weekend2_deb'),
(12, 'mission_transport_heure_deb'),
(13, 'mission_transport_heure_fin'),
(14, 'mission_transport_day_weekend1'),
(15, 'mission_transport_day_weekend2'),
(16, 'travail_jour_weekend1_fin'),
(17, 'travail_jour_weekend2_fin');

-- --------------------------------------------------------

--
-- Structure de la table `contact_planning`
--

CREATE TABLE `contact_planning` (
  `contact_planning_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `date_debut` datetime DEFAULT NULL,
  `date_debut_day` date DEFAULT NULL,
  `date_fin` datetime DEFAULT NULL,
  `date_fin_day` date DEFAULT NULL,
  `contact_planning_status_id` int(11) DEFAULT NULL,
  `contact_is_in_work` tinyint(1) DEFAULT NULL,
  `is_end_date_defined` tinyint(4) DEFAULT NULL,
  `note` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `date_system` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_planning_days`
--

CREATE TABLE `contact_planning_days` (
  `contact_id` bigint(20) NOT NULL,
  `poste_id` int(11) NOT NULL,
  `date_day` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_planning_status`
--

CREATE TABLE `contact_planning_status` (
  `contact_planning_status_id` int(11) NOT NULL,
  `contact_planning_status_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `contact_planning_status`
--

INSERT INTO `contact_planning_status` (`contact_planning_status_id`, `contact_planning_status_designation`) VALUES
(1, 'congé'),
(2, 'Disponible'),
(3, 'maladie'),
(4, 'retrait');

-- --------------------------------------------------------

--
-- Structure de la table `contact_ramy`
--

CREATE TABLE `contact_ramy` (
  `contact_id` bigint(20) NOT NULL,
  `code_barre` varchar(20) DEFAULT NULL,
  `nom_prenom` varchar(50) DEFAULT NULL,
  `type_clients` varchar(20) DEFAULT NULL,
  `default_route_id` varchar(10) DEFAULT NULL,
  `mobil1` varchar(15) DEFAULT NULL,
  `mobil2` varchar(15) DEFAULT NULL,
  `commune` varchar(20) DEFAULT NULL,
  `wilaya` varchar(20) DEFAULT NULL,
  `classement_id` varchar(5) DEFAULT NULL,
  `is_pet` varchar(5) DEFAULT NULL,
  `is_pack` varchar(5) DEFAULT NULL,
  `is_plf` varchar(5) DEFAULT NULL,
  `type_client_id` int(10) DEFAULT NULL,
  `wilaya_id` int(11) DEFAULT NULL,
  `commune_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contact_reclamation`
--

CREATE TABLE `contact_reclamation` (
  `contact_reclamation_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_reclamation_date` datetime DEFAULT NULL,
  `contact_reclamation_date_day` date DEFAULT NULL,
  `contact_reclamation_urgence` tinyint(1) DEFAULT NULL,
  `contact_reclamation_texte` text COLLATE utf8_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_reclamation_mouvement`
--

CREATE TABLE `contact_reclamation_mouvement` (
  `contact_reclamation_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_reunion_invitation`
--

CREATE TABLE `contact_reunion_invitation` (
  `contact_reunion_invitation_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_reunion_invitation_created_by` bigint(20) DEFAULT NULL,
  `contact_reunion_invitation_created_date` datetime DEFAULT NULL,
  `contact_reunion_salle_id` bigint(20) DEFAULT NULL,
  `contact_reunion_departement_id` bigint(20) DEFAULT NULL,
  `contact_reunion_date_debut` datetime DEFAULT NULL,
  `contact_reunion_date_debut_day` date DEFAULT NULL,
  `contact_reunion_date_fin` datetime DEFAULT NULL,
  `contact_reunion_date_fin_day` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_reunion_invitation_contact`
--

CREATE TABLE `contact_reunion_invitation_contact` (
  `contact_reunion_invitation_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_accept` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_reunion_salle`
--

CREATE TABLE `contact_reunion_salle` (
  `contact_reunion_salle_id` bigint(20) NOT NULL,
  `contact_reunion_salle_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_stats`
--

CREATE TABLE `contact_stats` (
  `stats_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `stats_date` date DEFAULT NULL,
  `montant_dette_fournisseur` double DEFAULT NULL,
  `client_montant_carte` double DEFAULT NULL,
  `client_montant_avance` double DEFAULT NULL,
  `client_montant_avoir` double DEFAULT NULL,
  `client_montant_credit` double DEFAULT NULL,
  `client_montant_point_fidelite` double DEFAULT NULL,
  `client_montant_bonus` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_type`
--

CREATE TABLE `contact_type` (
  `contact_type_id` int(11) NOT NULL,
  `contact_genre_id` tinyint(4) NOT NULL,
  `contact_type_name` varchar(40) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contact_type`
--

INSERT INTO `contact_type` (`contact_type_id`, `contact_genre_id`, `contact_type_name`) VALUES
(1, 1, 'Magasinier'),
(19, 1, 'Réparateur'),
(21, 1, 'Employé'),
(22, 1, 'Personne'),
(23, 2, 'Client'),
(24, 2, 'Fournisseur / Prestataire'),
(25, 2, 'Administration publique'),
(26, 2, 'Autorité publique'),
(27, 2, 'Institution'),
(28, 1, 'prévendeur'),
(29, 1, 'vendeur'),
(30, 1, 'Chauffeur'),
(31, 1, 'Responsable'),
(41, 2, 'Partenaires'),
(51, 2, 'Concurrents');

-- --------------------------------------------------------

--
-- Structure de la table `contact_vendeur`
--

CREATE TABLE `contact_vendeur` (
  `entreprise_id` bigint(20) NOT NULL,
  `vendeur_id` bigint(20) NOT NULL,
  `date_debut` datetime DEFAULT NULL,
  `date_fin` datetime DEFAULT NULL,
  `active` tinyint(1) DEFAULT NULL,
  `vendeur_manager_id` bigint(20) DEFAULT NULL,
  `vendeur_departement_id` bigint(20) DEFAULT NULL,
  `vendeur_groupe_id` bigint(20) DEFAULT NULL,
  `use_restricted_articles` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contact_vendeur_objectif`
--

CREATE TABLE `contact_vendeur_objectif` (
  `entreprise_id` bigint(20) DEFAULT NULL,
  `vendeur_id` bigint(20) NOT NULL DEFAULT '0',
  `mois` int(10) NOT NULL,
  `annee` int(10) NOT NULL,
  `montant_objectif` double DEFAULT NULL,
  `montant_realise` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `contrats`
--

CREATE TABLE `contrats` (
  `contrat_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `compte_id` bigint(20) DEFAULT NULL,
  `date_debut` datetime DEFAULT NULL,
  `date_fin` datetime DEFAULT NULL,
  `contrat_status_id` int(11) DEFAULT NULL,
  `contrat_status_cause` int(11) DEFAULT NULL,
  `contrat_type_id` int(11) DEFAULT NULL,
  `bc_id` bigint(20) DEFAULT NULL,
  `montant_total` double DEFAULT NULL,
  `montant_realise` double DEFAULT NULL,
  `montant_souhaite` double DEFAULT NULL,
  `numero` double DEFAULT NULL,
  `contrat_modele_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déclencheurs `contrats`
--
DELIMITER $$
CREATE TRIGGER `trigger_numero` BEFORE INSERT ON `contrats` FOR EACH ROW SET new.numero=if((SELECT  MAX(`numero`) from Contrats)is null,1,(SELECT  MAX(`numero`)+1  from Contrats ))
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Structure de la table `contrat_achat`
--

CREATE TABLE `contrat_achat` (
  `contrat_achat_id` bigint(20) NOT NULL,
  `contrat_achat_designation` varchar(30) NOT NULL,
  `date_debut` date NOT NULL,
  `date_fin` date NOT NULL,
  `montant` double NOT NULL,
  `montant_total_paye` double NOT NULL DEFAULT '0',
  `is_paid` tinyint(1) NOT NULL,
  `etat_contrat` tinyint(2) NOT NULL COMMENT '0: en cours; 1: achevé; 2: annulé',
  `upload_document` varchar(256) NOT NULL,
  `fournisseur_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contrat_achat_echeancier`
--

CREATE TABLE `contrat_achat_echeancier` (
  `echeancier_id` bigint(20) NOT NULL,
  `mois` int(11) NOT NULL,
  `annee` int(11) NOT NULL,
  `montant_final` double NOT NULL,
  `montant_regle` double NOT NULL DEFAULT '0',
  `etat_paiement` tinyint(2) NOT NULL,
  `mois_date_debut` date NOT NULL,
  `mois_date_fin` date NOT NULL,
  `contrat_achat_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contrat_achat_ressource`
--

CREATE TABLE `contrat_achat_ressource` (
  `ressource_id` bigint(20) NOT NULL,
  `contrat_achat_id` bigint(20) NOT NULL,
  `etat_paiement` tinyint(1) NOT NULL,
  `BL` bigint(20) NOT NULL,
  `montant_total` double NOT NULL,
  `montant_paye` double NOT NULL DEFAULT '0',
  `montant_facilite` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contrat_modele`
--

CREATE TABLE `contrat_modele` (
  `contrat_modele_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contrat_modele_designation` varchar(256) DEFAULT NULL,
  `contrat_modele_filename` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contrat_modele`
--

INSERT INTO `contrat_modele` (`contrat_modele_id`, `entreprise_id`, `contrat_modele_designation`, `contrat_modele_filename`) VALUES
(2, 122, 'Commercial', NULL),
(3, 305, 'Commercial', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `contrat_module`
--

CREATE TABLE `contrat_module` (
  `contrat_id` bigint(20) NOT NULL,
  `module_id` bigint(20) NOT NULL,
  `montant_jour` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `contrat_status`
--

CREATE TABLE `contrat_status` (
  `contrat_status_id` int(11) NOT NULL,
  `contrat_status_designation` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contrat_status`
--

INSERT INTO `contrat_status` (`contrat_status_id`, `contrat_status_designation`) VALUES
(1, 'En cours'),
(2, 'Terminé'),
(3, 'Annulé'),
(4, 'En préparation');

-- --------------------------------------------------------

--
-- Structure de la table `contrat_type`
--

CREATE TABLE `contrat_type` (
  `contrat_type_id` int(11) NOT NULL,
  `contrat_type_designation` varchar(256) DEFAULT NULL,
  `contrat_type_modele` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contrat_type`
--

INSERT INTO `contrat_type` (`contrat_type_id`, `contrat_type_designation`, `contrat_type_modele`) VALUES
(1, 'Contrat Commercial', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `contrat_vehicule`
--

CREATE TABLE `contrat_vehicule` (
  `contrat_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) NOT NULL,
  `montant_jour` double DEFAULT NULL,
  `montant_install_gps` double DEFAULT NULL,
  `montant_desinstall_gps` double DEFAULT NULL,
  `montant_intervention` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `contrat_vehicule`
--

INSERT INTO `contrat_vehicule` (`contrat_id`, `vehicule_id`, `montant_jour`, `montant_install_gps`, `montant_desinstall_gps`, `montant_intervention`) VALUES
(14, 116, 100, NULL, NULL, NULL),
(16, 34, 100, NULL, NULL, NULL),
(16, 103, 100, NULL, NULL, NULL),
(16, 169, 100, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `controlle`
--

CREATE TABLE `controlle` (
  `controlle_id` bigint(20) UNSIGNED NOT NULL,
  `nom` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_id` int(11) NOT NULL,
  `groupe_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `controlle`
--

INSERT INTO `controlle` (`controlle_id`, `nom`, `description`, `type_id`, `groupe_id`) VALUES
(1, 'Carburant', NULL, 1, 1),
(21, 'Assurance', NULL, 4, 2),
(31, 'Permis de Conduire', NULL, 1, 2),
(41, 'CT', NULL, 1, 2),
(51, 'AA', NULL, 1, 2),
(61, 'Essuie Glace', NULL, 3, 1),
(71, 'Retroviseur Externe', NULL, 1, 1),
(81, 'Commentaires', NULL, 2, 1),
(91, 'Retroviseur Interieur', NULL, 1, 1),
(101, 'Commentaires', NULL, 2, 1);

-- --------------------------------------------------------

--
-- Structure de la table `controlle_group`
--

CREATE TABLE `controlle_group` (
  `controlle_group_id` bigint(20) UNSIGNED NOT NULL,
  `controlle_group_designation` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `controlle_group`
--

INSERT INTO `controlle_group` (`controlle_group_id`, `controlle_group_designation`) VALUES
(1, 'Parc'),
(2, 'Documents Administrative ');

-- --------------------------------------------------------

--
-- Structure de la table `controlle_possible_values`
--

CREATE TABLE `controlle_possible_values` (
  `controlle_id` int(11) NOT NULL,
  `value_id` int(11) NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `controlle_possible_values`
--

INSERT INTO `controlle_possible_values` (`controlle_id`, `value_id`, `name`) VALUES
(11, 1, 'good'),
(11, 11, 'avg'),
(11, 21, 'bad'),
(61, 31, 'OK'),
(61, 41, 'A Verifier'),
(61, 51, 'Intervention'),
(71, 61, 'OK'),
(71, 71, 'Deteriorer'),
(71, 81, 'Absent'),
(81, 91, 'OK'),
(81, 101, 'Deteriorer'),
(81, 111, 'Absent'),
(91, 121, 'OK'),
(91, 131, 'Deteriorer'),
(91, 141, 'Absent');

-- --------------------------------------------------------

--
-- Structure de la table `controlle_value`
--

CREATE TABLE `controlle_value` (
  `controlle_id` int(11) NOT NULL,
  `ressource_id` int(11) NOT NULL,
  `value` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_day` date NOT NULL,
  `by_id` int(11) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `controlle_value`
--

INSERT INTO `controlle_value` (`controlle_id`, `ressource_id`, `value`, `date_day`, `by_id`, `updated_at`) VALUES
(11, 11, '11', '2024-10-02', 305, '2024-10-02 13:38:52'),
(11, 11, '1', '2024-10-02', NULL, '2024-10-02 14:11:16'),
(1, 11, '25', '2024-10-03', NULL, '2024-10-03 13:21:53'),
(11, 11, '11', '2024-10-03', NULL, '2024-10-03 13:21:53'),
(1, 11, '25', '2024-10-03', NULL, '2024-10-03 13:25:41'),
(11, 11, '11', '2024-10-03', NULL, '2024-10-03 13:25:41'),
(1, 11, '25', '2024-10-03', NULL, '2024-10-03 13:39:40'),
(11, 11, '11', '2024-10-03', NULL, '2024-10-03 13:39:40'),
(1, 11, '25', '2024-10-03', NULL, '2024-10-03 14:25:06'),
(11, 11, '11', '2024-10-03', NULL, '2024-10-03 14:25:06'),
(1, 11, '25', '2024-10-03', NULL, '2024-10-03 14:40:27'),
(11, 11, '11', '2024-10-03', NULL, '2024-10-03 14:40:27'),
(1, 11, '25', '2024-10-03', NULL, '2024-10-03 14:42:30'),
(11, 11, '11', '2024-10-03', NULL, '2024-10-03 14:42:30'),
(1, 11, '25', '2024-10-03', NULL, '2024-10-03 14:43:39'),
(11, 11, '11', '2024-10-03', NULL, '2024-10-03 14:43:39'),
(1, 31, 'ffff', '2024-10-07', NULL, '2024-10-07 08:00:15'),
(11, 31, '11', '2024-10-07', NULL, '2024-10-07 08:00:16'),
(21, 31, '2024-10-08 00:00:00', '2024-10-07', NULL, '2024-10-07 08:00:16'),
(31, 31, 'false', '2024-10-07', NULL, '2024-10-07 08:00:16'),
(1, 31, 'another test', '2024-10-07', NULL, '2024-10-07 08:01:35'),
(11, 31, '1', '2024-10-07', NULL, '2024-10-07 08:01:35'),
(21, 31, '2024-10-08 00:00:00', '2024-10-07', NULL, '2024-10-07 08:01:35'),
(31, 31, 'true', '2024-10-07', NULL, '2024-10-07 08:01:35'),
(1, 21, 'aymen test', '2024-10-07', 305, '2024-10-07 08:06:57'),
(11, 21, '1', '2024-10-07', 305, '2024-10-07 08:06:57'),
(21, 21, '2024-10-08 00:00:00', '2024-10-07', 305, '2024-10-07 08:06:57'),
(31, 21, 'true', '2024-10-07', 305, '2024-10-07 08:06:57'),
(1, 11, 'hhhhhhh', '2024-10-07', 305, '2024-10-07 12:40:06'),
(11, 11, '11', '2024-10-07', 305, '2024-10-07 12:40:07'),
(21, 11, '2024-10-08 00:00:00', '2024-10-07', 305, '2024-10-07 12:40:07'),
(31, 11, 'true', '2024-10-07', 305, '2024-10-07 12:40:07'),
(1, 1, 'hhhjk', '2024-10-07', 305, '2024-10-07 12:45:43'),
(11, 1, '1', '2024-10-07', 305, '2024-10-07 12:45:43'),
(21, 1, '2024-10-07 00:00:00', '2024-10-07', 305, '2024-10-07 12:45:43'),
(31, 1, 'true', '2024-10-07', 305, '2024-10-07 12:45:43'),
(1, 1, 'ter009', '2024-10-08', 11, '2024-10-08 13:42:48'),
(11, 1, '1', '2024-10-08', 11, '2024-10-08 13:42:48'),
(21, 1, '2024-10-08 00:00:00', '2024-10-08', 11, '2024-10-08 13:42:48'),
(31, 1, 'true', '2024-10-08', 11, '2024-10-08 13:42:48'),
(1, 41, 'true', '2024-10-08', 11, '2024-10-08 15:20:20'),
(11, 41, '1', '2024-10-08', 11, '2024-10-08 15:20:20'),
(61, 41, '31', '2024-10-08', 11, '2024-10-08 15:20:20'),
(21, 41, '2024-10-08 00:00:00', '2024-10-08', 11, '2024-10-08 15:20:20'),
(31, 41, 'true', '2024-10-08', 11, '2024-10-08 15:20:20'),
(41, 41, 'true', '2024-10-08', 11, '2024-10-08 15:20:20'),
(51, 41, 'true', '2024-10-08', 11, '2024-10-08 15:20:20'),
(1, 41, 'true', '2024-10-08', 11, '2024-10-08 15:26:18'),
(11, 41, '1', '2024-10-08', 11, '2024-10-08 15:26:18'),
(61, 41, '31', '2024-10-08', 11, '2024-10-08 15:26:18'),
(71, 41, '61', '2024-10-08', 11, '2024-10-08 15:26:18'),
(81, 41, '91', '2024-10-08', 11, '2024-10-08 15:26:18'),
(91, 41, '121', '2024-10-08', 11, '2024-10-08 15:26:18'),
(21, 41, '2024-10-08 00:00:00', '2024-10-08', 11, '2024-10-08 15:26:18'),
(31, 41, 'true', '2024-10-08', 11, '2024-10-08 15:26:18'),
(41, 41, 'true', '2024-10-08', 11, '2024-10-08 15:26:18'),
(51, 41, 'true', '2024-10-08', 11, '2024-10-08 15:26:18'),
(1, 1, 'false', '2024-10-16', 11, '2024-10-16 07:23:49'),
(11, 1, '11', '2024-10-16', 11, '2024-10-16 07:23:49'),
(61, 1, '41', '2024-10-16', 11, '2024-10-16 07:23:49'),
(71, 1, 'false', '2024-10-16', 11, '2024-10-16 07:23:49'),
(81, 1, 'test', '2024-10-16', 11, '2024-10-16 07:23:49'),
(91, 1, 'false', '2024-10-16', 11, '2024-10-16 07:23:49'),
(101, 1, 'test', '2024-10-16', 11, '2024-10-16 07:23:49'),
(21, 1, '2024-10-31 00:00:00', '2024-10-16', 11, '2024-10-16 07:23:49'),
(31, 1, 'true', '2024-10-16', 11, '2024-10-16 07:23:49'),
(41, 1, 'true', '2024-10-16', 11, '2024-10-16 07:23:49'),
(51, 1, 'true', '2024-10-16', 11, '2024-10-16 07:23:49'),
(1, 21, 'true', '2024-10-27', 11, '2024-10-27 12:55:30'),
(11, 21, '21', '2024-10-27', 11, '2024-10-27 12:55:30'),
(61, 21, '41', '2024-10-27', 11, '2024-10-27 12:55:30'),
(71, 21, 'true', '2024-10-27', 11, '2024-10-27 12:55:30'),
(81, 21, 'yy', '2024-10-27', 11, '2024-10-27 12:55:30'),
(91, 21, 'true', '2024-10-27', 11, '2024-10-27 12:55:30'),
(101, 21, 'tt', '2024-10-27', 11, '2024-10-27 12:55:30'),
(21, 21, '2024-10-28 00:00:00', '2024-10-27', 11, '2024-10-27 12:55:30'),
(31, 21, 'true', '2024-10-27', 11, '2024-10-27 12:55:30'),
(41, 21, 'true', '2024-10-27', 11, '2024-10-27 12:55:30'),
(51, 21, 'true', '2024-10-27', 11, '2024-10-27 12:55:30'),
(1, 1, 'false', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(61, 1, '51', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(71, 1, 'true', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(81, 1, 'غغ', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(91, 1, 'true', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(101, 1, 'تت', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(21, 1, '2024-10-30 00:00:00', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(31, 1, 'true', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(41, 1, 'true', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(51, 1, 'true', '2024-10-31', 1031, '2024-10-31 21:51:37'),
(1, 1, 'false', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(61, 1, '41', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(71, 1, 'true', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(81, 1, 'غ', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(91, 1, 'true', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(101, 1, 'ف', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(21, 1, '2024-11-04 00:00:00', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(31, 1, 'true', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(41, 1, 'false', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(51, 1, 'false', '2024-11-03', 1031, '2024-11-03 08:05:14'),
(1, 41, 'true', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(61, 41, '31', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(71, 41, 'true', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(81, 41, 'u', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(91, 41, 'true', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(101, 41, 'yy', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(21, 41, '2024-11-18 00:00:00', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(31, 41, 'false', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(41, 41, 'true', '2024-11-04', 1031, '2024-11-04 11:30:43'),
(51, 41, 'false', '2024-11-04', 1031, '2024-11-04 11:30:43');

-- --------------------------------------------------------

--
-- Structure de la table `critere_type`
--

CREATE TABLE `critere_type` (
  `critere_type_id` int(11) NOT NULL,
  `critere_type_designation` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `critere_type`
--

INSERT INTO `critere_type` (`critere_type_id`, `critere_type_designation`) VALUES
(1, 'intérêts produits'),
(2, 'visibilité produits '),
(3, 'disponibilité produits'),
(4, 'récurrences des commandes ');

-- --------------------------------------------------------

--
-- Structure de la table `dashboard`
--

CREATE TABLE `dashboard` (
  `dashboard_id` bigint(20) NOT NULL,
  `dashboard_designation` varchar(256) DEFAULT NULL,
  `isDefault` tinyint(1) NOT NULL DEFAULT '0',
  `nbColumn` int(11) NOT NULL DEFAULT '3',
  `user_id` bigint(20) DEFAULT NULL,
  `isSystem` tinyint(1) NOT NULL DEFAULT '0',
  `sidePanelClassName` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `dashboard`
--

INSERT INTO `dashboard` (`dashboard_id`, `dashboard_designation`, `isDefault`, `nbColumn`, `user_id`, `isSystem`, `sidePanelClassName`) VALUES
(128, 'taux', 0, 3, 4, 0, 'TreeSidePanel'),
(129, '2222', 0, 3, 4, 0, 'TreeSidePanel'),
(131, '3232', 0, 3, 4, 0, 'TreeSidePanel'),
(133, 'Aide et contact', 0, 3, 4, 1, 'HelpSidePanel'),
(134, 'Détails véhicule', 0, 3, 4, 1, 'SidePanel2'),
(135, 'Missions', 0, 3, 4, 1, 'SidePanel2'),
(136, 'Résumés', 0, 3, 4, 1, 'SidePanel2'),
(137, 'Stock, achats et appro', 0, 3, 4, 1, 'SidePanel2'),
(138, 'Activités du jour', 0, 3, 4, 1, 'SidePanel2'),
(139, 'Parc', 1, 3, 4, 1, 'TreeSidePanel'),
(140, 'Résumé, Objectifs et KPI', 0, 3, 4, 1, ''),
(141, 'Suivi par carte', 0, 3, 4, 0, 'SidePanelSuivi');

-- --------------------------------------------------------

--
-- Structure de la table `dashlet_details`
--

CREATE TABLE `dashlet_details` (
  `dashlet_id` int(255) NOT NULL,
  `report_id` bigint(20) NOT NULL,
  `dashboard_id` bigint(20) NOT NULL,
  `ordre` int(11) DEFAULT NULL,
  `parametres` text,
  `column_refresh` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `depot`
--

CREATE TABLE `depot` (
  `depot_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `depot_parent_id` bigint(20) DEFAULT NULL,
  `depot_parent_left` bigint(20) DEFAULT NULL,
  `depot_parent_right` bigint(20) DEFAULT NULL,
  `depot_manager_id` bigint(20) DEFAULT NULL,
  `depot_vendeur_id` bigint(20) DEFAULT NULL,
  `depot_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_emplacement_text` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_ean13` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_code_barre` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_path` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_point_id` bigint(20) DEFAULT NULL,
  `depot_owner_id` bigint(20) DEFAULT NULL,
  `depot_immobilier_usage_type` tinyint(1) DEFAULT NULL,
  `depot_surface` double DEFAULT NULL,
  `depot_volume` double DEFAULT NULL,
  `depot_poid_max` double DEFAULT NULL,
  `depot_is_used` tinyint(1) DEFAULT NULL,
  `depot_current_fill_percent` double DEFAULT NULL,
  `depot_need_defrag` tinyint(1) DEFAULT NULL,
  `depot_niveau_rangement` int(11) DEFAULT NULL,
  `depot_ordre_rangement` int(11) DEFAULT NULL,
  `depot_distance_from_entree` double DEFAULT NULL,
  `depot_height_from_feet` double DEFAULT NULL,
  `depot_is_departement` tinyint(1) DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL,
  `depot_type` bigint(20) DEFAULT NULL,
  `adresse` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `commune_id` int(11) DEFAULT NULL,
  `wilaya_id` int(11) DEFAULT NULL,
  `longitude` double DEFAULT NULL,
  `latitude` double DEFAULT NULL,
  `frigo` tinyint(1) DEFAULT NULL,
  `temperature_min` float DEFAULT NULL,
  `temperature_max` float DEFAULT NULL,
  `depot_gardé` tinyint(1) DEFAULT NULL,
  `depot_blindé` tinyint(1) DEFAULT NULL,
  `depot_barreaudage` tinyint(1) DEFAULT NULL,
  `longueur` double DEFAULT NULL,
  `largeur` double DEFAULT NULL,
  `hauteur` double DEFAULT NULL,
  `vehicule` tinyint(1) DEFAULT NULL,
  `vehicule_id` bigint(20) DEFAULT NULL,
  `ordre_passage` int(11) DEFAULT NULL,
  `temps_accessibilite` double DEFAULT NULL,
  `cout_accessibilite` double DEFAULT NULL,
  `entrepot_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `depot`
--

INSERT INTO `depot` (`depot_id`, `entreprise_id`, `depot_parent_id`, `depot_parent_left`, `depot_parent_right`, `depot_manager_id`, `depot_vendeur_id`, `depot_designation`, `depot_emplacement_text`, `depot_ean13`, `depot_code_barre`, `depot_path`, `depot_point_id`, `depot_owner_id`, `depot_immobilier_usage_type`, `depot_surface`, `depot_volume`, `depot_poid_max`, `depot_is_used`, `depot_current_fill_percent`, `depot_need_defrag`, `depot_niveau_rangement`, `depot_ordre_rangement`, `depot_distance_from_entree`, `depot_height_from_feet`, `depot_is_departement`, `departement_id`, `depot_type`, `adresse`, `commune_id`, `wilaya_id`, `longitude`, `latitude`, `frigo`, `temperature_min`, `temperature_max`, `depot_gardé`, `depot_blindé`, `depot_barreaudage`, `longueur`, `largeur`, `hauteur`, `vehicule`, `vehicule_id`, `ordre_passage`, `temps_accessibilite`, `cout_accessibilite`, `entrepot_id`) VALUES
(8, 305, 7, NULL, NULL, NULL, NULL, 'Depot - Magasin Moyens Généraux', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9, 305, NULL, NULL, NULL, NULL, NULL, 'Citerne', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `depot_07`
--

CREATE TABLE `depot_07` (
  `depot_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `depot_parent_id` bigint(20) DEFAULT NULL,
  `depot_parent_left` bigint(20) DEFAULT NULL,
  `depot_parent_right` bigint(20) DEFAULT NULL,
  `depot_manager_id` bigint(20) DEFAULT NULL,
  `depot_vendeur_id` bigint(20) DEFAULT NULL,
  `depot_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_emplacement_text` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_ean13` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_code_barre` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_path` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_point_id` bigint(20) DEFAULT NULL,
  `depot_owner_id` bigint(20) DEFAULT NULL,
  `depot_immobilier_usage_type` tinyint(1) DEFAULT NULL,
  `depot_surface` double DEFAULT NULL,
  `depot_volume` double DEFAULT NULL,
  `depot_poid_max` double DEFAULT NULL,
  `depot_is_used` tinyint(1) DEFAULT NULL,
  `depot_current_fill_percent` double DEFAULT NULL,
  `depot_need_defrag` tinyint(1) DEFAULT NULL,
  `depot_niveau_rangement` int(11) DEFAULT NULL,
  `depot_ordre_rangement` int(11) DEFAULT NULL,
  `depot_distance_from_entree` double DEFAULT NULL,
  `depot_height_from_feet` double DEFAULT NULL,
  `depot_is_departement` tinyint(1) DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL,
  `depot_type` bigint(20) DEFAULT NULL,
  `adresse` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `commune_id` int(11) DEFAULT NULL,
  `wilaya_id` int(11) DEFAULT NULL,
  `longitude` double DEFAULT NULL,
  `latitude` double DEFAULT NULL,
  `frigo` tinyint(1) DEFAULT NULL,
  `temperature_min` float DEFAULT NULL,
  `temperature_max` float DEFAULT NULL,
  `depot_gardé` tinyint(1) DEFAULT NULL,
  `depot_blindé` tinyint(1) DEFAULT NULL,
  `depot_barreaudage` tinyint(1) DEFAULT NULL,
  `longueur` double DEFAULT NULL,
  `largeur` double DEFAULT NULL,
  `hauteur` double DEFAULT NULL,
  `vehicule` tinyint(1) DEFAULT NULL,
  `vehicule_id` bigint(20) DEFAULT NULL,
  `ordre_passage` int(11) DEFAULT NULL,
  `temps_accessibilite` double DEFAULT NULL,
  `cout_accessibilite` double DEFAULT NULL,
  `entrepot_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `depot_article_can`
--

CREATE TABLE `depot_article_can` (
  `depot_id` bigint(20) NOT NULL,
  `article_id` bigint(20) NOT NULL,
  `article_unite_id` int(11) NOT NULL DEFAULT '0',
  `quantite_max` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `depot_article_famille_can`
--

CREATE TABLE `depot_article_famille_can` (
  `depot_id` bigint(20) NOT NULL DEFAULT '0',
  `article_famille_id` bigint(20) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `depot_article_optimal`
--

CREATE TABLE `depot_article_optimal` (
  `depot_id` bigint(20) NOT NULL,
  `article_id` bigint(20) NOT NULL,
  `article_unite_id` int(11) NOT NULL,
  `quantite_optimale` double DEFAULT NULL,
  `quantite_minimale` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `depot_mouvement_type`
--

CREATE TABLE `depot_mouvement_type` (
  `depot_id` bigint(20) NOT NULL,
  `mouvement_type_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `depot_mouvement_type`
--

INSERT INTO `depot_mouvement_type` (`depot_id`, `mouvement_type_id`) VALUES
(-2, 1),
(-2, 36),
(-2, 58),
(-2, 83),
(-2, 200),
(-2, 400),
(-1, 1),
(-1, 36),
(-1, 83),
(1, 1),
(1, 3),
(1, 4),
(1, 5),
(1, 6),
(1, 7),
(1, 9),
(1, 10),
(1, 11),
(1, 12),
(1, 33),
(1, 34),
(1, 35),
(1, 36),
(1, 37),
(1, 38),
(1, 39),
(1, 40),
(1, 41),
(1, 42),
(1, 43),
(1, 44),
(1, 45),
(1, 46),
(1, 47),
(1, 48),
(1, 49),
(1, 50),
(1, 52),
(1, 53),
(1, 54),
(1, 55),
(1, 56),
(1, 57),
(1, 61),
(1, 81),
(1, 82),
(1, 83),
(1, 400),
(2, 1),
(2, 3),
(2, 4),
(2, 5),
(2, 6),
(2, 7),
(2, 9),
(2, 10),
(2, 11),
(2, 12),
(2, 33),
(2, 34),
(2, 35),
(2, 36),
(2, 37),
(2, 38),
(2, 39),
(2, 40),
(2, 41),
(2, 42),
(2, 43),
(2, 44),
(2, 45),
(2, 46),
(2, 47),
(2, 48),
(2, 49),
(2, 50),
(2, 52),
(2, 53),
(2, 54),
(2, 55),
(2, 56),
(2, 57),
(2, 61),
(2, 81),
(2, 82),
(2, 83),
(2, 400),
(6, 1),
(6, 3),
(6, 4),
(6, 5),
(6, 6),
(6, 7),
(6, 9),
(6, 10),
(6, 11),
(6, 12),
(6, 33),
(6, 34),
(6, 35),
(6, 36),
(6, 37),
(6, 38),
(6, 39),
(6, 40),
(6, 41),
(6, 42),
(6, 43),
(6, 44),
(6, 45),
(6, 46),
(6, 47),
(6, 48),
(6, 49),
(6, 50),
(6, 52),
(6, 53),
(6, 54),
(6, 55),
(6, 56),
(6, 57),
(6, 61),
(6, 81),
(6, 82),
(6, 83),
(6, 400),
(475, 1),
(475, 36),
(475, 83),
(475, 200),
(475, 400),
(476, 1),
(476, 36),
(476, 83),
(476, 200),
(476, 400),
(477, 1),
(477, 36),
(477, 83),
(477, 200),
(477, 400),
(478, 1),
(478, 36),
(478, 83),
(478, 200),
(478, 400),
(479, 1),
(479, 36),
(479, 83),
(479, 200),
(479, 400),
(480, 1),
(480, 36),
(480, 83),
(480, 200),
(480, 400),
(481, 1),
(481, 36),
(481, 83),
(481, 200),
(481, 400),
(482, 1),
(482, 36),
(482, 83),
(482, 200),
(482, 400),
(483, 1),
(483, 36),
(483, 83),
(483, 200),
(483, 400),
(484, 1),
(484, 36),
(484, 83),
(484, 200),
(484, 400),
(485, 1),
(485, 36),
(485, 83),
(485, 200),
(485, 400),
(486, 1),
(486, 36),
(486, 83),
(486, 200),
(486, 400),
(487, 1),
(487, 36),
(487, 83),
(487, 200),
(487, 400),
(488, 1),
(488, 36),
(488, 83),
(488, 200),
(488, 400),
(489, 1),
(489, 36),
(489, 83),
(489, 200),
(489, 400),
(490, 1),
(490, 36),
(490, 83),
(490, 200),
(490, 400),
(491, 1),
(491, 36),
(491, 83),
(491, 200),
(491, 400),
(492, 1),
(492, 36),
(492, 83),
(492, 200),
(492, 400),
(493, 1),
(493, 36),
(493, 83),
(493, 200),
(493, 400),
(494, 1),
(494, 36),
(494, 83),
(494, 200),
(494, 400),
(495, 1),
(495, 36),
(495, 83),
(495, 200),
(495, 400),
(496, 1),
(496, 36),
(496, 83),
(496, 200),
(496, 400),
(497, 1),
(497, 36),
(497, 83),
(497, 200),
(497, 400),
(498, 1),
(498, 36),
(498, 83),
(498, 200),
(498, 400),
(499, 1),
(499, 36),
(499, 83),
(499, 200),
(499, 400),
(500, 1),
(500, 36),
(500, 83),
(500, 200),
(500, 400),
(501, 1),
(501, 36),
(501, 83),
(501, 200),
(501, 400),
(502, 1),
(502, 36),
(502, 83),
(502, 200),
(502, 400),
(503, 1),
(503, 36),
(503, 83),
(503, 200),
(503, 400),
(504, 1),
(504, 36),
(504, 83),
(504, 200),
(504, 400),
(505, 1),
(505, 36),
(505, 83),
(505, 200),
(505, 400),
(506, 1),
(506, 36),
(506, 83),
(506, 200),
(506, 400),
(507, 1),
(507, 36),
(507, 83),
(507, 200),
(507, 400),
(508, 1),
(508, 36),
(508, 83),
(508, 200),
(508, 400),
(509, 1),
(509, 36),
(509, 83),
(509, 200),
(509, 400),
(510, 1),
(510, 36),
(510, 83),
(510, 200),
(510, 400),
(511, 1),
(511, 36),
(511, 83),
(511, 200),
(511, 400),
(512, 1),
(512, 36),
(512, 83),
(512, 200),
(512, 400),
(513, 1),
(513, 36),
(513, 83),
(513, 200),
(513, 400),
(514, 1),
(514, 36),
(514, 83),
(514, 200),
(514, 400),
(515, 1),
(515, 36),
(515, 83),
(515, 200),
(515, 400),
(516, 1),
(516, 36),
(516, 83),
(516, 200),
(516, 400),
(517, 1),
(517, 36),
(517, 83),
(517, 200),
(517, 400),
(518, 1),
(518, 36),
(518, 83),
(518, 200),
(518, 400),
(519, 1),
(519, 36),
(519, 83),
(519, 200),
(519, 400),
(520, 1),
(520, 36),
(520, 83),
(520, 200),
(520, 400),
(521, 1),
(521, 36),
(521, 83),
(521, 200),
(521, 400),
(522, 1),
(522, 36),
(522, 83),
(522, 200),
(522, 400),
(523, 1),
(523, 36),
(523, 83),
(523, 200),
(523, 400),
(524, 1),
(524, 36),
(524, 83),
(524, 200),
(524, 400),
(525, 1),
(525, 36),
(525, 83),
(525, 200),
(525, 400),
(526, 1),
(526, 36),
(526, 83),
(526, 200),
(526, 400),
(527, 1),
(527, 36),
(527, 83),
(527, 200),
(527, 400),
(528, 1),
(528, 36),
(528, 83),
(528, 200),
(528, 400),
(529, 1),
(529, 36),
(529, 83),
(529, 200),
(529, 400),
(530, 1),
(530, 36),
(530, 83),
(530, 200),
(530, 400),
(531, 1),
(531, 36),
(531, 83),
(531, 200),
(531, 400),
(532, 1),
(532, 36),
(532, 83),
(532, 200),
(532, 400),
(533, 1),
(533, 36),
(533, 83),
(533, 200),
(533, 400),
(534, 1),
(534, 36),
(534, 83),
(534, 200),
(534, 400),
(535, 1),
(535, 36),
(535, 83),
(535, 200),
(535, 400),
(536, 1),
(536, 36),
(536, 83),
(536, 200),
(536, 400),
(537, 1),
(537, 36),
(537, 83),
(537, 200),
(537, 400),
(538, 1),
(538, 36),
(538, 83),
(538, 200),
(538, 400),
(539, 1),
(539, 36),
(539, 83),
(539, 200),
(539, 400),
(540, 1),
(540, 36),
(540, 83),
(540, 200),
(540, 400),
(541, 1),
(541, 36),
(541, 83),
(541, 200),
(541, 400),
(542, 1),
(542, 36),
(542, 83),
(542, 200),
(542, 400),
(543, 1),
(543, 36),
(543, 83),
(543, 200),
(543, 400),
(544, 1),
(544, 36),
(544, 83),
(544, 200),
(544, 400),
(545, 1),
(545, 36),
(545, 83),
(545, 200),
(545, 400),
(546, 1),
(546, 36),
(546, 83),
(546, 200),
(546, 400),
(547, 1),
(547, 36),
(547, 83),
(547, 200),
(547, 400),
(548, 1),
(548, 36),
(548, 83),
(548, 200),
(548, 400),
(549, 1),
(549, 36),
(549, 83),
(549, 200),
(549, 400),
(550, 1),
(550, 36),
(550, 83),
(550, 200),
(550, 400),
(551, 1),
(551, 36),
(551, 83),
(551, 200),
(551, 400),
(552, 1),
(552, 36),
(552, 83),
(552, 200),
(552, 400),
(553, 1),
(553, 36),
(553, 83),
(553, 200),
(553, 400),
(554, 1),
(554, 36),
(554, 83),
(554, 200),
(554, 400),
(555, 1),
(555, 36),
(555, 83),
(555, 200),
(555, 400),
(556, 1),
(556, 36),
(556, 83),
(556, 200),
(556, 400),
(557, 1),
(557, 36),
(557, 83),
(557, 200),
(557, 400),
(558, 1),
(558, 36),
(558, 83),
(558, 200),
(558, 400),
(559, 1),
(559, 36),
(559, 83),
(559, 200),
(559, 400),
(560, 1),
(560, 36),
(560, 83),
(560, 200),
(560, 400),
(561, 1),
(561, 36),
(561, 83),
(561, 200),
(561, 400),
(562, 1),
(562, 36),
(562, 83),
(562, 200),
(562, 400),
(563, 1),
(563, 36),
(563, 83),
(563, 200),
(563, 400),
(564, 1),
(564, 36),
(564, 83),
(564, 200),
(564, 400),
(565, 1),
(565, 36),
(565, 83),
(565, 200),
(565, 400),
(566, 1),
(566, 36),
(566, 83),
(566, 200),
(566, 400),
(567, 1),
(567, 36),
(567, 83),
(567, 200),
(567, 400),
(568, 1),
(568, 36),
(568, 83),
(568, 200),
(568, 400),
(569, 1),
(569, 36),
(569, 83),
(569, 200),
(569, 400),
(570, 1),
(570, 36),
(570, 83),
(570, 200),
(570, 400),
(571, 1),
(571, 36),
(571, 83),
(571, 200),
(571, 400),
(572, 1),
(572, 36),
(572, 83),
(572, 200),
(572, 400),
(573, 1),
(573, 36),
(573, 83),
(573, 200),
(573, 400),
(574, 1),
(574, 36),
(574, 83),
(574, 200),
(574, 400),
(575, 1),
(575, 36),
(575, 83),
(575, 200),
(575, 400),
(576, 1),
(576, 36),
(576, 83),
(576, 200),
(576, 400),
(577, 1),
(577, 36),
(577, 83),
(577, 200),
(577, 400),
(578, 1),
(578, 36),
(578, 83),
(578, 200),
(578, 400),
(579, 1),
(579, 36),
(579, 83),
(579, 200),
(579, 400),
(580, 1),
(580, 36),
(580, 83),
(580, 200),
(580, 400),
(581, 1),
(581, 36),
(581, 83),
(581, 200),
(581, 400),
(582, 1),
(582, 36),
(582, 83),
(582, 200),
(582, 400),
(583, 1),
(583, 36),
(583, 83),
(583, 200),
(583, 400),
(584, 1),
(584, 36),
(584, 83),
(584, 200),
(584, 400),
(585, 1),
(585, 36),
(585, 83),
(585, 200),
(585, 400),
(586, 1),
(586, 36),
(586, 83),
(586, 200),
(586, 400),
(587, 1),
(587, 36),
(587, 83),
(587, 200),
(587, 400),
(588, 1),
(588, 36),
(588, 83),
(588, 200),
(588, 400),
(589, 1),
(589, 36),
(589, 83),
(589, 200),
(589, 400),
(590, 1),
(590, 36),
(590, 83),
(590, 200),
(590, 400),
(591, 1),
(591, 36),
(591, 83),
(591, 200),
(591, 400),
(592, 1),
(592, 36),
(592, 83),
(592, 200),
(592, 400),
(593, 1),
(593, 36),
(593, 83),
(593, 200),
(593, 400),
(594, 1),
(594, 36),
(594, 83),
(594, 200),
(594, 400),
(595, 1),
(595, 36),
(595, 83),
(595, 200),
(595, 400),
(596, 1),
(596, 36),
(596, 83),
(596, 200),
(596, 400),
(597, 1),
(597, 36),
(597, 83),
(597, 200),
(597, 400),
(598, 1),
(598, 36),
(598, 83),
(598, 200),
(598, 400),
(599, 1),
(599, 36),
(599, 83),
(599, 200),
(599, 400),
(600, 1),
(600, 36),
(600, 83),
(600, 200),
(600, 400),
(601, 1),
(601, 36),
(601, 83),
(601, 200),
(601, 400),
(602, 1),
(602, 36),
(602, 83),
(602, 200),
(602, 400),
(603, 1),
(603, 36),
(603, 83),
(603, 200),
(603, 400),
(604, 1),
(604, 36),
(604, 83),
(604, 200),
(604, 400),
(605, 1),
(605, 36),
(605, 83),
(605, 200),
(605, 400),
(606, 1),
(606, 36),
(606, 83),
(606, 200),
(606, 400),
(607, 1),
(607, 36),
(607, 83),
(607, 200),
(607, 400),
(608, 1),
(608, 36),
(608, 83),
(608, 200),
(608, 400),
(609, 1),
(609, 36),
(609, 83),
(609, 200),
(609, 400),
(610, 1),
(610, 36),
(610, 83),
(610, 200),
(610, 400),
(611, 1),
(611, 36),
(611, 83),
(611, 200),
(611, 400),
(612, 1),
(612, 36),
(612, 83),
(612, 200),
(612, 400),
(613, 1),
(613, 36),
(613, 83),
(613, 200),
(613, 400),
(614, 1),
(614, 36),
(614, 83),
(614, 200),
(614, 400),
(615, 1),
(615, 36),
(615, 83),
(615, 200),
(615, 400),
(616, 1),
(616, 36),
(616, 83),
(616, 200),
(616, 400),
(617, 1),
(617, 36),
(617, 83),
(617, 200),
(617, 400),
(618, 1),
(618, 36),
(618, 83),
(618, 200),
(618, 400),
(619, 1),
(619, 36),
(619, 83),
(619, 200),
(619, 400),
(620, 1),
(620, 36),
(620, 83),
(620, 200),
(620, 400),
(621, 1),
(621, 36),
(621, 83),
(621, 200),
(621, 400),
(622, 1),
(622, 36),
(622, 83),
(622, 200),
(622, 400),
(623, 1),
(623, 36),
(623, 83),
(623, 200),
(623, 400),
(624, 1),
(624, 36),
(624, 83),
(624, 200),
(624, 400),
(625, 1),
(625, 36),
(625, 83),
(625, 200),
(625, 400),
(626, 1),
(626, 36),
(626, 83),
(626, 200),
(626, 400),
(627, 1),
(627, 36),
(627, 83),
(627, 200),
(627, 400),
(628, 1),
(628, 36),
(628, 83),
(628, 200),
(628, 400),
(629, 1),
(629, 36),
(629, 83),
(629, 200),
(629, 400),
(630, 1),
(630, 36),
(630, 83),
(630, 200),
(630, 400),
(631, 1),
(631, 36),
(631, 83),
(631, 200),
(631, 400),
(632, 1),
(632, 36),
(632, 83),
(632, 200),
(632, 400),
(633, 1),
(633, 36),
(633, 83),
(633, 200),
(633, 400),
(634, 1),
(634, 36),
(634, 83),
(634, 200),
(634, 400),
(635, 1),
(635, 36),
(635, 83),
(635, 200),
(635, 400),
(636, 1),
(636, 36),
(636, 83),
(636, 200),
(636, 400),
(637, 1),
(637, 36),
(637, 83),
(637, 200),
(637, 400),
(638, 1),
(638, 36),
(638, 83),
(638, 200),
(638, 400),
(639, 1),
(639, 36),
(639, 83),
(639, 200),
(639, 400),
(640, 1),
(640, 36),
(640, 83),
(640, 200),
(640, 400),
(641, 1),
(641, 36),
(641, 83),
(641, 200),
(641, 400),
(642, 1),
(642, 36),
(642, 83),
(642, 200),
(642, 400),
(643, 1),
(643, 36),
(643, 83),
(643, 200),
(643, 400),
(644, 1),
(644, 36),
(644, 83),
(644, 200),
(644, 400),
(645, 1),
(645, 36),
(645, 83),
(645, 200),
(645, 400),
(646, 1),
(646, 36),
(646, 83),
(646, 200),
(646, 400),
(647, 1),
(647, 36),
(647, 83),
(647, 200),
(647, 400),
(648, 1),
(648, 36),
(648, 83),
(648, 200),
(648, 400),
(649, 1),
(649, 36),
(649, 83),
(649, 200),
(649, 400),
(650, 1),
(650, 36),
(650, 83),
(650, 200),
(650, 400),
(651, 1),
(651, 36),
(651, 83),
(651, 200),
(651, 400),
(652, 1),
(652, 36),
(652, 83),
(652, 200),
(652, 400),
(653, 1),
(653, 36),
(653, 83),
(653, 200),
(653, 400),
(654, 1),
(654, 36),
(654, 83),
(654, 200),
(654, 400),
(655, 1),
(655, 36),
(655, 83),
(655, 200),
(655, 400),
(656, 1),
(656, 36),
(656, 83),
(656, 200),
(656, 400),
(657, 1),
(657, 36),
(657, 83),
(657, 200),
(657, 400),
(658, 1),
(658, 36),
(658, 83),
(658, 200),
(658, 400),
(659, 1),
(659, 36),
(659, 83),
(659, 200),
(659, 400),
(660, 1),
(660, 36),
(660, 83),
(660, 200),
(660, 400),
(661, 1),
(661, 36),
(661, 83),
(661, 200),
(661, 400),
(662, 1),
(662, 36),
(662, 83),
(662, 200),
(662, 400),
(663, 1),
(663, 36),
(663, 83),
(663, 200),
(663, 400),
(664, 1),
(664, 36),
(664, 83),
(664, 200),
(664, 400),
(665, 1),
(665, 36),
(665, 83),
(665, 200),
(665, 400),
(666, 1),
(666, 36),
(666, 83),
(666, 200),
(666, 400),
(667, 1),
(667, 36),
(667, 83),
(667, 200),
(667, 400),
(668, 1),
(668, 36),
(668, 83),
(668, 200),
(668, 400),
(669, 1),
(669, 36),
(669, 83),
(669, 200),
(669, 400),
(670, 1),
(670, 36),
(670, 83),
(670, 200),
(670, 400),
(671, 1),
(671, 36),
(671, 83),
(671, 200),
(671, 400),
(681, 1),
(681, 36),
(681, 83),
(681, 200),
(681, 400),
(691, 1),
(691, 36),
(691, 83),
(691, 200),
(691, 400),
(701, 1),
(701, 36),
(701, 83),
(701, 200),
(701, 400),
(711, 1),
(711, 36),
(711, 83),
(711, 200),
(711, 400),
(721, 1),
(721, 36),
(721, 83),
(721, 200),
(721, 400),
(731, 1),
(731, 36),
(731, 83),
(731, 200),
(731, 400),
(741, 1),
(741, 36),
(741, 83),
(741, 200),
(741, 400),
(751, 1),
(751, 36),
(751, 83),
(751, 200),
(751, 400),
(761, 1),
(761, 36),
(761, 83),
(761, 200),
(761, 400),
(771, 1),
(771, 36),
(771, 83),
(771, 200),
(771, 400),
(781, 1),
(781, 36),
(781, 83),
(781, 200),
(781, 400),
(791, 1),
(791, 36),
(791, 83),
(791, 200),
(791, 400),
(801, 1),
(801, 36),
(801, 83),
(801, 200),
(801, 400),
(811, 1),
(811, 36),
(811, 83),
(811, 200),
(811, 400),
(821, 1),
(821, 36),
(821, 83),
(821, 200),
(821, 400),
(831, 1),
(831, 36),
(831, 83),
(831, 200),
(831, 400),
(841, 1),
(841, 36),
(841, 83),
(841, 200),
(841, 400),
(851, 1),
(851, 36),
(851, 83),
(851, 200),
(851, 400),
(861, 1),
(861, 36),
(861, 83),
(861, 200),
(861, 400),
(871, 1),
(871, 36),
(871, 83),
(871, 200),
(871, 400),
(881, 1),
(881, 36),
(881, 83),
(881, 200),
(881, 400),
(891, 1),
(891, 36),
(891, 83),
(891, 200),
(891, 400),
(901, 1),
(901, 36),
(901, 83),
(901, 200),
(901, 400),
(911, 1),
(911, 36),
(911, 83),
(911, 200),
(911, 400),
(921, 1),
(921, 36),
(921, 83),
(921, 200),
(921, 400),
(931, 1),
(931, 36),
(931, 83),
(931, 200),
(931, 400),
(941, 1),
(941, 36),
(941, 83),
(941, 200),
(941, 400),
(951, 1),
(951, 36),
(951, 83),
(951, 200),
(951, 400),
(961, 1),
(961, 36),
(961, 83),
(961, 200),
(961, 400),
(971, 1),
(971, 36),
(971, 83),
(971, 200),
(971, 400),
(981, 1),
(981, 36),
(981, 83),
(981, 200),
(981, 400),
(991, 1),
(991, 36),
(991, 83),
(991, 200),
(991, 400),
(1001, 1),
(1001, 36),
(1001, 83),
(1001, 200),
(1001, 400),
(1011, 1),
(1011, 36),
(1011, 83),
(1011, 200),
(1011, 400),
(1021, 1),
(1021, 36),
(1021, 83),
(1021, 200),
(1021, 400),
(1031, 1),
(1031, 36),
(1031, 83),
(1031, 200),
(1031, 400),
(1041, 1),
(1041, 36),
(1041, 83),
(1041, 200),
(1041, 400),
(1051, 1),
(1051, 36),
(1051, 83),
(1051, 200),
(1051, 400),
(1061, 1),
(1061, 36),
(1061, 83),
(1061, 200),
(1061, 400),
(1071, 1),
(1071, 36),
(1071, 83),
(1071, 200),
(1071, 400),
(1081, 1),
(1081, 36),
(1081, 83),
(1081, 200),
(1081, 400),
(1091, 1),
(1091, 36),
(1091, 83),
(1091, 200),
(1091, 400),
(1101, 1),
(1101, 36),
(1101, 83),
(1101, 200),
(1101, 400),
(1111, 1),
(1111, 36),
(1111, 45),
(1111, 83),
(1111, 400),
(1121, 83),
(1121, 400),
(1131, 1),
(1131, 36),
(1131, 83),
(1131, 200),
(1131, 400),
(1141, 1),
(1141, 36),
(1141, 83),
(1141, 200),
(1141, 400),
(1151, 1),
(1151, 36),
(1151, 83),
(1151, 200),
(1151, 400),
(1161, 83),
(1161, 200),
(1161, 400),
(1181, 1),
(1181, 36),
(1191, 1),
(1191, 36),
(1201, 1),
(1201, 36),
(1211, 1),
(1211, 36),
(1221, 1),
(1221, 36),
(1231, 1),
(1231, 36),
(1241, 1),
(1241, 36),
(1251, 1),
(1251, 36),
(1261, 1),
(1261, 36),
(1271, 1),
(1271, 36),
(1281, 1),
(1281, 36),
(1291, 1),
(1291, 36),
(1301, 1),
(1301, 8),
(1301, 36),
(1311, 1),
(1311, 36),
(1321, 1),
(1321, 36),
(1331, 1),
(1331, 36),
(1341, 1),
(1341, 36),
(1351, 1),
(1351, 36),
(1361, 1),
(1361, 36),
(1371, 1),
(1371, 36),
(1381, 36),
(1391, 36),
(1401, 36),
(1411, 36),
(1421, 36),
(1431, 36),
(1441, 36),
(1461, 36),
(1471, 36),
(1481, 36),
(1491, 36),
(1501, 36),
(1511, 36),
(1521, 36),
(1531, 36),
(1541, 36),
(1551, 36),
(1561, 2),
(1561, 36),
(1571, 36),
(1851, 51),
(1871, 51),
(1881, 51);

-- --------------------------------------------------------

--
-- Structure de la table `depot_type`
--

CREATE TABLE `depot_type` (
  `depot_type_id` bigint(20) NOT NULL DEFAULT '0',
  `entreprise_id` bigint(20) DEFAULT NULL,
  `depot_type_parent_id` bigint(20) DEFAULT NULL,
  `depot_type_parent_left` bigint(20) DEFAULT NULL,
  `depot_type_parent_right` bigint(20) DEFAULT NULL,
  `depot_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `depot_type`
--

INSERT INTO `depot_type` (`depot_type_id`, `entreprise_id`, `depot_type_parent_id`, `depot_type_parent_left`, `depot_type_parent_right`, `depot_type_designation`) VALUES
(1, 122, NULL, NULL, NULL, 'Departement / Service'),
(2, 122, NULL, NULL, NULL, 'Entrepot'),
(3, 122, 2, NULL, NULL, 'Depot'),
(4, 122, 2, NULL, NULL, 'Rangement de stockage'),
(5, 122, NULL, NULL, NULL, 'Citerne'),
(6, 122, 2, NULL, NULL, 'Véhicule / Camions / Remorque'),
(7, 305, 3, NULL, NULL, 'Dépôt mobile');

-- --------------------------------------------------------

--
-- Structure de la table `depot_vendeur`
--

CREATE TABLE `depot_vendeur` (
  `entreprise_id` bigint(20) NOT NULL DEFAULT '0',
  `vendeur_id` bigint(20) NOT NULL DEFAULT '0',
  `depot_id` bigint(20) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `device_compte`
--

CREATE TABLE `device_compte` (
  `device_id` varchar(16) NOT NULL,
  `compte_id` bigint(20) NOT NULL,
  `date_last_connexion` datetime DEFAULT NULL,
  `date_first_connexion` datetime DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `device_compte`
--

INSERT INTO `device_compte` (`device_id`, `compte_id`, `date_last_connexion`, `date_first_connexion`, `is_active`) VALUES
('14554789', 1, '2020-09-28 00:00:00', '2020-09-28 00:00:00', 1);

-- --------------------------------------------------------

--
-- Structure de la table `disconnection_sever`
--

CREATE TABLE `disconnection_sever` (
  `disconnection_server_id` bigint(20) NOT NULL,
  `server_id` bigint(20) DEFAULT NULL,
  `disconnection_date_start` datetime DEFAULT NULL,
  `disconnection_date_start_day` date DEFAULT NULL,
  `disconnection_date_end` datetime DEFAULT NULL,
  `disconnection_date_end_day` date DEFAULT NULL,
  `disconnection_reason` text,
  `solution` text,
  `perte_total` double DEFAULT NULL,
  `perte_texte_raport` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `disconnection_sever`
--

INSERT INTO `disconnection_sever` (`disconnection_server_id`, `server_id`, `disconnection_date_start`, `disconnection_date_start_day`, `disconnection_date_end`, `disconnection_date_end_day`, `disconnection_reason`, `solution`, `perte_total`, `perte_texte_raport`) VALUES
(1, 2, '2017-09-19 00:30:00', '2017-09-19', '2017-09-24 01:45:00', '2017-09-24', 'raison1', 'solution5', 2100, NULL),
(2, 2, '2018-07-10 00:00:00', '2018-07-10', '2018-07-10 01:15:00', '2018-07-10', 'raison', 'solution', 1500, NULL),
(3, 1, '2019-01-16 00:15:00', '2019-01-16', '2019-01-16 00:30:00', '2019-01-16', 'gtifg', 'lnio', 1250, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `disconnection_sever_listner`
--

CREATE TABLE `disconnection_sever_listner` (
  `disconnection_server_listner_id` bigint(20) NOT NULL,
  `server_listner_id` bigint(20) DEFAULT NULL,
  `disconnection_date_start` datetime DEFAULT NULL,
  `disconnection_date_start_day` date DEFAULT NULL,
  `disconnection_date_end` datetime DEFAULT NULL,
  `disconnection_date_end_day` date DEFAULT NULL,
  `disconnection_reason` text,
  `solution` text,
  `perte_total` double DEFAULT NULL,
  `perte_texte_raport` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `disconnection_sever_listner`
--

INSERT INTO `disconnection_sever_listner` (`disconnection_server_listner_id`, `server_listner_id`, `disconnection_date_start`, `disconnection_date_start_day`, `disconnection_date_end`, `disconnection_date_end_day`, `disconnection_reason`, `solution`, `perte_total`, `perte_texte_raport`) VALUES
(1, 2, '2017-09-28 01:45:00', '2017-09-28', '2017-09-28 02:15:00', '2017-09-28', 'raison1', 'solution1', 1500, NULL),
(2, 3, '2017-09-28 01:15:00', '2017-09-28', '2017-09-29 02:45:00', '2017-09-29', 'raison2', 'solution2', 600, NULL),
(3, 3, '2017-09-28 00:30:00', '2017-09-28', '2017-09-28 03:30:00', '2017-09-28', 'raison3', 'solution3', 1205, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `disconnection_vehicule`
--

CREATE TABLE `disconnection_vehicule` (
  `disconnection_vehicule_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) DEFAULT NULL,
  `disconnection_date_start` datetime DEFAULT NULL,
  `disconnection_date_start_day` date DEFAULT NULL,
  `disconnection_date_end` datetime DEFAULT NULL,
  `disconnection_date_end_day` date DEFAULT NULL,
  `disconnection_reason` text,
  `disconnection_solution` text,
  `perte_total` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `disconnection_vehicule`
--

INSERT INTO `disconnection_vehicule` (`disconnection_vehicule_id`, `vehicule_id`, `disconnection_date_start`, `disconnection_date_start_day`, `disconnection_date_end`, `disconnection_date_end_day`, `disconnection_reason`, `disconnection_solution`, `perte_total`) VALUES
(1, 13, '2017-09-23 00:30:00', '2017-09-23', '2017-09-26 01:30:00', '2017-09-26', 'raison1', 'solution1', 600),
(2, 14, '2017-09-23 00:45:00', '2017-09-23', '2017-09-25 03:00:00', '2017-09-25', 'raison25', 'slution2', 1200);

-- --------------------------------------------------------

--
-- Structure de la table `document_file`
--

CREATE TABLE `document_file` (
  `document_file_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `document_type_id` int(11) DEFAULT NULL,
  `document_filetype` varchar(4) COLLATE utf8_unicode_ci DEFAULT NULL,
  `document_path` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `document_commentaire` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `document_online_show` tinyint(1) DEFAULT NULL,
  `document_description` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `document_online_description` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `document_file`
--

INSERT INTO `document_file` (`document_file_id`, `entreprise_id`, `document_type_id`, `document_filetype`, `document_path`, `document_commentaire`, `document_online_show`, `document_description`, `document_online_description`) VALUES
(1, 305, 14, 'txt', '/app/public/305/documents/sinistres/1727701666.txt', NULL, NULL, 'doc', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `document_file_type`
--

CREATE TABLE `document_file_type` (
  `document_file_type_id` varchar(4) COLLATE utf8_unicode_ci NOT NULL,
  `document_file_type_designation` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `document_file_type`
--

INSERT INTO `document_file_type` (`document_file_type_id`, `document_file_type_designation`) VALUES
('doc', 'Word'),
('jpg', 'Image JPG'),
('pdf', 'PDF'),
('png', 'Image PNG'),
('RAR', 'Documents compressés RAR'),
('txt', 'Texte'),
('xls', 'Excel'),
('ZIP', 'Documents compressés ZIP');

-- --------------------------------------------------------

--
-- Structure de la table `document_groupe`
--

CREATE TABLE `document_groupe` (
  `document_group_id` bigint(20) NOT NULL,
  `document_group_designation` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `document_groupe`
--

INSERT INTO `document_groupe` (`document_group_id`, `document_group_designation`) VALUES
(1, 'Véhicules'),
(11, 'Moyens'),
(21, 'Chauffeurs'),
(31, 'Employés'),
(41, 'Documents RH'),
(51, 'Documents commercials');

-- --------------------------------------------------------

--
-- Structure de la table `document_type`
--

CREATE TABLE `document_type` (
  `document_type_id` int(11) NOT NULL,
  `document_type_designation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `document_type`
--

INSERT INTO `document_type` (`document_type_id`, `document_type_designation`) VALUES
(1, 'Logo'),
(2, 'Permis de conduire'),
(3, 'Carte d\'identité'),
(6, 'CV'),
(7, 'Registre de commerce'),
(10, 'Carte fiscale'),
(11, 'Modèle de document'),
(12, 'dossier Assurance'),
(13, 'Photo sinistre'),
(14, 'document sinistre'),
(15, 'Video Sinistre'),
(16, 'Document operation'),
(17, 'Carte grise'),
(18, 'Assurance'),
(19, 'Contrôle technique'),
(20, 'Vignette'),
(21, 'Permis de circulé'),
(22, 'Attestation d\'Assurance'),
(23, 'Photo Véhicule et moyen'),
(24, 'Vidéo Véhicule et moyen'),
(25, 'Photo Article'),
(26, 'Vidéo Article'),
(27, 'Décharge'),
(28, 'Restitution');

-- --------------------------------------------------------

--
-- Structure de la table `document_type_document_group`
--

CREATE TABLE `document_type_document_group` (
  `document_type_id` bigint(20) NOT NULL,
  `document_group_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `domaine_activity`
--

CREATE TABLE `domaine_activity` (
  `domaine_activity_id` bigint(20) NOT NULL,
  `domaine_activity_designation_lang_id` bigint(20) DEFAULT NULL,
  `domaine_activity_designation_text_id` bigint(20) DEFAULT NULL,
  `domaine_activity_parent_id` bigint(20) DEFAULT NULL,
  `domaine_activity_parent_left` bigint(20) DEFAULT NULL,
  `domaine_activity_parent_right` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `domaine_activity_attribute`
--

CREATE TABLE `domaine_activity_attribute` (
  `domaine_activity_attribute_id` bigint(20) NOT NULL,
  `domaine_activity_attribute_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `domaine_activity_attribute_value`
--

CREATE TABLE `domaine_activity_attribute_value` (
  `domaine_activity_attribute_id` bigint(20) NOT NULL DEFAULT '0',
  `domaine_activity_id` bigint(20) NOT NULL DEFAULT '0',
  `domaine_activity_attribute_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `domaine_activity_contact`
--

CREATE TABLE `domaine_activity_contact` (
  `domaine_activity_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `domaine_activity_point`
--

CREATE TABLE `domaine_activity_point` (
  `contact_id` bigint(20) NOT NULL DEFAULT '0',
  `commune_id` int(11) NOT NULL DEFAULT '0',
  `contact_responsable_id` bigint(20) DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL,
  `domaine_activity_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `driver`
--

CREATE TABLE `driver` (
  `driver_id` bigint(20) NOT NULL,
  `driver_group_id` bigint(20) DEFAULT NULL,
  `is_group_chief` tinyint(1) DEFAULT NULL,
  `is_remplacant` tinyint(1) DEFAULT NULL,
  `is_surface` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `driver_group`
--

CREATE TABLE `driver_group` (
  `driver_group_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `driver_group_designation` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `driver_group`
--

INSERT INTO `driver_group` (`driver_group_id`, `entreprise_id`, `driver_group_designation`) VALUES
(1, 122, 'Chauffeurs de livraison'),
(2, 122, 'Vendeurs'),
(3, 122, 'Secteur B'),
(4, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `driver_planning`
--

CREATE TABLE `driver_planning` (
  `driver_planning_id` bigint(20) NOT NULL,
  `driver_id` bigint(20) DEFAULT NULL,
  `start_date` datetime DEFAULT NULL,
  `start_date_day` date DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `end_date_day` date DEFAULT NULL,
  `driver_planning_status_id` int(11) DEFAULT NULL,
  `driver_is_in_work` tinyint(4) DEFAULT NULL,
  `is_end_date_defined` tinyint(4) DEFAULT NULL,
  `note` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `driver_planning_status`
--

CREATE TABLE `driver_planning_status` (
  `driver_planning_status_id` int(11) NOT NULL,
  `driver_planning_status_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `driver_vehicule`
--

CREATE TABLE `driver_vehicule` (
  `driver_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) NOT NULL,
  `is_default` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `evaluation_type`
--

CREATE TABLE `evaluation_type` (
  `evaluation_type_id` int(11) NOT NULL,
  `evaluation_type_designation` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `evaluation_type`
--

INSERT INTO `evaluation_type` (`evaluation_type_id`, `evaluation_type_designation`) VALUES
(1, 'AssiduitÃ©'),
(2, 'Comportement'),
(3, 'Communication'),
(4, 'PrÃ©sentation'),
(5, 'Rendement');

-- --------------------------------------------------------

--
-- Structure de la table `evaluation_valeur`
--

CREATE TABLE `evaluation_valeur` (
  `evaluation_valeur_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `evaluation_type_id` int(11) DEFAULT NULL,
  `evaluateur_id` bigint(20) DEFAULT NULL,
  `evaluee_id` bigint(20) DEFAULT NULL,
  `operation_id` bigint(20) DEFAULT NULL,
  `evaluation_valeur` int(11) DEFAULT NULL,
  `evaluation_valeur_remarque` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `famille_tmp`
--

CREATE TABLE `famille_tmp` (
  `id` bigint(20) NOT NULL,
  `code` varchar(56) DEFAULT NULL,
  `designation` varchar(56) DEFAULT NULL,
  `parent` varchar(56) DEFAULT NULL,
  `famille` varchar(56) DEFAULT NULL,
  `parent_id` bigint(56) DEFAULT NULL,
  `famille_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `fidelite_carte`
--

CREATE TABLE `fidelite_carte` (
  `fidelite_carte_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `ressource_id` bigint(20) DEFAULT NULL,
  `article_mouvement_id` bigint(20) DEFAULT NULL,
  `fidelite_carte_type_id` bigint(20) DEFAULT NULL,
  `fidelite_carte_password` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `fidelite_carte_client`
--

CREATE TABLE `fidelite_carte_client` (
  `fidelite_carte_id` bigint(20) NOT NULL DEFAULT '0',
  `entreprise_id` bigint(20) NOT NULL DEFAULT '0',
  `client_id` bigint(20) NOT NULL DEFAULT '0',
  `fidelite_carte_date_debut` datetime NOT NULL,
  `fidelite_carte_date_fin` datetime NOT NULL,
  `fidelite_carte_code_ean13` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fidelite_carte_code_barre` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `fidelite_carte_code_qr` double DEFAULT NULL,
  `fidelite_carte_montant_cumule` double DEFAULT NULL,
  `fidelite_carte_date_dernier_achat` datetime DEFAULT NULL,
  `fidelite_carte_password` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `fidelite_carte_type`
--

CREATE TABLE `fidelite_carte_type` (
  `fidelite_carte_type_id` bigint(20) NOT NULL DEFAULT '0',
  `entreprise_id` bigint(20) DEFAULT NULL,
  `fidelite_carte_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_caisse_contact`
--

CREATE TABLE `finance_caisse_contact` (
  `caisse_id` bigint(20) NOT NULL,
  `caissier_id` bigint(20) NOT NULL,
  `caisse_type` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `finance_caisse_physique`
--

CREATE TABLE `finance_caisse_physique` (
  `id` bigint(100) NOT NULL,
  `caisse_id` bigint(20) DEFAULT NULL,
  `caisse_source_id` bigint(20) DEFAULT NULL,
  `caissier_id` bigint(20) DEFAULT NULL,
  `solde_theorique` double DEFAULT NULL,
  `solde_physique` double DEFAULT NULL,
  `type` bigint(20) DEFAULT NULL,
  `type_designation` varchar(100) DEFAULT NULL,
  `date_theorique` date DEFAULT NULL,
  `date_physique` datetime DEFAULT NULL,
  `physique_caisse_principale` double DEFAULT NULL,
  `date_physique_caisse_principale` date DEFAULT NULL,
  `theorique_correcte` double DEFAULT NULL,
  `encaissement_caisse_principale` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `finance_cheque`
--

CREATE TABLE `finance_cheque` (
  `finance_cheque_id` bigint(20) NOT NULL,
  `remise_cheque_id` bigint(20) NOT NULL,
  `caisse_id` bigint(20) DEFAULT NULL,
  `compte_id` bigint(20) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `finance_compte_etablissement_id` bigint(20) DEFAULT NULL,
  `finance_compte_etablissement_agence_id` bigint(20) DEFAULT NULL,
  `finance_cheque_numero` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `finance_cheque_date` date DEFAULT NULL,
  `finance_cheque_is_used` tinyint(1) DEFAULT NULL,
  `finance_cheque_montant` double DEFAULT NULL,
  `finance_cheque_date_remise` date DEFAULT NULL,
  `finance_cheque_date_encaissement` date DEFAULT NULL,
  `finance_cheque_is_porteur` tinyint(1) DEFAULT NULL,
  `finance_cheque_to` bigint(20) DEFAULT NULL,
  `finance_cheque_by` bigint(11) DEFAULT NULL,
  `finance_cheque_barre` tinyint(1) DEFAULT NULL,
  `finance_cheque_montant_lettre` text COLLATE utf8_unicode_ci,
  `finance_cheque_etat_paiement` int(3) DEFAULT '0',
  `finance_versement_id` bigint(20) DEFAULT NULL,
  `is_signed` tinyint(1) DEFAULT NULL,
  `is_delivered` tinyint(1) DEFAULT NULL,
  `is_cancelled` tinyint(1) DEFAULT NULL,
  `cancel_cause` tinyint(1) DEFAULT NULL,
  `delivered_to` bigint(20) DEFAULT NULL,
  `delivered_date` date DEFAULT NULL,
  `finance_cheque_in0_out1` tinyint(1) DEFAULT NULL,
  `finance_cheque_photo` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_cheque`
--

INSERT INTO `finance_cheque` (`finance_cheque_id`, `remise_cheque_id`, `caisse_id`, `compte_id`, `entreprise_id`, `finance_compte_etablissement_id`, `finance_compte_etablissement_agence_id`, `finance_cheque_numero`, `finance_cheque_date`, `finance_cheque_is_used`, `finance_cheque_montant`, `finance_cheque_date_remise`, `finance_cheque_date_encaissement`, `finance_cheque_is_porteur`, `finance_cheque_to`, `finance_cheque_by`, `finance_cheque_barre`, `finance_cheque_montant_lettre`, `finance_cheque_etat_paiement`, `finance_versement_id`, `is_signed`, `is_delivered`, `is_cancelled`, `cancel_cause`, `delivered_to`, `delivered_date`, `finance_cheque_in0_out1`, `finance_cheque_photo`) VALUES
(10, 1, 1, NULL, NULL, 1, 4, '6955566666', '2021-03-02', NULL, 200000, NULL, NULL, NULL, 1, 24957, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL),
(11, 1, 2, NULL, NULL, 1, 1, '124312', '2021-04-22', NULL, 10000, NULL, NULL, NULL, 1, 25202, NULL, NULL, 0, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte`
--

CREATE TABLE `finance_compte` (
  `compte_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `proprietaire_id` bigint(20) DEFAULT NULL,
  `compte_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `compte_type_id` bigint(20) DEFAULT NULL,
  `caisse_type` tinyint(1) DEFAULT '0',
  `password` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `etat_caisse` tinyint(1) DEFAULT NULL,
  `finance_compte_etablissement_id` bigint(20) DEFAULT NULL,
  `finance_compte_etablissement_agence_id` bigint(20) DEFAULT NULL,
  `finance_compte_managed_by` bigint(20) DEFAULT NULL,
  `finance_compte_managed_start_date` datetime DEFAULT NULL,
  `finance_compte_managed_end_date` datetime DEFAULT NULL,
  `numero_compte` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cle` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
  `numero_rib` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `pays_id` int(4) DEFAULT NULL,
  `wilaya_id` int(11) DEFAULT NULL,
  `commune_id` int(11) DEFAULT NULL,
  `departement_id` bigint(20) DEFAULT NULL,
  `financier_id` bigint(20) DEFAULT NULL,
  `comptabilite_type_id` bigint(20) DEFAULT NULL,
  `date_creation` datetime DEFAULT NULL,
  `solde` double DEFAULT NULL,
  `solde_date` datetime DEFAULT NULL,
  `total_cheque` int(11) DEFAULT NULL,
  `is_desactivated` tinyint(4) DEFAULT NULL,
  `solde_physique` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_compte`
--

INSERT INTO `finance_compte` (`compte_id`, `entreprise_id`, `proprietaire_id`, `compte_designation`, `compte_type_id`, `caisse_type`, `password`, `etat_caisse`, `finance_compte_etablissement_id`, `finance_compte_etablissement_agence_id`, `finance_compte_managed_by`, `finance_compte_managed_start_date`, `finance_compte_managed_end_date`, `numero_compte`, `cle`, `numero_rib`, `pays_id`, `wilaya_id`, `commune_id`, `departement_id`, `financier_id`, `comptabilite_type_id`, `date_creation`, `solde`, `solde_date`, `total_cheque`, `is_desactivated`, `solde_physique`) VALUES
(1, 305, 28627, 'Caisse dépôt', 1, 1, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 180000, '2023-12-13 15:33:06', 0, NULL, 0),
(2, 305, 28623, 'Caisse 1', 1, 0, NULL, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70000, '2023-12-07 14:36:51', 0, NULL, NULL),
(3, 305, 28624, 'Caisse 2', 1, 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, '2021-04-22 13:51:09', 0, NULL, NULL),
(4, NULL, 28625, 'Caisse 3', 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL),
(5, NULL, 28626, 'Caisse 4', 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6, NULL, NULL, 'Caisse fournisseur', 1, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 961835, '2021-04-21 12:59:44', NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_alerte`
--

CREATE TABLE `finance_compte_alerte` (
  `compte_alerte_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `compte_id` bigint(20) DEFAULT NULL,
  `alerte_min` bigint(20) DEFAULT NULL,
  `alerte_max` bigint(20) DEFAULT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `contact_info_type_id` bigint(20) DEFAULT NULL,
  `contact_info` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_alerte_operation`
--

CREATE TABLE `finance_compte_alerte_operation` (
  `compte_alerte_id` bigint(20) NOT NULL DEFAULT '0',
  `compte_operation_id` bigint(20) NOT NULL DEFAULT '0',
  `alerted` tinyint(1) DEFAULT NULL,
  `contact_info_type_id` bigint(20) DEFAULT NULL,
  `contact_info_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alert_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_etablissement`
--

CREATE TABLE `finance_compte_etablissement` (
  `finance_compte_etablissement_id` bigint(20) NOT NULL,
  `finance_compte_etablissement_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `finance_compte_etablissement_abreviation` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_etablissement_agence`
--

CREATE TABLE `finance_compte_etablissement_agence` (
  `finance_compte_etablissement_agence_id` bigint(20) NOT NULL,
  `finance_compte_etablissement_id` bigint(20) DEFAULT NULL,
  `finance_compte_etablissement_agence_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `finance_compte_etablissement_agence_abreviation` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_monnaie_piece`
--

CREATE TABLE `finance_compte_monnaie_piece` (
  `compte_id` bigint(20) NOT NULL DEFAULT '0',
  `finance_monnaie_piece` bigint(20) NOT NULL DEFAULT '0',
  `nombre` int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_operation`
--

CREATE TABLE `finance_compte_operation` (
  `compte_operation_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `compte_operation_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `compte_id` bigint(20) DEFAULT NULL,
  `compte_operation_type_id` bigint(20) DEFAULT NULL,
  `compte_operation_type_detail_id` bigint(20) DEFAULT NULL,
  `recu_paiement_document_id` bigint(20) DEFAULT NULL,
  `recu_paiement_numero` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `compte_operation_contact_id` bigint(20) DEFAULT NULL,
  `compte_operation_nom` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `compte_operation_prenom` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_operation_type`
--

CREATE TABLE `finance_compte_operation_type` (
  `compte_operation_type_id` bigint(20) NOT NULL,
  `compte_operation_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_compte_operation_type`
--

INSERT INTO `finance_compte_operation_type` (`compte_operation_type_id`, `compte_operation_type_designation`) VALUES
(-1, 'Débit'),
(1, 'Crédit');

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_operation_type_detail`
--

CREATE TABLE `finance_compte_operation_type_detail` (
  `finance_compte_operation_type_detail_id` bigint(20) NOT NULL,
  `compte_operation_type_id` bigint(20) NOT NULL,
  `finance_compte_operation_type_detail_designation` varchar(256) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_compte_type`
--

CREATE TABLE `finance_compte_type` (
  `compte_type_id` bigint(20) NOT NULL,
  `compte_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_compte_type`
--

INSERT INTO `finance_compte_type` (`compte_type_id`, `compte_type_designation`) VALUES
(1, 'Caisse'),
(2, 'Compte bancaire');

-- --------------------------------------------------------

--
-- Structure de la table `finance_mode_paiement`
--

CREATE TABLE `finance_mode_paiement` (
  `finance_mode_paiement_id` int(20) NOT NULL DEFAULT '0',
  `finance_mode_paiement_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_mode_paiement`
--

INSERT INTO `finance_mode_paiement` (`finance_mode_paiement_id`, `finance_mode_paiement_designation`) VALUES
(1, 'Espèce'),
(2, 'Virement'),
(3, 'Versement'),
(4, 'Chèque');

-- --------------------------------------------------------

--
-- Structure de la table `finance_monnaie`
--

CREATE TABLE `finance_monnaie` (
  `monnaie_id` bigint(20) NOT NULL,
  `monnaie_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `monnaie_abreviation` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `pays_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_monnaie`
--

INSERT INTO `finance_monnaie` (`monnaie_id`, `monnaie_designation`, `monnaie_abreviation`, `pays_id`) VALUES
(1, 'dinars algerien', 'DZD', 1);

-- --------------------------------------------------------

--
-- Structure de la table `finance_monnaie_piece`
--

CREATE TABLE `finance_monnaie_piece` (
  `finance_monnaie_piece_id` bigint(20) NOT NULL DEFAULT '0',
  `finance_monnaie_piece_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `monnaie_id` bigint(20) DEFAULT NULL,
  `valeur_unite` int(11) DEFAULT NULL,
  `active` tinyint(1) DEFAULT NULL,
  `image` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `type` tinyint(2) NOT NULL,
  `ordre` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_monnaie_piece`
--

INSERT INTO `finance_monnaie_piece` (`finance_monnaie_piece_id`, `finance_monnaie_piece_designation`, `monnaie_id`, `valeur_unite`, `active`, `image`, `type`, `ordre`) VALUES
(1, '1 Dinar', 1, 1, 1, '/app/public/ressources/1.png', 1, 13),
(2, '2 Dinars', 1, 2, 1, '/app/public/ressources/2.png', 1, 12),
(5, '5 Dinars', 1, 5, 1, '/app/public/ressources/5.png', 1, 11),
(10, '10 Dinars', 1, 10, 1, '/app/public/ressources/10.png', 1, 10),
(20, '20 Dinars', 1, 20, 1, '/app/public/ressources/20.png', 1, 9),
(50, '50 Dinars', 1, 50, 1, '/app/public/ressources/50.png', 1, 8),
(100, '100 Dinars', 1, 100, 1, '/app/public/ressources/100.png', 1, 7),
(101, '100 Dinars', 1, 100, 1, '/app/public/ressources/100b.jpg', 2, 5),
(200, '200 Dinars', 1, 200, 1, '/app/public/ressources/200.png', 1, 6),
(201, '200 Dinars', 1, 200, 1, '/app/public/ressources/200b.jpg', 2, 4),
(500, '500 Dinars', 1, 500, 1, '/app/public/ressources/500.jpg', 2, 3),
(1000, '1000 Dinars', 1, 1000, 1, '/app/public/ressources/1000.jpg', 2, 2),
(2000, '2000 Dinars', 1, 2000, 1, '/app/public/ressources/2000.jpg', 2, 1);

-- --------------------------------------------------------

--
-- Structure de la table `finance_ordre_paiement`
--

CREATE TABLE `finance_ordre_paiement` (
  `finance_ordre_paiement_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `paiement_to_id` bigint(20) DEFAULT NULL,
  `monnaie_id` bigint(20) DEFAULT NULL,
  `montant` double DEFAULT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `service_fait_validated` tinyint(1) DEFAULT NULL,
  `service_fait_validated_date` datetime DEFAULT NULL,
  `service_fait_manager_id` bigint(20) DEFAULT NULL,
  `service_fait_manager_validation_date` datetime DEFAULT NULL,
  `compte_operation_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_ordre_paiement_remarque`
--

CREATE TABLE `finance_ordre_paiement_remarque` (
  `finance_ordre_paiement_remarque_id` bigint(20) NOT NULL,
  `finance_ordre_paiement_remarque_texte` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `finance_ordre_paiement_remarque_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_paiement_delai`
--

CREATE TABLE `finance_paiement_delai` (
  `paiement_delai_id` bigint(20) NOT NULL,
  `paiement_delai_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_paiement_delai`
--

INSERT INTO `finance_paiement_delai` (`paiement_delai_id`, `paiement_delai_designation`) VALUES
(1, 'Immmédiat'),
(2, 'A terme');

-- --------------------------------------------------------

--
-- Structure de la table `finance_paiement_rappel`
--

CREATE TABLE `finance_paiement_rappel` (
  `paiement_rappel_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `paiement_delai_id` bigint(20) DEFAULT NULL,
  `contact_info_type_id` bigint(20) DEFAULT NULL,
  `contact_info_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_date` datetime DEFAULT NULL,
  `contact_date_day` date DEFAULT NULL,
  `contact_note` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_rappel_date` datetime DEFAULT NULL,
  `contact_rappel_date_day` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_remise_cheque`
--

CREATE TABLE `finance_remise_cheque` (
  `remise_cheque_id` bigint(20) NOT NULL,
  `caisse_id` bigint(20) DEFAULT NULL,
  `compte_id` bigint(20) DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `finance_compte_etablissement_id` bigint(20) DEFAULT NULL,
  `finance_compte_etablissement_agence_id` bigint(20) DEFAULT NULL,
  `remise_cheque_numero` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `remise_cheque_date` date DEFAULT NULL,
  `remise_cheque_is_used` tinyint(1) DEFAULT NULL,
  `remise_cheque_montant` double DEFAULT NULL,
  `remise_cheque_date_remise` date DEFAULT NULL,
  `remise_cheque_is_porteur` tinyint(1) DEFAULT NULL,
  `remise_cheque_to` bigint(20) DEFAULT NULL,
  `remise_cheque_by` bigint(11) DEFAULT NULL,
  `remise_cheque_barre` tinyint(1) DEFAULT NULL,
  `remise_cheque_montant_lettre` text COLLATE utf8_unicode_ci,
  `is_signed` tinyint(1) DEFAULT NULL,
  `is_delivered` tinyint(1) DEFAULT NULL,
  `is_cancelled` tinyint(1) DEFAULT NULL,
  `cancel_cause` tinyint(1) DEFAULT NULL,
  `delivered_to` bigint(20) DEFAULT NULL,
  `delivered_date` date DEFAULT NULL,
  `remise_cheque_photo` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `finance_remise_cheque`
--

INSERT INTO `finance_remise_cheque` (`remise_cheque_id`, `caisse_id`, `compte_id`, `entreprise_id`, `finance_compte_etablissement_id`, `finance_compte_etablissement_agence_id`, `remise_cheque_numero`, `remise_cheque_date`, `remise_cheque_is_used`, `remise_cheque_montant`, `remise_cheque_date_remise`, `remise_cheque_is_porteur`, `remise_cheque_to`, `remise_cheque_by`, `remise_cheque_barre`, `remise_cheque_montant_lettre`, `is_signed`, `is_delivered`, `is_cancelled`, `cancel_cause`, `delivered_to`, `delivered_date`, `remise_cheque_photo`) VALUES
(1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 10000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `finance_versement`
--

CREATE TABLE `finance_versement` (
  `finance_versement_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `compte_operation_id` bigint(20) DEFAULT NULL,
  `compte_operation_type_id` bigint(20) DEFAULT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `versement_date` datetime DEFAULT NULL,
  `versement_date_day` date DEFAULT NULL,
  `mode_paiement_id` bigint(20) DEFAULT NULL,
  `is_remise_differee` tinyint(1) DEFAULT NULL,
  `encaissement_date` datetime DEFAULT NULL,
  `encaissement_date_day` date DEFAULT NULL,
  `is_delayed` tinyint(1) DEFAULT NULL,
  `is_paid` tinyint(1) DEFAULT NULL,
  `is_notified` tinyint(1) DEFAULT NULL,
  `versement_montant` double DEFAULT NULL,
  `comptabilite_type_id` bigint(20) DEFAULT NULL,
  `accuse_contact` tinyint(1) DEFAULT NULL,
  `remise_date` datetime DEFAULT NULL,
  `remise_date_day` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_versement_monnaie_piece`
--

CREATE TABLE `finance_versement_monnaie_piece` (
  `finance_versement_id` bigint(20) NOT NULL DEFAULT '0',
  `finance_monnaie_piece_id` bigint(20) NOT NULL DEFAULT '0',
  `nombre` int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `finance_versement_notification`
--

CREATE TABLE `finance_versement_notification` (
  `finance_versement_notification_id` bigint(20) NOT NULL,
  `finance_versement_id` bigint(20) DEFAULT NULL,
  `notification_info_type_id` bigint(20) DEFAULT NULL,
  `notification_info_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `notification_date` datetime DEFAULT NULL,
  `notification_date_day` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `fournisseur_solde_initial_historique`
--

CREATE TABLE `fournisseur_solde_initial_historique` (
  `id` bigint(20) NOT NULL,
  `fournisseur_id` bigint(20) NOT NULL,
  `reglement_caisse_id` bigint(100) DEFAULT NULL,
  `old_solde` double DEFAULT '0',
  `montant_regle` double DEFAULT '0',
  `new_solde` double DEFAULT '0',
  `date_day` date NOT NULL,
  `date` datetime DEFAULT NULL,
  `reglement_by` bigint(20) DEFAULT NULL,
  `commentaire` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `frigo_type`
--

CREATE TABLE `frigo_type` (
  `frigo_type_id` int(11) NOT NULL,
  `frigo_type_designation` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `frigo_type_modele_constructeur` varchar(100) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `frigo_type`
--

INSERT INTO `frigo_type` (`frigo_type_id`, `frigo_type_designation`, `frigo_type_modele_constructeur`) VALUES
(1, 'frigo1', 'frigo50kg'),
(2, 'frigo2', 'frigo20kg'),
(3, 'frigo3', 'frigo60kg'),
(4, 'frigo4', 'test_type');

-- --------------------------------------------------------

--
-- Structure de la table `frigo_type_value`
--

CREATE TABLE `frigo_type_value` (
  `frigo_type_value_id` bigint(20) NOT NULL,
  `frigo_type_id` int(11) DEFAULT NULL,
  `indice_decimal` int(11) NOT NULL,
  `temperature` double NOT NULL,
  `is_real` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `garantie`
--

CREATE TABLE `garantie` (
  `garantie_id` bigint(20) NOT NULL DEFAULT '0',
  `entreprise_id` bigint(20) DEFAULT NULL,
  `article_mouvement_id` bigint(20) DEFAULT NULL,
  `garantie_motif` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `garantie_numero` bigint(20) DEFAULT NULL,
  `garantie_piece` tinyint(1) DEFAULT NULL,
  `garantie_piece_duree` int(11) DEFAULT NULL,
  `garantie_piece_start_date` date DEFAULT NULL,
  `garantie_piece_end_date` date DEFAULT NULL,
  `garantie_mo` tinyint(1) DEFAULT NULL,
  `garantie_mo_duree` int(11) DEFAULT NULL,
  `garantie_mo_start_date` date DEFAULT NULL,
  `garantie_mo_end_date` date DEFAULT NULL,
  `garantie_mouvement_ligne_id_replaced` bigint(20) DEFAULT NULL,
  `garantie_note` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `active` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `garantie_attribute`
--

CREATE TABLE `garantie_attribute` (
  `garantie_attribute_id` bigint(20) NOT NULL DEFAULT '0',
  `entreprise_id` bigint(20) DEFAULT NULL,
  `garantie_attribute_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `garantie_attribute_value`
--

CREATE TABLE `garantie_attribute_value` (
  `garantie_attribute_id` bigint(20) NOT NULL DEFAULT '0',
  `garantie_id` bigint(20) NOT NULL DEFAULT '0',
  `garantie_attribute_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `geo_alarm`
--

CREATE TABLE `geo_alarm` (
  `alarm_id` bigint(20) NOT NULL,
  `id_tracker` bigint(20) NOT NULL,
  `model_id` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `alarm_code_hex` varchar(6) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alarm_subcode_hex` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alarm_type` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `description` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `alarm_priority` varchar(20) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Déchargement des données de la table `geo_alarm`
--

INSERT INTO `geo_alarm` (`alarm_id`, `id_tracker`, `model_id`, `alarm_code_hex`, `alarm_subcode_hex`, `alarm_type`, `description`, `alarm_priority`) VALUES
(1, 45220220634, 'VT310', '9999', '50', 'batterie', 'Coupure courant externe', '1'),
(2, 45220220634, 'VT310', '9999', '01', 'Input 1 active', 'Demande de secours (Bouton SOS)', '1'),
(3, 45220220634, 'VT310', '9999', '02', 'Input 2 active', 'Porte ouverte', '3'),
(4, 45220220634, 'VT310', '9999', '03', 'Input 3 active', 'Entrée 3 active', '3'),
(5, 45220220634, 'VT310', '9999', '05', 'Input 5 active', 'Frigo démarré', '2'),
(6, 45220220634, 'VT310', '9999', '04', 'Input 4 active', 'Moteur démarré', '2'),
(7, 45220220634, 'VT310', '9999', '10', 'batterie', 'Batterie déchargée', '1'),
(8, 45220220634, 'VT310', '9999', '11', 'speed', 'Alarme de vitesse', '3'),
(9, 45220220634, 'VT310', '9999', '12', 'movement', 'Véhicule en mouvement, ou en dehors de la zone autorisée', '4'),
(10, 45220220634, 'VT310', '9999', '13', 'geofence', 'Entrée zone geofence', '4'),
(11, 45220220634, 'VT310', '9999', '14', 'tracker', 'Rétablissement Courant Externe', '1'),
(12, 45220220634, 'VT310', '9999', '15', 'zone', 'Entrée à un garage / Tunel, ...', '4'),
(13, 45220220634, 'VT310', '9999', '16', 'zone', 'Sortie d\'un garage / Tunel, ...', '4'),
(14, 45220220634, 'VT310', '9999', '31', 'Input 1 inactive', 'Bouton de demande de secours relâché (Bouton SOS)', '1'),
(15, 45220220634, 'VT310', '9999', '32', 'Input 2 inactive', 'Porte fermée', '3'),
(16, 45220220634, 'VT310', '9999', '33', 'Input 3 Inactive', 'Entrée 3 inactive', '3'),
(17, 45220220634, 'VT310', '9999', '34', 'Input 4 inactive', 'Moteur éteint', '2'),
(18, 45220220634, 'VT310', '9999', '52', 'report', 'Rapport de brackage', '4'),
(19, 45220220634, 'VT310', '9999', '53', 'gps', 'Antenne GPS coupé', '1'),
(20, 45220220634, 'VT310', '9999', '63', 'report', 'Véhicule déplacé, en mouvement', '4'),
(21, 45220220634, 'VT310', '9999', '35', 'Input 5 Inactive', 'Frigo arrêté', '2'),
(22, 45220220634, 'VT310', '9999', 'AA', 'connexion', 'Rétablissement du signal', '5'),
(23, 45220220634, 'VT310', '9999', 'AB', 'déconnexion', 'Signal absent', '1'),
(21943, 866771023282881, 'T1', '9999', '50', 'batterie', 'Coupure courant de la batterie', '1'),
(21944, 866771023282881, 'T1', '9999', '01', 'Input 1 active', 'Demande de secours', '1'),
(21945, 866771023282881, 'T1', '9999', '02', 'Input 2 active', 'Porte ouverte', '3'),
(21946, 866771023282881, 'T1', '9999', '03', 'Input 3 active', 'Entrée 3 active', '3'),
(21947, 866771023282881, 'T1', '9999', '05', 'Input 5 active', 'Frigo démarré', '2'),
(21948, 866771023282881, 'T1', '9999', '04', 'Input 4 active', 'Moteur démarré', '2'),
(21949, 866771023282881, 'T1', '9999', '10', 'batterie', 'Batterie déchargée', '1'),
(21950, 866771023282881, 'T1', '9999', '11', 'speed', 'Dépassement de vitesse', '3'),
(21951, 866771023282881, 'T1', '9999', '12', 'movement', 'Véhicule en mouvement, ou en dehors de la zone autorisée', '4'),
(21952, 866771023282881, 'T1', '9999', '13', 'geofence', 'Entrée à une zone prédéfinie', '4'),
(21953, 866771023282881, 'T1', '9999', '14', 'tracker', 'Rétablissement Courant Externe', '1'),
(21954, 866771023282881, 'T1', '9999', '15', 'zone', 'Entrée à un garage / Tunel, ...', '4'),
(21955, 866771023282881, 'T1', '9999', '16', 'zone', 'Sortie d\'un garage / Tunel, ...', '4'),
(21956, 866771023282881, 'T1', '9999', '31', 'Input 1 inactive', 'Demande de secours (Bouton relâché)', '1'),
(21957, 866771023282881, 'T1', '9999', '32', 'Input 2 inactive', 'Porte fermée', '3'),
(21958, 866771023282881, 'T1', '9999', '33', 'Input 3 Inactive', 'Entrée 3 inactive', '3'),
(21959, 866771023282881, 'T1', '9999', '34', 'Input 4 inactive', 'Moteur arrêté', '2'),
(21960, 866771023282881, 'T1', '9999', '52', 'report', 'Rapport de brackage', '4'),
(21961, 866771023282881, 'T1', '9999', '53', 'gps', 'Antenne GPS coupé', '1'),
(21962, 866771023282881, 'T1', '9999', '63', 'report', 'Rapport par distance', '4'),
(21963, 866771023282881, 'T1', '9999', '35', 'Input 5 Inactive', 'Frigo arrêté', '2'),
(21964, 866771023282881, 'T1', '9999', 'AA', 'connexion', 'Rétablissement du signal', '1'),
(21965, 866771023282881, 'T1', '9999', 'AB', 'déconnexion', 'Signal absent', '1');

-- --------------------------------------------------------

--
-- Structure de la table `geo_alarm_template`
--

CREATE TABLE `geo_alarm_template` (
  `alarm_id` bigint(20) NOT NULL,
  `protocol_id` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `model_id` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `alarm_code_hex` varchar(6) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alarm_subcode_hex` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alarm_type` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `description` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `alarm_priority` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `visible` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Déchargement des données de la table `geo_alarm_template`
--

INSERT INTO `geo_alarm_template` (`alarm_id`, `protocol_id`, `model_id`, `alarm_code_hex`, `alarm_subcode_hex`, `alarm_type`, `description`, `alarm_priority`, `visible`) VALUES
(1, 'meiligao', 'VT310', '9999', '50', 'batterie', 'Coupure courant de la batterie', '1', 1),
(2, 'meiligao', 'VT310', '9999', '01', 'Input 1 active', 'Demande de secours', '1', 1),
(3, 'meiligao', 'VT310', '9999', '02', 'Input 2 active', 'Porte ouverte', '3', 1),
(4, 'meiligao', 'VT310', '9999', '03', 'Input 3 active', 'Entrée 3 active', '3', 0),
(5, 'meiligao', 'VT310', '9999', '05', 'Input 5 active', 'Frigo démarré', '2', 1),
(6, 'meiligao', 'VT310', '9999', '04', 'Input 4 active', 'Moteur démarré', '2', 1),
(7, 'meiligao', 'VT310', '9999', '10', 'batterie', 'Batterie déchargée', '1', 1),
(8, 'meiligao', 'VT310', '9999', '11', 'speed', 'Dépassement de vitesse', '3', 1),
(9, 'meiligao', 'VT310', '9999', '12', 'movement', 'Véhicule en mouvement, ou en dehors de la zone autorisée', '4', 1),
(10, 'meiligao', 'VT310', '9999', '13', 'geofence', 'Entrée à une zone prédéfinie', '4', 1),
(11, 'meiligao', 'VT310', '9999', '14', 'tracker', 'Rétablissement Courant Externe', '1', 1),
(12, 'meiligao', 'VT310', '9999', '15', 'zone', 'Entrée à un garage / Tunel, ...', '4', 1),
(13, 'meiligao', 'VT310', '9999', '16', 'zone', 'Sortie d\'un garage / Tunel, ...', '4', 1),
(14, 'meiligao', 'VT310', '9999', '31', 'Input 1 inactive', 'Demande de secours (Bouton relâché)', '1', 0),
(15, 'meiligao', 'VT310', '9999', '32', 'Input 2 inactive', 'Porte fermée', '3', 1),
(16, 'meiligao', 'VT310', '9999', '33', 'Input 3 Inactive', 'Entrée 3 inactive', '3', 0),
(17, 'meiligao', 'VT310', '9999', '34', 'Input 4 inactive', 'Moteur arrêté', '2', 1),
(18, 'meiligao', 'VT310', '9999', '52', 'report', 'Rapport de brackage', '4', 0),
(19, 'meiligao', 'VT310', '9999', '53', 'gps', 'Antenne GPS coupé', '1', 0),
(20, 'meiligao', 'VT310', '9999', '63', 'report', 'Rapport par distance', '4', 0),
(21, 'meiligao', 'VT310', '9999', '35', 'Input 5 Inactive', 'Frigo arrêté', '2', 1),
(22, 'meiligao', 'VT310', '9999', 'AA', 'connexion', 'Rétablissement du signal', '1', 1),
(23, 'meiligao', 'VT310', '9999', 'AB', 'déconnexion', 'Signal absent', '1', 1),
(24, 'meitrack', 'T1', '9999', '50', 'batterie', 'Coupure courant de la batterie', '1', 1),
(25, 'meitrack', 'T1', '9999', '01', 'Input 1 active', 'Demande de secours', '1', 1),
(26, 'meitrack', 'T1', '9999', '02', 'Input 2 active', 'Porte ouverte', '3', 1),
(27, 'meitrack', 'T1', '9999', '03', 'Input 3 active', 'Entrée 3 active', '3', 0),
(28, 'meitrack', 'T1', '9999', '05', 'Input 5 active', 'Frigo démarré', '2', 1),
(29, 'meitrack', 'T1', '9999', '04', 'Input 4 active', 'Moteur démarré', '2', 1),
(30, 'meitrack', 'T1', '9999', '10', 'batterie', 'Batterie déchargée', '1', 1),
(31, 'meitrack', 'T1', '9999', '11', 'speed', 'Dépassement de vitesse', '3', 1),
(32, 'meitrack', 'T1', '9999', '12', 'movement', 'Véhicule en mouvement, ou en dehors de la zone autorisée', '4', 1),
(33, 'meitrack', 'T1', '9999', '13', 'geofence', 'Entrée à une zone prédéfinie', '4', 1),
(34, 'meitrack', 'T1', '9999', '14', 'tracker', 'Rétablissement Courant Externe', '1', 1),
(35, 'meitrack', 'T1', '9999', '15', 'zone', 'Entrée à un garage / Tunel, ...', '4', 1),
(36, 'meitrack', 'T1', '9999', '16', 'zone', 'Sortie d\'un garage / Tunel, ...', '4', 1),
(37, 'meitrack', 'T1', '9999', '31', 'Input 1 inactive', 'Demande de secours (Bouton relâché)', '1', 0),
(38, 'meitrack', 'T1', '9999', '32', 'Input 2 inactive', 'Porte fermée', '3', 1),
(39, 'meitrack', 'T1', '9999', '33', 'Input 3 Inactive', 'Entrée 3 inactive', '3', 0),
(40, 'meitrack', 'T1', '9999', '34', 'Input 4 inactive', 'Moteur arrêté', '2', 1),
(41, 'meitrack', 'T1', '9999', '52', 'report', 'Rapport de brackage', '4', 0),
(42, 'meitrack', 'T1', '9999', '53', 'gps', 'Antenne GPS coupé', '1', 0),
(43, 'meitrack', 'T1', '9999', '63', 'report', 'Rapport par distance', '4', 0),
(44, 'meitrack', 'T1', '9999', '35', 'Input 5 Inactive', 'Frigo arrêté', '2', 1),
(45, 'meitrack', 'T1', '9999', 'AA', 'connexion', 'Rétablissement du signal', '1', 1),
(46, 'meitrack', 'T1', '9999', 'AB', 'déconnexion', 'Signal absent', '1', 1),
(47, 'T1CAN', 'meitrack', '9999', '50', 'batterie', 'Coupure courant de la batterie', '1', 1),
(48, 'T1CAN', 'meitrack', '9999', '01', 'Input 1 active', 'Demande de secours', '1', 1),
(49, 'T1CAN', 'meitrack', '9999', '02', 'Input 2 active', 'Porte ouverte', '3', 1),
(50, 'T1CAN', 'meitrack', '9999', '03', 'Input 3 active', 'Entrée 3 active', '3', 0),
(51, 'T1CAN', 'meitrack', '9999', '05', 'Input 5 active', 'Frigo démarré', '2', 1),
(52, 'T1CAN', 'meitrack', '9999', '04', 'Input 4 active', 'Moteur démarré', '2', 1),
(53, 'T1CAN', 'meitrack', '9999', '10', 'batterie', 'Batterie déchargée', '1', 1),
(54, 'T1CAN', 'meitrack', '9999', '11', 'speed', 'Dépassement de vitesse', '3', 1),
(55, 'T1CAN', 'meitrack', '9999', '12', 'movement', 'Véhicule en mouvement, ou en dehors de la zone autorisée', '4', 1),
(56, 'T1CAN', 'meitrack', '9999', '13', 'geofence', 'Entrée à une zone prédéfinie', '4', 1),
(57, 'T1CAN', 'meitrack', '9999', '14', 'tracker', 'Rétablissement Courant Externe', '1', 1),
(58, 'T1CAN', 'meitrack', '9999', '15', 'zone', 'Entrée à un garage / Tunel, ...', '4', 1),
(59, 'T1CAN', 'meitrack', '9999', '16', 'zone', 'Sortie d\'un garage / Tunel, ...', '4', 1),
(60, 'T1CAN', 'meitrack', '9999', '31', 'Input 1 inactive', 'Demande de secours (Bouton relâché)', '1', 0),
(61, 'T1CAN', 'meitrack', '9999', '32', 'Input 2 inactive', 'Porte fermée', '3', 1),
(62, 'T1CAN', 'meitrack', '9999', '33', 'Input 3 Inactive', 'Entrée 3 inactive', '3', 0),
(63, 'T1CAN', 'meitrack', '9999', '34', 'Input 4 inactive', 'Moteur arrêté', '2', 1),
(64, 'T1CAN', 'meitrack', '9999', '52', 'report', 'Rapport de brackage', '4', 0),
(65, 'T1CAN', 'meitrack', '9999', '53', 'gps', 'Antenne GPS coupé', '1', 0),
(66, 'T1CAN', 'meitrack', '9999', '63', 'report', 'Rapport par distance', '4', 0),
(67, 'T1CAN', 'meitrack', '9999', '35', 'Input 5 Inactive', 'Frigo arrêté', '2', 1),
(68, 'T1CAN', 'meitrack', '9999', 'AA', 'connexion', 'Rétablissement du signal', '1', 1),
(69, 'T1CAN', 'meitrack', '9999', 'AB', 'déconnexion', 'Signal absent', '1', 1);

-- --------------------------------------------------------

--
-- Structure de la table `geo_alarm_type`
--

CREATE TABLE `geo_alarm_type` (
  `alarm_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Déchargement des données de la table `geo_alarm_type`
--

INSERT INTO `geo_alarm_type` (`alarm_type`) VALUES
('batterie'),
('geofence'),
('gps'),
('Input 1 active'),
('Input 1 inactive'),
('Input 2 active'),
('Input 2 inactive'),
('Input 3 active'),
('Input 3 Inactive'),
('Input 4 active'),
('Input 4 inactive'),
('Input 5 active'),
('Input 5 Inactive'),
('movement'),
('report'),
('speed'),
('tracker'),
('zone');

-- --------------------------------------------------------

--
-- Structure de la table `geo_alert`
--

CREATE TABLE `geo_alert` (
  `vehicule_id` bigint(20) NOT NULL,
  `matricule` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  `alarm_id` bigint(20) NOT NULL,
  `email_address` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `auto_alarm` int(1) NOT NULL,
  `alert_description` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `frequence_day` int(10) NOT NULL,
  `alert_type` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `id_tracker` bigint(20) DEFAULT NULL,
  `date_creation` datetime DEFAULT NULL,
  `created_by` bigint(20) DEFAULT NULL,
  `mobile_number` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_time_limited` int(1) DEFAULT NULL,
  `time_interval_start` time DEFAULT NULL,
  `time_interval_end` time DEFAULT NULL,
  `software_notification` int(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- --------------------------------------------------------

--
-- Structure de la table `geo_command_to_tracker`
--

CREATE TABLE `geo_command_to_tracker` (
  `num` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `date_request` datetime NOT NULL,
  `id_tracker` bigint(20) NOT NULL,
  `commande` varchar(4) CHARACTER SET utf8 NOT NULL,
  `parameter` varchar(130) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_sent` int(1) NOT NULL,
  `date_send` datetime NOT NULL,
  `is_locked_for_send` int(1) NOT NULL,
  `pid_lock_sender` bigint(20) NOT NULL,
  `date_locked` datetime NOT NULL,
  `need_response` int(1) NOT NULL,
  `responded` int(1) NOT NULL,
  `date_response` datetime NOT NULL,
  `response` varchar(130) COLLATE utf8_unicode_ci NOT NULL,
  `response_json` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `all_packet_hexa` varchar(256) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- --------------------------------------------------------

--
-- Structure de la table `geo_fueltank_type`
--

CREATE TABLE `geo_fueltank_type` (
  `fueltank_type_id` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `fueltank_type_designation` varchar(100) CHARACTER SET latin1 NOT NULL,
  `fueltank_type_carburant` bigint(20) DEFAULT NULL,
  `fueltank_signe` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `geo_fueltank_type`
--

INSERT INTO `geo_fueltank_type` (`fueltank_type_id`, `fueltank_type_designation`, `fueltank_type_carburant`, `fueltank_signe`) VALUES
('audi15', 'no name', 5, 1),
('dada', 'no name yet ', 2, -1),
('DAF570D', 'Réservoir DAF 570 litres', 1, -1),
('HILUX80D', 'Toyota Hilux, 80 litres', 2, -1),
('HYUND100D', 'Camions Hyndai HD 35/65/72', 3, -1),
('PARTNER60D', 'Peugeot Partner Diesel, 60 litres', 4, -1),
('PEUG206C50', 'Peugeot 206 Diesel', 5, -1),
('PG47', 'dada', 2, -1),
('RT200D', 'Renault Truck 7T, carburant 200L', 6, -1),
('RT280D', 'Renault Truck 280 Diesel', 1, -1),
('RT315D', 'Renault Truck 315 Diesel', 1, -1),
('RT330D', 'Renault Tracteur, 330 litres', 2, -1),
('RT405D', 'Camions 405 Litres', 1, -1),
('RT420D', 'Renault Truck 420 Diesel', 3, -1),
('RT421D', 'Renault Truck 421 Diesel', 6, -1),
('RT570D', 'Renault Truck 570 Diesel', 6, -1),
('RT610D', 'Renault Truck 610 Diesel', 6, -1),
('RT615D', 'Renault Tracteur, 615 litres', 3, -1),
('RT730D', 'Renault Truck 730 Diesel', 3, -1),
('RT800D', 'Scania, carburant 800L', 2, -1),
('test', 'test name ', 2, 1),
('test 2', 'test name 2', 2, -1),
('YARIS42P', 'Yaris Essence, 42 litres', 5, -1);

-- --------------------------------------------------------

--
-- Structure de la table `geo_fueltank_type_value`
--

CREATE TABLE `geo_fueltank_type_value` (
  `fueltank_type_id` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `fueltank_value` int(11) NOT NULL,
  `fueltank_liters` double NOT NULL,
  `fueltank_level` double NOT NULL,
  `fueltank_level_16` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déchargement des données de la table `geo_fueltank_type_value`
--

INSERT INTO `geo_fueltank_type_value` (`fueltank_type_id`, `fueltank_value`, `fueltank_liters`, `fueltank_level`, `fueltank_level_16`) VALUES
('dada', 1360, 0, 0, 0),
('DAF570D', 555, 144, 25.35, 4.06),
('DAF570D', 556, 143, 25.17, 4.03),
('DAF570D', 557, 142, 25, 4),
('DAF570D', 558, 141, 24.83, 3.97),
('DAF570D', 559, 140, 24.65, 3.94),
('DAF570D', 560, 139, 24.48, 3.92),
('DAF570D', 561, 138, 24.3, 3.89),
('DAF570D', 562, 137, 24.13, 3.86),
('DAF570D', 563, 136, 23.95, 3.83),
('DAF570D', 564, 135, 23.78, 3.8),
('DAF570D', 565, 134, 23.6, 3.78),
('DAF570D', 566, 133, 23.43, 3.75),
('DAF570D', 567, 132, 23.25, 3.72),
('DAF570D', 568, 131, 23.08, 3.69),
('DAF570D', 569, 130, 22.9, 3.66),
('DAF570D', 570, 129, 22.73, 3.64),
('DAF570D', 571, 128, 22.55, 3.61),
('DAF570D', 572, 127, 22.38, 3.58),
('DAF570D', 573, 126, 22.2, 3.55),
('DAF570D', 574, 125, 22.03, 3.52),
('DAF570D', 575, 124, 21.85, 3.5),
('DAF570D', 576, 123, 21.68, 3.47),
('DAF570D', 577, 122, 21.5, 3.44),
('DAF570D', 578, 121, 21.33, 3.41),
('DAF570D', 579, 120, 21.15, 3.38),
('DAF570D', 580, 119, 20.98, 3.36),
('DAF570D', 581, 118, 20.8, 3.33),
('DAF570D', 582, 117, 20.63, 3.3),
('DAF570D', 583, 116, 20.45, 3.27),
('DAF570D', 584, 115, 20.28, 3.24),
('DAF570D', 585, 114, 20.1, 3.22),
('DAF570D', 586, 113, 19.93, 3.19),
('DAF570D', 587, 112, 19.76, 3.16),
('DAF570D', 588, 111, 19.58, 3.13),
('DAF570D', 589, 110, 19.41, 3.11),
('PEUG206C50', 649, 19, 39.87, 6.38),
('PEUG206C50', 650, 19, 39.77, 6.36),
('PEUG206C50', 651, 19, 39.66, 6.35),
('PEUG206C50', 652, 19, 39.55, 6.33),
('PEUG206C50', 653, 19, 39.45, 6.31),
('PEUG206C50', 654, 19, 39.34, 6.29),
('PEUG206C50', 655, 19, 39.23, 6.28),
('PEUG206C50', 656, 19, 39.13, 6.26),
('PEUG206C50', 657, 19, 39.02, 6.24),
('PEUG206C50', 658, 19, 38.91, 6.23),
('PEUG206C50', 659, 19, 38.81, 6.21),
('PEUG206C50', 660, 19, 38.7, 6.19),
('PEUG206C50', 661, 19, 38.59, 6.17),
('PEUG206C50', 662, 19, 38.49, 6.16),
('PEUG206C50', 663, 19, 38.38, 6.14),
('PEUG206C50', 664, 19, 38.27, 6.12),
('PEUG206C50', 665, 19, 38.17, 6.11),
('PEUG206C50', 666, 19, 38.06, 6.09),
('PEUG206C50', 667, 18, 37.95, 6.07),
('PEUG206C50', 668, 18, 37.85, 6.06),
('PEUG206C50', 669, 18, 37.74, 6.04),
('PEUG206C50', 670, 18, 37.63, 6.02),
('PEUG206C50', 671, 18, 37.53, 6),
('PEUG206C50', 672, 18, 37.42, 5.99),
('PEUG206C50', 673, 18, 37.31, 5.97),
('PEUG206C50', 674, 18, 37.21, 5.95),
('PEUG206C50', 675, 18, 37.1, 5.94),
('PEUG206C50', 676, 18, 36.99, 5.92),
('PEUG206C50', 677, 18, 36.89, 5.9),
('PEUG206C50', 678, 18, 36.78, 5.88),
('PEUG206C50', 679, 18, 36.67, 5.87),
('PEUG206C50', 680, 18, 36.57, 5.85),
('PEUG206C50', 681, 18, 36.46, 5.83),
('PEUG206C50', 682, 18, 36.35, 5.82),
('PEUG206C50', 683, 18, 36.25, 5.8),
('PEUG206C50', 684, 18, 36.14, 5.78),
('PEUG206C50', 685, 18, 36.03, 5.76),
('PEUG206C50', 686, 17, 35.93, 5.75),
('PEUG206C50', 687, 17, 35.82, 5.73),
('PEUG206C50', 688, 17, 35.71, 5.71),
('PEUG206C50', 689, 17, 35.61, 5.7),
('PEUG206C50', 690, 17, 35.5, 5.68),
('PEUG206C50', 691, 17, 35.39, 5.66),
('PEUG206C50', 692, 17, 35.29, 5.65),
('PEUG206C50', 693, 17, 35.18, 5.63),
('PEUG206C50', 694, 17, 35.07, 5.61),
('PEUG206C50', 695, 17, 34.97, 5.6),
('PEUG206C50', 696, 17, 34.86, 5.58),
('PEUG206C50', 697, 17, 34.75, 5.56),
('PEUG206C50', 698, 17, 34.65, 5.54),
('PEUG206C50', 699, 17, 34.54, 5.53),
('PEUG206C50', 700, 17, 34.43, 5.51),
('PEUG206C50', 701, 17, 34.33, 5.49),
('PEUG206C50', 702, 17, 34.22, 5.48),
('PEUG206C50', 703, 17, 34.12, 5.46),
('PEUG206C50', 704, 17, 34.01, 5.44),
('RT315D', 110, 315, 100, 16),
('RT315D', 111, 313, 99.62, 15.94),
('RT315D', 112, 312, 99.25, 15.88),
('RT315D', 113, 311, 98.87, 15.82),
('RT315D', 114, 310, 98.5, 15.76),
('RT315D', 115, 309, 98.12, 15.7),
('RT315D', 116, 307, 97.74, 15.64),
('RT315D', 117, 306, 97.37, 15.58),
('RT315D', 118, 305, 96.99, 15.52),
('RT315D', 119, 304, 96.62, 15.46),
('RT315D', 120, 303, 96.24, 15.4),
('RT315D', 121, 301, 95.86, 15.34),
('RT315D', 122, 300, 95.49, 15.28),
('RT315D', 123, 299, 95.11, 15.22),
('RT315D', 124, 298, 94.74, 15.16),
('RT315D', 125, 297, 94.36, 15.1),
('RT315D', 126, 296, 93.98, 15.04),
('RT315D', 127, 294, 93.61, 14.98),
('RT315D', 128, 293, 93.23, 14.92),
('RT315D', 129, 292, 92.86, 14.86),
('RT315D', 130, 291, 92.48, 14.8),
('RT315D', 131, 290, 92.11, 14.74),
('RT315D', 132, 288, 91.73, 14.68),
('RT315D', 133, 287, 91.35, 14.62),
('RT315D', 134, 286, 90.98, 14.56),
('RT315D', 135, 285, 90.6, 14.5),
('RT315D', 136, 284, 90.23, 14.44),
('RT315D', 137, 283, 89.85, 14.38),
('RT315D', 138, 281, 89.47, 14.32),
('RT315D', 139, 280, 89.1, 14.26),
('RT315D', 140, 279, 88.72, 14.2),
('RT315D', 141, 278, 88.35, 14.14),
('RT315D', 142, 277, 87.97, 14.08);

-- --------------------------------------------------------

--
-- Structure de la table `geo_geocode`
--

CREATE TABLE `geo_geocode` (
  `latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `address` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `city` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `state` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `town` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `geocoded` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- --------------------------------------------------------

--
-- Structure de la table `geo_geofence`
--

CREATE TABLE `geo_geofence` (
  `geofence_id` int(11) NOT NULL,
  `client_id` bigint(20) NOT NULL,
  `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `date_creation` datetime NOT NULL,
  `created_by` bigint(20) NOT NULL,
  `geofence_form` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `circle_o_longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `circle_o_latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `circle_radius` bigint(20) NOT NULL,
  `rectangle_top_right_longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `rectangle_top_right_latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `rectangle_bottom_left_longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `rectangle_bottom_left_latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `polygone_id` bigint(20) NOT NULL,
  `color` varchar(10) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Déchargement des données de la table `geo_geofence`
--

INSERT INTO `geo_geofence` (`geofence_id`, `client_id`, `description`, `date_creation`, `created_by`, `geofence_form`, `circle_o_longitude`, `circle_o_latitude`, `circle_radius`, `rectangle_top_right_longitude`, `rectangle_top_right_latitude`, `rectangle_bottom_left_longitude`, `rectangle_bottom_left_latitude`, `polygone_id`, `color`) VALUES
(42, 24, 'Blida', '2013-07-05 11:59:11', 18, 'Cercle', '2.8160495391749', '36.480352557800', 9633, '', '', '', '', 0, 'FF0000'),
(43, 24, 'Tizi Ouzzou', '2013-07-05 12:01:44', 18, 'Cercle', '4.0692422265615', '36.707980957343', 24959, '', '', '', '', 0, '339966'),
(44, 24, 'Skikda', '2013-07-05 12:02:02', 18, 'Cercle', '6.8982217187494', '36.835585795462', 33099, '', '', '', '', 0, 'FF00FF'),
(45, 24, 'El Djelfa', '2013-07-05 12:27:25', 18, 'Cercle', '3.0615752846713', '34.889550147985', 61999, '', '', '', '', 0, '000000'),
(46, 24, 'Oran', '2013-07-05 12:27:48', 18, 'Cercle', '-0.530954012203', '35.705499634281', 89286, '', '', '', '', 0, 'FF9900'),
(47, 24, 'Boufarik', '2013-07-05 12:34:14', 18, 'Cercle', '2.9128665557731', '36.579116259422', 5952, '', '', '', '', 0, '000080'),
(48, 24, 'Biskra', '2013-07-05 12:37:43', 18, 'Cercle', '5.6346803345950', '34.849129016154', 48428, '', '', '', '', 0, '808000'),
(49, 24, 'Ouled Djellal', '2013-07-05 12:43:59', 18, 'Cercle', '5.0606446900647', '34.426551836567', 10181, '', '', '', '', 0, '008000'),
(51, 24, 'Bechar 2225', '2013-07-06 12:53:28', 18, 'Cercle', '-2.237023766967', '31.589482571891', 17317, '', '', '', '', 0, 'FF6600'),
(52, 24, 'Bechar 3', '2013-07-06 12:53:47', 18, 'Cercle', '-2.426537927123', '31.535656190899', 12845, '', '', '', '', 0, '800000'),
(53, 1, 'Boufarik', '2013-07-06 13:01:24', 1, 'Cercle', '2.9128236410872', '36.575622550394', 126, '', '', '', '', 0, '008000'),
(54, 1, 'L\'école maternelle 2 extra', '2013-07-06 13:01:44', 1, 'Cercle', '2.9177750075725', '36.579219747663', 187, '', '', '', '', 0, '008000'),
(58, 22, 'Oued Smar', '2013-07-13 18:09:20', 16, 'Cercle', '3.1202617090051', '36.714041978987', 3210, '', '', '', '', 0, '003366'),
(59, 22, 'Ben Aknoun', '2013-07-13 18:41:40', 16, 'Cercle', '2.9520762694509', '36.750878053779', 3162, '', '', '', '', 0, '003366'),
(60, 22, 'Bab El Oued', '2013-07-13 19:00:53', 16, 'Cercle', '3.0460606420909', '36.799821387518', 3056, '', '', '', '', 0, 'FF0000'),
(66, 1, 'Les Sources', '2013-07-19 21:22:09', 1, 'Cercle', '03.048237', '036.734007', 2570, '', '', '', '', 0, 'FF0000'),
(67, 18, 'La Cadat, Les Sources', '2013-07-20 00:38:26', 12, 'Cercle', '03.056314', '036.737166', 147, '', '', '', '', 0, 'FF0000'),
(68, 23, 'Dépot Alger', '2013-07-20 12:33:23', 17, 'Cercle', '02.980475', '036.745530', 2359, '', '', '', '', 0, 'FF0000'),
(69, 23, 'Usine Akbou', '2013-07-20 12:33:51', 17, 'Cercle', '04.553923', '036.466758', 3110, '', '', '', '', 0, '003366'),
(70, 23, 'Constantine', '2013-07-20 12:34:16', 17, 'Cercle', '06.450781', '036.307423', 70788, '', '', '', '', 0, '800000'),
(72, 16, 'Ouled Fayet', '2013-07-28 14:32:58', 10, 'Cercle', '02.947988', '036.726423', 1874, '', '', '', '', 0, 'FF0000'),
(73, 23, 'el omaria', '2013-12-04 16:45:57', 17, 'Cercle', '03.030426', '036.266363', 2913, '', '', '', '', 0, ''),
(74, 23, 'Dépot Annaba', '2013-12-19 10:28:17', 17, 'Cercle', '07.085241', '036.913710', 3915, '', '', '', '', 0, 'FF0000'),
(75, 14, 'Gouraya', '2014-01-28 15:46:30', 31, 'Cercle', '01.902164', '036.574483', 6068, '', '', '', '', 0, 'FF0000'),
(76, 14, 'El Harrach', '2014-01-28 15:47:02', 31, 'Cercle', '03.131860', '036.711668', 982, '', '', '', '', 0, '800000'),
(77, 23, 'Usine', '2014-04-01 11:02:57', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(78, 23, 'Usine', '2014-04-01 11:03:05', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(79, 23, 'Usine', '2014-04-01 11:03:59', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(80, 23, 'Usine', '2014-04-01 11:03:59', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(81, 23, 'Usine', '2014-04-01 11:04:03', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(82, 23, 'Usine', '2014-04-01 11:04:03', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(83, 23, 'Usine', '2014-04-01 11:04:03', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(84, 23, 'Usine', '2014-04-01 11:04:04', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(85, 23, 'Usine', '2014-04-01 11:04:04', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(86, 23, 'Usine', '2014-04-01 11:04:04', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(87, 23, 'Usine', '2014-04-01 11:04:04', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(88, 23, 'Usine', '2014-04-01 11:04:05', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(89, 23, 'Usine', '2014-04-01 11:05:03', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, ''),
(90, 23, 'Usine', '2014-04-01 11:05:15', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, 'FF0000'),
(91, 23, 'Usine', '2014-04-01 11:05:15', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, 'FF0000'),
(92, 23, 'Usine', '2014-04-01 11:05:15', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, 'FF0000'),
(93, 23, 'Usine', '2014-04-01 11:05:16', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, 'FF0000'),
(94, 23, 'Usine', '2014-04-01 11:05:16', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, 'FF0000'),
(95, 23, 'Usine', '2014-04-01 11:05:16', 17, 'Cercle', '04.556554', '036.469244', 664, '', '', '', '', 0, 'FF0000'),
(96, 34, 'Alger', '2014-05-04 13:33:49', 34, 'Cercle', '03.068760', '036.792377', 22559, '', '', '', '', 0, 'FF0000'),
(97, 12, 'Les Sources', '2014-05-06 08:29:30', 6, 'Cercle', '03.057449', '036.737015', 461, '', '', '', '', 0, 'FF0000'),
(98, 12, 'Bab Ezouar', '2014-05-06 08:29:48', 6, 'Cercle', '03.181646', '036.721941', 2274, '', '', '', '', 0, '000000'),
(99, 41, 'Alger', '2014-05-12 12:27:03', 60, 'Cercle', '04.652210', '036.259063', 1282, '', '', '', '', 0, 'FF0000'),
(101, 28, 'Alger', '2014-05-14 12:06:10', 23, 'Cercle', '03.094691', '036.769463', 22162, '', '', '', '', 0, 'FF0000'),
(102, 28, 'Oran', '2014-05-14 12:06:42', 23, 'Cercle', '-00.546933', '035.680771', 31567, '', '', '', '', 0, '333300');

-- --------------------------------------------------------

--
-- Structure de la table `geo_geofence_point`
--

CREATE TABLE `geo_geofence_point` (
  `geofence_id` int(11) NOT NULL,
  `client_id` bigint(20) NOT NULL,
  `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `date_creation` datetime NOT NULL,
  `created_by` bigint(20) NOT NULL,
  `geofence_form` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `circle_o_longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `circle_o_latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `circle_radius` bigint(20) NOT NULL,
  `rectangle_top_right_longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `rectangle_top_right_latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `rectangle_bottom_left_longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `rectangle_bottom_left_latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `polygone_id` bigint(20) NOT NULL,
  `color` varchar(10) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- --------------------------------------------------------

--
-- Structure de la table `geo_geofence_tracker`
--

CREATE TABLE `geo_geofence_tracker` (
  `geofence_id` bigint(20) NOT NULL,
  `id_tracker` bigint(20) NOT NULL,
  `date_insertion` datetime NOT NULL,
  `created_by` bigint(20) NOT NULL,
  `is_sent_to_tracker` int(1) NOT NULL,
  `alarm_on_enter` tinyint(1) NOT NULL,
  `alarm_on_exit` tinyint(1) NOT NULL,
  `is_deleted_from_tracker` int(1) NOT NULL,
  `is_command_sent_to_delete_from_tracker` int(1) NOT NULL,
  `commande_id_creation` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- --------------------------------------------------------

--
-- Structure de la table `geo_map_icons`
--

CREATE TABLE `geo_map_icons` (
  `icon_id` bigint(20) NOT NULL,
  `size` int(11) NOT NULL,
  `path` varchar(250) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;

-- --------------------------------------------------------

--
-- Structure de la table `geo_mobile_sim_tracker`
--

CREATE TABLE `geo_mobile_sim_tracker` (
  `serial_number` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `id_tracker` bigint(20) NOT NULL,
  `date_start` datetime NOT NULL,
  `date_end` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- --------------------------------------------------------

--
-- Structure de la table `geo_obd_parametre`
--

CREATE TABLE `geo_obd_parametre` (
  `gps_obd_parametre_id` bigint(20) NOT NULL,
  `gps_obd_parametre_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `gps_obd_parametre_texte` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `geo_parametrage_alerte`
--

CREATE TABLE `geo_parametrage_alerte` (
  `id` int(11) NOT NULL,
  `vehicule_Id` bigint(11) NOT NULL,
  `matricule` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `evenement` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `ardsAlerter` varchar(100) NOT NULL,
  `modeAlerte` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `freqEnvoie` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `geo_report_daily`
--

CREATE TABLE `geo_report_daily` (
  `daily_id` bigint(20) NOT NULL,
  `vehicle_id` bigint(20) NOT NULL,
  `date` date NOT NULL,
  `total_meters` bigint(20) NOT NULL,
  `total_cost` float NOT NULL,
  `speed_average` int(11) NOT NULL,
  `speed_max` int(11) NOT NULL,
  `total_duration` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `total_parking_duration` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `activity_img` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `heure_premier_demarrge` datetime NOT NULL,
  `heure_dernier_stationnement` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Déchargement des données de la table `geo_report_daily`
--

INSERT INTO `geo_report_daily` (`daily_id`, `vehicle_id`, `date`, `total_meters`, `total_cost`, `speed_average`, `speed_max`, `total_duration`, `total_parking_duration`, `activity_img`, `heure_premier_demarrge`, `heure_dernier_stationnement`) VALUES
(1, 15, '2020-01-07', 142, 1250.2, 40, 104, '3h 12min', '11h 45min', 'http://web2.geoloc.dz/geo2/export/dailyact/1051/1051_2018-03-01_13065.png', '2018-03-05 06:15:00', '2018-03-05 14:22:00');

-- --------------------------------------------------------

--
-- Structure de la table `geo_report_parking`
--

CREATE TABLE `geo_report_parking` (
  `id` bigint(20) NOT NULL,
  `vehicle_id` bigint(20) NOT NULL,
  `start_date` datetime NOT NULL,
  `end_date` datetime NOT NULL,
  `start_date_day` date NOT NULL,
  `end_date_day` date NOT NULL,
  `duration` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `latitude` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `longitude` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `address` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `city` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `state` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `town` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `alarms_summary` text COLLATE utf8_unicode_ci NOT NULL,
  `stop_reason` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `reverse_geocoded` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Déchargement des données de la table `geo_report_parking`
--

INSERT INTO `geo_report_parking` (`id`, `vehicle_id`, `start_date`, `end_date`, `start_date_day`, `end_date_day`, `duration`, `latitude`, `longitude`, `address`, `city`, `state`, `town`, `alarms_summary`, `stop_reason`, `reverse_geocoded`) VALUES
(1, 43, '2018-03-05 07:20:12', '2018-03-18 11:29:21', '2018-03-05', '2018-03-05', '4h 9min', '34.754223', '3.068390', 'Aïn Maabed, Djelfa, Algérie', '', 'Djelfa', 'Aïn Maabed', '', '', 101578);

-- --------------------------------------------------------

--
-- Structure de la table `geo_report_wastage`
--

CREATE TABLE `geo_report_wastage` (
  `wastage_id` bigint(20) NOT NULL,
  `vehicle_id` bigint(20) NOT NULL,
  `start_date` datetime NOT NULL,
  `end_date` datetime NOT NULL,
  `start_date_day` date NOT NULL,
  `end_date_day` date NOT NULL,
  `duration` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `duration_wastage` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `latitude` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `longitude` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
  `address` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `city` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `state` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `town` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `reverse_geocoded` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- --------------------------------------------------------

--
-- Structure de la table `geo_trace`
--

CREATE TABLE `geo_trace` (
  `num` bigint(20) NOT NULL,
  `date_insertion` datetime DEFAULT NULL,
  `date_insertion_day` date DEFAULT NULL,
  `id_tracker` bigint(20) DEFAULT '0',
  `vehicle_id` bigint(20) DEFAULT '0',
  `trip_id` bigint(20) DEFAULT NULL,
  `is_new_changes` int(1) DEFAULT '1',
  `is_new_position` int(1) DEFAULT NULL,
  `commande` varchar(4) CHARACTER SET utf8 DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `date_day` date DEFAULT NULL,
  `is_alarm` int(1) DEFAULT NULL,
  `alarme_code` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alarme_description` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `gprmc_utc_time_str` varchar(15) CHARACTER SET utf8 DEFAULT NULL,
  `gprmc_gps_status` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
  `gprmc_latitude` varchar(10) CHARACTER SET utf8 DEFAULT NULL,
  `gprmc_NS` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
  `gprmc_longitude` varchar(10) CHARACTER SET utf8 DEFAULT NULL,
  `gprmc_EW` varchar(1) CHARACTER SET utf8 DEFAULT NULL,
  `gprmc_speed` float DEFAULT NULL,
  `speed` int(11) DEFAULT NULL,
  `gprmc_heading_deg` float DEFAULT NULL,
  `gprmc_magnetic_variation` varchar(5) CHARACTER SET utf8 DEFAULT NULL,
  `gprmc_WE_cd_checksum` varchar(5) CHARACTER SET utf8 DEFAULT NULL,
  `hdop` double DEFAULT NULL,
  `altitude` bigint(20) DEFAULT NULL,
  `state` varchar(4) CHARACTER SET utf8 DEFAULT NULL,
  `base_id` varchar(20) CHARACTER SET utf8 DEFAULT NULL,
  `csq` int(11) DEFAULT NULL,
  `journey` bigint(20) DEFAULT NULL,
  `priorite` int(11) DEFAULT NULL,
  `latitude_decimal` varchar(15) CHARACTER SET utf8 DEFAULT NULL,
  `longitude_decimal` varchar(15) CHARACTER SET utf8 DEFAULT NULL,
  `adresse_geocodee` varchar(256) CHARACTER SET utf8 DEFAULT NULL,
  `analog_input_1` varchar(4) CHARACTER SET utf8 DEFAULT NULL,
  `analog_input_2` varchar(4) CHARACTER SET utf8 DEFAULT NULL,
  `analog_input_3` varchar(4) CHARACTER SET utf8 DEFAULT NULL,
  `analog_input_4` varchar(4) CHARACTER SET utf8 DEFAULT NULL,
  `analog_input_5` varchar(4) CHARACTER SET utf8 DEFAULT NULL,
  `digital_input_1` int(1) DEFAULT NULL,
  `digital_input_2` int(1) DEFAULT NULL,
  `digital_input_3` int(1) DEFAULT NULL,
  `digital_input_4` int(1) DEFAULT NULL,
  `digital_input_5` int(1) DEFAULT NULL,
  `digital_output_1` int(1) DEFAULT NULL,
  `digital_output_2` int(1) DEFAULT NULL,
  `digital_output_3` int(1) DEFAULT NULL,
  `digital_output_4` int(1) DEFAULT NULL,
  `digital_output_5` int(1) DEFAULT NULL,
  `gms_signal` int(11) DEFAULT NULL,
  `accelerometer_data` bigint(20) DEFAULT NULL,
  `power_supply_voltage` double DEFAULT NULL,
  `battery_current` double DEFAULT NULL,
  `pcb_temperature` double DEFAULT NULL,
  `temperature_sensor_1` double DEFAULT NULL,
  `temperature_sensor_2` double DEFAULT NULL,
  `temperature_sensor_3` double DEFAULT NULL,
  `fuel_value` double DEFAULT NULL,
  `fuel_percent` double DEFAULT NULL,
  `fuel_liters` double DEFAULT NULL,
  `fuel_altitude_diff` int(11) DEFAULT NULL,
  `fuel_remplissage` int(1) DEFAULT NULL,
  `fuel_latest_percent` int(11) DEFAULT NULL,
  `frigo_temperature` double DEFAULT '0',
  `obd_pid` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
  `obd_value` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
  `max_acceleration_value` int(11) DEFAULT NULL,
  `max_deceleration_value` int(11) DEFAULT NULL,
  `assisted_event_info` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
  `can_data_exists` int(1) DEFAULT NULL,
  `j1939_vehicle_speed_wheel` int(11) DEFAULT NULL,
  `j1939_vehicle_speed_tachograph` int(11) DEFAULT NULL,
  `j1939_clutch_switch` int(1) DEFAULT NULL,
  `j1939_tachograph_performance` int(1) DEFAULT NULL,
  `j1939_parking_brake_switch` int(1) DEFAULT NULL,
  `j1939_cruise_control` int(1) DEFAULT NULL,
  `j1939_accelerator_pedal_position` int(11) DEFAULT NULL,
  `j1939_total_fuel_used` bigint(20) DEFAULT NULL,
  `j1939_engine_speed` int(11) DEFAULT NULL,
  `j1939_total_engine_hours` double DEFAULT NULL,
  `j1939_high_resolution_vehicle_distance` bigint(20) DEFAULT NULL,
  `j1939_engine_coolant_temperature` bigint(20) DEFAULT NULL,
  `j1939_fuel_level` int(11) DEFAULT NULL,
  `j1939_actual_engine_torque` int(11) DEFAULT NULL,
  `j1939_ambient_air_temperature` int(11) DEFAULT NULL,
  `j1939_high_resolution_engine_total_fuel_used` double DEFAULT NULL,
  `j1939_load_at_current_speed` int(11) DEFAULT NULL,
  `j1939_engine_fuel_rate` double DEFAULT NULL,
  `j1939_axle_weight` double DEFAULT NULL,
  `j1939_service_distance` bigint(20) DEFAULT NULL,
  `j1939_instantaneous_fuel_economy` double DEFAULT NULL,
  `j1939_status_engine_brake` int(11) DEFAULT NULL,
  `j1939_engine_oil_temperature` int(11) DEFAULT NULL,
  `j1939_engine_fuel_temperature` int(11) DEFAULT NULL,
  `j1939_total_vehicle_hours` int(11) DEFAULT NULL,
  `j1939_trip_distance` int(11) DEFAULT NULL,
  `j1939_engine_trip_fuel` int(11) DEFAULT NULL,
  `j1939_percent_clutch_slip` int(11) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `IMEI` varchar(56) COLLATE utf8_unicode_ci DEFAULT NULL,
  `serial_number` varchar(56) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mission_point_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- --------------------------------------------------------

--
-- Structure de la table `geo_tracker`
--

CREATE TABLE `geo_tracker` (
  `id_tracker` bigint(20) NOT NULL,
  `imei` bigint(20) DEFAULT NULL,
  `vehicle_id` bigint(20) NOT NULL DEFAULT '0',
  `model_id` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `sim_serial_number` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `latest_id_trace` bigint(20) DEFAULT NULL,
  `active` int(1) NOT NULL,
  `latest_date_heartbeat_from_tracker` datetime NOT NULL,
  `latest_cmd_received_from_tracker` bigint(20) NOT NULL,
  `latest_date_received_from_tracker` datetime NOT NULL,
  `latest_date_send_to_tracker` datetime NOT NULL,
  `latest_date_report` datetime NOT NULL,
  `is_tracking_time_interval` int(1) NOT NULL,
  `tracking_time_interval` int(11) NOT NULL,
  `tracking_time_max_wait` int(11) NOT NULL,
  `is_tracking_distance_interval` int(11) NOT NULL,
  `tracking_distance_interval` int(11) NOT NULL,
  `date_first_server_connection` datetime NOT NULL,
  `is_disconnection_reported` int(1) NOT NULL DEFAULT '1',
  `is_reconnection_reported` int(1) NOT NULL DEFAULT '1',
  `socket_to_be_reset` int(1) NOT NULL,
  `journey_init_value` bigint(20) NOT NULL,
  `visible` int(1) NOT NULL DEFAULT '0',
  `latest_date` datetime NOT NULL,
  `latest_date_from_log` datetime NOT NULL,
  `longitude` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
  `latitude` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
  `journey` bigint(20) NOT NULL,
  `old_longitude` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
  `old_latitude` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
  `old_journey` bigint(20) NOT NULL,
  `gprmc_speed` float NOT NULL,
  `gprmc_heading_deg` float NOT NULL,
  `is_alarm` int(1) NOT NULL,
  `alarme_code` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
  `alarme_description` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `digital_input_4` int(1) NOT NULL,
  `digital_input_2` int(1) NOT NULL,
  `csq` int(11) NOT NULL,
  `gprmc_gps_status` varchar(1) CHARACTER SET utf8 NOT NULL,
  `hdop` double NOT NULL,
  `fuel_percent` double NOT NULL,
  `fuel_liters` double NOT NULL,
  `frigo_temperature` double NOT NULL DEFAULT '0',
  `frigo_status` int(1) NOT NULL DEFAULT '0',
  `frigo_pcb` int(11) NOT NULL,
  `reset` int(11) NOT NULL DEFAULT '0',
  `latest_incomplete_buffer` text COLLATE utf8_unicode_ci NOT NULL,
  `mission_point_id` bigint(20) NOT NULL,
  `max_acceleration_value` int(11) DEFAULT NULL,
  `max_deceleration_value` int(11) DEFAULT NULL,
  `assisted_event_info` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
  `can_installed` int(1) DEFAULT NULL,
  `can_data_exists` int(1) DEFAULT NULL,
  `j1939_vehicle_speed_wheel` int(11) DEFAULT NULL,
  `j1939_vehicle_speed_tachograph` int(11) DEFAULT NULL,
  `j1939_clutch_switch` int(1) DEFAULT NULL,
  `j1939_tachograph_performance` int(1) DEFAULT NULL,
  `j1939_parking_brake_switch` int(1) DEFAULT NULL,
  `j1939_cruise_control` int(1) DEFAULT NULL,
  `j1939_accelerator_pedal_position` int(11) DEFAULT NULL,
  `j1939_total_fuel_used` bigint(20) DEFAULT NULL,
  `j1939_engine_speed` int(11) DEFAULT NULL,
  `j1939_total_engine_hours` double DEFAULT NULL,
  `j1939_high_resolution_vehicle_distance` bigint(20) DEFAULT NULL,
  `j1939_engine_coolant_temperature` bigint(20) DEFAULT NULL,
  `j1939_fuel_level` int(11) DEFAULT NULL,
  `j1939_actual_engine_torque` int(11) DEFAULT NULL,
  `j1939_ambient_air_temperature` int(11) DEFAULT NULL,
  `j1939_high_resolution_engine_total_fuel_used` double DEFAULT NULL,
  `j1939_load_at_current_speed` int(11) DEFAULT NULL,
  `j1939_engine_fuel_rate` double DEFAULT NULL,
  `j1939_axle_weight` double DEFAULT NULL,
  `j1939_service_distance` bigint(20) DEFAULT NULL,
  `j1939_instantaneous_fuel_economy` double DEFAULT NULL,
  `j1939_status_engine_brake` int(11) NOT NULL,
  `j1939_engine_oil_temperature` int(11) NOT NULL,
  `j1939_engine_fuel_temperature` int(11) NOT NULL,
  `j1939_total_vehicle_hours` int(11) NOT NULL,
  `j1939_trip_distance` int(11) NOT NULL,
  `j1939_engine_trip_fuel` int(11) NOT NULL,
  `j1939_percent_clutch_slip` int(11) NOT NULL,
  `fonctionnement` int(11) DEFAULT NULL,
  `stock` int(11) DEFAULT NULL,
  `fonctionnement_detail` int(11) DEFAULT NULL,
  `disconnection_reason` int(11) DEFAULT NULL,
  `disconnection_next_action_id` int(11) DEFAULT NULL,
  `disconnection_next_action_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Déchargement des données de la table `geo_tracker`
--

INSERT INTO `geo_tracker` (`id_tracker`, `imei`, `vehicle_id`, `model_id`, `password`, `sim_serial_number`, `latest_id_trace`, `active`, `latest_date_heartbeat_from_tracker`, `latest_cmd_received_from_tracker`, `latest_date_received_from_tracker`, `latest_date_send_to_tracker`, `latest_date_report`, `is_tracking_time_interval`, `tracking_time_interval`, `tracking_time_max_wait`, `is_tracking_distance_interval`, `tracking_distance_interval`, `date_first_server_connection`, `is_disconnection_reported`, `is_reconnection_reported`, `socket_to_be_reset`, `journey_init_value`, `visible`, `latest_date`, `latest_date_from_log`, `longitude`, `latitude`, `journey`, `old_longitude`, `old_latitude`, `old_journey`, `gprmc_speed`, `gprmc_heading_deg`, `is_alarm`, `alarme_code`, `alarme_description`, `digital_input_4`, `digital_input_2`, `csq`, `gprmc_gps_status`, `hdop`, `fuel_percent`, `fuel_liters`, `frigo_temperature`, `frigo_status`, `frigo_pcb`, `reset`, `latest_incomplete_buffer`, `mission_point_id`, `max_acceleration_value`, `max_deceleration_value`, `assisted_event_info`, `can_installed`, `can_data_exists`, `j1939_vehicle_speed_wheel`, `j1939_vehicle_speed_tachograph`, `j1939_clutch_switch`, `j1939_tachograph_performance`, `j1939_parking_brake_switch`, `j1939_cruise_control`, `j1939_accelerator_pedal_position`, `j1939_total_fuel_used`, `j1939_engine_speed`, `j1939_total_engine_hours`, `j1939_high_resolution_vehicle_distance`, `j1939_engine_coolant_temperature`, `j1939_fuel_level`, `j1939_actual_engine_torque`, `j1939_ambient_air_temperature`, `j1939_high_resolution_engine_total_fuel_used`, `j1939_load_at_current_speed`, `j1939_engine_fuel_rate`, `j1939_axle_weight`, `j1939_service_distance`, `j1939_instantaneous_fuel_economy`, `j1939_status_engine_brake`, `j1939_engine_oil_temperature`, `j1939_engine_fuel_temperature`, `j1939_total_vehicle_hours`, `j1939_trip_distance`, `j1939_engine_trip_fuel`, `j1939_percent_clutch_slip`, `fonctionnement`, `stock`, `fonctionnement_detail`, `disconnection_reason`, `disconnection_next_action_id`, `disconnection_next_action_date`) VALUES
(45220220634, 359231039573033, 19, 'VT310', '201205', NULL, NULL, 1, '2018-01-17 19:35:28', -1, '2018-01-17 19:36:09', '2016-02-11 19:54:13', '2018-01-17 03:30:21', 1, 60, 300, 0, 100, '2018-01-17 19:16:08', 0, 1, 0, 0, 1, '2018-01-17 19:36:09', '2018-01-17 19:36:07', '3.03008', '36.736655', 70236292, '3.0293', '36.73702', 70236292, 31.9285, 147, 0, '', '', 1, 0, 11, 'A', 0.8, 0, 0, 1, 0, 0, 0, '2424008045220220634fff99553138333630372e3030302c412c333634342e313939332c4e2c30303330312e383034382c452c31372e32342c3134372c3137303131382c2c2a33317c302e387c3139397c323830307c303136302c303030417c303235423030303230303437323734367c30427c30343137433842450ad2', 0, 0, 0, '', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, 1, NULL, NULL),
(866771023282881, 866771023282881, 15, 'T1', '201203', NULL, NULL, 1, '2018-01-17 19:36:16', 255, '2036-02-06 06:28:15', '2016-02-11 19:54:13', '2018-01-17 03:30:56', 1, 60, 300, 0, 100, '2018-01-17 19:16:08', 1, 0, 1, 0, 1, '2018-01-17 19:36:16', '2018-01-17 19:36:16', '-0.000001', '-0.000001', 4294967295, '7.738380', '36.907406', 59616015, 65535, 65535, 0, '25', '', 1, 1, 255, 'A', 6553.5, 10560, 0, 105.6, 0, 0, 0, '', 0, 0, 0, '', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, 2, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `geo_tracker_connection_status`
--

CREATE TABLE `geo_tracker_connection_status` (
  `geo_tracker_connection_status_id` int(11) NOT NULL,
  `geo_tracker_connection_status_designation` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `geo_tracker_connection_status`
--

INSERT INTO `geo_tracker_connection_status` (`geo_tracker_connection_status_id`, `geo_tracker_connection_status_designation`) VALUES
(1, 'Normal'),
(2, 'Bloqué'),
(3, 'Véhicule à l\'arrêt');

-- --------------------------------------------------------

--
-- Structure de la table `geo_tracker_disconnection_action`
--

CREATE TABLE `geo_tracker_disconnection_action` (
  `geo_tracker_disconnection_action_id` int(11) NOT NULL,
  `geo_tracker_disconnection_action_designation` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `geo_tracker_disconnection_action`
--

INSERT INTO `geo_tracker_disconnection_action` (`geo_tracker_disconnection_action_id`, `geo_tracker_disconnection_action_designation`) VALUES
(1, 'envoyer commande déblocage'),
(2, 'réglage gps ou de sa connexion'),
(3, 'changer le gps'),
(4, 'récupérer le gps');

-- --------------------------------------------------------

--
-- Structure de la table `geo_tracker_foctionnement_detail`
--

CREATE TABLE `geo_tracker_foctionnement_detail` (
  `geo_tracker_fct_detail_id` int(11) NOT NULL,
  `geo_tracker_fct_detail_desig` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `geo_tracker_foctionnement_detail`
--

INSERT INTO `geo_tracker_foctionnement_detail` (`geo_tracker_fct_detail_id`, `geo_tracker_fct_detail_desig`) VALUES
(1, 'pour les machines legers'),
(2, 'pour les machines lourds');

-- --------------------------------------------------------

--
-- Structure de la table `geo_tracker_install`
--

CREATE TABLE `geo_tracker_install` (
  `geo_tracker_install_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) NOT NULL,
  `date_install` datetime NOT NULL,
  `tracker_id` bigint(20) NOT NULL,
  `is_install` tinyint(1) DEFAULT NULL,
  `is_uninstall` tinyint(1) DEFAULT NULL,
  `frais_mission` double DEFAULT NULL,
  `intervention_region` varchar(100) DEFAULT NULL,
  `depenses` double DEFAULT NULL,
  `revenu` double DEFAULT NULL,
  `benef` double DEFAULT NULL,
  `porte` tinyint(1) DEFAULT NULL,
  `obd` tinyint(1) DEFAULT NULL,
  `frigo` tinyint(1) DEFAULT NULL,
  `carburant` tinyint(1) DEFAULT NULL,
  `benne` tinyint(1) DEFAULT NULL,
  `coupe_moteur` tinyint(1) DEFAULT NULL,
  `benne_signal` tinyint(1) DEFAULT NULL,
  `door_signal` tinyint(1) DEFAULT NULL,
  `obd_protocol` varchar(256) DEFAULT NULL,
  `frigo_type_id` int(11) DEFAULT NULL,
  `carburant_type_id` bigint(20) DEFAULT NULL,
  `installer_id` bigint(20) DEFAULT NULL,
  `frigo_status_using_input` int(11) DEFAULT NULL,
  `frigo_status_signe` tinyint(1) DEFAULT NULL,
  `uninstal_date` datetime DEFAULT NULL,
  `uninstall_reason_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `geo_tracker_install`
--

INSERT INTO `geo_tracker_install` (`geo_tracker_install_id`, `vehicule_id`, `date_install`, `tracker_id`, `is_install`, `is_uninstall`, `frais_mission`, `intervention_region`, `depenses`, `revenu`, `benef`, `porte`, `obd`, `frigo`, `carburant`, `benne`, `coupe_moteur`, `benne_signal`, `door_signal`, `obd_protocol`, `frigo_type_id`, `carburant_type_id`, `installer_id`, `frigo_status_using_input`, `frigo_status_signe`, `uninstal_date`, `uninstall_reason_id`) VALUES
(1, 3, '2018-11-13 00:00:00', 866771023282881, 1, 0, NULL, NULL, 150, NULL, 1, 0, 1, 0, 1, 0, 0, 1, 0, '1', 15, 1, 139, NULL, 1, '2018-11-21 00:00:00', 4),
(2, 12, '2018-11-12 00:00:00', 45220220634, 0, 1, NULL, NULL, 250, NULL, 0, 1, 0, 1, 0, 1, 1, 1, 1, '0', 12, 6, 121, NULL, 1, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `geo_tracker_model`
--

CREATE TABLE `geo_tracker_model` (
  `model_id` varchar(15) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `constructeur_id` bigint(20) DEFAULT NULL,
  `model_designation` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `model_protocol` varchar(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `geo_tracker_model`
--

INSERT INTO `geo_tracker_model` (`model_id`, `constructeur_id`, `model_designation`, `model_protocol`) VALUES
('T1', NULL, NULL, NULL),
('T1CAN', NULL, NULL, NULL),
('T622', NULL, NULL, NULL),
('VT310', NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `geo_tracker_stock`
--

CREATE TABLE `geo_tracker_stock` (
  `geo_tracker_stock_id` int(11) NOT NULL,
  `geo_tracker_designation` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `geo_tracker_stock`
--

INSERT INTO `geo_tracker_stock` (`geo_tracker_stock_id`, `geo_tracker_designation`) VALUES
(1, 'En stock'),
(2, 'Chez installateur'),
(3, 'Installé dans véhicule'),
(4, 'Chez réparateur'),
(5, 'Perdu à désinstaller'),
(6, 'Perdu');

-- --------------------------------------------------------

--
-- Structure de la table `geo_tracker_uninstall_reason`
--

CREATE TABLE `geo_tracker_uninstall_reason` (
  `geo_tracker_uninstall_reason_id` int(11) NOT NULL,
  `geo_tracker_uninstall_reason_designation` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `geo_tracker_uninstall_reason`
--

INSERT INTO `geo_tracker_uninstall_reason` (`geo_tracker_uninstall_reason_id`, `geo_tracker_uninstall_reason_designation`) VALUES
(1, 'Fin contrat'),
(2, 'Vehicule vendu'),
(3, 'Véhicule accidenté / panne'),
(4, 'Fin abonnement véhicule'),
(5, 'GPS à changer');

-- --------------------------------------------------------

--
-- Structure de la table `geo_trip`
--

CREATE TABLE `geo_trip` (
  `trip_id` bigint(20) NOT NULL,
  `vehicle_id` bigint(20) NOT NULL,
  `id_tracker` bigint(20) NOT NULL,
  `driver_id` bigint(20) NOT NULL,
  `mission_id` bigint(20) DEFAULT NULL,
  `compute_again` int(1) NOT NULL DEFAULT '1',
  `is_pb` int(1) NOT NULL DEFAULT '0',
  `nb_reverse_geocoded` int(1) NOT NULL,
  `start_date` datetime NOT NULL,
  `end_date` datetime NOT NULL,
  `start_date_day` date NOT NULL,
  `end_date_day` date NOT NULL,
  `duration` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_meters` bigint(20) NOT NULL,
  `total_cost` float NOT NULL,
  `speed_average` int(11) NOT NULL,
  `speed_max` int(11) NOT NULL,
  `start_latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `start_longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `start_journey` bigint(20) NOT NULL,
  `start_address` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `start_city` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `start_state` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `start_town` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `end_latitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `end_longitude` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `end_journey` bigint(20) NOT NULL,
  `end_address` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `end_city` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `end_state` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `end_town` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `note` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `alarms_summary` text COLLATE utf8_unicode_ci NOT NULL,
  `stop_reason` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `geo_trip_type` tinyint(1) DEFAULT NULL COMMENT '0-stationnement / 1 -tournée'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Déchargement des données de la table `geo_trip`
--

INSERT INTO `geo_trip` (`trip_id`, `vehicle_id`, `id_tracker`, `driver_id`, `mission_id`, `compute_again`, `is_pb`, `nb_reverse_geocoded`, `start_date`, `end_date`, `start_date_day`, `end_date_day`, `duration`, `total_meters`, `total_cost`, `speed_average`, `speed_max`, `start_latitude`, `start_longitude`, `start_journey`, `start_address`, `start_city`, `start_state`, `start_town`, `end_latitude`, `end_longitude`, `end_journey`, `end_address`, `end_city`, `end_state`, `end_town`, `note`, `alarms_summary`, `stop_reason`, `geo_trip_type`) VALUES
(268962941, 41, 45220220634, 2, NULL, 1, 0, 0, '2018-11-26 00:00:00', '2018-11-27 00:00:00', '2018-11-26', '2018-11-27', NULL, 0, 0, 50, 100, '', '', 0, 'adress1', '', '', '', '', '', 0, 'adress2', '', '', '', '', '', '', NULL),
(268962942, 41, 45220220634, 2, NULL, 1, 0, 0, '2018-11-26 00:00:00', '2018-11-27 00:00:00', '2018-11-26', '2018-11-27', NULL, 0, 0, 60, 100, '', '', 0, 'dres21', 'dres22', '', '', '', '', 0, '', '', '', '', '', '', '', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `geo_vehicule_autorization_use`
--

CREATE TABLE `geo_vehicule_autorization_use` (
  `vehicle_id` bigint(20) NOT NULL DEFAULT '0',
  `day_of_week` tinyint(4) NOT NULL DEFAULT '0',
  `hour_start` datetime DEFAULT NULL,
  `hour_end` datetime DEFAULT NULL,
  `authorized` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `geo_vehicule_obd_type`
--

CREATE TABLE `geo_vehicule_obd_type` (
  `vehicule_obd_type_id` bigint(20) NOT NULL,
  `vehicule_obd_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `geo_vehicule_type_obd_parametre`
--

CREATE TABLE `geo_vehicule_type_obd_parametre` (
  `vehicule_obd_type_id` bigint(20) NOT NULL DEFAULT '0',
  `gps_obd_parametre_id` bigint(20) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `groupe_notion_authorization`
--

CREATE TABLE `groupe_notion_authorization` (
  `notion_athorization_id` bigint(20) NOT NULL,
  `groupe_user_id` int(11) NOT NULL,
  `is_action` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `groupe_user`
--

CREATE TABLE `groupe_user` (
  `groupe_id` int(11) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `groupe_designation` varchar(256) DEFAULT NULL,
  `groupe_created_by` bigint(20) DEFAULT NULL,
  `is_admin` tinyint(4) NOT NULL DEFAULT '0',
  `administrateur` tinyint(2) NOT NULL,
  `is_admin_objectif` tinyint(4) NOT NULL DEFAULT '0',
  `is_admin_caisse` tinyint(4) NOT NULL DEFAULT '0',
  `is_admin_stat` tinyint(4) NOT NULL DEFAULT '0',
  `is_chef_atelie` tinyint(4) NOT NULL DEFAULT '0',
  `is_chef_parc` tinyint(4) NOT NULL DEFAULT '0',
  `is_controller` tinyint(4) NOT NULL DEFAULT '0',
  `can_see_carburant` tinyint(4) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Déchargement des données de la table `groupe_user`
--

INSERT INTO `groupe_user` (`groupe_id`, `entreprise_id`, `groupe_designation`, `groupe_created_by`, `is_admin`, `administrateur`, `is_admin_objectif`, `is_admin_caisse`, `is_admin_stat`, `is_chef_atelie`, `is_chef_parc`, `is_controller`, `can_see_carburant`) VALUES
(1, 305, 'Admin', 1, 1, 1, 1, 1, 1, 1, 1, 1, 0),
(34, 305, 'Chefs de Zone', 1, 1, 0, 0, 0, 0, 0, 0, 0, 0),
(35, 305, 'Gestionnaire de Stock', 1, 1, 0, 0, 0, 0, 0, 0, 0, 0),
(37, 305, 'Contrôleur', 1, 0, 0, 0, 0, 0, 0, 0, 1, 0),
(142, 305, 'Chefs de Secteur', 305, 1, 0, 0, 0, 0, 0, 0, 0, 0),
(151, 305, 'Résponsable Magasin', NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0),
(201, 305, 'Magasinier', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(241, 305, 'Chef de Parc', NULL, 1, 1, 0, 0, 0, 0, 1, 0, 0),
(261, 305, 'Chef d\'Atelier', NULL, 0, 0, 1, 0, 0, 1, 0, 1, 1),
(271, 305, 'Responsable', NULL, 1, 1, 1, 1, 1, 0, 0, 0, 0),
(291, 305, 'test', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(311, 305, 'Chef d\'Atelier Moto', NULL, 0, 0, 0, 0, 1, 0, 0, 0, 0),
(321, 305, 'Résponsable Moyen Géneraux', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(331, 305, 'Résponsable PLF', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(341, 305, 'Responsable Lavage', NULL, 0, 0, 1, 1, 1, 1, 0, 0, 0),
(351, 305, 'Responsable maintenance préventive', NULL, 0, 0, 1, 1, 1, 1, 0, 0, 0),
(361, 305, 'idk', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(381, 305, 'Pompiste', NULL, 0, 1, 0, 0, 0, 0, 0, 0, 1),
(391, 305, 'test_2', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(401, 305, 'test_2', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(411, 305, 'tesdt test', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0);

-- --------------------------------------------------------

--
-- Structure de la table `groupe_user_annuaire`
--

