CREATE TABLE `localisation_point` (
  `point_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `contact_id` bigint(20) DEFAULT NULL,
  `point_designation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `point_longitude` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `point_latitude` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `point_radius` bigint(20) DEFAULT NULL,
  `commune_id` int(11) DEFAULT NULL,
  `wilaya_id` int(11) DEFAULT NULL,
  `point_type_id` bigint(20) DEFAULT NULL,
  `point_parent_id` bigint(20) DEFAULT NULL,
  `is_default` int(1) DEFAULT NULL,
  `point_color` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `point_address` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `forme_type` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `localisation_point_type`
--

CREATE TABLE `localisation_point_type` (
  `point_type_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `point_type_designation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `point_type_icon` varchar(100) COLLATE utf8_unicode_ci DEFAULT 'home.png'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `localisation_wilaya`
--

CREATE TABLE `localisation_wilaya` (
  `wilaya_id` int(11) NOT NULL,
  `wilaya_intitule` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `localisation_wilaya` (`wilaya_id`, `wilaya_intitule`) VALUES
(1, 'Adrar '),
(2, 'Chlef'),
(3, 'Laghouat'),
(4, 'Oum-El-Bouaghi'),
(5, 'Batna'),
(6, 'Béjaia'),
(7, 'Biskra'),
(8, 'Béchar'),
(9, 'Blida'),
(10, 'Bouira'),
(11, 'Tamanrasset'),
(12, 'Tébessa'),
(13, 'Tlemcen'),
(14, 'Tiaret'),
(15, 'Tizi-Ouzou'),
(16, 'Alger'),
(17, 'Djelfa'),
(18, 'Jijel'),
(19, 'Sétif'),
(20, 'Saida'),
(21, 'Skikda'),
(22, 'Sidi-Bel-Abbès'),
(23, 'Annaba'),
(24, 'Guelma'),
(25, 'Constantine'),
(26, 'Medea'),
(27, 'Mostaganem'),
(28, 'M\'Sila'),
(29, 'Mascara'),
(30, 'Ouargla'),
(31, 'Oran'),
(32, 'El-Bayadh'),
(33, 'Illizi'),
(34, 'Bordj-Bou-Arreridj'),
(35, 'Boumerdès'),
(36, 'El-Tarf'),
(37, 'Tindouf'),
(38, 'Tissemsilt'),
(39, 'El-Oued'),
(40, 'Khenchela'),
(41, 'Souk-Ahras'),
(42, 'Tipaza'),
(43, 'Mila'),
(44, 'Aïn-Defla'),
(45, 'Naâma'),
(46, 'Aïn-Témouchent'),
(47, 'Ghardaia'),
(48, 'Relizane'),
(49, 'Timimoun'),
(50, 'Bordj Badji Mokhtar'),
(51, 'Ouled Djellal '),
(52, 'Béni Abbès'),
(53, 'Salah'),
(54, 'In Guezzam'),
(55, 'Touggourt'),
(56, 'Djanet'),
(57, 'El M\'Ghair'),
(58, 'El Meniaa');

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

--
-- Structure de la table `marketing`
--

CREATE TABLE `marketing` (
  `client_id` bigint(20) NOT NULL,
  `critere_type_id` int(11) NOT NULL,
  `date` date NOT NULL,
  `mission_point_id` bigint(20) DEFAULT NULL,
  `valeur` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `marketing` (`client_id`, `critere_type_id`, `date`, `mission_point_id`, `valeur`) VALUES
(380, 1, '2020-06-28', 6, '15');

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

--
-- Structure de la table `message`
--

CREATE TABLE `message` (
  `message_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `to_contact_id` bigint(20) DEFAULT NULL,
  `sent_request_by` bigint(20) DEFAULT NULL,
  `point_id` bigint(20) DEFAULT NULL,
  `vehicule_id` bigint(20) DEFAULT NULL,
  `date_entree` datetime DEFAULT NULL,
  `message_objet` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `message_designation` text COLLATE utf8_unicode_ci,
  `message_type` tinyint(1) DEFAULT NULL,
  `message_status` int(11) DEFAULT NULL,
  `date_action` datetime DEFAULT NULL,
  `date_insertion` datetime DEFAULT NULL,
  `date_envoi` datetime DEFAULT NULL,
  `message_destination` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `exclure_envoi_depuis` time DEFAULT NULL,
  `exclure_envoi_jusquea` time DEFAULT NULL,
  `nombre_maximum_envoi` bigint(20) DEFAULT NULL,
  `deleted_at` date DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT '1',
  `sync_id` tinyint(4) DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2024_02_26_143547_create_activity_log_table', 0),
(11, '2024_02_26_143547_create_activity_log_type_table', 0),
(21, '2024_02_26_143547_create_app_mobile_allowed_versions_table', 0),
(31, '2024_02_26_143547_create_applications_table', 0),
(41, '2024_02_26_143547_create_article_table', 0),
(51, '2024_02_26_143547_create_article_article_caracteristique_table', 0),
(61, '2024_02_26_143547_create_article_article_libelle_table', 0),
(71, '2024_02_26_143547_create_article_article_tag_table', 0),
(81, '2024_02_26_143547_create_article_article_unite_table', 0),
(91, '2024_02_26_143547_create_article_article_unite_article_groupe_prix_table', 0),
(101, '2024_02_26_143547_create_article_article_unite_article_groupe_prix_historique_table', 0),
(111, '2024_02_26_143547_create_article_article_unite_depot_table', 0),
(121, '2024_02_26_143547_create_article_classe_table', 0),
(131, '2024_02_26_143547_create_article_composant_table', 0),
(141, '2024_02_26_143547_create_article_contenance_table', 0),
(151, '2024_02_26_143547_create_article_documentfile_table', 0),
(161, '2024_02_26_143547_create_article_etat_table', 0),
(171, '2024_02_26_143547_create_article_famille_table', 0),
(181, '2024_02_26_143547_create_article_famille_nature_table', 0),
(191, '2024_02_26_143547_create_article_famille_speciale_table', 0),
(201, '2024_02_26_143547_create_article_fournisseur_table', 0),
(211, '2024_02_26_143547_create_article_groupe_prix_table', 0),
(221, '2024_02_26_143547_create_article_marque_table', 0),
(231, '2024_02_26_143547_create_article_media_documentfile_table', 0),
(241, '2024_02_26_143547_create_article_modele_table', 0),
(251, '2024_02_26_143547_create_article_mouvement_table', 0),
(261, '2024_02_26_143547_create_article_mouvement_article_mouvement_table', 0),
(271, '2024_02_26_143547_create_article_mouvement_documentfile_table', 0),
(281, '2024_02_26_143547_create_article_mouvement_mouvement_ligne_table', 0),
(291, '2024_02_26_143547_create_article_mouvement_mouvement_ligne_reservation_table', 0),
(301, '2024_02_26_143547_create_article_mouvement_operation_type_table', 0),
(311, '2024_02_26_143547_create_article_mouvement_param_table', 0),
(321, '2024_02_26_143547_create_article_param_table', 0),
(331, '2024_02_26_143547_create_article_parfume_table', 0),
(341, '2024_02_26_143547_create_article_production_project_table', 0),
(351, '2024_02_26_143547_create_article_production_task_table', 0),
(361, '2024_02_26_143547_create_article_tag_table', 0),
(371, '2024_02_26_143547_create_article_taxe_table', 0),
(381, '2024_02_26_143547_create_article_type_table', 0),
(391, '2024_02_26_143547_create_article_unite_table', 0),
(401, '2024_02_26_143547_create_article_unite_param_table', 0),
(411, '2024_02_26_143547_create_assurance_document_table', 0),
(421, '2024_02_26_143547_create_authorization_tag_table', 0),
(431, '2024_02_26_143547_create_authorization_tag_ressource_table', 0),
(441, '2024_02_26_143547_create_authorization_tag_user_table', 0),
(451, '2024_02_26_143547_create_autorisation_table', 0),
(461, '2024_02_26_143547_create_autorisation_contact_table', 0),
(471, '2024_02_26_143547_create_autorite_table', 0),
(481, '2024_02_26_143547_create_balance_caissier_table', 0),
(491, '2024_02_26_143547_create_balance_caissier_mouvement_typre_table', 0),
(501, '2024_02_26_143547_create_balance_credit_table', 0),
(511, '2024_02_26_143547_create_balance_credit_type_table', 0),
(521, '2024_02_26_143547_create_balance_fournisseur_table', 0),
(531, '2024_02_26_143547_create_balance_fournisseur_mouvement_type_table', 0),
(541, '2024_02_26_143547_create_balance_stock_table', 0),
(551, '2024_02_26_143547_create_bobine_table', 0),
(561, '2024_02_26_143547_create_carburant_bon_table', 0),
(571, '2024_02_26_143547_create_cause_inactivite_table', 0),
(581, '2024_02_26_143547_create_cheque_documentFile_table', 0),
(591, '2024_02_26_143547_create_client_codification_table', 0),
(601, '2024_02_26_143547_create_client_codification_composant_table', 0),
(611, '2024_02_26_143547_create_client_codification_type_table', 0),
(621, '2024_02_26_143547_create_client_ecart_historique_table', 0),
(631, '2024_02_26_143547_create_client_planning_table', 0),
(641, '2024_02_26_143547_create_client_planning_status_table', 0),
(651, '2024_02_26_143547_create_codification_clients_table', 0),
(661, '2024_02_26_143547_create_codification_clients_types_table', 0),
(671, '2024_02_26_143547_create_colis_table', 0),
(681, '2024_02_26_143547_create_colis_article_mouvement_table', 0),
(691, '2024_02_26_143547_create_colis_type_table', 0),
(701, '2024_02_26_143547_create_colis_type_article_table', 0),
(711, '2024_02_26_143547_create_communication_client_table', 0),
(721, '2024_02_26_143547_create_communication_client_type_table', 0),
(731, '2024_02_26_143547_create_compte_module_table', 0),
(741, '2024_02_26_143547_create_compte_operation_mouvement_table', 0),
(751, '2024_02_26_143547_create_compte_parametre_table', 0),
(761, '2024_02_26_143547_create_compte_parametre_groupe_table', 0),
(771, '2024_02_26_143547_create_compte_parametre_possible_value_table', 0),
(781, '2024_02_26_143547_create_compte_parametre_value_table', 0),
(791, '2024_02_26_143547_create_comptes_table', 0),
(801, '2024_02_26_143547_create_contact_table', 0),
(811, '2024_02_26_143547_create_contact_attribute_table', 0),
(821, '2024_02_26_143547_create_contact_attribute_value_table', 0),
(831, '2024_02_26_143547_create_contact_bank_info_table', 0),
(841, '2024_02_26_143547_create_contact_can_use_table', 0),
(851, '2024_02_26_143547_create_contact_can_use_limitedday_table', 0),
(861, '2024_02_26_143547_create_contact_civilite_table', 0),
(871, '2024_02_26_143547_create_contact_classement_table', 0),
(881, '2024_02_26_143547_create_contact_contact_classement_table', 0),
(891, '2024_02_26_143547_create_contact_contact_fonction_table', 0),
(901, '2024_02_26_143547_create_contact_contact_group_table', 0),
(911, '2024_02_26_143547_create_contact_contact_groupe_client_table', 0),
(921, '2024_02_26_143547_create_contact_contact_parametre_table', 0),
(931, '2024_02_26_143547_create_contact_contact_type_table', 0),
(941, '2024_02_26_143547_create_contact_departement_table', 0),
(951, '2024_02_26_143547_create_contact_documentfile_table', 0),
(961, '2024_02_26_143547_create_contact_ecart_historique_table', 0),
(971, '2024_02_26_143547_create_contact_fonction_table', 0),
(981, '2024_02_26_143547_create_contact_genre_table', 0),
(991, '2024_02_26_143547_create_contact_group_table', 0),
(1001, '2024_02_26_143547_create_contact_group_mission_planning_table', 0),
(1011, '2024_02_26_143547_create_contact_group_planning_table', 0),
(1021, '2024_02_26_143547_create_contact_groupe_client_table', 0),
(1031, '2024_02_26_143547_create_contact_groupe_vendeur_table', 0),
(1041, '2024_02_26_143547_create_contact_groupe_vendeur_article_table', 0),
(1051, '2024_02_26_143547_create_contact_groupe_vendeur_famille_article_table', 0),
(1061, '2024_02_26_143547_create_contact_info_table', 0),
(1071, '2024_02_26_143547_create_contact_info_type_table', 0),
(1081, '2024_02_26_143547_create_contact_mission_zone_table', 0),
(1091, '2024_02_26_143547_create_contact_parametre_table', 0),
(1101, '2024_02_26_143547_create_contact_planning_table', 0),
(1111, '2024_02_26_143547_create_contact_planning_days_table', 0),
(1121, '2024_02_26_143547_create_contact_planning_status_table', 0),
(1131, '2024_02_26_143547_create_contact_type_table', 0),
(1141, '2024_02_26_143547_create_contact_vendeur_objectif_table', 0),
(1151, '2024_02_26_143547_create_critere_type_table', 0),
(1161, '2024_02_26_143547_create_depot_table', 0),
(1171, '2024_02_26_143547_create_depot_article_can_table', 0),
(1181, '2024_02_26_143547_create_depot_article_famille_can_table', 0),
(1191, '2024_02_26_143547_create_depot_mouvement_type_table', 0),
(1201, '2024_02_26_143547_create_depot_type_table', 0),
(1211, '2024_02_26_143547_create_device_compte_table', 0),
(1221, '2024_02_26_143547_create_devices_param_table', 0),
(1231, '2024_02_26_143547_create_document_file_table', 0),
(1241, '2024_02_26_143547_create_document_file_type_table', 0),
(1251, '2024_02_26_143547_create_document_type_table', 0),
(1261, '2024_02_26_143547_create_entreprise_grids_param_table', 0),
(1271, '2024_02_26_143547_create_excel_article_table', 0),
(1281, '2024_02_26_143547_create_excel_article_contenance_table', 0),
(1291, '2024_02_26_143547_create_excel_article_famille_table', 0),
(1301, '2024_02_26_143547_create_excel_article_marque_table', 0),
(1311, '2024_02_26_143547_create_excel_article_nature_table', 0),
(1321, '2024_02_26_143547_create_excel_article_parfume_table', 0),
(1331, '2024_02_26_143547_create_excel_article_type_table', 0),
(1341, '2024_02_26_143547_create_excel_client_table', 0),
(1351, '2024_02_26_143547_create_excel_contact_fonction_table', 0),
(1361, '2024_02_26_143547_create_excel_depot_table', 0),
(1371, '2024_02_26_143547_create_excel_famille_article_table', 0),
(1381, '2024_02_26_143547_create_excel_groupe_client_table', 0),
(1391, '2024_02_26_143547_create_excel_groupe_user_table', 0),
(1401, '2024_02_26_143547_create_excel_import_status_table', 0),
(1411, '2024_02_26_143547_create_excel_users_table', 0),
(1421, '2024_02_26_143547_create_excel_vehicule_table', 0),
(1431, '2024_02_26_143547_create_excel_zone_table', 0),
(1441, '2024_02_26_143547_create_exception_table', 0),
(1451, '2024_02_26_143547_create_failed_jobs_table', 0),
(1461, '2024_02_26_143547_create_finance_caisse_contact_table', 0),
(1471, '2024_02_26_143547_create_finance_caisse_physique_table', 0),
(1481, '2024_02_26_143547_create_finance_cheque_table', 0),
(1491, '2024_02_26_143547_create_finance_compte_table', 0),
(1501, '2024_02_26_143547_create_finance_compte_alerte_table', 0),
(1511, '2024_02_26_143547_create_finance_compte_alerte_operation_table', 0),
(1521, '2024_02_26_143547_create_finance_compte_etablissement_table', 0),
(1531, '2024_02_26_143547_create_finance_compte_etablissement_agence_table', 0),
(1541, '2024_02_26_143547_create_finance_compte_monnaie_piece_table', 0),
(1551, '2024_02_26_143547_create_finance_compte_operation_table', 0),
(1561, '2024_02_26_143547_create_finance_compte_operation_type_table', 0),
(1571, '2024_02_26_143547_create_finance_compte_operation_type_detail_table', 0),
(1581, '2024_02_26_143547_create_finance_compte_type_table', 0),
(1591, '2024_02_26_143547_create_finance_mode_paiement_table', 0),
(1601, '2024_02_26_143547_create_finance_monnaie_table', 0),
(1611, '2024_02_26_143547_create_finance_monnaie_piece_table', 0),
(1621, '2024_02_26_143547_create_finance_ordre_paiement_table', 0),
(1631, '2024_02_26_143547_create_finance_ordre_paiement_remarque_table', 0),
(1641, '2024_02_26_143547_create_finance_paiement_delai_table', 0),
(1651, '2024_02_26_143547_create_finance_paiement_rappel_table', 0),
(1661, '2024_02_26_143547_create_finance_remise_cheque_table', 0),
(1671, '2024_02_26_143547_create_finance_versement_table', 0),
(1681, '2024_02_26_143547_create_finance_versement_monnaie_piece_table', 0),
(1691, '2024_02_26_143547_create_finance_versement_notification_table', 0),
(1701, '2024_02_26_143547_create_finance_virement_table', 0),
(1711, '2024_02_26_143547_create_flag_lock_table', 0),
(1721, '2024_02_26_143547_create_fournisseur_solde_initial_historique_table', 0),
(1731, '2024_02_26_143547_create_geo_trace_table', 0),
(1741, '2024_02_26_143547_create_groupe_notion_authorization_table', 0),
(1751, '2024_02_26_143547_create_groupe_user_table', 0),
(1761, '2024_02_26_143547_create_groupe_user_annuaire_table', 0),
(1771, '2024_02_26_143547_create_groupe_user_article_famille_table', 0),
(1781, '2024_02_26_143547_create_groupe_user_module_table', 0),
(1791, '2024_02_26_143547_create_groupe_user_module_action_table', 0),
(1801, '2024_02_26_143547_create_groupe_user_objectif_type_table', 0),
(1811, '2024_02_26_143547_create_groupe_vendeur_table', 0),
(1821, '2024_02_26_143547_create_groupe_vendeur_quota_table', 0),
(1831, '2024_02_26_143547_create_groupe_vendeur_quota_model_table', 0),
(1841, '2024_02_26_143547_create_health_check_result_history_items_table', 0),
(1851, '2024_02_26_143547_create_holidays_table', 0),
(1861, '2024_02_26_143547_create_immobilier_usage_type_table', 0),
(1871, '2024_02_26_143547_create_infraction_table', 0),
(1881, '2024_02_26_143547_create_infraction_documentfile_table', 0),
(1891, '2024_02_26_143547_create_infraction_ressource_table', 0),
(1901, '2024_02_26_143547_create_infraction_sanction_type_table', 0),
(1911, '2024_02_26_143547_create_infraction_temoins_table', 0),
(1921, '2024_02_26_143547_create_infraction_type_table', 0),
(1931, '2024_02_26_143547_create_inscription_table', 0),
(1941, '2024_02_26_143547_create_inscriptions_table', 0),
(1951, '2024_02_26_143547_create_job_test_table', 0),
(1961, '2024_02_26_143547_create_jobs_table', 0),
(1971, '2024_02_26_143547_create_lang_table', 0),
(1981, '2024_02_26_143547_create_lang_text_table', 0),
(1991, '2024_02_26_143547_create_localisation_commune_table', 0),
(2001, '2024_02_26_143547_create_localisation_point_table', 0),
(2011, '2024_02_26_143547_create_localisation_point_type_table', 0),
(2021, '2024_02_26_143547_create_localisation_wilaya_table', 0),
(2031, '2024_02_26_143547_create_marketing_table', 0),
(2041, '2024_02_26_143547_create_message_table', 0),
(2051, '2024_02_26_143547_create_mission_table', 0),
(2061, '2024_02_26_143547_create_mission_day_of_month_table', 0),
(2071, '2024_02_26_143547_create_mission_day_of_week_table', 0),
(2081, '2024_02_26_143547_create_mission_declaration_recette_table', 0),
(2091, '2024_02_26_143547_create_mission_document_table', 0),
(2101, '2024_02_26_143547_create_mission_entreprise_table', 0),
(2111, '2024_02_26_143547_create_mission_entreprise_beneficiaire_table', 0),
(2121, '2024_02_26_143547_create_mission_eval_table', 0),
(2131, '2024_02_26_143547_create_mission_eval_critere_type_table', 0),
(2141, '2024_02_26_143547_create_mission_grid_stats_table', 0),
(2151, '2024_02_26_143547_create_mission_mission_table', 0),
(2161, '2024_02_26_143547_create_mission_missionnaire_table', 0),
(2171, '2024_02_26_143547_create_mission_missionnaire_motif_table', 0),
(2181, '2024_02_26_143547_create_mission_params_missionnaire_list_table', 0),
(2191, '2024_02_26_143547_create_mission_params_point_depart_table', 0),
(2201, '2024_02_26_143547_create_mission_params_vehicule_list_table', 0),
(2211, '2024_02_26_143547_create_mission_planning_table', 0),
(2221, '2024_02_26_143547_create_mission_planning_missionnaire_table', 0),
(2231, '2024_02_26_143547_create_mission_planning_missionnaire_motif_table', 0),
(2241, '2024_02_26_143547_create_mission_planning_periodicite_table', 0),
(2251, '2024_02_26_143547_create_mission_planning_value_table', 0),
(2261, '2024_02_26_143547_create_mission_planning_value_client_table', 0),
(2271, '2024_02_26_143547_create_mission_poids_table', 0),
(2281, '2024_02_26_143547_create_mission_point_table', 0),
(2291, '2024_02_26_143547_create_mission_point_annulation_raison_table', 0),
(2301, '2024_02_26_143547_create_mission_point_media_documentfile_table', 0),
(2311, '2024_02_26_143547_create_mission_point_status_table', 0),
(2321, '2024_02_26_143547_create_mission_ressource_table', 0),
(2331, '2024_02_26_143547_create_mission_role_table', 0),
(2341, '2024_02_26_143547_create_mission_sortie_table', 0),
(2351, '2024_02_26_143547_create_mission_sortie_ligne_table', 0),
(2361, '2024_02_26_143547_create_mission_status_table', 0),
(2371, '2024_02_26_143547_create_mission_transporteur_table', 0),
(2381, '2024_02_26_143547_create_mission_type_cargo_table', 0),
(2391, '2024_02_26_143547_create_mission_zone_table', 0),
(2401, '2024_02_26_143547_create_mission_zone_26092021_table', 0),
(2411, '2024_02_26_143547_create_mission_zone_contact_table', 0),
(2421, '2024_02_26_143547_create_mission_zone_old_table', 0),
(2431, '2024_02_26_143547_create_mission_zone_params_table', 0),
(2441, '2024_02_26_143547_create_mission_zone_params_missionnaire_table', 0),
(2451, '2024_02_26_143547_create_mission_zone_parcours_table', 0),
(2461, '2024_02_26_143547_create_mission_zone_ramy_table', 0),
(2471, '2024_02_26_143547_create_mission_zone_type_table', 0),
(2481, '2024_02_26_143547_create_misson_zone_params_carburant_table', 0),
(2491, '2024_02_26_143547_create_misson_zone_point_table', 0),
(2501, '2024_02_26_143547_create_mobile_deleted_data_table', 0),
(2511, '2024_02_26_143547_create_mobile_params_table', 0),
(2521, '2024_02_26_143547_create_module_table', 0),
(2531, '2024_02_26_143547_create_module_action_table', 0),
(2541, '2024_02_26_143547_create_module_mobile_table', 0),
(2551, '2024_02_26_143547_create_module_mobile_group_user_table', 0),
(2561, '2024_02_26_143547_create_motif_conge_table', 0),
(2571, '2024_02_26_143547_create_mouvement_table', 0),
(2581, '2024_02_26_143547_create_mouvement_client_table', 0),
(2591, '2024_02_26_143547_create_mouvement_documentfile_table', 0),
(2601, '2024_02_26_143547_create_mouvement_finance_compte_operation_table', 0),
(2611, '2024_02_26_143547_create_mouvement_fournisseur_type_table', 0),
(2621, '2024_02_26_143547_create_mouvement_id_confirmation_table', 0),
(2631, '2024_02_26_143547_create_mouvement_ligne_table', 0),
(2641, '2024_02_26_143547_create_mouvement_ligne_client_table', 0),
(2651, '2024_02_26_143547_create_mouvement_ligne_composant_param_table', 0),
(2661, '2024_02_26_143547_create_mouvement_ligne_mouvement_ligne_table', 0),
(2671, '2024_02_26_143547_create_mouvement_ligne_param_table', 0),
(2681, '2024_02_26_143547_create_mouvement_ligne_trash_table', 0),
(2691, '2024_02_26_143547_create_mouvement_modele_document_table', 0),
(2701, '2024_02_26_143547_create_mouvement_mouvement_table', 0),
(2711, '2024_02_26_143547_create_mouvement_mouvement_ligne_table', 0),
(2721, '2024_02_26_143547_create_mouvement_mouvement_taxe_table', 0),
(2731, '2024_02_26_143547_create_mouvement_note_table', 0),
(2741, '2024_02_26_143547_create_mouvement_notification_programme_table', 0),
(2751, '2024_02_26_143547_create_mouvement_operation_type_table', 0),
(2761, '2024_02_26_143547_create_mouvement_parametre_table', 0),
(2771, '2024_02_26_143547_create_mouvement_params_contact_table', 0),
(2781, '2024_02_26_143547_create_mouvement_status_table', 0),
(2791, '2024_02_26_143547_create_mouvement_trash_table', 0),
(2801, '2024_02_26_143547_create_mouvement_type_table', 0),
(2811, '2024_02_26_143547_create_mouvement_type_contact_table', 0),
(2821, '2024_02_26_143547_create_mouvement_type_groupe_table', 0),
(2831, '2024_02_26_143547_create_mouvement_validateur_table', 0),
(2841, '2024_02_26_143547_create_mouvement_vente_operation_type_table', 0),
(2851, '2024_02_26_143547_create_notification_table', 0),
(2861, '2024_02_26_143547_create_objectif_table', 0),
(2871, '2024_02_26_143547_create_objectif_drop_size_table', 0),
(2881, '2024_02_26_143547_create_objectif_edit_permission_table', 0),
(2891, '2024_02_26_143547_create_objectif_fonction_authorization_table', 0),
(2901, '2024_02_26_143547_create_objectif_prime_table', 0),
(2911, '2024_02_26_143547_create_objectif_prime_famille_table', 0),
(2921, '2024_02_26_143547_create_objectif_prime_groupe_value_table', 0),
(2931, '2024_02_26_143547_create_objectif_prime_value_table', 0),
(2941, '2024_02_26_143547_create_objectif_produit_table', 0),
(2951, '2024_02_26_143547_create_objectif_report_mailing_table', 0),
(2961, '2024_02_26_143547_create_objectif_taux_succes_table', 0),
(2971, '2024_02_26_143547_create_objectif_type_table', 0),
(2981, '2024_02_26_143547_create_operation_cout_table', 0),
(2991, '2024_02_26_143547_create_operation_cout_type_table', 0),
(3001, '2024_02_26_143547_create_optimisation_table', 0),
(3011, '2024_02_26_143547_create_optimisation_mission_table', 0),
(3021, '2024_02_26_143547_create_optimisation_mission_point_table', 0),
(3031, '2024_02_26_143547_create_optimisation_mission_point_commande_table', 0),
(3041, '2024_02_26_143547_create_optimisation_param_client_table', 0),
(3051, '2024_02_26_143547_create_optimisation_param_depot_table', 0),
(3061, '2024_02_26_143547_create_optimisation_param_vehicule_table', 0),
(3071, '2024_02_26_143547_create_optimisation_status_table', 0),
(3081, '2024_02_26_143547_create_optimisation_type_table', 0),
(3091, '2024_02_26_143547_create_paiement_mode_table', 0),
(3101, '2024_02_26_143547_create_param_table', 0),
(3111, '2024_02_26_143547_create_parametres_table', 0),
(3121, '2024_02_26_143547_create_parc_alert_table', 0),
(3131, '2024_02_26_143547_create_parc_anomalie_frais_table', 0),
(3141, '2024_02_26_143547_create_parc_anomalie_operation_table', 0),
(3151, '2024_02_26_143547_create_parc_anomalie_type_table', 0),
(3161, '2024_02_26_143547_create_parc_assurance_table', 0),
(3171, '2024_02_26_143547_create_parc_assurance_contrat_table', 0),
(3181, '2024_02_26_143547_create_parc_assurance_detail_table', 0),
(3191, '2024_02_26_143547_create_parc_assurance_garantie_type_table', 0),
(3201, '2024_02_26_143547_create_parc_assurance_sinistre_degat_table', 0),
(3211, '2024_02_26_143547_create_parc_assurance_sinistre_degat_type_table', 0),
(3221, '2024_02_26_143547_create_parc_assurance_sinistre_modele_table', 0),
(3231, '2024_02_26_143547_create_parc_assurance_sinistre_versement_table', 0),
(3241, '2024_02_26_143547_create_parc_assurance_vehicule_modele_table', 0),
(3251, '2024_02_26_143547_create_parc_constat_table', 0),
(3261, '2024_02_26_143547_create_parc_constat_element_table', 0),
(3271, '2024_02_26_143547_create_parc_constat_element_modele_table', 0),
(3281, '2024_02_26_143547_create_parc_constat_modele_table', 0),
(3291, '2024_02_26_143547_create_parc_constat_value_table', 0),
(3301, '2024_02_26_143547_create_parc_operation_table', 0),
(3311, '2024_02_26_143547_create_parc_operation_action_table', 0),
(3321, '2024_02_26_143547_create_parc_operation_action_excute_table', 0),
(3331, '2024_02_26_143547_create_parc_operation_article_type_table', 0),
(3341, '2024_02_26_143547_create_parc_operation_article_used_table', 0),
(3351, '2024_02_26_143547_create_parc_operation_controle_attribute_table', 0),
(3361, '2024_02_26_143547_create_parc_operation_controle_attribute_groupe_table', 0),
(3371, '2024_02_26_143547_create_parc_operation_controle_attribute_value_table', 0),
(3381, '2024_02_26_143547_create_parc_operation_document_table', 0),
(3391, '2024_02_26_143547_create_parc_operation_dtc_code_table', 0),
(3401, '2024_02_26_143547_create_parc_operation_mouvement_table', 0),
(3411, '2024_02_26_143547_create_parc_operation_note_table', 0),
(3421, '2024_02_26_143547_create_parc_operation_scan_dtc_code_table', 0),
(3431, '2024_02_26_143547_create_parc_operation_status_table', 0),
(3441, '2024_02_26_143547_create_parc_operation_type_table', 0),
(3451, '2024_02_26_143547_create_parc_ressource_operation_required_table', 0),
(3461, '2024_02_26_143547_create_parc_ressource_operation_required_modele_table', 0),
(3471, '2024_02_26_143547_create_parc_sinistre_table', 0),
(3481, '2024_02_26_143547_create_parc_sinistre_assurance_declaration_attribut_table', 0),
(3491, '2024_02_26_143547_create_parc_sinistre_declaration_table', 0),
(3501, '2024_02_26_143547_create_parc_sinistre_documentfile_table', 0),
(3511, '2024_02_26_143547_create_parc_sinistre_personne_concernees_situation_table', 0),
(3521, '2024_02_26_143547_create_parc_sinistre_personnes_concernees_table', 0),
(3531, '2024_02_26_143547_create_parc_sinistre_vehicule_adversaire_table', 0),
(3541, '2024_02_26_143547_create_parc_station_carburant_table', 0),
(3551, '2024_02_26_143547_create_password_resets_table', 0),
(3561, '2024_02_26_143547_create_pays_table', 0),
(3571, '2024_02_26_143547_create_personal_access_tokens_table', 0),
(3581, '2024_02_26_143547_create_prime_table', 0),
(3591, '2024_02_26_143547_create_production_table', 0),
(3601, '2024_02_26_143547_create_production_etape_table', 0),
(3611, '2024_02_26_143547_create_production_etape_tmp_table', 0),
(3621, '2024_02_26_143547_create_production_mouvement_ligne_table', 0),
(3631, '2024_02_26_143547_create_production_mouvement_stock_table', 0),
(3641, '2024_02_26_143547_create_production_param_table', 0),
(3651, '2024_02_26_143547_create_production_planning_table', 0),
(3661, '2024_02_26_143547_create_production_planning_status_table', 0),
(3671, '2024_02_26_143547_create_production_planning_tmp_table', 0),
(3681, '2024_02_26_143547_create_production_status_table', 0),
(3691, '2024_02_26_143547_create_promotion_table', 0),
(3701, '2024_02_26_143547_create_promotion_article_commmande_table', 0),
(3711, '2024_02_26_143547_create_promotion_article_gratuite_table', 0),
(3721, '2024_02_26_143547_create_promotion_customer_count_table', 0),
(3731, '2024_02_26_143547_create_promotion_detail_table', 0),
(3741, '2024_02_26_143547_create_promotion_famille_commmande_table', 0),
(3751, '2024_02_26_143547_create_promotion_famille_gratuite_table', 0),
(3761, '2024_02_26_143547_create_promotion_famille_groupe_table', 0),
(3771, '2024_02_26_143547_create_promotion_groupe_table', 0),
(3781, '2024_02_26_143547_create_promotion_mouvement_table', 0),
(3791, '2024_02_26_143547_create_promotion_niveau_table', 0),
(3801, '2024_02_26_143547_create_promotion_palier_table', 0),
(3811, '2024_02_26_143547_create_promotion_status_table', 0),
(3821, '2024_02_26_143547_create_promotion_type_table', 0),
(3831, '2024_02_26_143547_create_promotion_zone_table', 0),
(3841, '2024_02_26_143547_create_reglement_table', 0),
(3851, '2024_02_26_143547_create_reglement_caisse_table', 0),
(3861, '2024_02_26_143547_create_reglement_caisse_mission_table', 0),
(3871, '2024_02_26_143547_create_reglement_caisse_reglement_caisse_table', 0),
(3881, '2024_02_26_143547_create_reglement_detail_table', 0),
(3891, '2024_02_26_143547_create_reglement_document_table', 0),
(3901, '2024_02_26_143547_create_reglement_fournisseur_table', 0),
(3911, '2024_02_26_143547_create_reglement_mouvement_table', 0),
(3921, '2024_02_26_143547_create_reglement_mouvement_caisse_type_table', 0),
(3931, '2024_02_26_143547_create_reglement_operation_table', 0),
(3941, '2024_02_26_143547_create_reglement_reglement_table', 0),
(3951, '2024_02_26_143547_create_reglement_status_table', 0),
(3961, '2024_02_26_143547_create_reglement_type_table', 0),
(3971, '2024_02_26_143547_create_remise_cheque_documentFile_table', 0),
(3981, '2024_02_26_143547_create_remplissage_bon_table', 0),
(3991, '2024_02_26_143547_create_ressource_table', 0),
(4001, '2024_02_26_143547_create_ressource_affectation_table', 0),
(4011, '2024_02_26_143547_create_ressource_caracteristique_table', 0),
(4021, '2024_02_26_143547_create_ressource_caracteristique_type_table', 0),
(4031, '2024_02_26_143547_create_ressource_desig_table', 0),
(4041, '2024_02_26_143547_create_ressource_documentfile_table', 0),
(4051, '2024_02_26_143547_create_ressource_marque_table', 0),
(4061, '2024_02_26_143547_create_ressource_media_documentfile_table', 0),
(4071, '2024_02_26_143547_create_ressource_modele_table', 0),
(4081, '2024_02_26_143547_create_ressource_modele_documentfile_table', 0),
(4091, '2024_02_26_143547_create_ressource_mouvement_table', 0),
(4101, '2024_02_26_143547_create_ressource_planning_table', 0),
(4111, '2024_02_26_143547_create_ressource_planning_status_table', 0),
(4121, '2024_02_26_143547_create_ressource_planning_type_table', 0),
(4131, '2024_02_26_143547_create_ressource_ressource_attached_table', 0),
(4141, '2024_02_26_143547_create_ressource_ressource_equipement_table', 0),
(4151, '2024_02_26_143547_create_ressource_ressource_status_table', 0),
(4161, '2024_02_26_143547_create_ressource_ressource_tag_table', 0),
(4171, '2024_02_26_143547_create_ressource_ressource_usage_table', 0),
(4181, '2024_02_26_143547_create_ressource_status_table', 0),
(4191, '2024_02_26_143547_create_ressource_tag_table', 0),
(4201, '2024_02_26_143547_create_ressource_tag_groupe_user_table', 0),
(4211, '2024_02_26_143547_create_ressource_type_table', 0),
(4221, '2024_02_26_143547_create_ressource_usage_service_type_table', 0),
(4231, '2024_02_26_143547_create_ressource_usage_type_table', 0),
(4241, '2024_02_26_143547_create_rh_demande_conge_table', 0),
(4251, '2024_02_26_143547_create_rh_working_days_table', 0),
(4261, '2024_02_26_143547_create_sessions_table', 0),
(4271, '2024_02_26_143547_create_societe_secteur_activite_table', 0),
(4281, '2024_02_26_143547_create_stat_fournisseur_table', 0),
(4291, '2024_02_26_143547_create_statistique_table', 0),
(4301, '2024_02_26_143547_create_stats_table', 0),
(4311, '2024_02_26_143547_create_stats_active_table', 0),
(4321, '2024_02_26_143547_create_stats_test_table', 0),
(4331, '2024_02_26_143547_create_stats_type_table', 0),
(4341, '2024_02_26_143547_create_task_table', 0),
(4351, '2024_02_26_143547_create_taux_succes_table', 0),
(4361, '2024_02_26_143547_create_taxe_table', 0),
(4371, '2024_02_26_143547_create_taxe_tva_status_table', 0),
(4381, '2024_02_26_143547_create_type_absence_table', 0),
(4391, '2024_02_26_143547_create_type_societe_table', 0),
(4401, '2024_02_26_143547_create_user_table', 0),
(4411, '2024_02_26_143547_create_user_authorisation_notion_value_table', 0),
(4421, '2024_02_26_143547_create_user_authorization_notion_table', 0),
(4431, '2024_02_26_143547_create_user_authorization_objectif_type_table', 0),
(4441, '2024_02_26_143547_create_user_depot_table', 0),
(4451, '2024_02_26_143547_create_user_device_log_table', 0),
(4461, '2024_02_26_143547_create_user_devices_table', 0),
(4471, '2024_02_26_143547_create_user_droit_notion_table', 0),
(4481, '2024_02_26_143547_create_user_droit_notion_type_table', 0),
(4491, '2024_02_26_143547_create_user_invitations_table', 0),
(4501, '2024_02_26_143547_create_user_module_table', 0),
(4511, '2024_02_26_143547_create_user_operation_table', 0),
(4521, '2024_02_26_143547_create_user_operation_log_table', 0),
(4531, '2024_02_26_143547_create_user_rapport_table', 0),
(4541, '2024_02_26_143547_create_user_ressource_table', 0),
(4551, '2024_02_26_143547_create_users_table', 0),
(4561, '2024_02_26_143547_create_users_mission_zone_table', 0),
(4571, '2024_02_26_143547_create_userst_table', 0),
(4581, '2024_02_26_143547_create_vehicule_table', 0),
(4591, '2024_02_26_143547_create_vehicule_carburant_prix_table', 0),
(4601, '2024_02_26_143547_create_vehicule_carburant_type_table', 0),
(4611, '2024_02_26_143547_create_vehicule_classe_table', 0),
(4621, '2024_02_26_143547_create_vehicule_compteur_km_table', 0),
(4631, '2024_02_26_143547_create_vehicule_gpl_type_table', 0),
(4641, '2024_02_26_143547_create_vehicule_remplissage_carburant_table', 0),
(4651, '2024_02_26_143547_create_vehicule_remplissage_carburant_type_table', 0),
(4661, '2024_02_26_143547_create_vehicule_type_table', 0),
(4671, '2024_02_26_143547_create_vehicule_usage_type_table', 0);

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

--
-- Structure de la table `mission`
--

CREATE TABLE `mission` (
  `mission_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `transporter_id` bigint(20) DEFAULT NULL,
  `date_depart` date DEFAULT NULL,
  `date_arrivee` date DEFAULT NULL,
  `heure_depart` time DEFAULT NULL,
  `heure_arrivee` time DEFAULT NULL,
  `vehicle_id` bigint(20) DEFAULT NULL,
  `driver_id` bigint(20) DEFAULT NULL,
  `km_start` double DEFAULT NULL,
  `km_end` double DEFAULT NULL,
  `resume_total_km` int(11) DEFAULT NULL,
  `prevision_date_depart` date DEFAULT NULL,
  `prevision_date_arrivee` date DEFAULT NULL,
  `prevision_heure_depart` time DEFAULT NULL,
  `prevision_heure_arrivee` time DEFAULT NULL,
  `prevision_nombre_bon_carburant` int(11) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT '1',
  `date_arrivee_destination` date DEFAULT NULL,
  `is_accomplished` int(11) DEFAULT NULL,
  `mission_note` text COLLATE utf8_unicode_ci,
  `frais_mission` float DEFAULT NULL,
  `created_by` bigint(20) DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  `bon_type_id` bigint(20) DEFAULT NULL,
  `ods_num` bigint(20) DEFAULT NULL,
  `ods_year` year(4) DEFAULT NULL,
  `current` tinyint(1) DEFAULT NULL,
  `first_destination` bigint(20) DEFAULT NULL,
  `next_ods` bigint(20) DEFAULT NULL,
  `total_remplissage_carburant` int(11) DEFAULT NULL,
  `total_consommation_montant` int(11) DEFAULT NULL,
  `m_montant_ht` float DEFAULT NULL,
  `montant_credits` float DEFAULT NULL,
  `montant_encaissements` float DEFAULT NULL,
  `montant_ventes` float DEFAULT NULL,
  `montant_commandes` float DEFAULT NULL,
  `montant_recouvrement` double DEFAULT NULL,
  `montant_ecart` double DEFAULT NULL,
  `montant_declare` double NOT NULL,
  `validation_caissier` tinyint(1) NOT NULL DEFAULT '0',
  `validation_magasinier` tinyint(1) NOT NULL DEFAULT '0',
  `client_invoice_num` int(11) DEFAULT NULL,
  `client_invoice_year` year(4) DEFAULT NULL,
  `client_bl_num` int(11) DEFAULT NULL,
  `client_bl_year` year(4) DEFAULT NULL,
  `client_bon_chargement_num` int(11) DEFAULT NULL,
  `client_bon_chargement_year` year(4) DEFAULT NULL,
  `transporter_invoice_num` int(11) DEFAULT NULL,
  `transporter_invoice_year` year(4) DEFAULT NULL,
  `transporter_bl_num` int(11) DEFAULT NULL,
  `transporter_bl_year` year(4) DEFAULT NULL,
  `df_client_invoice_num` int(11) DEFAULT NULL,
  `df_client_invoice_year` year(4) DEFAULT NULL,
  `df_client_bl_num` int(11) DEFAULT NULL,
  `df_client_bl_year` year(4) DEFAULT NULL,
  `df_transporter_invoice_num` int(11) DEFAULT NULL,
  `df_transporter_invoice_year` year(4) DEFAULT NULL,
  `df_transporter_bl_num` int(11) DEFAULT NULL,
  `df_transporter_bl_year` year(4) DEFAULT NULL,
  `notifications_driver` int(11) DEFAULT NULL,
  `notifications_client` int(11) DEFAULT NULL,
  `notifications_points` int(11) DEFAULT NULL,
  `nb_caisses` int(11) DEFAULT NULL,
  `nb_cartons` int(11) DEFAULT NULL,
  `nb_fardeaux` int(11) DEFAULT NULL,
  `nb_palettes` int(11) DEFAULT NULL,
  `point_depot_chargement` bigint(20) DEFAULT NULL,
  `quai_chargement` bigint(20) DEFAULT NULL,
  `vehicle_type` int(11) DEFAULT NULL,
  `mission_type` int(11) DEFAULT NULL,
  `is_affected` int(11) DEFAULT NULL,
  `numero_affectation` bigint(20) DEFAULT NULL,
  `annee_affectation` year(4) DEFAULT NULL,
  `is_charged` int(11) DEFAULT NULL,
  `date_chargement` datetime DEFAULT NULL,
  `visa_logistique` int(11) DEFAULT NULL,
  `visa_transporteur` int(11) DEFAULT NULL,
  `visa_client` int(11) DEFAULT NULL,
  `mission_role_id` bigint(20) DEFAULT NULL,
  `mission_route_id` bigint(20) DEFAULT NULL,
  `entreprise_beneficiaire_id` bigint(20) DEFAULT NULL,
  `is_multiple_beneficiaire` tinyint(1) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `validation_caissier_id` bigint(20) DEFAULT NULL,
  `validation_magasinier_id` bigint(20) DEFAULT NULL,
  `is_treated` tinyint(2) DEFAULT NULL,
  `montant` double DEFAULT NULL,
  `is_vente_not_traited` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déclencheurs `mission`
--
DELIMITER $$
CREATE TRIGGER `duplication_check` BEFORE INSERT ON `mission` FOR EACH ROW begin
    /*IF (select EXISTS (select * from mission ms where 	
                       ms.date_depart=new.date_depart 
                       and ms.mission_role_id=new.mission_role_id 
                       and ms.transporter_id=new.transporter_id 
                       and ms.vehicle_id=new.vehicle_id )) then
    signal sqlstate '45000'
    SET MESSAGE_TEXT = "ligne dupliqué";
    END IF ;*/
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trigger_insert_mission_ods` BEFORE INSERT ON `mission` FOR EACH ROW SET new.`ods_num`=
  if((SELECT  MAX(`ods_num`)  
   from `mission` where  entreprise_id=new.entreprise_id and ods_year=YEAR(CURRENT_DATE()) ) is null, 1 ,
  (SELECT  MAX(`ods_num`)+1  from `mission` where  entreprise_id=new.entreprise_id and ods_year=YEAR(CURRENT_DATE())
  )), new.`ods_year`=YEAR(CURRENT_DATE())
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_stats` AFTER UPDATE ON `mission` FOR EACH ROW BEGIN
if(new.validation_magasinier = 1 and old.validation_magasinier=0) THEN
 call setMissionStats(new.mission_id);
end if; 
END
$$
DELIMITER ;

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

--
-- Structure de la table `mission_day_of_month`
--

CREATE TABLE `mission_day_of_month` (
  `mission_day_of_month_day` tinyint(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_day_of_month` (`mission_day_of_month_day`) VALUES
(1),
(2),
(3),
(4),
(5),
(6),
(7),
(8),
(9),
(10),
(11),
(12),
(13),
(14),
(15),
(16),
(17),
(18),
(19),
(20),
(21),
(22),
(23),
(24),
(25),
(26),
(27),
(28),
(29),
(30),
(31);

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

--
-- Structure de la table `mission_day_of_week`
--

CREATE TABLE `mission_day_of_week` (
  `mission_day_of_week_day` tinyint(4) NOT NULL,
  `day_designation` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_day_of_week` (`mission_day_of_week_day`, `day_designation`) VALUES
(1, 'Dimanche'),
(2, 'Lundi'),
(3, 'Mardi'),
(4, 'Mercredi'),
(5, 'Jeudi'),
(6, 'Vendredi'),
(7, 'Samedi');

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

--
-- Structure de la table `mission_declaration_recette`
--

CREATE TABLE `mission_declaration_recette` (
  `mission_id` bigint(20) NOT NULL DEFAULT '0',
  `finance_monnaie_piece_id` bigint(20) NOT NULL DEFAULT '0',
  `nombre_livreur` bigint(20) DEFAULT NULL,
  `montant_livreur` bigint(20) DEFAULT NULL,
  `nombre_caissier` bigint(20) DEFAULT NULL,
  `montant_caissier` bigint(20) DEFAULT NULL,
  `caisse_id` int(10) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_document`
--

CREATE TABLE `mission_document` (
  `mission_id` bigint(20) NOT NULL,
  `document_file_id` bigint(20) NOT NULL,
  `mission_document_designation` varchar(100) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_entreprise`
--

CREATE TABLE `mission_entreprise` (
  `entreprise_id` bigint(20) NOT NULL,
  `entreprise_beneficiaire_id` bigint(20) NOT NULL,
  `entreprise_beneficiaire_priorite` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_entreprise_beneficiaire`
--

CREATE TABLE `mission_entreprise_beneficiaire` (
  `mission_id` bigint(20) NOT NULL,
  `entreprise_beneficiaire_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_eval`
--

CREATE TABLE `mission_eval` (
  `mission_id` bigint(20) NOT NULL,
  `eval_critere_type_id` bigint(20) NOT NULL,
  `mission_critere_evaluation` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_eval` (`mission_id`, `eval_critere_type_id`, `mission_critere_evaluation`) VALUES
(21, 1, 3.5),
(21, 2, 4.5);

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

--
-- Structure de la table `mission_eval_critere_type`
--

CREATE TABLE `mission_eval_critere_type` (
  `eval_critere_type_id` bigint(20) NOT NULL,
  `eval_critere_type_designation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_grid_stats`
--

CREATE TABLE `mission_grid_stats` (
  `mission_id` bigint(20) NOT NULL,
  `mission_role_id` bigint(20) DEFAULT NULL,
  `transporter_id` bigint(20) DEFAULT NULL,
  `mission_route_id` bigint(20) DEFAULT NULL,
  `date_depart` date DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `nbr_clients` bigint(21) DEFAULT '0',
  `visited_clients` decimal(23,0) DEFAULT NULL,
  `visited_clients_percent` decimal(30,4) DEFAULT NULL,
  `succes_nombre` decimal(23,0) DEFAULT NULL,
  `succes_percent` decimal(30,4) DEFAULT NULL,
  `n_vente_nombre` decimal(23,0) DEFAULT NULL,
  `n_vente_percent` decimal(30,4) DEFAULT NULL,
  `n_visite_nombre` decimal(23,0) DEFAULT NULL,
  `n_visite_percent` decimal(30,4) DEFAULT NULL,
  `drop_size` double(17,0) DEFAULT NULL,
  `hr_arrive` time DEFAULT NULL,
  `Hr_depart` time DEFAULT NULL,
  `ecart` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `mission_mission`
--

CREATE TABLE `mission_mission` (
  `mission_id1` bigint(20) NOT NULL,
  `mission_id2` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_missionnaire`
--

CREATE TABLE `mission_missionnaire` (
  `mission_id` bigint(20) NOT NULL DEFAULT '0',
  `missionnaire_id` bigint(20) NOT NULL DEFAULT '0',
  `mission_missionnaire_date_debut` datetime DEFAULT NULL,
  `mission_missionnaire_date_debut_day` date DEFAULT NULL,
  `mission_missionnaire_date_fin` datetime DEFAULT NULL,
  `mission_missionnaire_date_fin_day` date DEFAULT NULL,
  `mission_missionnaire_responsable` bigint(20) DEFAULT NULL,
  `mission_missionnaire_motif_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_missionnaire_motif`
--

CREATE TABLE `mission_missionnaire_motif` (
  `mission_missionnaire_motif_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `mission_role_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_missionnaire_motif` (`mission_missionnaire_motif_id`, `entreprise_id`, `mission_role_designation`) VALUES
(1, 305, 'Prevente'),
(2, 305, 'Vente');

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

--
-- Structure de la table `mission_params_missionnaire_list`
--

CREATE TABLE `mission_params_missionnaire_list` (
  `entreprise_id` bigint(20) NOT NULL,
  `transporteur_id` bigint(20) NOT NULL,
  `missionnaire_id` bigint(20) NOT NULL,
  `missionnaire_role` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_params_missionnaire_list` (`entreprise_id`, `transporteur_id`, `missionnaire_id`, `missionnaire_role`) VALUES
(305, 2678, 2770, 357),
(305, 305, 2845, 351),
(305, 933, 1046, 2),
(305, 121, 2630, 350),
(305, 305, 906, 1);

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

--
-- Structure de la table `mission_params_point_depart`
--

CREATE TABLE `mission_params_point_depart` (
  `entreprise_id` bigint(20) NOT NULL,
  `entreprise_beneficiaire_id` bigint(20) NOT NULL,
  `point_chargement_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_params_vehicule_list`
--

CREATE TABLE `mission_params_vehicule_list` (
  `entreprise_id` bigint(20) NOT NULL,
  `transporteur_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) NOT NULL,
  `mission_role_id` bigint(20) NOT NULL,
  `vehicule_cargo_type_id` bigint(20) NOT NULL,
  `vehicule_cargo_poids_max` bigint(20) NOT NULL,
  `vehicule_max_distance_route` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_params_vehicule_list` (`entreprise_id`, `transporteur_id`, `vehicule_id`, `mission_role_id`, `vehicule_cargo_type_id`, `vehicule_cargo_poids_max`, `vehicule_max_distance_route`) VALUES
(305, 933, 2, 350, 4, 5, 5),
(305, 2827, 5, 357, 4, 1, 60),
(305, 117, 3, 350, 3, 1, 25),
(305, 2537, 5, 351, 4, 4, 2000),
(305, 1001, 5, 1, 2, 1, 150),
(305, 2, 920, 1, 4, 18, 45000);

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

--
-- Structure de la table `mission_planning`
--

CREATE TABLE `mission_planning` (
  `mission_planning_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `mission_planning_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mission_planning_created_by` bigint(20) DEFAULT NULL,
  `mission_planning_created_date` datetime DEFAULT NULL,
  `mission_planning_zone_id` bigint(20) DEFAULT NULL,
  `mission_planning_vahicle_id` bigint(20) DEFAULT NULL,
  `mission_planning_driver_id` bigint(20) DEFAULT NULL,
  `mission_planning_vendeur_id` bigint(20) DEFAULT NULL,
  `mission_planning_periodicite_id` bigint(20) DEFAULT NULL,
  `mission_role_id` bigint(20) DEFAULT NULL,
  `entreprise_beneficiaire_id` bigint(20) DEFAULT NULL,
  `is_multiple_beneficiaire` tinyint(1) DEFAULT NULL,
  `route_type_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_planning_missionnaire`
--

CREATE TABLE `mission_planning_missionnaire` (
  `mission_planning_id` bigint(20) NOT NULL DEFAULT '0',
  `contact_id` bigint(20) NOT NULL DEFAULT '0',
  `mission_planning_missionnaire_date_debut` datetime DEFAULT NULL,
  `mission_planning_missionnaire_date_debut_day` date DEFAULT NULL,
  `mission_planning_missionnaire_date_fin` datetime DEFAULT NULL,
  `mission_planning_missionnaire_date_fin_day` date DEFAULT NULL,
  `mission_planning_missionnaire_responsable` tinyint(1) DEFAULT NULL,
  `mission_planning_missionnaire_motif_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_planning_missionnaire_motif`
--

CREATE TABLE `mission_planning_missionnaire_motif` (
  `mission_planning_missionnaire_motif_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `mission_planning_role_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_planning_missionnaire_motif` (`mission_planning_missionnaire_motif_id`, `entreprise_id`, `mission_planning_role_designation`) VALUES
(1, 305, 'Prevent'),
(2, 305, 'Vente');

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

--
-- Structure de la table `mission_planning_periodicite`
--

CREATE TABLE `mission_planning_periodicite` (
  `mission_planning_periodicite_id` bigint(20) NOT NULL,
  `mission_planning_periodicite_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_planning_periodicite` (`mission_planning_periodicite_id`, `mission_planning_periodicite_designation`) VALUES
(1, 'Hebdomadaire'),
(2, 'Mensuelle');

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

--
-- Structure de la table `mission_planning_value`
--

CREATE TABLE `mission_planning_value` (
  `mission_planning_id` bigint(20) NOT NULL DEFAULT '0',
  `mission_day_of_month_day` tinyint(4) NOT NULL DEFAULT '0',
  `mission_day_of_week_day` tinyint(4) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_planning_value_client`
--

CREATE TABLE `mission_planning_value_client` (
  `mission_planning_id` bigint(20) NOT NULL,
  `mission_day_of_month_day` tinyint(4) NOT NULL,
  `mission_day_of_week_day` tinyint(4) NOT NULL,
  `client_id` bigint(20) NOT NULL,
  `is_active` tinyint(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_poids`
--

CREATE TABLE `mission_poids` (
  `mission_poids_id` bigint(20) NOT NULL,
  `mission_poids_value` double NOT NULL,
  `mission_poids_unite` varchar(10) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_point`
--

CREATE TABLE `mission_point` (
  `m_mission_point_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `customer_id` bigint(20) DEFAULT NULL,
  `missionnaire_responsable_id` bigint(20) DEFAULT NULL,
  `point_id_depart` bigint(20) DEFAULT NULL,
  `point_id_arrivee` bigint(20) DEFAULT NULL,
  `motif_id` bigint(100) DEFAULT NULL,
  `mission_id` bigint(20) DEFAULT NULL,
  `mp_depense_mission` float DEFAULT NULL,
  `mp_date_depart` date DEFAULT NULL,
  `mp_date_arrivee` date DEFAULT NULL,
  `mp_heure_depart` time DEFAULT NULL,
  `mp_heure_arrivee` time DEFAULT NULL,
  `ordre` bigint(20) DEFAULT NULL,
  `mp_durree` bigint(20) DEFAULT NULL,
  `rentabiliser` tinyint(1) DEFAULT NULL,
  `mp_montant_ht` float DEFAULT NULL,
  `mp_total_km` bigint(20) DEFAULT NULL,
  `mp_total_time` bigint(20) DEFAULT NULL,
  `mp_remaining_time` bigint(20) DEFAULT NULL,
  `mp_remaining_distance` bigint(20) DEFAULT NULL,
  `mp_nb_bon_carburant` int(11) DEFAULT NULL,
  `mp_nbr_jours` smallint(6) DEFAULT NULL,
  `mp_nbr_heures` smallint(6) DEFAULT NULL,
  `temps_passe_client` time DEFAULT NULL,
  `status` smallint(6) NOT NULL DEFAULT '1',
  `status_percent` int(11) DEFAULT NULL,
  `remplissage_carburant` float DEFAULT NULL,
  `position_date` datetime DEFAULT NULL,
  `position_longitude` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `position_latitude` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `parking_status` int(11) DEFAULT NULL,
  `parking_date` datetime DEFAULT NULL,
  `parking_limit_time` int(11) DEFAULT NULL,
  `parking_limit_distance` int(11) DEFAULT NULL,
  `parking_alerted` int(11) DEFAULT NULL,
  `parking_alert_date` datetime DEFAULT NULL,
  `parking_alert_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `recouvrement` double DEFAULT NULL,
  `paiement` double DEFAULT NULL,
  `remarque` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `existe_photos` tinyint(1) NOT NULL,
  `is_planned` tinyint(2) DEFAULT '0',
  `annulation_raison_id` int(11) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_point_annulation_raison`
--

CREATE TABLE `mission_point_annulation_raison` (
  `raison_id` tinyint(4) NOT NULL,
  `raison_designation` varchar(256) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_point_annulation_raison` (`raison_id`, `raison_designation`) VALUES
(1, 'Fermé'),
(2, 'Responsable absent'),
(3, 'Produits disponible'),
(4, 'No vente'),
(5, 'Achat auprès d’autres fournisseurs'),
(6, 'Visite reportée : Route inaccessible'),
(7, 'Visite reportée : Temps insuffisants'),
(8, 'Fausse Commande');

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

--
-- Structure de la table `mission_point_media_documentfile`
--

CREATE TABLE `mission_point_media_documentfile` (
  `mission_point_media_documentfile_id` bigint(20) NOT NULL,
  `mission_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) NOT NULL,
  `point_id` bigint(20) NOT NULL,
  `document_path` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `document_name` varchar(56) COLLATE utf8_unicode_ci DEFAULT NULL,
  `upload_date` date DEFAULT NULL,
  `upload_date_time` datetime DEFAULT NULL,
  `upload_by` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déclencheurs `mission_point_media_documentfile`
--
DELIMITER $$
CREATE TRIGGER `update_exist_photo` BEFORE INSERT ON `mission_point_media_documentfile` FOR EACH ROW BEGIN update mission_point mp set mp.existe_photos=1 where mp.m_mission_point_id=new.point_id;
 end
$$
DELIMITER ;

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

--
-- Structure de la table `mission_point_status`
--

CREATE TABLE `mission_point_status` (
  `mission_point_status_id` int(11) NOT NULL,
  `mission_point_status_designation` varchar(50) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_point_status` (`mission_point_status_id`, `mission_point_status_designation`) VALUES
(3, 'Reste à visiter (En cours)'),
(4, 'Visite avec succès'),
(5, 'Visite sans commande'),
(6, 'Non visité '),
(1, 'préparé ');

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

--
-- Structure de la table `mission_ressource`
--

CREATE TABLE `mission_ressource` (
  `mission_id` bigint(20) NOT NULL DEFAULT '0',
  `ressource_id` bigint(20) NOT NULL DEFAULT '0',
  `date_debut` datetime DEFAULT NULL,
  `date_fin` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_ressource` (`mission_id`, `ressource_id`, `date_debut`, `date_fin`) VALUES
(2, 3, NULL, NULL),
(21, 21, '2019-06-13 00:00:00', '2019-06-29 00:00:00'),
(21, 800, '2020-03-18 00:00:00', '2020-04-23 00:00:00');

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

--
-- Structure de la table `mission_role`
--

CREATE TABLE `mission_role` (
  `mission_role_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `mission_role_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_role` (`mission_role_id`, `entreprise_id`, `mission_role_designation`) VALUES
(1, 122, 'Livraison'),
(2, 122, 'Collecte'),
(3, 122, 'Transport malade'),
(4, 122, 'Transport personnel'),
(5, 122, 'Transport dépannage'),
(6, 122, 'Administration'),
(7, 305, 'Livraison'),
(8, 305, 'Collecte'),
(9, 305, 'Transport malade'),
(10, 305, 'Transport personnel'),
(11, 305, 'Transport dépannage'),
(12, 305, 'Administration'),
(13, 548, 'Livraison'),
(14, 548, 'Collecte'),
(15, 548, 'Transport malade'),
(16, 548, 'Transport personnel'),
(17, 548, 'Transport dépannage'),
(18, 548, 'Administration'),
(19, 549, 'Livraison'),
(20, 549, 'Collecte'),
(21, 549, 'Transport malade'),
(22, 549, 'Transport personnel'),
(23, 549, 'Transport dépannage'),
(24, 549, 'Administration'),
(25, 550, 'Livraison'),
(26, 550, 'Collecte'),
(27, 550, 'Transport malade'),
(28, 550, 'Transport personnel'),
(29, 550, 'Transport dépannage'),
(30, 550, 'Administration'),
(31, 551, 'Livraison'),
(32, 551, 'Collecte'),
(33, 551, 'Transport malade'),
(34, 551, 'Transport personnel'),
(35, 551, 'Transport dépannage'),
(36, 551, 'Administration'),
(37, 552, 'Livraison'),
(38, 552, 'Collecte'),
(39, 552, 'Transport malade'),
(40, 552, 'Transport personnel'),
(41, 552, 'Transport dépannage'),
(42, 552, 'Administration'),
(43, 553, 'Livraison'),
(44, 553, 'Collecte'),
(45, 553, 'Transport malade'),
(46, 553, 'Transport personnel'),
(47, 553, 'Transport dépannage'),
(48, 553, 'Administration'),
(49, 554, 'Livraison'),
(50, 554, 'Collecte'),
(51, 554, 'Transport malade'),
(52, 554, 'Transport personnel'),
(53, 554, 'Transport dépannage'),
(54, 554, 'Administration'),
(55, 555, 'Livraison'),
(56, 555, 'Collecte'),
(57, 555, 'Transport malade'),
(58, 555, 'Transport personnel'),
(59, 555, 'Transport dépannage'),
(60, 555, 'Administration'),
(61, 556, 'Livraison'),
(62, 556, 'Collecte'),
(63, 556, 'Transport malade'),
(64, 556, 'Transport personnel'),
(65, 556, 'Transport dépannage'),
(66, 556, 'Administration'),
(67, 562, 'Livraison'),
(68, 562, 'Collecte'),
(69, 562, 'Transport malade'),
(70, 562, 'Transport personnel'),
(71, 562, 'Transport dépannage'),
(72, 562, 'Administration'),
(73, 563, 'Livraison'),
(74, 563, 'Collecte'),
(75, 563, 'Transport malade'),
(76, 563, 'Transport personnel'),
(77, 563, 'Transport dépannage'),
(78, 563, 'Administration'),
(79, 564, 'Livraison'),
(80, 564, 'Collecte'),
(81, 564, 'Transport malade'),
(82, 564, 'Transport personnel'),
(83, 564, 'Transport dépannage'),
(84, 564, 'Administration'),
(85, 565, 'Livraison'),
(86, 565, 'Collecte'),
(87, 565, 'Transport malade'),
(88, 565, 'Transport personnel'),
(89, 565, 'Transport dépannage'),
(90, 565, 'Administration'),
(91, 566, 'Livraison'),
(92, 566, 'Collecte'),
(93, 566, 'Transport malade'),
(94, 566, 'Transport personnel'),
(95, 566, 'Transport dépannage'),
(96, 566, 'Administration'),
(97, 567, 'Livraison'),
(98, 567, 'Collecte'),
(99, 567, 'Transport malade'),
(100, 567, 'Transport personnel'),
(101, 567, 'Transport dépannage'),
(102, 567, 'Administration'),
(103, 568, 'Livraison'),
(104, 568, 'Collecte'),
(105, 568, 'Transport malade'),
(106, 568, 'Transport personnel'),
(107, 568, 'Transport dépannage'),
(108, 568, 'Administration'),
(109, 569, 'Livraison'),
(110, 569, 'Collecte'),
(111, 569, 'Transport malade'),
(112, 569, 'Transport personnel'),
(113, 569, 'Transport dépannage'),
(114, 569, 'Administration'),
(115, 570, 'Livraison'),
(116, 570, 'Collecte'),
(117, 570, 'Transport malade'),
(118, 570, 'Transport personnel'),
(119, 570, 'Transport dépannage'),
(120, 570, 'Administration'),
(121, 571, 'Livraison'),
(122, 571, 'Collecte'),
(123, 571, 'Transport malade'),
(124, 571, 'Transport personnel'),
(125, 571, 'Transport dépannage'),
(126, 571, 'Administration'),
(127, 584, 'Livraison'),
(128, 584, 'Collecte'),
(129, 584, 'Transport malade'),
(130, 584, 'Transport personnel'),
(131, 584, 'Transport dépannage'),
(132, 584, 'Administration'),
(133, 585, 'Livraison'),
(134, 585, 'Collecte'),
(135, 585, 'Transport malade'),
(136, 585, 'Transport personnel'),
(137, 585, 'Transport dépannage'),
(138, 585, 'Administration'),
(139, 586, 'Livraison'),
(140, 586, 'Collecte'),
(141, 586, 'Transport malade'),
(142, 586, 'Transport personnel'),
(143, 586, 'Transport dépannage'),
(144, 586, 'Administration'),
(145, 587, 'Livraison'),
(146, 587, 'Collecte'),
(147, 587, 'Transport malade'),
(148, 587, 'Transport personnel'),
(149, 587, 'Transport dépannage'),
(150, 587, 'Administration'),
(151, 588, 'Livraison'),
(152, 588, 'Collecte'),
(153, 588, 'Transport malade'),
(154, 588, 'Transport personnel'),
(155, 588, 'Transport dépannage'),
(156, 588, 'Administration'),
(157, 589, 'Livraison'),
(158, 589, 'Collecte'),
(159, 589, 'Transport malade'),
(160, 589, 'Transport personnel'),
(161, 589, 'Transport dépannage'),
(162, 589, 'Administration'),
(163, 590, 'Livraison'),
(164, 590, 'Collecte'),
(165, 590, 'Transport malade'),
(166, 590, 'Transport personnel'),
(167, 590, 'Transport dépannage'),
(168, 590, 'Administration'),
(169, 591, 'Livraison'),
(170, 591, 'Collecte'),
(171, 591, 'Transport malade'),
(172, 591, 'Transport personnel'),
(173, 591, 'Transport dépannage'),
(174, 591, 'Administration'),
(175, 592, 'Livraison'),
(176, 592, 'Collecte'),
(177, 592, 'Transport malade'),
(178, 592, 'Transport personnel'),
(179, 592, 'Transport dépannage'),
(180, 592, 'Administration'),
(181, 593, 'Livraison'),
(182, 593, 'Collecte'),
(183, 593, 'Transport malade'),
(184, 593, 'Transport personnel'),
(185, 593, 'Transport dépannage'),
(186, 593, 'Administration'),
(187, 594, 'Livraison'),
(188, 594, 'Collecte'),
(189, 594, 'Transport malade'),
(190, 594, 'Transport personnel'),
(191, 594, 'Transport dépannage'),
(192, 594, 'Administration'),
(193, 595, 'Livraison'),
(194, 595, 'Collecte'),
(195, 595, 'Transport malade'),
(196, 595, 'Transport personnel'),
(197, 595, 'Transport dépannage'),
(198, 595, 'Administration'),
(199, 596, 'Livraison'),
(200, 596, 'Collecte'),
(201, 596, 'Transport malade'),
(202, 596, 'Transport personnel'),
(203, 596, 'Transport dépannage'),
(204, 596, 'Administration'),
(205, 597, 'Livraison'),
(206, 597, 'Collecte'),
(207, 597, 'Transport malade'),
(208, 597, 'Transport personnel'),
(209, 597, 'Transport dépannage'),
(210, 597, 'Administration'),
(211, 598, 'Livraison'),
(212, 598, 'Collecte'),
(213, 598, 'Transport malade'),
(214, 598, 'Transport personnel'),
(215, 598, 'Transport dépannage'),
(216, 598, 'Administration'),
(217, 599, 'Livraison'),
(218, 599, 'Collecte'),
(219, 599, 'Transport malade'),
(220, 599, 'Transport personnel'),
(221, 599, 'Transport dépannage'),
(222, 599, 'Administration'),
(223, 600, 'Livraison'),
(224, 600, 'Collecte'),
(225, 600, 'Transport malade'),
(226, 600, 'Transport personnel'),
(227, 600, 'Transport dépannage'),
(228, 600, 'Administration'),
(229, 601, 'Livraison'),
(230, 601, 'Collecte'),
(231, 601, 'Transport malade'),
(232, 601, 'Transport personnel'),
(233, 601, 'Transport dépannage'),
(234, 601, 'Administration'),
(235, 602, 'Livraison'),
(236, 602, 'Collecte'),
(237, 602, 'Transport malade'),
(238, 602, 'Transport personnel'),
(239, 602, 'Transport dépannage'),
(240, 602, 'Administration'),
(241, 603, 'Livraison'),
(242, 603, 'Collecte'),
(243, 603, 'Transport malade'),
(244, 603, 'Transport personnel'),
(245, 603, 'Transport dépannage'),
(246, 603, 'Administration'),
(247, 604, 'Livraison'),
(248, 604, 'Collecte'),
(249, 604, 'Transport malade'),
(250, 604, 'Transport personnel'),
(251, 604, 'Transport dépannage'),
(252, 604, 'Administration'),
(253, 605, 'Livraison'),
(254, 605, 'Collecte'),
(255, 605, 'Transport malade'),
(256, 605, 'Transport personnel'),
(257, 605, 'Transport dépannage'),
(258, 605, 'Administration'),
(259, 606, 'Livraison'),
(260, 606, 'Collecte'),
(261, 606, 'Transport malade'),
(262, 606, 'Transport personnel'),
(263, 606, 'Transport dépannage'),
(264, 606, 'Administration'),
(265, 607, 'Livraison'),
(266, 607, 'Collecte'),
(267, 607, 'Transport malade'),
(268, 607, 'Transport personnel'),
(269, 607, 'Transport dépannage'),
(270, 607, 'Administration'),
(271, 608, 'Livraison'),
(272, 608, 'Collecte'),
(273, 608, 'Transport malade'),
(274, 608, 'Transport personnel'),
(275, 608, 'Transport dépannage'),
(276, 608, 'Administration'),
(277, 609, 'Livraison'),
(278, 609, 'Collecte'),
(279, 609, 'Transport malade'),
(280, 609, 'Transport personnel'),
(281, 609, 'Transport dépannage'),
(282, 609, 'Administration'),
(283, 610, 'Livraison'),
(284, 610, 'Collecte'),
(285, 610, 'Transport malade'),
(286, 610, 'Transport personnel'),
(287, 610, 'Transport dépannage'),
(288, 610, 'Administration'),
(289, 611, 'Livraison'),
(290, 611, 'Collecte'),
(291, 611, 'Transport malade'),
(292, 611, 'Transport personnel'),
(293, 611, 'Transport dépannage'),
(294, 611, 'Administration'),
(295, 612, 'Livraison'),
(296, 612, 'Collecte'),
(297, 612, 'Transport malade'),
(298, 612, 'Transport personnel'),
(299, 612, 'Transport dépannage'),
(300, 612, 'Administration'),
(301, 613, 'Livraison'),
(302, 613, 'Collecte'),
(303, 613, 'Transport malade'),
(304, 613, 'Transport personnel'),
(305, 613, 'Transport dépannage'),
(306, 613, 'Administration'),
(307, 614, 'Livraison'),
(308, 614, 'Collecte'),
(309, 614, 'Transport malade'),
(310, 614, 'Transport personnel'),
(311, 614, 'Transport dépannage'),
(312, 614, 'Administration'),
(313, 615, 'Livraison'),
(314, 615, 'Collecte'),
(315, 615, 'Transport malade'),
(316, 615, 'Transport personnel'),
(317, 615, 'Transport dépannage'),
(318, 615, 'Administration'),
(319, 616, 'Livraison'),
(320, 616, 'Collecte'),
(321, 616, 'Transport malade'),
(322, 616, 'Transport personnel'),
(323, 616, 'Transport dépannage'),
(324, 616, 'Administration'),
(325, 617, 'Livraison'),
(326, 617, 'Collecte'),
(327, 617, 'Transport malade'),
(328, 617, 'Transport personnel'),
(329, 617, 'Transport dépannage'),
(330, 617, 'Administration'),
(331, 618, 'Livraison'),
(332, 618, 'Collecte'),
(333, 618, 'Transport malade'),
(334, 618, 'Transport personnel'),
(335, 618, 'Transport dépannage'),
(336, 618, 'Administration'),
(337, 619, 'Livraison'),
(338, 619, 'Collecte'),
(339, 619, 'Transport malade'),
(340, 619, 'Transport personnel'),
(341, 619, 'Transport dépannage'),
(342, 619, 'Administration'),
(343, 620, 'Livraison'),
(344, 620, 'Collecte'),
(345, 620, 'Transport malade'),
(346, 620, 'Transport personnel'),
(347, 620, 'Transport dépannage'),
(348, 620, 'Administration'),
(349, 621, 'Livraison'),
(350, 621, 'Collecte'),
(351, 621, 'Transport malade'),
(352, 621, 'Transport personnel'),
(353, 621, 'Transport dépannage'),
(354, 621, 'Administration'),
(355, 622, 'Livraison'),
(356, 622, 'Collecte'),
(357, 622, 'Transport malade'),
(358, 622, 'Transport personnel'),
(359, 622, 'Transport dépannage'),
(360, 622, 'Administration'),
(361, 623, 'Livraison'),
(362, 623, 'Collecte'),
(363, 623, 'Transport malade'),
(364, 623, 'Transport personnel'),
(365, 623, 'Transport dépannage'),
(366, 623, 'Administration'),
(367, 624, 'Livraison'),
(368, 624, 'Collecte'),
(369, 624, 'Transport malade'),
(370, 624, 'Transport personnel'),
(371, 624, 'Transport dépannage'),
(372, 624, 'Administration'),
(373, 634, 'Livraison'),
(374, 634, 'Collecte'),
(375, 634, 'Transport malade'),
(376, 634, 'Transport personnel'),
(377, 634, 'Transport dépannage'),
(378, 634, 'Administration'),
(379, 649, 'Livraison'),
(380, 649, 'Collecte'),
(381, 649, 'Transport malade'),
(382, 649, 'Transport personnel'),
(383, 649, 'Transport dépannage'),
(384, 649, 'Administration'),
(385, 650, 'Livraison'),
(386, 650, 'Collecte'),
(387, 650, 'Transport malade'),
(388, 650, 'Transport personnel'),
(389, 650, 'Transport dépannage'),
(390, 650, 'Administration'),
(391, 651, 'Livraison'),
(392, 651, 'Collecte'),
(393, 651, 'Transport malade'),
(394, 651, 'Transport personnel'),
(395, 651, 'Transport dépannage'),
(396, 651, 'Administration'),
(397, 652, 'Livraison'),
(398, 652, 'Collecte'),
(399, 652, 'Transport malade'),
(400, 652, 'Transport personnel'),
(401, 652, 'Transport dépannage'),
(402, 652, 'Administration'),
(403, 654, 'Livraison'),
(404, 654, 'Collecte'),
(405, 654, 'Transport malade'),
(406, 654, 'Transport personnel'),
(407, 654, 'Transport dépannage'),
(408, 654, 'Administration'),
(409, 655, 'Livraison'),
(410, 655, 'Collecte'),
(411, 655, 'Transport malade'),
(412, 655, 'Transport personnel'),
(413, 655, 'Transport dépannage'),
(414, 655, 'Administration'),
(415, 2957, 'Livraison'),
(416, 2957, 'Collecte'),
(417, 2957, 'Transport malade'),
(418, 2957, 'Transport personnel'),
(419, 2957, 'Transport dépannage'),
(420, 2957, 'Administration');

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

--
-- Structure de la table `mission_sortie`
--

CREATE TABLE `mission_sortie` (
  `mission_sortie_id` bigint(20) NOT NULL,
  `mission_sortie_date` datetime DEFAULT NULL,
  `mission_sortie_date_debut` datetime DEFAULT NULL,
  `mission_sortie_date_fin` datetime DEFAULT NULL,
  `mission_id` bigint(20) DEFAULT NULL,
  `mission_sortie_designation` varchar(56) COLLATE utf8_unicode_ci DEFAULT NULL,
  `wilaya_id` int(11) DEFAULT NULL,
  `chef_zone_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_sortie` (`mission_sortie_id`, `mission_sortie_date`, `mission_sortie_date_debut`, `mission_sortie_date_fin`, `mission_id`, `mission_sortie_designation`, `wilaya_id`, `chef_zone_id`) VALUES
(8, '2020-08-04 00:00:00', '2020-08-04 00:00:00', '2020-08-04 00:00:00', NULL, 'missions day 1', NULL, NULL),
(2, '2020-08-04 00:00:00', '2020-08-04 00:00:00', '2020-08-04 00:00:00', NULL, 'missions day 1', NULL, 305),
(4, '2020-09-30 00:00:00', '2020-09-30 00:00:00', '2020-11-19 00:00:00', NULL, 'Sortie 5', NULL, NULL),
(5, '2020-09-23 00:00:00', '2020-09-23 00:00:00', '2020-09-23 00:00:00', NULL, 'Sortie 33', NULL, NULL),
(7, '2020-10-03 00:00:00', '2020-10-03 00:00:00', '2020-10-03 00:00:00', NULL, 'sortie planifie', NULL, NULL),
(9, '2020-10-21 00:00:00', '2020-10-21 00:00:00', '2020-10-21 00:00:00', NULL, 'Sortie du 21 au 23', NULL, NULL);

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

--
-- Structure de la table `mission_sortie_ligne`
--

CREATE TABLE `mission_sortie_ligne` (
  `mission_sortie_ligne_id` bigint(20) NOT NULL,
  `mission_sortie_id` bigint(20) DEFAULT NULL,
  `article_id` bigint(20) DEFAULT NULL,
  `detail` double DEFAULT NULL,
  `compte` double DEFAULT NULL,
  `gros` double DEFAULT NULL,
  `fardeaux` double DEFAULT NULL,
  `palettes` double DEFAULT NULL,
  `total_palettes` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_sortie_ligne` (`mission_sortie_ligne_id`, `mission_sortie_id`, `article_id`, `detail`, `compte`, `gros`, `fardeaux`, `palettes`, `total_palettes`) VALUES
(1, 1, 10001, 25, NULL, NULL, NULL, NULL, NULL),
(2, 1, 10002, 26, NULL, NULL, NULL, NULL, NULL),
(3, 1, 10003, 27, NULL, NULL, NULL, NULL, NULL),
(4, 1, 10004, 28, NULL, NULL, NULL, NULL, NULL);

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

--
-- Structure de la table `mission_status`
--

CREATE TABLE `mission_status` (
  `mission_status_id` int(11) NOT NULL,
  `mission_status_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_status` (`mission_status_id`, `mission_status_designation`) VALUES
(1, 'Préparée'),
(3, 'En cours'),
(4, 'Terminée'),
(5, 'Annulée');

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

--
-- Structure de la table `mission_transporteur`
--

CREATE TABLE `mission_transporteur` (
  `entreprise_id` bigint(20) NOT NULL,
  `transporteur_id` bigint(20) NOT NULL,
  `transporteur_priorite` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_type_cargo`
--

CREATE TABLE `mission_type_cargo` (
  `mission_type_cargo_id` bigint(20) NOT NULL,
  `mission_type_cargo_designation` varchar(100) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_type_cargo` (`mission_type_cargo_id`, `mission_type_cargo_designation`) VALUES
(1, 'Frigo'),
(2, 'Benne'),
(3, 'Bus'),
(4, 'Véhicule'),
(5, 'Conteneur');

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

--
-- Structure de la table `mission_zone`
--

CREATE TABLE `mission_zone` (
  `zone_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `zone_contact_id` bigint(20) DEFAULT NULL,
  `parent_zone_id` bigint(20) DEFAULT NULL,
  `zone_type_id` int(11) DEFAULT NULL,
  `zone_point_id` bigint(100) DEFAULT NULL,
  `zone_designation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_time` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_kilometrage` float DEFAULT NULL,
  `depot_id` bigint(20) DEFAULT NULL,
  `zone_responsable_id` bigint(20) DEFAULT NULL,
  `entreprise_beneficiaire_id` bigint(20) DEFAULT NULL,
  `next_client_code` int(20) NOT NULL DEFAULT '0',
  `zone_designation_new_code` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `next_client_code_updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `segment` json DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déclencheurs `mission_zone`
--
DELIMITER $$
CREATE TRIGGER `create_ressource` AFTER INSERT ON `mission_zone` FOR EACH ROW BEGIN
if(new.zone_type_id=2)THEN
insert into ressource(ressource_id,ressource_type_id,ressource_designation,zone_id,entreprise_id)VALUES(null,-3,new.zone_designation,new.zone_id,new.entreprise_id);
end if ;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_ressource` BEFORE UPDATE ON `mission_zone` FOR EACH ROW BEGIN
if(new.zone_type_id=2 and old.zone_designation<>new.zone_designation)THEN
update ressource set ressource_designation=new.zone_designation where zone_id=new.zone_id;
end if ;
END
$$
DELIMITER ;

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

--
-- Structure de la table `mission_zone_26092021`
--

CREATE TABLE `mission_zone_26092021` (
  `zone_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `zone_contact_id` bigint(20) DEFAULT NULL,
  `parent_zone_id` bigint(20) DEFAULT NULL,
  `zone_type_id` int(11) DEFAULT NULL,
  `zone_point_id` bigint(100) DEFAULT NULL,
  `zone_designation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_time` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_kilometrage` float DEFAULT NULL,
  `depot_id` bigint(20) DEFAULT NULL,
  `zone_responsable_id` bigint(20) DEFAULT NULL,
  `entreprise_beneficiaire_id` bigint(20) DEFAULT NULL,
  `next_client_code` int(20) NOT NULL DEFAULT '0',
  `zone_designation_new_code` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `next_client_code_updated_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_zone_contact`
--

CREATE TABLE `mission_zone_contact` (
  `zone_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL,
  `type_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déclencheurs `mission_zone_contact`
--
DELIMITER $$
CREATE TRIGGER `edit_mission_planning` AFTER INSERT ON `mission_zone_contact` FOR EACH ROW BEGIN
if(new.type_id=1)then
update mission_planning  mp set mp.mission_planning_vendeur_id=new.contact_id
where mp.mission_planning_zone_id=new.zone_id and mp.mission_role_id=1;
end if;
if(new.type_id=2)then
update mission_planning  mp set mp.mission_planning_vendeur_id=new.contact_id
where mp.mission_planning_zone_id=new.zone_id and mp.mission_role_id=2;
end if;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `edit_mission_planning2` BEFORE INSERT ON `mission_zone_contact` FOR EACH ROW BEGIN
if(new.type_id=1)then
update mission_planning  mp set mp.mission_planning_vendeur_id=new.contact_id
where mp.mission_planning_zone_id=new.zone_id and mp.mission_role_id=1;
end if;
if(new.type_id=2)then
update mission_planning  mp set mp.mission_planning_vendeur_id=new.contact_id
where mp.mission_planning_zone_id=new.zone_id and mp.mission_role_id=2;
end if;
END
$$
DELIMITER ;

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

--
-- Structure de la table `mission_zone_old`
--

CREATE TABLE `mission_zone_old` (
  `zone_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `zone_contact_id` bigint(20) DEFAULT NULL,
  `parent_zone_id` bigint(20) DEFAULT NULL,
  `zone_type_id` int(11) DEFAULT NULL,
  `zone_point_id` bigint(100) DEFAULT NULL,
  `zone_designation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_time` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_kilometrage` float DEFAULT NULL,
  `depot_id` bigint(20) DEFAULT NULL,
  `zone_responsable_id` bigint(20) DEFAULT NULL,
  `entreprise_beneficiaire_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_zone_params`
--

CREATE TABLE `mission_zone_params` (
  `zone_id` bigint(20) NOT NULL,
  `transporter_id` bigint(20) NOT NULL,
  `vehicle_type_id` int(11) NOT NULL,
  `total_km` int(11) NOT NULL,
  `prix_ht` float DEFAULT NULL,
  `nb_bons` int(11) DEFAULT NULL,
  `frais` float DEFAULT NULL,
  `frais_km` float DEFAULT NULL,
  `delai` int(11) DEFAULT NULL,
  `accept_client` tinyint(1) DEFAULT NULL,
  `accept_transporter` tinyint(1) DEFAULT NULL,
  `mission_role_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_zone_params_missionnaire`
--

CREATE TABLE `mission_zone_params_missionnaire` (
  `zone_id` bigint(20) NOT NULL,
  `transporteur_id` bigint(20) NOT NULL,
  `vehicle_type_id` int(11) NOT NULL,
  `missionnaire_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) NOT NULL,
  `missionnaire_motif_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_zone_parcours`
--

CREATE TABLE `mission_zone_parcours` (
  `zone_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) DEFAULT NULL,
  `livreur_id` bigint(20) DEFAULT NULL,
  `designation` varchar(50) CHARACTER SET latin1 NOT NULL,
  `route_type_id` int(11) NOT NULL,
  `prevendeur_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_zone_ramy`
--

CREATE TABLE `mission_zone_ramy` (
  `zone_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `zone_contact_id` bigint(20) DEFAULT NULL,
  `parent_zone_id` bigint(20) DEFAULT NULL,
  `zone_type_id` int(11) DEFAULT NULL,
  `zone_point_id` bigint(100) DEFAULT NULL,
  `zone_designation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_time` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `total_kilometrage` float DEFAULT NULL,
  `depot_id` bigint(20) DEFAULT NULL,
  `zone_responsable_id` bigint(20) DEFAULT NULL,
  `entreprise_beneficiaire_id` bigint(20) DEFAULT NULL,
  `next_client_code` int(20) NOT NULL DEFAULT '0',
  `zone_designation_new_code` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `next_client_code_updated_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mission_zone_type`
--

CREATE TABLE `mission_zone_type` (
  `zone_type_id` int(11) NOT NULL,
  `zone_type_designation` varchar(256) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mission_zone_type` (`zone_type_id`, `zone_type_designation`) VALUES
(1, 'Secteur'),
(2, 'Route'),
(3, 'Iteniraire'),
(0, 'Zone'),
(-1, 'Région');

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

--
-- Structure de la table `misson_zone_params_carburant`
--

CREATE TABLE `misson_zone_params_carburant` (
  `zone_id` bigint(20) NOT NULL,
  `transporter_id` bigint(20) NOT NULL,
  `vehicle_type_id` int(11) NOT NULL,
  `capacite_reservoir` int(11) NOT NULL,
  `nb_bon_carburant` bigint(20) DEFAULT NULL,
  `max_carburant` float DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `misson_zone_params_carburant` (`zone_id`, `transporter_id`, `vehicle_type_id`, `capacite_reservoir`, `nb_bon_carburant`, `max_carburant`) VALUES
(3, 199, 3, 632, 9562, 95652),
(3, 315, 2, 70, 70, 700),
(5, 121, 4, 65, 425, 600),
(5, 933, 1, 78, 60, 25);

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

--
-- Structure de la table `misson_zone_point`
--

CREATE TABLE `misson_zone_point` (
  `zone_id` bigint(20) NOT NULL,
  `point_id` bigint(20) NOT NULL,
  `point_ordre` int(11) DEFAULT NULL,
  `alert_point` tinyint(1) NOT NULL,
  `alert_driver` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mobile_deleted_data`
--

CREATE TABLE `mobile_deleted_data` (
  `id` bigint(20) NOT NULL,
  `table_name` varchar(56) CHARACTER SET latin1 NOT NULL,
  `id_in_table` bigint(20) NOT NULL,
  `is_deleted` tinyint(4) NOT NULL DEFAULT '0',
  `mission_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mobile_params`
--

CREATE TABLE `mobile_params` (
  `param_id` int(11) NOT NULL,
  `param_designation` varchar(56) NOT NULL,
  `param_value` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

INSERT INTO `mobile_params` (`param_id`, `param_designation`, `param_value`) VALUES
(1, 'activate_force_sync', 0),
(2, 'nb_bl_limit_to_sync', 3),
(3, 'resumeParQte', 1);

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

--
-- Structure de la table `module`
--

CREATE TABLE `module` (
  `module_id` bigint(20) NOT NULL,
  `module_name` varchar(100) DEFAULT NULL,
  `module_sysname` varchar(56) DEFAULT NULL,
  `active` tinyint(1) DEFAULT NULL,
  `parent_id` bigint(20) DEFAULT NULL,
  `icone` varchar(100) DEFAULT NULL,
  `ordre` int(11) DEFAULT NULL,
  `root` tinyint(1) DEFAULT NULL,
  `window` tinyint(1) DEFAULT NULL,
  `admin` tinyint(1) DEFAULT NULL,
  `article_id` bigint(20) DEFAULT NULL,
  `article_unite_id` int(11) DEFAULT NULL,
  `montant_jour` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

INSERT INTO `module` (`module_id`, `module_name`, `module_sysname`, `active`, `parent_id`, `icone`, `ordre`, `root`, `window`, `admin`, `article_id`, `article_unite_id`, `montant_jour`) VALUES
(9, 'Admin', 'admin', 1, NULL, 'flaticon2-user-1 ', 1, 1, 0, 1, NULL, NULL, NULL),
(10, 'Déconnexion', 'logout', 1, NULL, 'flaticon-logout', 25, 1, 1, NULL, NULL, NULL, NULL),
(12, 'Annuaire', 'contacts-book/contacts', 0, 68, 'flaticon-users-1', 3, 1, 1, 1, NULL, NULL, NULL),
(602, 'Autorisation des smartphones', 'smartphone/list', 1, 631, '', 13, 0, 1, 1, NULL, NULL, NULL),
(66, 'Stock Inventaire MG', 'stock-mg-inventaire', 1, 122, '', 5, 0, 1, 0, NULL, NULL, NULL),
(68, 'Parc automobile', 'flotte_automobile', 0, NULL, 'flaticon2-delivery-truck', 8, 1, 0, 0, NULL, NULL, NULL),
(70, 'Véhicules', 'parc/automobile', 1, 68, 'flaticon2-delivery-truck', 1, 0, 1, 1, NULL, NULL, NULL),
(72, 'Constatations', 'constat', 0, 121, '', 0, 0, 1, 0, NULL, NULL, NULL),
(73, 'Prélèvement Kms', 'prelevementKm', 0, 121, '', 0, 0, 1, 0, NULL, NULL, NULL),
(76, 'Consomation carburant', 'consommation-carburant', 0, 68, '', 7, 0, 1, 0, NULL, NULL, NULL),
(77, 'Assurance', 'assurance', 0, 68, '', 2, 0, 1, 0, NULL, NULL, NULL),
(79, 'Stock', 'stock', 1, NULL, 'flaticon2-delivery-package', 5, 1, 1, 0, NULL, NULL, NULL),
(82, 'Communication', 'messagerie', 0, NULL, 'flaticon-chat', 2, 1, 1, NULL, NULL, NULL, NULL),
(83, 'Comptes', 'comptes', 0, 99, '', 0, 0, 1, 1, NULL, NULL, NULL),
(84, 'Abonnement', 'abonnement', 0, 99, '', 0, 0, 1, NULL, NULL, NULL, NULL),
(85, 'Paramètres des autorisations', 'paramAuto', 0, 100, '', 0, 0, 1, 0, NULL, NULL, NULL),
(86, 'Contrats', 'contrats', 0, 99, '', 0, 0, 1, 0, NULL, NULL, NULL),
(87, 'Etat stock MG', 'mg-etats-stock', 1, 122, '', 0, 0, 1, NULL, NULL, NULL, 200),
(88, 'Interventions', 'intervention', 0, 99, '', 0, 0, 1, NULL, NULL, NULL, NULL),
(89, 'Puces', 'sim', 0, 99, '', 0, 0, 1, NULL, NULL, NULL, 200),
(90, 'Maintenances corrective et curative\'', 'maintenance', 0, 68, '', 4, 1, 0, 0, NULL, NULL, NULL),
(91, 'Missions', 'missions', 1, NULL, 'flaticon2-start-up', 4, 1, 0, NULL, NULL, NULL, NULL),
(92, 'Missions', 'missions', 1, 91, '', 2, 0, 1, NULL, NULL, NULL, NULL),
(93, 'Planifications des missions', 'planification-missions', 1, 91, '', 1, 0, 1, NULL, NULL, NULL, NULL),
(94, 'Paramétrage des zones et routes', 'parametres-missions/route-settings', 1, 9, '', 2, 0, 1, NULL, NULL, NULL, NULL),
(95, 'Planning des tournées', 'parametres-missions/regular-mission-settings', 1, 9, '', 3, 1, 1, NULL, NULL, NULL, NULL),
(96, 'Sinistres et accidents', 'scinistres', 0, 68, '', 5, 0, 1, 0, NULL, NULL, NULL),
(97, 'Avoir fournisseurs', 'gestion-achats/facture-avoir-fournisseur', 1, 127, '', 8, 1, 0, NULL, NULL, NULL, NULL),
(98, 'Infractions', 'infractions', 0, 68, '', 6, 0, 1, NULL, NULL, NULL, NULL),
(99, 'LICENCES', 'administration', 0, NULL, '\r\nflaticon2-settings', 25, 1, 0, NULL, NULL, NULL, NULL),
(100, 'DATAFIRST', 'datafirst', 0, NULL, '', 0, 1, 0, 1, NULL, NULL, NULL),
(101, 'Admin Produits', 'stock-gestion', 1, 9, '', 6, 0, 1, 0, NULL, NULL, NULL),
(102, 'Bons de transferts', 'documents-bl/bons-transfert', 1, 79, '', 3, 0, 1, 0, NULL, NULL, NULL),
(103, 'Mouvements de stock', 'mouvement-stock', 1, 79, '', 2, 0, 1, 0, NULL, NULL, NULL),
(104, 'Bon de chargement', 'gestion-achats/bons-chargement', 0, 79, '', 11, 0, 1, 0, NULL, NULL, NULL),
(105, 'Inventaire et corrections stock', 'stock-inventaire', 1, 79, '', 4, 0, 1, 0, NULL, NULL, NULL),
(106, 'Analyse des achats', 'gestion-achats/analyse-achats', 0, 127, NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL),
(107, 'Planning', 'planning', 0, 68, '', 8, 0, 1, NULL, NULL, NULL, NULL),
(108, 'Planning employés', 'planning/planningEmployes', 0, 68, '', 8, 0, 1, 0, NULL, NULL, NULL),
(109, 'Planning véhicules', 'planning/planningVehicules', 0, 68, '', 9, 0, 1, 0, NULL, NULL, NULL),
(110, 'Géolocalisation', 'geolocalisation', 1, NULL, 'flaticon2-map', 12, 1, 0, 0, NULL, NULL, NULL),
(111, 'Activités quotidiennes', 'activites_vehicules', 1, 110, '', 1, 0, 1, NULL, NULL, NULL, NULL),
(112, 'Tournées et stationnement', 'geolocalisation/tournees', 1, 110, '', 2, 0, 1, NULL, NULL, NULL, NULL),
(113, 'Positions', 'positions', 1, 110, '', 3, 0, 1, NULL, NULL, NULL, NULL),
(114, 'Points d\'intérêts\r\n', 'points_interets/list', 1, 110, '', 4, 0, 1, NULL, NULL, NULL, NULL),
(115, 'Suivi des documents', 'suivi-administratif', 0, 68, '', 11, 0, 1, NULL, NULL, NULL, NULL),
(118, 'Paramètres fonctionnels', 'functional-parameters', 1, 9, '', 1, 0, 1, NULL, NULL, NULL, NULL),
(119, 'Mouvement stock MG', 'mg-mouvement-stock', 1, 122, '', 4, 0, 1, NULL, NULL, NULL, NULL),
(120, 'Factures fournisseurs', 'gestion-achats/facture-fournisseur', 1, 127, '', 7, 0, 1, NULL, NULL, NULL, NULL),
(121, 'Suivi', 'suivi', 0, NULL, 'flaticon-statistics', 0, 1, 0, NULL, NULL, NULL, NULL),
(122, 'Moyens généraux', 'parametrage', 0, NULL, 'flaticon2-settings', 10, 1, 0, NULL, NULL, NULL, NULL),
(123, 'Suivi des documents', 'suivi-administratif', 0, 68, ' ', 10, 0, 1, NULL, NULL, NULL, NULL),
(124, 'Paramétrage des véhicules', 'param-vehicules', 1, 110, ' ', 5, 0, 1, NULL, NULL, NULL, NULL),
(125, 'Importation données', 'importData', 0, 68, '\"\"', 0, 0, 1, NULL, NULL, NULL, NULL),
(126, 'Accueil', 'home', 1, NULL, 'flaticon-home-2', 0, 1, 1, NULL, NULL, NULL, NULL),
(131, 'Fournisseurs', 'fournisseurs/fournisseurs', 1, 641, NULL, 21, NULL, 0, NULL, NULL, NULL, NULL),
(127, 'Bons Fournisseur', 'uc-fournisseurs-app', 1, NULL, 'flaticon2-shopping-cart-1', 6, NULL, 0, NULL, NULL, NULL, NULL),
(128, 'Ventes', 'uc-clients', 1, NULL, 'flaticon-shopping-basket', 8, NULL, 0, NULL, NULL, NULL, NULL),
(129, 'Demandes de prix', 'gestion-achats/demandes-prix', 0, 127, NULL, 2, NULL, 0, NULL, NULL, NULL, NULL),
(130, 'RH', 'uc-employes', 0, NULL, 'flaticon-users-1', NULL, NULL, 0, NULL, NULL, NULL, NULL),
(132, 'Bons de réception', 'gestion-achats/bons-reception', 1, 651, NULL, 1, NULL, 1, NULL, NULL, NULL, NULL),
(133, 'Bons de retour fournisseurs', 'gestion-achats/bons-retour-fournisseur', 1, 127, NULL, 7, NULL, 1, NULL, NULL, NULL, NULL),
(134, 'Règlements fournisseurs', 'gestion-achats/reglement-fournisseur', 0, 127, NULL, 11, NULL, 1, NULL, NULL, NULL, NULL),
(135, 'Clients', 'clients', 1, 641, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL),
(136, 'Vendeurs / Prévendeurs', 'commercial', 1, 641, NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL),
(137, 'Bon de sortie Dons', 'documents-bl/bons-sortie-don', 1, 79, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL),
(138, 'Bons de livraisons', 'gestion-achats/bons-livraison', 1, 128, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL),
(139, 'Factures', 'gestion-ventes/facture-vente', 1, 128, NULL, 21, NULL, NULL, NULL, NULL, NULL, NULL),
(140, 'Bons de retour', 'gestion-ventes/bons-retour-client', 1, 128, NULL, 6, NULL, 1, NULL, NULL, NULL, NULL),
(141, 'Avoirs', 'gestion-ventes/facture-avoir', 0, 128, NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL),
(142, 'Règlements clients', 'gestion-ventes/reglement-client', 0, 128, NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL),
(143, 'Promotions', 'promotions', 1, 128, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL),
(144, 'Analyses des ventes', 'gestion-achats/analyse-ventes', 0, 128, NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL),
(145, 'Statistiques', 'statistiques', 1, NULL, 'flaticon2-chart', 9, NULL, NULL, NULL, NULL, NULL, NULL),
(146, 'Devis fournisseurs', 'gestion-achats/devis-fournisseurs', 1, 127, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL),
(147, 'Commandes d’achat', 'gestion-achats/bons-cmd-achat', 1, 651, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL),
(148, 'Statistiques des commandes', 'statistiques/commandes', 1, 128, NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL),
(149, 'Ventes et réalisations', 'rapport-commercial', 0, 145, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL),
(150, 'Paramétrage Objectifs', 'paramsKpi', 1, 9, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL),
(151, 'Finances', 'Finances', 1, NULL, 'flaticon-price-tag', 10, NULL, 0, NULL, NULL, NULL, NULL),
(152, 'Mouvement des livreurs', 'sessions-caisse', 1, 151, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL),
(153, 'Marchés et Soumissions', 'gestion-achats/comparatif-offres', 0, 127, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL),
(154, 'Employés', 'employes', 1, 641, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL),
(155, 'Etats du stock', 'etats-stock', 1, 79, NULL, 1, 0, 1, NULL, NULL, NULL, NULL),
(156, 'Créances', 'gestion-ventes/creance', 1, 128, NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL),
(157, 'Produits MG', 'produits-mg', 0, 9, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL),
(158, 'Objectifs des ventes', 'objectifs-vente', 0, 9, NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL),
(159, 'Demande de consommation MG', 'demandes_bl', 1, 122, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL),
(160, 'Mouvement comptes et caisses', 'mouvement-caisse/list', 1, 151, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL),
(162, 'Bons de commandes', 'gestion-ventes/bons-cmd-vente', 1, 128, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL),
(161, 'Comptes et caisses', 'states', 1, 151, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(163, 'Bons de consommations MG', 'gestion-achats/bons-consomm', 1, 122, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL),
(164, 'Historique du système', 'historique-systeme', 1, 631, '', 16, NULL, NULL, NULL, NULL, NULL, NULL),
(166, 'Planning par vendeur', 'parametres-missions/regular-mission-clients', 1, 9, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL),
(165, 'Affectation des quotas', 'documents-bl/quotas', 1, 91, NULL, 13, NULL, NULL, NULL, NULL, NULL, NULL),
(167, 'Paramétrage des quotas', 'parametrage-quotas', 1, 9, NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL),
(168, ' Bons de sortie retour', 'documents-bl/bons-sortie-retour', 1, 79, NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL),
(169, 'Statistiques', 'statistiques/list', 1, 145, NULL, 17, NULL, NULL, NULL, NULL, NULL, NULL),
(170, 'Bons d\'avaries', 'documents-bl/bons-avaries', 1, 79, NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL),
(171, 'Objectifs', 'objectifs', 1, 180, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL),
(180, 'Objectifs', 'objectifs', 1, NULL, 'flaticon-list-3', 11, NULL, NULL, NULL, NULL, NULL, NULL),
(181, 'Statistiques des objectifs', 'statistiques/objectifs', 1, 180, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL),
(182, 'Statistiques', 'statistiques/stock', 0, 79, NULL, 20, NULL, NULL, NULL, NULL, NULL, NULL),
(183, 'Règlement des fournisseurs', 'etat-fournisseurs', 1, 151, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL),
(185, 'Suivi des chèques', 'suivi-cheques', 1, 151, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL),
(184, 'Remise des chèques', 'remise-cheques', 1, 151, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL),
(186, 'Suivi des réalisations', 'top-realisations', 1, 180, '', 4, NULL, NULL, NULL, NULL, NULL, NULL),
(187, 'Gestion des terminaux mobiles', 'smartphone/list', 1, 99, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL),
(188, 'Gestion des comptes', 'comptes/list', 1, 99, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(190, 'Abonnements', 'abonnement', 1, 99, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL),
(191, 'Paramétrage des comptes', 'parametrage-comptes/list', 1, 99, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL),
(192, 'Planning par zone', 'parametres-missions/new-planifiation', 1, 9, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL),
(194, 'Paramétrage des alertes', 'parametrage-alertes', 1, 110, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL),
(195, 'Rapports', 'envoi-rapports', 1, 110, NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL),
(196, 'Localisation', 'geolocalisation/flotte', 1, 110, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(197, 'Production', '/production', 1, NULL, 'flaticon-web', 13, NULL, NULL, NULL, NULL, NULL, NULL),
(198, 'Fabrication', 'fabrication', 1, 197, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(311, 'Support', 'support/\r\n', 1, 631, NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL),
(203, 'Bons de récupération', 'gestion-achats/bons-recuperation', 1, 79, NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL),
(202, 'Bons de déclassement', 'documents-bl/avaries-clients', 1, 79, NULL, 11, NULL, NULL, NULL, NULL, NULL, NULL),
(300, 'Factures d’avoir clients', 'gestion-ventes/facture-avoir', 1, 128, NULL, 22, NULL, NULL, NULL, NULL, NULL, NULL),
(201, 'Devis clients', 'gestion-ventes/devis', 1, 128, NULL, 23, NULL, NULL, NULL, NULL, NULL, NULL),
(204, 'Annuaire', 'contacts/contacts', 1, 82, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(205, 'Messagerie & Communication', 'messagerie/list', 1, 82, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL),
(206, 'Modèles de messages', 'messagerie/sms-model', 1, 82, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL),
(207, 'Gestion des lots', 'gestion-lots', 0, 79, NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL),
(208, 'Optimisation', 'optimisation', 1, 91, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL),
(209, 'Top employés', 'top-sellers', 1, 180, NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL),
(210, 'Gestion Emballage', 'gestion-emballage', 1, 79, NULL, 12, NULL, NULL, NULL, NULL, NULL, NULL),
(211, 'Bons de consommation', 'gestion-achats/bons-consommation', 1, 79, NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL),
(321, 'Stock', 'rapport-stock', 1, 145, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL),
(600, 'Bons de remplacement', 'documents-bl/bons-remplacement', 1, 79, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL),
(14, 'Gestion des utilisateurs', 'users', 1, 631, '', 9, 0, 1, 1, NULL, NULL, NULL),
(189, 'Temps réel', 'geolocalisation/temps_reel', 1, 110, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(631, 'gestion des permissions', 'admin', 1, NULL, 'flaticon2-user-1', 2, 1, 0, 1, NULL, NULL, NULL),
(651, 'Achats', 'stock', 1, NULL, 'flaticon2-shopping-cart-1', 7, NULL, NULL, NULL, NULL, NULL, NULL),
(641, 'Annuaire', 'admin', 1, NULL, 'flaticon2-user-1', 3, 1, 1, 1, NULL, NULL, NULL),
(200, 'Gestion des permissions', 'permissions', 1, 631, '', 10, 0, 1, 1, NULL, NULL, NULL);

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

--
-- Structure de la table `module_action`
--

CREATE TABLE `module_action` (
  `action_id` int(11) NOT NULL,
  `module_id` int(11) DEFAULT NULL,
  `action_designation` varchar(200) CHARACTER SET latin1 DEFAULT NULL,
  `url` varchar(200) CHARACTER SET latin1 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `module_action` (`action_id`, `module_id`, `action_designation`, `url`) VALUES
(1, NULL, 'resume/IndicatorValue', 'resume/IndicatorValue'),
(2, NULL, 'SWA/OrganisationNature', 'SWA/OrganisationNature'),
(3, NULL, 'SWA/OrganisationAgrementNature', 'SWA/OrganisationAgrementNature'),
(4, NULL, 'SWA/OrganisationDomaineActivite', 'SWA/OrganisationDomaineActivite'),
(5, NULL, 'SWA/Wilaya', 'SWA/Wilaya'),
(6, NULL, 'SWA/CommuneParWilaya', 'SWA/CommuneParWilaya'),
(7, NULL, 'SWA/Organisation', 'SWA/Organisation'),
(8, NULL, 'SWA/RepresentantType', 'SWA/RepresentantType'),
(9, NULL, 'SWA/RepresentantPoste', 'SWA/RepresentantPoste'),
(10, NULL, 'SWA/MembreStatut', 'SWA/MembreStatut'),
(11, NULL, 'SWA/MembreType', 'SWA/MembreType'),
(12, NULL, 'SWA/OrganisationGrid', 'SWA/OrganisationGrid'),
(13, NULL, 'SWA/addOrganisationGrid', 'SWA/addOrganisationGrid'),
(14, NULL, 'SWA/editOrganisationGrid', 'SWA/editOrganisationGrid'),
(15, NULL, 'SWA/deleteOrganisationGrid', 'SWA/deleteOrganisationGrid'),
(16, NULL, 'SWA/Representant', 'SWA/Representant'),
(17, NULL, 'SWA/addRepresentant', 'SWA/addRepresentant'),
(18, NULL, 'SWA/editRepresentant', 'SWA/editRepresentant'),
(19, NULL, 'SWA/deleteRepresentant', 'SWA/deleteRepresentant'),
(20, NULL, 'SWA/Membres', 'SWA/Membres'),
(21, NULL, 'SWA/addMembres', 'SWA/addMembres'),
(22, NULL, 'SWA/editMembres', 'SWA/editMembres'),
(23, NULL, 'SWA/deleteMembres', 'SWA/deleteMembres'),
(24, NULL, 'SWA/Structure', 'SWA/Structure'),
(25, NULL, 'SWA/addStructure', 'SWA/addStructure'),
(26, NULL, 'SWA/editStructure', 'SWA/editStructure'),
(27, NULL, 'SWA/deleteStructure', 'SWA/deleteStructure'),
(28, NULL, 'SWA/MembreStructer', 'SWA/MembreStructer'),
(29, NULL, 'SWA/addMembreStructer', 'SWA/addMembreStructer'),
(30, NULL, 'SWA/editMembreStructer', 'SWA/editMembreStructer'),
(31, NULL, 'SWA/deleteMembreStructer', 'SWA/deleteMembreStructer'),
(32, NULL, 'SWA/getMembreStructerParWilaya', 'SWA/getMembreStructerParWilaya'),
(33, NULL, 'SWA/getMembreStructerParCommune', 'SWA/getMembreStructerParCommune'),
(34, NULL, 'SWA/getMembreStructerByRegion', 'SWA/getMembreStructerByRegion'),
(35, NULL, 'SWA/addStructureCommune', 'SWA/addStructureCommune'),
(36, NULL, 'SWA/deleteStructureCommune', 'SWA/deleteStructureCommune'),
(37, NULL, 'SWA/getStructureCommune', 'SWA/getStructureCommune'),
(38, NULL, 'SWA/getProject', 'SWA/getProject'),
(39, NULL, 'SWA/addProject', 'SWA/addProject'),
(40, NULL, 'SWA/editProject', 'SWA/editProject'),
(41, NULL, 'SWA/deleteProject', 'SWA/deleteProject'),
(42, NULL, 'SWA/getProjetType', 'SWA/getProjetType'),
(43, NULL, 'SWA/getProjetDomaine', 'SWA/getProjetDomaine'),
(44, NULL, 'SWA/getProjetZoneType', 'SWA/getProjetZoneType'),
(45, NULL, 'SWA/getProjetZonegeoTypeDetail', 'SWA/getProjetZonegeoTypeDetail'),
(46, NULL, 'SWA/getProjetWilaya', 'SWA/getProjetWilaya'),
(47, NULL, 'SWA/addProjetWilaya', 'SWA/addProjetWilaya'),
(48, NULL, 'SWA/deleteProjetWilaya', 'SWA/deleteProjetWilaya'),
(49, NULL, 'SWA/getProjetCommune', 'SWA/getProjetCommune'),
(50, NULL, 'SWA/addProjetCommune', 'SWA/addProjetCommune'),
(51, NULL, 'SWA/deleteProjetCommune', 'SWA/deleteProjetCommune'),
(52, NULL, 'SWA/getProjetOrganisation', 'SWA/getProjetOrganisation'),
(53, NULL, 'SWA/addProjetOrganisation', 'SWA/addProjetOrganisation'),
(54, NULL, 'SWA/deleteProjetOrganisation', 'SWA/deleteProjetOrganisation'),
(55, NULL, 'SWA/getProjetRessourceHumaine', 'SWA/getProjetRessourceHumaine'),
(56, NULL, 'SWA/addProjetRessourceHumaine', 'SWA/addProjetRessourceHumaine'),
(57, NULL, 'SWA/deleteProjetRessourceHumaine', 'SWA/deleteProjetRessourceHumaine'),
(58, NULL, 'SWA/getMemberNiveauEtude', 'SWA/getMemberNiveauEtude'),
(59, NULL, 'SWA/getMemberPost', 'SWA/getMemberPost'),
(60, NULL, 'SWA/getMemberActivite', 'SWA/getMemberActivite'),
(61, NULL, 'SWA/getProjetDocument', 'SWA/getProjetDocument'),
(62, NULL, 'SWA/getStructerPost', 'SWA/getStructerPost'),
(63, NULL, 'SWA/getProjetPost', 'SWA/getProjetPost'),
(64, NULL, 'SWA/getStructureType', 'SWA/getStructureType'),
(65, NULL, 'SWA/getOrganisationAccount', 'SWA/getOrganisationAccount'),
(66, NULL, 'SWA/setOrganisationAccount', 'SWA/setOrganisationAccount'),
(67, NULL, 'SWA/getRepresentantAccount', 'SWA/getRepresentantAccount'),
(68, NULL, 'SWA/setRepresentantAccount', 'SWA/setRepresentantAccount'),
(69, NULL, 'SWA/setStructerOrganisation', 'SWA/setStructerOrganisation'),
(70, NULL, 'SWA/deleteStructerOrganisation', 'SWA/deleteStructerOrganisation'),
(71, NULL, 'stock/creeMouvementParMouvement', 'stock/creeMouvementParMouvement'),
(72, NULL, 'stock/dupliqueMouvement', 'stock/dupliqueMouvement'),
(73, NULL, 'stock/getColisage', 'stock/getColisage'),
(74, 101, 'Afficher les produits', 'stock/mouvements/Mouvement'),
(75, NULL, 'stock/mouvements/MouvementTotalRows', 'stock/mouvements/MouvementTotalRows'),
(76, NULL, 'stock/mouvements/MouvementLigne', 'stock/mouvements/MouvementLigne'),
(77, NULL, 'stock/mouvements/RelationDocs', 'stock/mouvements/RelationDocs'),
(78, 92, 'Ajouter un bon de commande', 'stock/mouvements/addMouvement'),
(79, NULL, 'stock/mouvements/addMouvementLignee', 'stock/mouvements/addMouvementLignee'),
(80, NULL, 'stock/mouvements/addArticleMovement', 'stock/mouvements/addArticleMovement'),
(81, NULL, 'stock/mouvements/editMouvement', 'stock/mouvements/editMouvement'),
(82, NULL, 'stock/mouvements/editMouvementLignee', 'stock/mouvements/editMouvementLignee'),
(83, NULL, 'stock/mouvements/editArticleMovement', 'stock/mouvements/editArticleMovement'),
(84, NULL, 'stock/mouvements/deleteMouvement', 'stock/mouvements/deleteMouvement'),
(85, NULL, 'stock/mouvements/deleteMouvementLigne', 'stock/mouvements/deleteMouvementLigne'),
(86, NULL, 'stock/mouvements/deleteArticleMouvement', 'stock/mouvements/deleteArticleMouvement'),
(87, NULL, 'stock/mouvements/mouvementDocs', 'stock/mouvements/mouvementDocs'),
(88, NULL, 'stock/mouvements/setBonsdeTransfertVente', 'stock/mouvements/setBonsdeTransfertVente'),
(89, NULL, 'stock/mouvements/setMouvementTransfertVente', 'stock/mouvements/setMouvementTransfertVente'),
(90, NULL, 'stock/mouvements/Satisfait', 'stock/mouvements/Satisfait'),
(91, NULL, 'stock/mouvements/validerInventaire', 'stock/mouvements/validerInventaire'),
(92, NULL, 'stock/mouvements/bonRetour', 'stock/mouvements/bonRetour'),
(93, NULL, 'stock/mouvements/conformiteInventaire', 'stock/mouvements/conformiteInventaire'),
(94, NULL, ' stock/mouvements/getColisage', ' stock/mouvements/getColisage'),
(95, NULL, 'stock/mouvements/addColisage', 'stock/mouvements/addColisage'),
(96, NULL, 'stock/mouvements/EditColisage', 'stock/mouvements/EditColisage'),
(97, NULL, 'stock/mouvements/deleteColisage', 'stock/mouvements/deleteColisage'),
(98, NULL, 'stock/mouvements/getExportData', 'stock/mouvements/getExportData'),
(99, NULL, 'stock/mouvements/ModePaiement', 'stock/mouvements/ModePaiement'),
(100, NULL, 'stock/mouvements/addDocumentToMouvement', 'stock/mouvements/addDocumentToMouvement'),
(101, NULL, 'stock/mouvements/getColisType', 'stock/mouvements/getColisType'),
(102, NULL, 'stock/mouvements/', 'stock/mouvements/'),
(103, NULL, '/stock/BonTransfertFromMission', '/stock/BonTransfertFromMission'),
(104, NULL, 'stock/mouvements/ValiderMouvement', 'stock/mouvements/ValiderMouvement'),
(105, NULL, 'getMontantLettre', 'getMontantLettre'),
(106, NULL, 'stock/mouvements/viderMouvement', 'stock/mouvements/viderMouvement'),
(107, NULL, 'stock/mouvements/transferMouvements', 'stock/mouvements/transferMouvements'),
(108, NULL, 'stock/mouvements/InitMouvementLigneInventaire', 'stock/mouvements/InitMouvementLigneInventaire'),
(109, NULL, 'stock/produit/article', 'stock/produit/article'),
(110, NULL, 'stock/produit/ArticleTotalRows', 'stock/produit/ArticleTotalRows'),
(111, NULL, 'stock/produit/Unites', 'stock/produit/Unites'),
(112, NULL, 'stock/produit/Paramunites', 'stock/produit/Paramunites'),
(113, NULL, 'stock/produit/editArticle', 'stock/produit/editArticle'),
(114, 155, 'Afficher les produits', 'stock/produit/produits'),
(115, NULL, 'stock/produit/QuantiteInDepot', 'stock/produit/QuantiteInDepot'),
(116, NULL, 'stock/produit/QuantiteInDepotTotalRows', 'stock/produit/QuantiteInDepotTotalRows'),
(117, NULL, 'stock/produit/produitsTotalRows', 'stock/produit/produitsTotalRows'),
(118, NULL, 'stock/produit/QuantiteInDepot', 'stock/produit/QuantiteInDepot'),
(119, NULL, 'stock/produit/addProduit', 'stock/produit/addProduit'),
(120, NULL, 'stock/produit/getUnite', 'stock/produit/getUnite'),
(121, NULL, 'stock/produit/ArticleMouvement', 'stock/produit/ArticleMouvement'),
(122, NULL, 'stock/produit/ArticleMouvementTotalRows', 'stock/produit/ArticleMouvementTotalRows'),
(123, NULL, 'stock/produit/RepartitionStock', 'stock/produit/RepartitionStock'),
(124, NULL, 'stock/produit/ArticleFournisseur', 'stock/produit/ArticleFournisseur'),
(125, NULL, 'stock/produit/addArticleFournisseur', 'stock/produit/addArticleFournisseur'),
(126, NULL, 'stock/produit/editArticleFournisseur', 'stock/produit/editArticleFournisseur'),
(127, NULL, 'stock/produit/deleteArticleFournisseur', 'stock/produit/deleteArticleFournisseur'),
(128, NULL, 'stock/produit/editDetail', 'stock/produit/editDetail'),
(129, NULL, 'stock/produit/editUnite', 'stock/produit/editUnite'),
(130, NULL, 'stock/produit/deleteUnite', 'stock/produit/deleteUnite'),
(131, NULL, 'stock/produit/editParamUnite', 'stock/produit/editParamUnite'),
(132, NULL, 'stock/produit/Marque', 'stock/produit/Marque'),
(133, NULL, 'stock/produit/Model', 'stock/produit/Model'),
(134, NULL, 'stock/produit/Taxes', 'stock/produit/Taxes'),
(135, NULL, 'stock/produit/exportProduit', 'stock/produit/exportProduit'),
(136, NULL, 'stock/produit/importProduit', 'stock/produit/importProduit'),
(137, NULL, 'stock/produit/deleteProduit', 'stock/produit/deleteProduit'),
(138, NULL, 'stock/produit/getGroupePrix', 'stock/produit/getGroupePrix'),
(139, NULL, 'stock/produit/editGroupePrix', 'stock/produit/editGroupePrix'),
(140, NULL, 'stock/produit/addGroupePrix', 'stock/produit/addGroupePrix'),
(141, NULL, 'stock/produit/deleteGroupePrix', 'stock/produit/deleteGroupePrix'),
(142, NULL, 'stock/produit/getEmplacement', 'stock/produit/getEmplacement'),
(143, NULL, 'stock/produit/addEmplacement', 'stock/produit/addEmplacement'),
(144, NULL, 'stock/produit/deleteEmplacement', 'stock/produit/deleteEmplacement'),
(145, NULL, 'stock/produit/editEmplacement', 'stock/produit/editEmplacement'),
(146, NULL, 'stock/produit/getPhotos', 'stock/produit/getPhotos'),
(147, NULL, 'stock/produit/addPhotos', 'stock/produit/addPhotos'),
(148, NULL, 'stock/produit/deletePhotos', 'stock/produit/deletePhotos'),
(149, NULL, 'stock/produit/getMachinesEtEquipements', 'stock/produit/getMachinesEtEquipements'),
(150, NULL, 'stock/produit/exportArticleMouvement', 'stock/produit/exportArticleMouvement'),
(151, NULL, 'stock/produit/exportRQArticleMouvement', 'stock/produit/exportRQArticleMouvement'),
(152, NULL, ' stock/produit/setDefaultImage', ' stock/produit/setDefaultImage'),
(153, NULL, ' stock/produit/addUnite', ' stock/produit/addUnite'),
(154, NULL, ' stock/produit/ArticleByFournisseur', ' stock/produit/ArticleByFournisseur'),
(155, NULL, 'stock/soumission/getSoumission', 'stock/soumission/getSoumission'),
(156, NULL, 'stock/soumission/getSoumissionEtat', 'stock/soumission/getSoumissionEtat'),
(157, NULL, 'stock/soumission/getSoumissionType', 'stock/soumission/getSoumissionType'),
(158, NULL, 'stock/soumission/addSoumission', 'stock/soumission/addSoumission'),
(159, NULL, 'stock/soumission/editSoumission', 'stock/soumission/editSoumission'),
(160, NULL, 'stock/soumission/deleteSoumission', 'stock/soumission/deleteSoumission'),
(161, NULL, 'stock/soumission/getArticles', 'stock/soumission/getArticles'),
(162, NULL, 'stock/soumission/getArticlesPrix', 'stock/soumission/getArticlesPrix'),
(163, NULL, 'stock/soumission/addArticle', 'stock/soumission/addArticle'),
(164, NULL, 'stock/soumission/addArticlePrix', 'stock/soumission/addArticlePrix'),
(165, NULL, 'stock/soumission/deleteArticle', 'stock/soumission/deleteArticle'),
(166, NULL, 'stock/soumission/deleteArticlePrix', 'stock/soumission/deleteArticlePrix'),
(167, NULL, 'stock/soumission/editArticlePrix', 'stock/soumission/editArticlePrix'),
(168, NULL, 'stock/soumission/getSoumissionsEtOffresFournisseurs', 'stock/soumission/getSoumissionsEtOffresFournisseurs'),
(169, NULL, 'stock/soumission/addSoumissionsEtOffresFournisseurs', 'stock/soumission/addSoumissionsEtOffresFournisseurs'),
(170, NULL, 'stock/soumission/editSoumissionsEtOffresFournisseurs', 'stock/soumission/editSoumissionsEtOffresFournisseurs'),
(171, NULL, 'stock/soumission/deleteSoumissionsEtOffresFournisseurs', 'stock/soumission/deleteSoumissionsEtOffresFournisseurs'),
(172, NULL, 'stock/soumission/comboOffreCatigories', 'stock/soumission/comboOffreCatigories'),
(173, NULL, 'stock/getBons', 'stock/getBons'),
(174, NULL, 'stock/addBons', 'stock/addBons'),
(175, NULL, 'stock/exportBons', 'stock/exportBons'),
(176, NULL, 'stock/imprimeBons', 'stock/imprimeBons'),
(177, NULL, 'stock/Bons/sendByMail', 'stock/Bons/sendByMail'),
(178, NULL, 'stock/Bons/saveAsDraft', 'stock/Bons/saveAsDraft'),
(179, NULL, 'stock/BonValide', 'stock/BonValide'),
(180, NULL, 'stock/soumission/creeBonReceptionFromCommandesAchat', 'stock/soumission/creeBonReceptionFromCommandesAchat'),
(181, NULL, 'stock/creeMissionsBySelectedBon', 'stock/creeMissionsBySelectedBon'),
(182, NULL, 'stock/mouvement/mouvementMouvement', 'stock/mouvement/mouvementMouvement'),
(183, NULL, 'stock/creeDemandeMissionsBySelectedBon', 'stock/creeDemandeMissionsBySelectedBon'),
(184, NULL, 'stock/getResumeArticleCharge', 'stock/getResumeArticleCharge'),
(185, NULL, 'parc/Maintenance/Maintenances', 'parc/Maintenance/Maintenances'),
(186, NULL, 'parc/Maintenance/OperationStatus', 'parc/Maintenance/OperationStatus'),
(187, NULL, 'parc/Maintenance/Operationtype', 'parc/Maintenance/Operationtype'),
(188, NULL, 'parc/Maintenance/addMaintenance', 'parc/Maintenance/addMaintenance'),
(189, NULL, 'parc/Maintenance/editDemande', 'parc/Maintenance/editDemande'),
(190, NULL, 'parc/Maintenance/editValidation', 'parc/Maintenance/editValidation'),
(191, NULL, 'parc/Maintenance/editImmoblilisation', 'parc/Maintenance/editImmoblilisation'),
(192, NULL, 'parc/Maintenance/OperationAtelie', 'parc/Maintenance/OperationAtelie'),
(193, NULL, 'parc/Maintenance/DecalreAtelie', 'parc/Maintenance/DecalreAtelie'),
(194, NULL, 'parc/Maintenance/DecalreTermine', 'parc/Maintenance/DecalreTermine'),
(195, NULL, 'parc/Maintenance/OperationsCombo', 'parc/Maintenance/OperationsCombo'),
(196, NULL, 'parc/Maintenance/OperationActions', 'parc/Maintenance/OperationActions'),
(197, NULL, 'parc/Maintenance/addGammeOperatoire', 'parc/Maintenance/addGammeOperatoire'),
(198, NULL, 'parc/Maintenance/editGammeOperatoire', 'parc/Maintenance/editGammeOperatoire'),
(199, NULL, 'parc/Maintenance/deleteGammeOperatoire', 'parc/Maintenance/deleteGammeOperatoire'),
(200, NULL, 'parc/Maintenance/addAction', 'parc/Maintenance/addAction'),
(201, NULL, 'parc/Maintenance/OperationMouvement', 'parc/Maintenance/OperationMouvement'),
(202, NULL, 'parc/Maintenance/OperationMouvementLigne', 'parc/Maintenance/OperationMouvementLigne'),
(203, NULL, 'parc/Maintenance/OperationArticleMouvement', 'parc/Maintenance/OperationArticleMouvement'),
(204, NULL, 'parc/Maintenance/OperationDocument', 'parc/Maintenance/OperationDocument'),
(205, NULL, 'parc/Maintenance/OperationControle', 'parc/Maintenance/OperationControle'),
(206, NULL, 'parc/Maintenance/OperationControle', 'parc/Maintenance/OperationControle'),
(207, 92, 'Liste des missions', 'mission/Missions'),
(208, NULL, 'mission/Missionstotalrows', 'mission/Missionstotalrows'),
(209, 92, 'Ajouter une mission', 'mission/addMission'),
(210, 92, 'Afficher la liste des clients', 'mission/PointPassage'),
(211, 92, 'ajout des clients au missions', 'mission/PointPassage/addPointPassage'),
(212, 92, 'suppression des clients d\'une mission ', 'mission/PointPassage/deletePointPassage'),
(213, NULL, 'mission/PointPassage/editPointPassage', 'mission/PointPassage/editPointPassage'),
(214, NULL, 'mission/Validations', 'mission/Validations'),
(215, NULL, 'mission/editValidation', 'mission/editValidation'),
(216, NULL, 'mission/Missionnaires', 'mission/Missionnaires'),
(217, NULL, 'mission/addMissionnaires', 'mission/addMissionnaires'),
(218, NULL, 'mission/deleteMissionnaires', 'mission/deleteMissionnaires'),
(219, NULL, 'mission/editMissionnaires', 'mission/editMissionnaires'),
(220, NULL, 'mission/MoyensUtilise', 'mission/MoyensUtilise'),
(221, NULL, 'mission/addMoyensUtilise', 'mission/addMoyensUtilise'),
(222, NULL, 'mission/editMoyensUtilise', 'mission/editMoyensUtilise'),
(223, NULL, 'mission/deleteMoyensUtilise', 'mission/deleteMoyensUtilise'),
(224, NULL, 'mission/getKilometrage', 'mission/getKilometrage'),
(225, NULL, 'mission/editKilometrage', 'mission/editKilometrage'),
(226, NULL, 'mission/getMissionEval', 'mission/getMissionEval'),
(227, NULL, 'mission/editMissionEval', 'mission/editMissionEval'),
(228, NULL, 'mission/ClientbyZone', 'mission/ClientbyZone'),
(229, NULL, 'mission/getMissionMontants', 'mission/getMissionMontants'),
(230, 92, 'edition des missions', 'mission/editMission'),
(231, 92, 'suppression des missions', 'mission/deleteMission'),
(232, NULL, 'mission/Combo/Zone', 'mission/Combo/Zone'),
(233, NULL, 'mission/Combo/SecteurByZone', 'mission/Combo/SecteurByZone'),
(234, 92, 'Combo des zone', 'mission/Combo/RouteBySecteur'),
(235, NULL, 'mission/Combo/MissionEntreprise', 'mission/Combo/MissionEntreprise'),
(236, NULL, 'mission/Combo/LocalisationPoint', 'mission/Combo/LocalisationPoint'),
(237, 92, 'mission/Combo/MissionStatus', 'mission/Combo/MissionStatus'),
(238, NULL, 'mission/Combo/MissionTransporteur', 'mission/Combo/MissionTransporteur'),
(239, NULL, 'mission/Combo/missionTypeCargo', 'mission/Combo/missionTypeCargo'),
(240, NULL, 'mission/Combo/motif', 'mission/Combo/motif'),
(241, NULL, 'mission/getMideaFiles', 'mission/getMideaFiles'),
(242, NULL, 'mission/addMideaFiles', 'mission/addMideaFiles'),
(243, NULL, 'mission/editMideaFiles', 'mission/editMideaFiles'),
(244, NULL, 'mission/deleteMideaFiles', 'mission/deleteMideaFiles'),
(245, NULL, 'mission/PointPassage/documentsClient', 'mission/PointPassage/documentsClient'),
(246, NULL, 'mission/PointPassage/articleClient', 'mission/PointPassage/articleClient'),
(247, 92, 'Stock Mobile', 'mission/stockMobile'),
(248, NULL, 'mission/CaisseEtReglements', 'mission/CaisseEtReglements'),
(249, 92, 'Afficher les BSR', 'mission/bonSortiesRetours'),
(250, 92, 'cloturé / annulé mission', 'mission/setMissionStatus'),
(251, NULL, 'mission/setMissionCaissevalidation', 'mission/setMissionCaissevalidation'),
(252, NULL, 'mission/setMissionMontantcaissier', 'mission/setMissionMontantcaissier'),
(253, NULL, 'mission/setmouvementransfereaudepot', 'mission/setmouvementransfereaudepot'),
(254, 92, 'saisir quantité retoure ', 'mission/setquantitemouvementligne'),
(255, NULL, 'mission/getquantitemouvementligne', 'mission/getquantitemouvementligne'),
(256, NULL, 'mission/Setmissionreglementcaisse', 'mission/Setmissionreglementcaisse'),
(257, NULL, 'mission/setmontantventesetvalidationmagasinier', 'mission/setmontantventesetvalidationmagasinier'),
(258, NULL, 'mission/getHistoriqueGeoTrace', 'mission/getHistoriqueGeoTrace'),
(259, NULL, 'mission/params/MissionZone', 'mission/params/MissionZone'),
(260, NULL, 'mission/params/editMissionZone', 'mission/params/editMissionZone'),
(261, NULL, 'mission/params/addMissionZone', 'mission/params/addMissionZone'),
(262, NULL, 'mission/params/deleteMissionZone', 'mission/params/deleteMissionZone'),
(263, NULL, 'mission/params/ZoneParametres', 'mission/params/ZoneParametres'),
(264, NULL, 'mission/params/editZoneParametres', 'mission/params/editZoneParametres'),
(265, NULL, 'mission/params/addZoneParametres', 'mission/params/addZoneParametres'),
(266, NULL, 'mission/params/deleteZoneParametres', 'mission/params/deleteZoneParametres'),
(267, NULL, 'mission/params/ZonePoint', 'mission/params/ZonePoint'),
(268, NULL, 'mission/params/addZonePoint', 'mission/params/addZonePoint'),
(269, NULL, 'mission/params/editZonePoint', 'mission/params/editZonePoint'),
(270, NULL, 'mission/params/deleteZonePoint', 'mission/params/deleteZonePoint'),
(271, NULL, 'mission/params/LocationPointByType', 'mission/params/LocationPointByType'),
(272, NULL, 'mission/params/LocationPointType', 'mission/params/LocationPointType'),
(273, NULL, 'mission/params/ZoneParametresMissionnaire', 'mission/params/ZoneParametresMissionnaire'),
(274, NULL, 'mission/params/editZoneParametresMissionnaire', 'mission/params/editZoneParametresMissionnaire'),
(275, NULL, 'mission/params/addZoneParametresMissionnaire', 'mission/params/addZoneParametresMissionnaire'),
(276, NULL, 'mission/params/deleteZoneParametresMissionnaire', 'mission/params/deleteZoneParametresMissionnaire'),
(277, NULL, 'mission/params/ZoneParametresCarburant', 'mission/params/ZoneParametresCarburant'),
(278, NULL, 'mission/params/addZoneParametresCarburant', 'mission/params/addZoneParametresCarburant'),
(279, NULL, 'mission/params/editZoneParametresCarburant', 'mission/params/editZoneParametresCarburant'),
(280, NULL, 'mission/params/deleteZoneParametresCarburant', 'mission/params/deleteZoneParametresCarburant'),
(281, NULL, 'mission/params/PointsDepart', 'mission/params/PointsDepart'),
(282, NULL, 'mission/params/deletePointsDepart', 'mission/params/deletePointsDepart'),
(283, NULL, 'mission/params/addPointsDepart', 'mission/params/addPointsDepart'),
(284, NULL, 'mission/params/MissionRole', 'mission/params/MissionRole'),
(285, NULL, 'mission/params/addMissionRole', 'mission/params/addMissionRole'),
(286, NULL, 'mission/params/editMissionRole', 'mission/params/editMissionRole'),
(287, NULL, 'mission/params/deleteMissionRole', 'mission/params/deleteMissionRole'),
(288, NULL, 'mission/params/Missionnaire', 'mission/params/Missionnaire'),
(289, NULL, 'mission/params/addMissionnaire', 'mission/params/addMissionnaire'),
(290, NULL, 'mission/params/deleteMissionnaire', 'mission/params/deleteMissionnaire'),
(291, NULL, 'mission/params/editMissionnaire', 'mission/params/editMissionnaire'),
(292, NULL, 'mission/params/MissionVehicule', 'mission/params/MissionVehicule'),
(293, NULL, 'mission/params/addMissionVehicule', 'mission/params/addMissionVehicule'),
(294, NULL, 'mission/params/editMissionVehicule', 'mission/params/editMissionVehicule'),
(295, NULL, 'mission/params/deleteMissionVehicule', 'mission/params/deleteMissionVehicule'),
(296, NULL, 'mission/params/MissionEntrepriseGrid', 'mission/params/MissionEntrepriseGrid'),
(297, NULL, 'mission/params/addMissionEntrepriseGrid', 'mission/params/addMissionEntrepriseGrid'),
(298, NULL, 'mission/params/editMissionEntrepriseGrid', 'mission/params/editMissionEntrepriseGrid'),
(299, NULL, 'mission/params/deleteMissionEntrepriseGrid', 'mission/params/deleteMissionEntrepriseGrid'),
(300, NULL, 'mission/params/MissionTransporteurGrid', 'mission/params/MissionTransporteurGrid'),
(301, NULL, 'mission/params/addMissionTransporteurGrid', 'mission/params/addMissionTransporteurGrid'),
(302, NULL, 'mission/params/editMissionTransporteurGrid', 'mission/params/editMissionTransporteurGrid'),
(303, NULL, 'mission/params/deleteMissionTransporteurGrid', 'mission/params/deleteMissionTransporteurGrid'),
(304, NULL, 'mission/params/MissionPoids', 'mission/params/MissionPoids'),
(305, NULL, 'mission/MissionsSurMob', 'mission/MissionsSurMob'),
(306, NULL, 'mission/BonsCommandesbymission', 'mission/BonsCommandesbymission'),
(307, NULL, 'mission/MissionsInfoMob', 'mission/MissionsInfoMob'),
(308, NULL, 'mission/CaissesEtReglements', 'mission/CaissesEtReglements'),
(309, NULL, 'mission/planification/initClientsByPlage', 'mission/planification/initClientsByPlage'),
(310, 93, 'Planning des missions et tournées régulières d’une journée', 'mission/planification/MissionPlanning'),
(311, NULL, 'mission/planification/addMissionPlanning', 'mission/planification/addMissionPlanning'),
(312, NULL, 'mission/planification/PlanifierMissions', 'mission/planification/PlanifierMissions'),
(313, NULL, 'mission/planification/deleteMissionPlanning', 'mission/planification/deleteMissionPlanning'),
(314, NULL, 'mission/planification/MissionsVehicule', 'mission/planification/MissionsVehicule'),
(315, NULL, 'mission/planification/ListArticleCharge', 'mission/planification/ListArticleCharge'),
(316, NULL, 'mission/planification/editArticleChargeQuantites', 'mission/planification/editArticleChargeQuantites'),
(317, NULL, 'mission/planification/CopyArticleFromVehicule', 'mission/planification/CopyArticleFromVehicule'),
(318, NULL, 'mission/planification/RepartirChargements', 'mission/planification/RepartirChargements'),
(319, NULL, 'mission/planification/ExecuteTransferts', 'mission/planification/ExecuteTransferts'),
(320, NULL, 'mission/planification/addArticletoChargement', 'mission/planification/addArticletoChargement'),
(321, NULL, 'mission/planification/getMissionPlanningClinets', 'mission/planification/getMissionPlanningClinets'),
(322, NULL, 'mission/planification/addMissionPlanningClinets', 'mission/planification/addMissionPlanningClinets'),
(323, NULL, 'mission/planification/editMissionPlanningClinets', 'mission/planification/editMissionPlanningClinets'),
(324, NULL, 'mission/planification/deleteMissionPlanningTournee', 'mission/planification/deleteMissionPlanningTournee'),
(325, 166, 'Liste des clients', 'mission/planification/getMissionPlanningRegulier'),
(326, NULL, 'mission/planification/getMissionPlanningRegulierTotalRows', 'mission/planification/getMissionPlanningRegulierTotalRows'),
(327, NULL, 'mission/planification/deleteClientsFromPlanning', 'mission/planification/deleteClientsFromPlanning'),
(328, NULL, 'mission/planification/deleteTransporterPlanning', 'mission/planification/deleteTransporterPlanning'),
(329, NULL, 'mission/planification/addClientsToRoad', 'mission/planification/addClientsToRoad'),
(330, 92, 'Quota et stock', 'mission/getQuotaLignes'),
(331, NULL, 'mission/getRoadBookHistorique', 'mission/getRoadBookHistorique'),
(332, NULL, 'mission/planification/quota/getQuotaParGroupe', 'mission/planification/quota/getQuotaParGroupe'),
(333, NULL, 'mission/planification/quota/getQuotaParPrevendeur', 'mission/planification/quota/getQuotaParPrevendeur'),
(334, NULL, 'Planning des missions et tournées régulières d’une journée', 'mission/planification/quota/comboGroupeVendeurs'),
(335, NULL, 'mission/planification/quota/setGroupeQuota', 'mission/planification/quota/setGroupeQuota'),
(336, NULL, 'mission/planification/quota/createQuota', 'mission/planification/quota/createQuota'),
(337, NULL, 'mission/planification/quota/proposeQuota', 'mission/planification/quota/proposeQuota'),
(338, NULL, 'mission/planification/createMissionsByCommands', 'mission/planification/createMissionsByCommands'),
(339, NULL, 'mission/planification/InitQuantiteVertuel', 'mission/planification/InitQuantiteVertuel'),
(340, NULL, 'mission/planification/getQuotaParGroupeModel', 'mission/planification/getQuotaParGroupeModel'),
(341, NULL, 'mission/planification/setQuotaParGroupeModel', 'mission/planification/setQuotaParGroupeModel'),
(342, NULL, 'mission/planification/InitQuotaFromModel', 'mission/planification/InitQuotaFromModel'),
(343, NULL, 'mission/planification/editMissionPlanning', 'mission/planification/editMissionPlanning'),
(344, NULL, 'message/getAlert', 'message/getAlert'),
(345, NULL, 'message/editAlert', 'message/editAlert'),
(346, NULL, 'message/deleteAlert', 'message/deleteAlert'),
(347, NULL, 'message/addAlert', 'message/addAlert'),
(348, NULL, 'message/Messages', 'message/Messages'),
(349, NULL, 'message/addMessages', 'message/addMessages'),
(350, NULL, 'message/deleteMessage', 'message/deleteMessage'),
(351, NULL, 'task/getTasks', 'task/getTasks'),
(352, NULL, 'task/updateTasks', 'task/updateTasks'),
(353, NULL, 'task/addTasks', 'task/addTasks'),
(354, NULL, 'task/deleteTasks', 'task/deleteTasks'),
(355, NULL, 'suivi/SuiviAdministratifRequired', 'suivi/SuiviAdministratifRequired'),
(356, NULL, 'suivi/SuiviAdministratif', 'suivi/SuiviAdministratif'),
(357, NULL, 'suivi/Operationtype', 'suivi/Operationtype'),
(358, NULL, 'suivi/OperationDocument', 'suivi/OperationDocument'),
(359, NULL, 'suivi/updateSuiviAdministratifRequired', 'suivi/updateSuiviAdministratifRequired'),
(360, NULL, 'suivi/addSuiviAdministratif', 'suivi/addSuiviAdministratif'),
(361, NULL, 'suivi/addDocumentParcOperation', 'suivi/addDocumentParcOperation'),
(362, NULL, 'suivi/deleteDocumentParcOperation', 'suivi/deleteDocumentParcOperation'),
(363, NULL, 'news/News', 'news/News'),
(364, NULL, 'news/addNews', 'news/addNews'),
(365, NULL, 'news/updateNews', 'news/updateNews'),
(366, NULL, 'parc/assurance/AssuranceContrats', 'parc/assurance/AssuranceContrats'),
(367, NULL, 'parc/assurance/updateAssuranceContrats', 'parc/assurance/updateAssuranceContrats'),
(368, NULL, 'parc/assurance/AssuranceVehicule', 'parc/assurance/AssuranceVehicule'),
(369, NULL, 'parc/assurance/updateAssuranceVehicule', 'parc/assurance/updateAssuranceVehicule'),
(370, NULL, 'parc/assurance/deleteAssuranceVehicule', 'parc/assurance/deleteAssuranceVehicule'),
(371, NULL, 'parc/assurance/AssuranceGarentie', 'parc/assurance/AssuranceGarentie'),
(372, NULL, 'parc/assurance/updateAssuranceGarentie', 'parc/assurance/updateAssuranceGarentie'),
(373, NULL, 'parc/assurance/AssuranceDocuments', 'parc/assurance/AssuranceDocuments'),
(374, NULL, 'parc/assurance/garentieType', 'parc/assurance/garentieType'),
(375, NULL, 'parc/assurance/addAssuranceContrats', 'parc/assurance/addAssuranceContrats'),
(376, NULL, 'parc/assurance/addVehiculeToAssuranceContrats', 'parc/assurance/addVehiculeToAssuranceContrats'),
(377, NULL, 'parc/assurance/addDocumentParcAssurance', 'parc/assurance/addDocumentParcAssurance'),
(378, NULL, 'parc/assurance/deleteDocumentParcAssurance', 'parc/assurance/deleteDocumentParcAssurance'),
(379, NULL, ' planning/contact/Planning', ' planning/contact/Planning'),
(380, NULL, 'planning/contact/addPlanning', 'planning/contact/addPlanning'),
(381, NULL, 'planning/contact/updatePlanning', 'planning/contact/updatePlanning'),
(382, NULL, 'planning/contact/deletePlanning', 'planning/contact/deletePlanning'),
(383, NULL, 'planning/contact/ContactPlanningStatus', 'planning/contact/ContactPlanningStatus'),
(384, NULL, 'planning/ressource/Planning', 'planning/ressource/Planning'),
(385, NULL, 'planning/ressource/addPlanning', 'planning/ressource/addPlanning'),
(386, NULL, 'planning/ressource/updatePlanning', 'planning/ressource/updatePlanning'),
(387, NULL, 'planning/ressource/deletePlanning', 'planning/ressource/deletePlanning'),
(388, NULL, 'planning/ressource/RessourcePlanningStatus', 'planning/ressource/RessourcePlanningStatus'),
(389, NULL, 'planning/ressource/RessourcePlanningType', 'planning/ressource/RessourcePlanningType'),
(390, NULL, ' infraction/Infraction', ' infraction/Infraction'),
(391, NULL, 'infraction/updateInfraction', 'infraction/updateInfraction'),
(392, NULL, 'infraction/addInfraction', 'infraction/addInfraction'),
(393, NULL, 'infraction/InfractionType', 'infraction/InfractionType'),
(394, NULL, 'infraction/MoyensAffecte', 'infraction/MoyensAffecte'),
(395, NULL, 'infraction/addMoyensAffecte', 'infraction/addMoyensAffecte'),
(396, NULL, 'infraction/deleteMoyensAffecte', 'infraction/deleteMoyensAffecte'),
(397, NULL, 'infraction/Temions', 'infraction/Temions'),
(398, NULL, 'infraction/updateTemion', 'infraction/updateTemion'),
(399, NULL, 'infraction/addTemion', 'infraction/addTemion'),
(400, NULL, 'infraction/deleteTemion', 'infraction/deleteTemion'),
(401, NULL, 'infraction/SancionAutorite', 'infraction/SancionAutorite'),
(402, NULL, 'infraction/updateSancionAutorite', 'infraction/updateSancionAutorite'),
(403, NULL, 'infraction/SancionEntreprise', 'infraction/SancionEntreprise'),
(404, NULL, 'infraction/updateSancionEntreprise', 'infraction/updateSancionEntreprise'),
(405, NULL, 'infraction/Remarque', 'infraction/Remarque'),
(406, NULL, 'infraction/updateRemarque', 'infraction/updateRemarque'),
(407, NULL, 'infraction/Document', 'infraction/Document'),
(408, NULL, 'infraction/addDocumentParcInfraction', 'infraction/addDocumentParcInfraction'),
(409, NULL, 'infraction/deleteDocumentParcInfraction', 'infraction/deleteDocumentParcInfraction'),
(410, NULL, ' ressource/comboVehicule', ' ressource/comboVehicule'),
(411, NULL, 'ressource/comboVehiculetype', 'ressource/comboVehiculetype'),
(412, NULL, 'ressource/ListRessource', 'ressource/ListRessource'),
(413, NULL, 'ressource/comboRessourceType', 'ressource/comboRessourceType'),
(414, NULL, 'ressource/marque', 'ressource/marque'),
(415, NULL, 'ressource/model', 'ressource/model'),
(416, NULL, 'ressource/usage', 'ressource/usage'),
(417, NULL, 'sinistre/sinistres', 'sinistre/sinistres'),
(418, NULL, 'sinistre/addSinistres', 'sinistre/addSinistres'),
(419, NULL, 'sinistre/updateSinistres', 'sinistre/updateSinistres'),
(420, NULL, 'sinistre/VehiculeAdversaire', 'sinistre/VehiculeAdversaire'),
(421, NULL, 'sinistre/addVehiculeAdversaire', 'sinistre/addVehiculeAdversaire'),
(422, NULL, 'sinistre/deleteVehiculeAdversaire', 'sinistre/deleteVehiculeAdversaire'),
(423, NULL, 'sinistre/PresonnesConcerne', 'sinistre/PresonnesConcerne'),
(424, NULL, 'sinistre/conboSituation', 'sinistre/conboSituation'),
(425, NULL, 'sinistre/addPresonnesConcerne', 'sinistre/addPresonnesConcerne'),
(426, NULL, 'sinistre/deletePresonnesConcerne', 'sinistre/deletePresonnesConcerne'),
(427, NULL, 'sinistre/LieuAccident', 'sinistre/LieuAccident'),
(428, NULL, 'sinistre/updateLieuAccident', 'sinistre/updateLieuAccident'),
(429, NULL, 'sinistre/SinistreAssuranceEtat', 'sinistre/SinistreAssuranceEtat'),
(430, NULL, 'sinistre/SinistreAssuranceDeclaration', 'sinistre/SinistreAssuranceDeclaration'),
(431, NULL, 'sinistre/SinistreAssuranceSuivi', 'sinistre/SinistreAssuranceSuivi'),
(432, NULL, 'sinistre/updateSinistreAssurance', 'sinistre/updateSinistreAssurance'),
(433, NULL, 'sinistre/SinistreRaport', 'sinistre/SinistreRaport'),
(434, NULL, 'sinistre/updateSinistreRaport', 'sinistre/updateSinistreRaport'),
(435, NULL, 'sinistre/SinistreDocument', 'sinistre/SinistreDocument'),
(436, NULL, 'sinistre/addDocumentParcSinistre', 'sinistre/addDocumentParcSinistre'),
(437, NULL, 'sinistre/deleteDocumentParcSinistre', 'sinistre/deleteDocumentParcSinistre'),
(438, NULL, 'users/groupuser', 'users/groupuser'),
(439, NULL, 'users/usersByGroup', 'users/usersByGroup'),
(440, NULL, 'users/addUser', 'users/addUser'),
(441, NULL, 'users/editUser', 'users/editUser'),
(442, NULL, 'users/deleteUser', 'users/deleteUser'),
(443, NULL, 'users/addGroupe', 'users/addGroupe'),
(444, NULL, 'users/ModulesGroup', 'users/ModulesGroup'),
(445, NULL, 'users/applicationByModule', 'users/applicationByModule'),
(446, NULL, 'users/editRightsToModules', 'users/editRightsToModules'),
(447, NULL, 'users/rightsToDashBoard', 'users/rightsToDashBoard'),
(448, NULL, 'users/updateRightsToDashBoard', 'users/updateRightsToDashBoard'),
(449, NULL, 'users/getRightsToRessourceTag', 'users/getRightsToRessourceTag'),
(450, NULL, 'users/getRessourceByTag', 'users/getRessourceByTag'),
(451, NULL, 'users/updateRightsToRessourceTag', 'users/updateRightsToRessourceTag'),
(452, NULL, 'users/getRightsToArticle', 'users/getRightsToArticle'),
(453, NULL, 'users/updateRightsToArticle', 'users/updateRightsToArticle'),
(454, NULL, 'users/getRightsToAnnuaire', 'users/getRightsToAnnuaire'),
(455, NULL, 'users/updateRightsToAnnuaire', 'users/updateRightsToAnnuaire'),
(456, NULL, 'users/modules', 'users/modules'),
(457, NULL, 'users/modulesChilds', 'users/modulesChilds'),
(458, NULL, 'users/profile', 'users/profile'),
(459, NULL, '/parametre/getIdendite', '/parametre/getIdendite'),
(460, NULL, '/parametre/updateIdendite', '/parametre/updateIdendite'),
(461, NULL, '/parametre/LocalisationEtContact', '/parametre/LocalisationEtContact'),
(462, NULL, '/parametre/updateLocalisationEtContact', '/parametre/updateLocalisationEtContact'),
(463, NULL, '/parametre/informationFiscBan', '/parametre/informationFiscBan'),
(464, NULL, '/parametre/updateInformationFiscBan', '/parametre/updateInformationFiscBan'),
(465, NULL, '/parametre/departements', '/parametre/departements'),
(466, NULL, 'depot/depotTypeCombo', 'depot/depotTypeCombo'),
(467, NULL, 'depot/depotAssocieCombo', 'depot/depotAssocieCombo'),
(468, NULL, '/parametre/updateDepartements', '/parametre/updateDepartements'),
(469, NULL, '/parametre/deleteDeparetements', '/parametre/deleteDeparetements'),
(470, NULL, '/parametre/addDepartements', '/parametre/addDepartements'),
(471, NULL, '/parametre/functions', '/parametre/functions'),
(472, NULL, '/parametre/updateFunctions', '/parametre/updateFunctions'),
(473, NULL, '/parametre/addFunctions', '/parametre/addFunctions'),
(474, NULL, '/parametre/deleteFonction', '/parametre/deleteFonction'),
(475, NULL, 'depot/comboDeparetements', 'depot/comboDeparetements'),
(476, NULL, 'depot/comboDepots', 'depot/comboDepots'),
(477, NULL, '/parametre/FamileArticle', '/parametre/FamileArticle'),
(478, NULL, '/parametre/addFamileArticle', '/parametre/addFamileArticle'),
(479, NULL, 'articleFamille/combo', 'articleFamille/combo'),
(480, NULL, 'articleFamilleGroup/combo', 'articleFamilleGroup/combo'),
(481, NULL, '/parametre/updateFamileArticle', '/parametre/updateFamileArticle'),
(482, NULL, '/parametre/deleteFamileArticle', '/parametre/deleteFamileArticle'),
(483, NULL, ' parametre/getGroupesClients', ' parametre/getGroupesClients'),
(484, NULL, 'parametre/addGroupesClients', 'parametre/addGroupesClients'),
(485, NULL, 'parametre/editGroupesClients', 'parametre/editGroupesClients'),
(486, NULL, 'parametre/deleteGroupesClients', 'parametre/deleteGroupesClients'),
(487, NULL, 'parametre/getGroupesPrix', 'parametre/getGroupesPrix'),
(488, NULL, 'parametre/addGroupesPrix', 'parametre/addGroupesPrix'),
(489, NULL, 'parametre/editGroupesPrix', 'parametre/editGroupesPrix'),
(490, NULL, 'parametre/deleteGroupesPrix', 'parametre/deleteGroupesPrix'),
(491, NULL, 'parametre/getComptes', 'parametre/getComptes'),
(492, NULL, 'parametre/getCaisses', 'parametre/getCaisses'),
(493, NULL, 'parametre/addComptes', 'parametre/addComptes'),
(494, NULL, 'parametre/addCaisses', 'parametre/addCaisses'),
(495, NULL, 'parametre/editComptes', 'parametre/editComptes'),
(496, NULL, 'parametre/editCaisses', 'parametre/editCaisses'),
(497, NULL, 'parametre/deleteComptes', 'parametre/deleteComptes'),
(498, NULL, 'parametre/deleteCaisses', 'parametre/deleteCaisses'),
(499, NULL, 'parametre/RH/getWorkDays', 'parametre/RH/getWorkDays'),
(500, NULL, 'parametre/RH/setWorkDays', 'parametre/RH/setWorkDays'),
(501, NULL, 'parametre/RH/getHolidays', 'parametre/RH/getHolidays'),
(502, NULL, 'parametre/RH/addHolidays', 'parametre/RH/addHolidays'),
(503, NULL, 'parametre/RH/editHolidays', 'parametre/RH/editHolidays'),
(504, NULL, 'parametre/RH/deleteHolidays', 'parametre/RH/deleteHolidays'),
(505, NULL, 'parametre/RH/getDemandeConge', 'parametre/RH/getDemandeConge'),
(506, NULL, 'parametre/RH/setDemandeConge', 'parametre/RH/setDemandeConge'),
(507, NULL, 'parametre/RH/getTypesAbsence', 'parametre/RH/getTypesAbsence'),
(508, NULL, 'parametre/RH/addTypesAbsence', 'parametre/RH/addTypesAbsence'),
(509, NULL, 'parametre/RH/comboBanques', 'parametre/RH/comboBanques'),
(510, NULL, 'parametre/RH/comboAgences', 'parametre/RH/comboAgences'),
(511, NULL, 'parametre/RH/editTypesAbsence', 'parametre/RH/editTypesAbsence'),
(512, NULL, 'parametre/RH/deleteTypeAbsence', 'parametre/RH/deleteTypeAbsence'),
(513, NULL, 'parametre/taxes/taxes', 'parametre/taxes/taxes'),
(514, NULL, 'parametre/taxes/addTaxes', 'parametre/taxes/addTaxes'),
(515, NULL, 'parametre/taxes/editTaxes', 'parametre/taxes/editTaxes'),
(516, NULL, 'parametre/taxes/deleteTaxes', 'parametre/taxes/deleteTaxes'),
(517, NULL, 'parametre/getMouvementNumerotation', 'parametre/getMouvementNumerotation'),
(518, NULL, 'parametre/addMouvementNumerotation', 'parametre/addMouvementNumerotation'),
(519, NULL, 'parametre/editMouvementNumerotation', 'parametre/editMouvementNumerotation'),
(520, NULL, 'parametre/deleteMouvementNumerotation', 'parametre/deleteMouvementNumerotation'),
(521, NULL, 'parametre/getEntrepots', 'parametre/getEntrepots'),
(522, NULL, 'parametre/addEntrepot', 'parametre/addEntrepot'),
(523, NULL, 'parametre/editEntrepot', 'parametre/editEntrepot'),
(524, NULL, 'parametre/deleteEntrepot', 'parametre/deleteEntrepot'),
(525, NULL, 'parametre/getDepots', 'parametre/getDepots'),
(526, NULL, 'parametre/addDepot', 'parametre/addDepot'),
(527, NULL, 'parametre/editDepot', 'parametre/editDepot'),
(528, NULL, 'parametre/deleteDepot', 'parametre/deleteDepot'),
(529, NULL, 'parametre/getDepotsMobiles', 'parametre/getDepotsMobiles'),
(530, NULL, 'parametre/addDepotMobile', 'parametre/addDepotMobile'),
(531, NULL, 'parametre/editDepotMobile', 'parametre/editDepotMobile'),
(532, NULL, 'parametre/deleteDepotMobile', 'parametre/deleteDepotMobile'),
(533, NULL, 'parametre/getColisType', 'parametre/getColisType'),
(534, NULL, 'parametre/addColisType', 'parametre/addColisType'),
(535, NULL, 'parametre/editColisType', 'parametre/editColisType'),
(536, NULL, 'parametre/deleteColisType', 'parametre/deleteColisType'),
(537, NULL, 'parametre/getColisTypeArticle', 'parametre/getColisTypeArticle'),
(538, NULL, 'parametre/addColisTypeArticle', 'parametre/addColisTypeArticle'),
(539, NULL, 'parametre/editColisTypeArticle', 'parametre/editColisTypeArticle'),
(540, NULL, 'parametre/deleteColisTypeArticle', 'parametre/deleteColisTypeArticle'),
(541, NULL, 'parametre/getEmplacementFamille', 'parametre/getEmplacementFamille'),
(542, NULL, 'parametre/addEmplacementFamille', 'parametre/addEmplacementFamille'),
(543, NULL, 'parametre/deleteEmplacementFamille', 'parametre/deleteEmplacementFamille'),
(544, NULL, 'parametre/ComboFonction', 'parametre/ComboFonction'),
(545, NULL, 'annuaire/contact', 'annuaire/contact'),
(546, NULL, 'annuaire/contacttotalrows', 'annuaire/contacttotalrows'),
(547, NULL, '/annuaire/group', '/annuaire/group'),
(548, NULL, '/annuaire/informations/contact', '/annuaire/informations/contact'),
(549, NULL, '/annuaire/informations/piecIdendite', '/annuaire/informations/piecIdendite'),
(550, NULL, '/annuaire/financeCompte', '/annuaire/financeCompte'),
(551, NULL, '/annuaire/information/permi', '/annuaire/information/permi'),
(552, NULL, '/annuaire/docs', '/annuaire/docs'),
(553, NULL, 'annuaire/workRelation', 'annuaire/workRelation'),
(554, NULL, '/annuaire/ressourceAttache', '/annuaire/ressourceAttache'),
(555, NULL, 'annuaire/addContact', 'annuaire/addContact'),
(556, NULL, '/annuaire/updateContact', '/annuaire/updateContact'),
(557, NULL, 'annuaire/updatePhoto', 'annuaire/updatePhoto'),
(558, NULL, 'annuaire/deletePhoto', 'annuaire/deletePhoto'),
(559, NULL, 'annuaire/contactType', 'annuaire/contactType'),
(560, NULL, 'annuaire/contactFunction', 'annuaire/contactFunction'),
(561, NULL, '/annuaire/updateContactGroup', '/annuaire/updateContactGroup'),
(562, NULL, '/annuaire/updateContactInfo', '/annuaire/updateContactInfo'),
(563, NULL, 'annuaire/addContactInfo', 'annuaire/addContactInfo'),
(564, NULL, 'annuaire/deleteContactInfo', 'annuaire/deleteContactInfo'),
(565, NULL, 'annuaire/updatePiencIdentite', 'annuaire/updatePiencIdentite'),
(566, NULL, 'annuaire/addFinanceCompte', 'annuaire/addFinanceCompte'),
(567, NULL, '/annuaire/updateFinanceCompte', '/annuaire/updateFinanceCompte'),
(568, 92, 'Liste des contact', 'contact/comboContact'),
(569, NULL, 'contact/comboContacttotalrows', 'contact/comboContacttotalrows'),
(570, NULL, 'contact/info', 'contact/info'),
(571, NULL, 'contact/assureur', 'contact/assureur'),
(572, NULL, 'contact/Archiver', 'contact/Archiver'),
(573, NULL, 'document/type', 'document/type'),
(574, NULL, 'contact/getContactPayementMethod', 'contact/getContactPayementMethod'),
(575, NULL, 'contact/setContactPayementMethod', 'contact/setContactPayementMethod'),
(576, NULL, 'annuaire/updatePermis', 'annuaire/updatePermis'),
(577, NULL, 'annuaire/deleteDoc', 'annuaire/deleteDoc'),
(578, NULL, 'annuaire/deleteFinanceCompte', 'annuaire/deleteFinanceCompte'),
(579, NULL, 'annuaire/addWorkRelation', 'annuaire/addWorkRelation'),
(580, NULL, 'annuaire/updateWorkRelation', 'annuaire/updateWorkRelation'),
(581, NULL, '/annuaire/deleteWorkRelation', '/annuaire/deleteWorkRelation'),
(582, NULL, 'parc/activitesDuJour', 'parc/activitesDuJour'),
(583, NULL, 'parc/affectation', 'parc/affectation'),
(584, NULL, 'parc/enReptureDeStock', 'parc/enReptureDeStock'),
(585, NULL, 'parc/moyennesGenEtEquip', 'parc/moyennesGenEtEquip'),
(586, NULL, 'parc/consommationStock', 'parc/consommationStock'),
(587, NULL, 'parc/ConsommationParDepartementService', 'parc/ConsommationParDepartementService'),
(588, NULL, 'parc/ProchanneMaintenancePreventive', 'parc/ProchanneMaintenancePreventive'),
(589, NULL, 'parc/ConsommationCarburant', 'parc/ConsommationCarburant'),
(590, NULL, 'parc/PannesEtMobilisation', 'parc/PannesEtMobilisation'),
(591, NULL, 'parc/ImmobilisationDesVehicules', 'parc/ImmobilisationDesVehicules'),
(592, NULL, 'parc/PannesDesVehicules', 'parc/PannesDesVehicules'),
(593, NULL, 'parc/DureMoyenneEntrePannes', 'parc/DureMoyenneEntrePannes'),
(594, NULL, 'parc/RapportDeConsommation', 'parc/RapportDeConsommation'),
(595, NULL, 'parc/carburantMonth', 'parc/carburantMonth'),
(596, NULL, 'parc/alarm', 'parc/alarm'),
(597, NULL, 'parc/sinistre', 'parc/sinistre'),
(598, NULL, 'parc/sinistres', 'parc/sinistres'),
(599, NULL, 'parc/sinistresPerYear', 'parc/sinistresPerYear'),
(600, NULL, 'parc/sinistressEvolutionPerYear', 'parc/sinistressEvolutionPerYear'),
(601, NULL, 'parc/coutMobilite', 'parc/coutMobilite'),
(602, NULL, 'parc/coutMobilitePerYear', 'parc/coutMobilitePerYear'),
(603, NULL, 'parc/ComparaisonAgences', 'parc/ComparaisonAgences'),
(604, NULL, 'parc/EvaluationAgences', 'parc/EvaluationAgences'),
(605, NULL, 'parc/ParcParType', 'parc/ParcParType'),
(606, NULL, 'parc/affectqtionParService', 'parc/affectqtionParService'),
(607, NULL, 'parc/ParcParMarques', 'parc/ParcParMarques'),
(608, NULL, 'parc/ParcParModeles', 'parc/ParcParModeles'),
(609, NULL, 'parc/EvolutionDuParc', 'parc/EvolutionDuParc'),
(610, NULL, 'parc/EvaluationsAndComportements', 'parc/EvaluationsAndComportements'),
(611, NULL, 'parc/Documents', 'parc/Documents'),
(612, NULL, 'parc/EvolutionConsommationsCarburantsParVehicule', 'parc/EvolutionConsommationsCarburantsParVehicule'),
(613, NULL, 'parc/EvolutionConsommationsPieceParVehicule', 'parc/EvolutionConsommationsPieceParVehicule'),
(614, NULL, 'parc/EvolutionConsommationsCarburants', 'parc/EvolutionConsommationsCarburants'),
(615, NULL, 'parc/EvolutionRegimesMoteurs', 'parc/EvolutionRegimesMoteurs'),
(616, NULL, 'parc/EvolutionConsommationsPiece', 'parc/EvolutionConsommationsPiece'),
(617, NULL, ' parc/vehicule/flotte', ' parc/vehicule/flotte'),
(618, NULL, 'parc/RQ_PARC_STAT_COUNT', 'parc/RQ_PARC_STAT_COUNT'),
(619, NULL, 'parc/vehicule/detailVehicule', 'parc/vehicule/detailVehicule'),
(620, NULL, 'parc/vehicule/detailCarburant', 'parc/vehicule/detailCarburant'),
(621, NULL, 'parc/vehicule/detailGPS', 'parc/vehicule/detailGPS'),
(622, NULL, 'parc/vehicule/creatEditVehicule', 'parc/vehicule/creatEditVehicule'),
(623, NULL, 'parc/vehicule/setIdentification', 'parc/vehicule/setIdentification'),
(624, NULL, 'parc/vehicule/setCarburant', 'parc/vehicule/setCarburant'),
(625, NULL, 'parc/vehicule/setUsage', 'parc/vehicule/setUsage'),
(626, NULL, 'parc/vehicule/setAffectation', 'parc/vehicule/setAffectation'),
(627, NULL, 'parc/vehicule/setAcquisition', 'parc/vehicule/setAcquisition'),
(628, NULL, 'parc/vehicule/documents', 'parc/vehicule/documents'),
(629, NULL, 'parc/vehicule/consommationCarburant', 'parc/vehicule/consommationCarburant'),
(630, NULL, 'parc/vehicule/consommationPieces', 'parc/vehicule/consommationPieces'),
(631, NULL, 'parc/vehicule/affectation', 'parc/vehicule/affectation'),
(632, NULL, 'parc/vehicule/affectation/miseADisposition', 'parc/vehicule/affectation/miseADisposition'),
(633, NULL, 'parc/vehicule/affectation/restitution', 'parc/vehicule/affectation/restitution'),
(634, NULL, 'parc/vehicule/moyensAttaches', 'parc/vehicule/moyensAttaches'),
(635, NULL, 'parc/vehicule/planning', 'parc/vehicule/planning'),
(636, NULL, 'parc/vehicule/photos', 'parc/vehicule/photos'),
(637, NULL, 'parc/vehicule/photos/addPhoto', 'parc/vehicule/photos/addPhoto'),
(638, NULL, 'parc/vehicule/photos/deletePhoto', 'parc/vehicule/photos/deletePhoto'),
(639, NULL, 'parc/vehicule/groupeVehicule', 'parc/vehicule/groupeVehicule'),
(640, NULL, 'parc/vehicule/exportGrid', 'parc/vehicule/exportGrid'),
(641, NULL, 'parc/consommationCarburant', 'parc/consommationCarburant'),
(642, NULL, 'parc/consommationCarburantDetails', 'parc/consommationCarburantDetails'),
(643, NULL, 'parc/consommationCarburantDocuments', 'parc/consommationCarburantDocuments'),
(644, NULL, 'parc/vehicule/affectation/update', 'parc/vehicule/affectation/update'),
(645, NULL, 'parc/vehicule/addDocumentParcVehicule', 'parc/vehicule/addDocumentParcVehicule'),
(646, NULL, 'parc/vehicule/deleteDocumentParcVehicule', 'parc/vehicule/deleteDocumentParcVehicule'),
(647, NULL, 'parc/vehicule/addDocumentConsommationCarburant', 'parc/vehicule/addDocumentConsommationCarburant'),
(648, NULL, 'parc/vehicule/deleteDocumentConsommationCarburant', 'parc/vehicule/deleteDocumentConsommationCarburant'),
(649, NULL, ' resume/ResumeDesIndicateurs', ' resume/ResumeDesIndicateurs'),
(650, NULL, 'resume/ResumeParMoisDesIndicateurs', 'resume/ResumeParMoisDesIndicateurs'),
(651, NULL, 'resume/ResumeParAnneeParIndicateur', 'resume/ResumeParAnneeParIndicateur'),
(652, NULL, 'resume/EvolutionParAnneeParIndicateur', 'resume/EvolutionParAnneeParIndicateur'),
(653, NULL, 'resume/ResumeDesEtatDesVehiculesParDepartement', 'resume/ResumeDesEtatDesVehiculesParDepartement'),
(654, NULL, 'resume/ObjectifsParents', 'resume/ObjectifsParents'),
(655, NULL, 'resume/ObjectifsChilds', 'resume/ObjectifsChilds'),
(656, NULL, 'resume/driversData', 'resume/driversData'),
(657, NULL, 'resume/carburantData', 'resume/carburantData'),
(658, NULL, 'resume/financeData', 'resume/financeData'),
(659, NULL, 'resume/parcData', 'resume/parcData'),
(660, NULL, 'resume/stockData', 'resume/stockData'),
(661, NULL, 'resume/missionsData', 'resume/missionsData'),
(662, NULL, 'resume/venteEtRealisationData', 'resume/venteEtRealisationData'),
(663, NULL, 'resume/venteEtRealisationDataLastMonth', 'resume/venteEtRealisationDataLastMonth'),
(664, NULL, 'resume/Objectifs', 'resume/Objectifs'),
(665, NULL, 'resume/ObjectifsByType resumerController@getObjectifsByType', 'resume/ObjectifsByType resumerController@getObjectifsByType'),
(666, NULL, 'resume/updateObjectifs resumerController@updateObjectifs', 'resume/updateObjectifs resumerController@updateObjectifs'),
(667, NULL, 'stock/VentesParVendeur', 'stock/VentesParVendeur'),
(668, NULL, 'stock/VentesParClient', 'stock/VentesParClient'),
(669, NULL, 'stock/VentesParRoute', 'stock/VentesParRoute'),
(670, NULL, 'stock/VentesParSecteur', 'stock/VentesParSecteur');
INSERT INTO `module_action` (`action_id`, `module_id`, `action_designation`, `url`) VALUES
(671, NULL, 'stock/VentesParZone', 'stock/VentesParZone'),
(672, NULL, 'stock/VentesStats', 'stock/VentesStats'),
(673, NULL, 'stock/ImpayeClients', 'stock/ImpayeClients'),
(674, NULL, 'stock/PlusComsommeVendusEvolution', 'stock/PlusComsommeVendusEvolution'),
(675, NULL, 'stock/IndicateursGeneraux', 'stock/IndicateursGeneraux'),
(676, NULL, 'resume/getCreancesClients', 'resume/getCreancesClients'),
(677, NULL, 'resume/getCreancesparBLClients', 'resume/getCreancesparBLClients'),
(678, NULL, 'resume/getCommunicationClients', 'resume/getCommunicationClients'),
(679, NULL, 'resume/ObjectifsbyYearAllmonth', 'resume/ObjectifsbyYearAllmonth'),
(680, NULL, 'resume/ParamObjectifsbymois', 'resume/ParamObjectifsbymois'),
(681, NULL, 'resume/ParamObjectifsbyvendeurbymois', 'resume/ParamObjectifsbyvendeurbymois'),
(682, NULL, 'stock/MouvementParJour', 'stock/MouvementParJour'),
(683, NULL, 'stock/MouvementParMois', 'stock/MouvementParMois'),
(684, NULL, 'stock/BLFournisseur', 'stock/BLFournisseur'),
(685, NULL, 'stock/MouvementParFamile', 'stock/MouvementParFamile'),
(686, NULL, 'stock/ArriverAuSeuil', 'stock/ArriverAuSeuil'),
(687, NULL, 'stock/PlusComsommeVendus', 'stock/PlusComsommeVendus'),
(688, NULL, 'stock/MoinsComsommeVendus', 'stock/MoinsComsommeVendus'),
(689, NULL, 'stock/VentesParClient', 'stock/VentesParClient'),
(690, NULL, 'stock/ressourcesByFamille', 'stock/ressourcesByFamille'),
(691, NULL, 'stock/ressourcesByMarque', 'stock/ressourcesByMarque'),
(692, NULL, 'stock/ressourcesByModel', 'stock/ressourcesByModel'),
(693, NULL, 'stock/affectation', 'stock/affectation'),
(694, NULL, 'stock/ressourceMouvements', 'stock/ressourceMouvements'),
(695, NULL, 'stock/ressourceMouvementsParAnnee', 'stock/ressourceMouvementsParAnnee'),
(696, NULL, 'stock/ressourceConsommation', 'stock/ressourceConsommation'),
(697, NULL, 'stock/ContactConsommation', 'stock/ContactConsommation'),
(698, NULL, 'stock/getData', 'stock/getData'),
(699, NULL, 'parc/geo/tourneesStationnement', 'parc/geo/tourneesStationnement'),
(700, NULL, 'parc/geo/historiqueDesTournees', 'parc/geo/historiqueDesTournees'),
(701, NULL, 'parc/geo/historiqueDesPositions', 'parc/geo/historiqueDesPositions'),
(702, NULL, 'parc/geo/activitesDesVehicule', 'parc/geo/activitesDesVehicule'),
(703, NULL, 'parc/geo/gaspillageCarburant', 'parc/geo/gaspillageCarburant'),
(704, NULL, 'parc/geo/pointsInterets', 'parc/geo/pointsInterets'),
(705, NULL, 'parc/geo/addPointsInterets', 'parc/geo/addPointsInterets'),
(706, NULL, 'RH/getEmployes', 'RH/getEmployes'),
(707, NULL, 'RH/getPersonalInformations', 'RH/getPersonalInformations'),
(708, NULL, 'RH/getProfissionnellesInformations', 'RH/getProfissionnellesInformations'),
(709, NULL, 'RH/setPersonalInformations', 'RH/setPersonalInformations'),
(710, NULL, 'RH/setProfissionnellesInformations', 'RH/setProfissionnellesInformations'),
(711, NULL, 'RH/formations/getformations', 'RH/formations/getformations'),
(712, NULL, 'RH/formations/getformationDetails', 'RH/formations/getformationDetails'),
(713, NULL, 'RH/formations/getStagiares', 'RH/formations/getStagiares'),
(714, NULL, 'RH/formations/getFormationCentre', 'RH/formations/getFormationCentre'),
(715, NULL, 'RH/formations/getFormateurs', 'RH/formations/getFormateurs'),
(716, NULL, 'RH/formations/getCalendrier', 'RH/formations/getCalendrier'),
(717, NULL, 'RH/formations/getCompteRendu', 'RH/formations/getCompteRendu'),
(718, NULL, 'RH/formations/getFormationDoc', 'RH/formations/getFormationDoc'),
(719, NULL, 'RH/formations/getDomaineCombo', 'RH/formations/getDomaineCombo'),
(720, NULL, 'RH/formations/editFormationCentre', 'RH/formations/editFormationCentre'),
(721, NULL, 'RH/formations/addStagiares', 'RH/formations/addStagiares'),
(722, NULL, 'RH/formations/addFormateurs', 'RH/formations/addFormateurs'),
(723, NULL, 'RH/formations/editFormationDetails', 'RH/formations/editFormationDetails'),
(724, NULL, 'RH/formations/comboEvaluation', 'RH/formations/comboEvaluation'),
(725, NULL, 'RH/formations/editCompteRendu', 'RH/formations/editCompteRendu'),
(726, NULL, 'RH/formations/deleteDoc', 'RH/formations/deleteDoc'),
(727, NULL, 'RH/Recrutement/getAnnoncesc', 'RH/Recrutement/getAnnoncesc'),
(728, NULL, 'RH/Recrutement/getAnnonces', 'RH/Recrutement/getAnnonces'),
(729, NULL, 'RH/Recrutement/getAnnonceDetail', 'RH/Recrutement/getAnnonceDetail'),
(730, NULL, 'RH/Recrutement/editAnnonce', 'RH/Recrutement/editAnnonce'),
(731, NULL, 'RH/Recrutement/addAnnonceDetail', 'RH/Recrutement/addAnnonceDetail'),
(732, NULL, 'RH/Recrutement/getCandidatures', 'RH/Recrutement/getCandidatures'),
(733, NULL, 'RH/Recrutement/addCandidat', 'RH/Recrutement/addCandidat'),
(734, NULL, 'RH/Recrutement/getCandidatDoc', 'RH/Recrutement/getCandidatDoc'),
(735, NULL, 'RH/Recrutement/setCandidatDoc', 'RH/Recrutement/setCandidatDoc'),
(736, NULL, 'RH/Recrutement/getDecisionEtContrat', 'RH/Recrutement/getDecisionEtContrat'),
(737, NULL, 'article/familles', 'article/familles'),
(738, NULL, 'article/', 'article/'),
(739, NULL, 'article/count/{famille}', 'article/count/{famille}'),
(740, NULL, 'article', 'article'),
(741, NULL, 'contact/mycontacts', 'contact/mycontacts'),
(742, NULL, 'contact/pages', 'contact/pages'),
(743, NULL, 'contact/addContact', 'contact/addContact'),
(744, NULL, 'contact/searchContact', 'contact/searchContact'),
(745, NULL, 'contact/financeEtablissement', 'contact/financeEtablissement'),
(746, NULL, 'contact/financeAgence', 'contact/financeAgence'),
(747, NULL, 'contact/addDoc', 'contact/addDoc'),
(748, NULL, 'contact/getParametres', 'contact/getParametres'),
(749, NULL, 'contact/setParametres', 'contact/setParametres'),
(750, NULL, 'contact/Parametres', 'contact/Parametres'),
(751, NULL, 'commande/intialiser', 'commande/intialiser'),
(752, NULL, 'commande/getMovements', 'commande/getMovements'),
(753, NULL, 'devices', 'devices'),
(754, NULL, '/devices/find', '/devices/find'),
(755, NULL, 'devices/activate', 'devices/activate'),
(756, NULL, '/devices/desactivate', '/devices/desactivate'),
(757, NULL, '/entreprise/domain', '/entreprise/domain'),
(758, NULL, 'devices/count ', 'devices/count '),
(759, NULL, 'achats/ComapatifOffres/getComaparatifOffres', 'achats/ComapatifOffres/getComaparatifOffres'),
(760, NULL, 'achats/Reglement/getReglement', 'achats/Reglement/getReglement'),
(761, NULL, 'achats/Reglement/espece', 'achats/Reglement/espece'),
(762, NULL, 'achats/Reglement/cheque', 'achats/Reglement/cheque'),
(763, NULL, 'achats/Reglement/virement', 'achats/Reglement/virement'),
(764, NULL, 'achats/Reglement/versement', 'achats/Reglement/versement'),
(765, NULL, 'achats/Reglement/deleteReglement', 'achats/Reglement/deleteReglement'),
(766, NULL, 'achats/Reglement/deleteEspece', 'achats/Reglement/deleteEspece'),
(767, NULL, 'achats/Reglement/deleteCheque', 'achats/Reglement/deleteCheque'),
(768, NULL, 'achats/Reglement/deleteVirement', 'achats/Reglement/deleteVirement'),
(769, NULL, 'achats/Reglement/deleteVersement', 'achats/Reglement/deleteVersement'),
(770, NULL, 'achats/Reglement/addReglement', 'achats/Reglement/addReglement'),
(771, NULL, 'achats/Reglement/addEspece', 'achats/Reglement/addEspece'),
(772, NULL, 'achats/Reglement/addCheque', 'achats/Reglement/addCheque'),
(773, NULL, 'achats/Reglement/addVirement', 'achats/Reglement/addVirement'),
(774, NULL, 'achats/Reglement/addVersement', 'achats/Reglement/addVersement'),
(775, NULL, 'achats/Reglement/editReglement', 'achats/Reglement/editReglement'),
(776, NULL, 'achats/Reglement/editEspece', 'achats/Reglement/editEspece'),
(777, NULL, 'achats/Reglement/editCheque', 'achats/Reglement/editCheque'),
(778, NULL, 'achats/Reglement/editVirement', 'achats/Reglement/editVirement'),
(779, NULL, 'achats/Reglement/editVersement', 'achats/Reglement/editVersement'),
(780, NULL, 'achats/Reglement/operationMouvement', 'achats/Reglement/operationMouvement'),
(781, NULL, 'achats/Reglement/addOperationMouvement', 'achats/Reglement/addOperationMouvement'),
(782, NULL, 'achats/Reglement/deleteOperationMouvement', 'achats/Reglement/deleteOperationMouvement'),
(783, NULL, 'achats/listDesAchat', 'achats/listDesAchat'),
(784, NULL, 'achats/listDesachats/details', 'achats/listDesachats/details'),
(785, NULL, 'achats/listDesachats/PaiementHistory', 'achats/listDesachats/PaiementHistory'),
(786, NULL, 'achats/getReglementType', 'achats/getReglementType'),
(787, NULL, 'achats/getCompteCombo', 'achats/getCompteCombo'),
(788, NULL, 'achats/getOperationCombo', 'achats/getOperationCombo'),
(789, NULL, 'achats/getReglementByVendeur', 'achats/getReglementByVendeur'),
(790, NULL, 'achats/getDetailReglementByVendeur', 'achats/getDetailReglementByVendeur'),
(791, NULL, 'achats/mission/getMissionSortie', 'achats/mission/getMissionSortie'),
(792, NULL, 'achats/mission/addMissionSortie', 'achats/mission/addMissionSortie'),
(793, NULL, 'achats/mission/editMissionSortie', 'achats/mission/editMissionSortie'),
(794, NULL, 'achats/mission/deleteMissionSortie', 'achats/mission/deleteMissionSortie'),
(795, NULL, 'achats/mission/getMissionSortieLigne', 'achats/mission/getMissionSortieLigne'),
(796, NULL, 'achats/mission/setMissionSortieLigne', 'achats/mission/setMissionSortieLigne'),
(797, NULL, 'achats/mission/deleteMissionSortieLigne', 'achats/mission/deleteMissionSortieLigne'),
(798, NULL, 'ventes/listClients', 'ventes/listClients'),
(799, NULL, 'ventes/listClientstotalrows', 'ventes/listClientstotalrows'),
(800, NULL, 'ventes/addClient', 'ventes/addClient'),
(801, NULL, 'ventes/editClient', 'ventes/editClient'),
(802, NULL, 'ventes/deleteClient', 'ventes/deleteClient'),
(803, NULL, 'ventes/client/info', 'ventes/client/info'),
(804, NULL, 'ventes/setClientInfo', 'ventes/setClientInfo'),
(805, NULL, 'ventes/authoriseCredit', 'ventes/authoriseCredit'),
(806, NULL, 'ventes/ventsEtOpportunites/derniersVents', 'ventes/ventsEtOpportunites/derniersVents'),
(807, NULL, 'ventes/ventsEtOpportunites/evolutionAchatPerMonth', 'ventes/ventsEtOpportunites/evolutionAchatPerMonth'),
(808, NULL, 'ventes/ventsEtOpportunites/ventsParArticle', 'ventes/ventsEtOpportunites/ventsParArticle'),
(809, NULL, 'ventes/historiqueDesPassages', 'ventes/historiqueDesPassages'),
(810, NULL, 'ventes/communicationsEtSupports', 'ventes/communicationsEtSupports'),
(811, NULL, 'ventes/marketing', 'ventes/marketing'),
(812, NULL, 'ventes/activite', 'ventes/activite'),
(813, NULL, 'ventes/autorisation/applicationMobile', 'ventes/autorisation/applicationMobile'),
(814, NULL, 'ventes/autorisation/setApplicationMobile', 'ventes/autorisation/setApplicationMobile'),
(815, NULL, 'ventes/autorisation/partageEtInvitation', 'ventes/autorisation/partageEtInvitation'),
(816, NULL, 'ventes/autorisation/SetPartageEtInvitation', 'ventes/autorisation/SetPartageEtInvitation'),
(817, NULL, 'ventes/documentClient', 'ventes/documentClient'),
(818, NULL, 'ventes/setDocumentClient', 'ventes/setDocumentClient'),
(819, NULL, 'ventes/deleteDocumentClient', 'ventes/deleteDocumentClient'),
(820, NULL, 'ventes/clientsPerso', 'ventes/clientsPerso'),
(821, NULL, 'ventes/addClientsPerso', 'ventes/addClientsPerso'),
(822, NULL, 'ventes/editClientsPerso', 'ventes/editClientsPerso'),
(823, NULL, 'ventes/deleteClientsPerso', 'ventes/deleteClientsPerso'),
(824, NULL, 'ventes/livraison/derniersLivraison', 'ventes/livraison/derniersLivraison'),
(825, NULL, 'ventes/livraison/evolutionLivraisonPerMonth', 'ventes/livraison/evolutionLivraisonPerMonth'),
(826, NULL, 'ventes/vendeurs', 'ventes/vendeurs'),
(827, NULL, 'ventes/vendeurstotalrows', 'ventes/vendeurstotalrows'),
(828, NULL, 'ventes/addVendeurs', 'ventes/addVendeurs'),
(829, NULL, 'ventes/editVendeurs', 'ventes/editVendeurs'),
(830, NULL, 'ventes/deleteVendeurs', 'ventes/deleteVendeurs'),
(831, NULL, 'ventes/vendeurs/autorisation', 'ventes/vendeurs/autorisation'),
(832, NULL, 'ventes/vendeurs/applicationMobile', 'ventes/vendeurs/applicationMobile'),
(833, NULL, 'ventes/vendeurs/setAutorisation', 'ventes/vendeurs/setAutorisation'),
(834, NULL, 'ventes/vendeurs/setApplicationMobile', 'ventes/vendeurs/setApplicationMobile'),
(835, NULL, 'ventes/vendeurs/setAuth', 'ventes/vendeurs/setAuth'),
(836, NULL, 'ventes/vendeurs/getAuthg', 'ventes/vendeurs/getAuthg'),
(837, NULL, 'ventes/vendeurs/realisation/activite', 'ventes/vendeurs/realisation/activite'),
(838, NULL, 'ventes/vendeurs/realisation/resumeMois', 'ventes/vendeurs/realisation/resumeMois'),
(839, NULL, 'ventes/vendeurs/objectifs', 'ventes/vendeurs/objectifs'),
(840, NULL, 'ventes/ClientPlanningStatus', 'ventes/ClientPlanningStatus'),
(841, NULL, 'ventes/CritereType', 'ventes/CritereType'),
(842, NULL, 'ventes/CommunicationClientType', 'ventes/CommunicationClientType'),
(843, NULL, 'ventes/packPromotionsList', 'ventes/packPromotionsList'),
(844, NULL, 'ventes/packPromotions', 'ventes/packPromotions'),
(845, NULL, 'ventes/packPromotions/addPack', 'ventes/packPromotions/addPack'),
(846, NULL, 'ventes/packPromotions/editPack', 'ventes/packPromotions/editPack'),
(847, NULL, 'ventes/packPromotions/deletePack', 'ventes/packPromotions/deletePack'),
(848, NULL, 'ventes/packPromotions/articles', 'ventes/packPromotions/articles'),
(849, NULL, 'ventes/packPromotions/addArticleToPack', 'ventes/packPromotions/addArticleToPack'),
(850, NULL, 'ventes/packPromotions/editArticleOfPack', 'ventes/packPromotions/editArticleOfPack'),
(851, 9, 'ventes/packPromotions/deleteArticleFromPack', 'ventes/packPromotions/deleteArticleFromPack'),
(852, NULL, 'ventes/packPromotions/transformPackToArticle', 'ventes/packPromotions/transformPackToArticle'),
(853, NULL, 'ventes/vendeurslist', 'ventes/vendeurslist'),
(854, NULL, 'ventes/getVendeursActivite', 'ventes/getVendeursActivite'),
(855, NULL, 'ventes/getClientParPlanning', 'ventes/getClientParPlanning'),
(856, 152, 'Voir la liste des encaissements', 'finances/sessionCaisse/getListCaisse'),
(857, NULL, 'finances/sessionCaisse/getResumeVendeur', 'finances/sessionCaisse/getResumeVendeur'),
(858, NULL, 'finances/sessionCaisse/getEcartCaisse', 'finances/sessionCaisse/getEcartCaisse'),
(859, NULL, 'finances/sessionCaisse/addSession', 'finances/sessionCaisse/addSession'),
(860, NULL, 'finances/sessionCaisse/editSession', 'finances/sessionCaisse/editSession'),
(861, NULL, 'finances/sessionCaisse/deleteSession', 'finances/sessionCaisse/deleteSession'),
(862, NULL, 'finances/sessionCaisse/getMontantsMissionCaisse', 'finances/sessionCaisse/getMontantsMissionCaisse'),
(863, NULL, 'finances/sessionCaisse/setMissionValidationCaisse', 'finances/sessionCaisse/setMissionValidationCaisse'),
(864, NULL, 'finances/sessionCaisse/getMontantEcartTotalVendeur', 'finances/sessionCaisse/getMontantEcartTotalVendeur'),
(865, NULL, 'finances/sessionCaisse/reglementEcartVendeur', 'finances/sessionCaisse/reglementEcartVendeur'),
(866, NULL, ' finances/mouvementCaisse/MouvementCaisse', ' finances/mouvementCaisse/MouvementCaisse'),
(867, NULL, 'finances/mouvementCaisse/MouvementCaisseTotalRows', 'finances/mouvementCaisse/MouvementCaisseTotalRows'),
(868, NULL, 'finances/mouvementCaisse/getComboCaisse', 'finances/mouvementCaisse/getComboCaisse'),
(869, NULL, 'finances/mouvementCaisse/getComboType', 'finances/mouvementCaisse/getComboType'),
(870, NULL, ' finances/etatCompte/getEtatCompte', ' finances/etatCompte/getEtatCompte'),
(871, NULL, 'finances/etatCompte/getTotal', 'finances/etatCompte/getTotal'),
(872, NULL, 'finances/etatCompte/getEtatFournisseur', 'finances/etatCompte/getEtatFournisseur'),
(873, NULL, 'finances/etatCompte/updateEtatFournisseur', 'finances/etatCompte/updateEtatFournisseur'),
(874, NULL, 'finances/etatCompte/getSoldeInitial', 'finances/etatCompte/getSoldeInitial'),
(875, NULL, ' users/modulemobile', ' users/modulemobile'),
(876, NULL, 'users/addModuleMobile', 'users/addModuleMobile'),
(877, NULL, 'users/editModuleMobile', 'users/editModuleMobile'),
(878, NULL, 'users/deleteModuleMobile', 'users/deleteModuleMobile'),
(879, NULL, 'users/getModuleMobilegroupuser', 'users/getModuleMobilegroupuser'),
(880, NULL, 'users/setModuleMobilegroupuser', 'users/setModuleMobilegroupuser'),
(881, NULL, 'users/addDeviceCompte', 'users/addDeviceCompte'),
(882, NULL, 'users/setDeviceCompte', 'users/setDeviceCompte'),
(883, NULL, 'users/getDeviceCompte', 'users/getDeviceCompte'),
(884, NULL, 'users/deleteDeviceCompte', 'users/deleteDeviceCompte'),
(885, NULL, 'users/addUserParametres', 'users/addUserParametres'),
(886, NULL, 'users/deleteUserParametres', 'users/deleteUserParametres'),
(887, NULL, 'users/getUserParametres ', 'users/getUserParametres '),
(888, NULL, 'users/setUserParametres', 'users/setUserParametres'),
(889, NULL, 'users/addInscription', 'users/addInscription'),
(890, NULL, 'users/deleteInscription', 'users/deleteInscription'),
(891, NULL, 'users/setInscription', 'users/setInscription'),
(892, NULL, 'users/getInscription', 'users/getInscription'),
(893, NULL, 'users/deleteGroupeUser', 'users/deleteGroupeUser'),
(894, NULL, 'users/editGroupeUser', 'users/editGroupeUser'),
(895, NULL, 'chifre', 'chifre'),
(896, NULL, 'upload', 'upload'),
(897, NULL, 'export/export', 'export/export'),
(898, NULL, 'export/exportDoc', 'export/exportDoc'),
(899, NULL, 'export/exportExcel', 'export/exportExcel'),
(900, NULL, 'export/exportBonsByMissionDate', 'export/exportBonsByMissionDate'),
(901, NULL, 'export/exportExcelBons', 'export/exportExcelBons'),
(902, NULL, 'export/exportUnpaidBL', 'export/exportUnpaidBL'),
(903, NULL, 'export/exportUnpaidBLGrp', 'export/exportUnpaidBLGrp'),
(904, NULL, 'export/exportUnpaidBLGrpByV', 'export/exportUnpaidBLGrpByV'),
(905, NULL, 'export/Export_recuVersement ', 'export/Export_recuVersement '),
(906, NULL, 'export/exportMissionsByDate', 'export/exportMissionsByDate'),
(907, NULL, 'export/exportClientsOfMission', 'export/exportClientsOfMission'),
(908, NULL, 'export/exportAllFromParc', 'export/exportAllFromParc'),
(909, NULL, 'export/exportVehicules', 'export/exportVehicules'),
(910, NULL, 'Imprimer les BSR', 'export/exportBonSortieRetour'),
(911, NULL, 'export/exportPackArticles', 'export/exportPackArticles'),
(912, 92, 'Imprimé RoadBook', 'export/exportRoadBook'),
(913, NULL, 'export/exportRoadBookByDate', 'export/exportRoadBookByDate'),
(914, NULL, 'export/exportDDR', 'export/exportDDR'),
(915, NULL, 'export/exportBonChargementEtBsr', 'export/exportBonChargementEtBsr'),
(916, NULL, 'export/exportMouvementsByDate', 'export/exportMouvementsByDate'),
(917, NULL, 'export/exportBonChargementEtBsr', 'export/exportBonChargementEtBsr'),
(918, NULL, 'export/exportMouvementsByDate', 'export/exportMouvementsByDate'),
(919, NULL, 'SyncDB/getData', 'SyncDB/getData'),
(920, NULL, 'SyncDB/addreglement', 'SyncDB/addreglement'),
(921, NULL, 'SyncDB/addMouvement', 'SyncDB/addMouvement'),
(922, NULL, 'SyncDB/SyncData', 'SyncDB/SyncData'),
(923, NULL, 'SyncDB/getMissionZoneData', 'SyncDB/getMissionZoneData'),
(924, NULL, 'test', 'test'),
(925, NULL, 'tests/2/alpha', 'tests/2/alpha'),
(926, NULL, 'testSin', 'testSin'),
(927, NULL, 'log/UserInfo', 'log/UserInfo'),
(928, NULL, 'log/DeviceSerialNumber', 'log/DeviceSerialNumber'),
(929, NULL, 'log/getUserDeviceLog', 'log/getUserDeviceLog'),
(930, NULL, 'log/UserIP', 'log/UserIP'),
(931, NULL, 'log/setUserDeviceLog', 'log/setUserDeviceLog'),
(932, NULL, 'log/OperationsList', 'log/OperationsList'),
(933, NULL, 'log/operationsList', 'log/operationsList'),
(934, NULL, 'log/UserInfo', 'log/UserInfo'),
(935, NULL, 'log/DeviceSerialNumber', 'log/DeviceSerialNumber'),
(936, NULL, 'log/getUserDeviceLog', 'log/getUserDeviceLog'),
(937, NULL, 'log/UserIP', 'log/UserIP'),
(938, NULL, 'log/setUserDeviceLog', 'log/setUserDeviceLog'),
(939, NULL, 'log/OperationsList', 'log/OperationsList'),
(940, NULL, 'log/operationsList', 'log/operationsList'),
(941, NULL, 'test', 'test'),
(942, NULL, 'client/getCode', 'client/getCode'),
(943, NULL, 'synNextCode', 'synNextCode'),
(944, NULL, 'setpassword', 'setpassword'),
(945, NULL, 'objectif/addObjectifVendeur', 'objectif/addObjectifVendeur'),
(946, NULL, 'objectif/updateObjectifVendeur', 'objectif/updateObjectifVendeur'),
(947, NULL, 'objectif/deleteObjectifVendeur', 'objectif/deleteObjectifVendeur'),
(948, NULL, 'statistique/getCategory', 'statistique/getCategory'),
(949, NULL, 'statistique/getFilterCol', 'statistique/getFilterCol'),
(950, NULL, 'statistique/getFilterRow', 'statistique/getFilterRow'),
(951, NULL, 'statistiques/getStats', 'statistiques/getStats'),
(952, NULL, 'parametre/FamileArticle', 'parametre/FamileArticle'),
(953, NULL, 'users/getActionsByModule', 'users/getActionsByModule'),
(954, 155, 'Afficher les mouvements', 'stock/mouvements/Mouvement'),
(955, 92, 'Afficher les BC/BT/BL', 'stock/mouvements/Mouvement'),
(956, 152, 'Liste des missions', 'mission/Missions'),
(961, 105, 'Tester la conformité de l\'inventaire', 'stock/mouvements/conformiteInventaire'),
(971, 105, 'Ajouter un article a l\'inventaire', 'stock/mouvements/addMouvementLigne'),
(981, 105, 'Créer un inventaire', 'stock/mouvements/addMouvement'),
(991, 95, 'Liste des missions planifiées', 'mission/planification/MissionPlanning'),
(1001, 95, 'Supprimer une mission planifiée', 'mission/planification/deleteMissionPlanning'),
(1011, 95, 'Ajouter une mission planifiée', 'mission/planification/addMissionPlanning'),
(1021, 95, 'Modifier une mission planifiée', 'mission/planification/editMissionPlanning'),
(1031, 95, 'Liste des clients d\'une mission planifiée', 'mission/planification/getMissionPlanningClinets'),
(1041, 95, 'Activer/desactiver des clients d\'une mission planifiée', 'mission/planification/editMissionPlanningClinets'),
(1051, 95, 'Ajouter un client a une mission planifiée', 'mission/planification/addMissionPlanningClinets'),
(1061, 155, 'Transfer des quantités d\'un dépôt', 'stock/mouvements/transferToDepotPrincipale'),
(1071, 92, 'Modification du quota a partir de la mission', 'stock/mouvements/EditQuotaQuantite'),
(1081, 92, 'Impression des BL', 'export/exportDoc'),
(1091, 92, 'Impression des BSR', 'export/exportBonChargementEtBsr'),
(1101, 92, 'Impression des BC', 'export/exportMouvementsByDate'),
(1111, 95, 'edition de quota ', 'mission/getQuotaLignes'),
(1121, 311, 'Changement du vendeur d\'une mission chargée', 'support/editVendeurOfMission');

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

--
-- Structure de la table `module_mobile`
--

CREATE TABLE `module_mobile` (
  `module_id` bigint(20) NOT NULL,
  `module_name` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `module_sysname` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `active` tinyint(4) DEFAULT NULL,
  `download_link` varchar(255) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `module_mobile` (`module_id`, `module_name`, `module_sysname`, `active`, `download_link`) VALUES
(1, 'application 1 ', 'app1', 1, NULL),
(2, 'application 2', 'app2', 1, NULL),
(3, 'application 3', 'app3', 1, 'download.com');

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

--
-- Structure de la table `module_mobile_group_user`
--

CREATE TABLE `module_mobile_group_user` (
  `module_id` bigint(20) NOT NULL,
  `group_user_id` bigint(20) NOT NULL,
  `is_authorized` tinyint(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `motif_conge`
--

CREATE TABLE `motif_conge` (
  `motif_conge_id` int(11) NOT NULL,
  `motif_conge_dsignation` varchar(256) CHARACTER SET latin1 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement`
--

CREATE TABLE `mouvement` (
  `mouvement_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `concern_contact_id` bigint(20) DEFAULT NULL,
  `mouvement_type_id` bigint(20) DEFAULT NULL,
  `mouvement_response_to_mouvement_id` bigint(20) DEFAULT NULL,
  `mouvement_status_id` bigint(20) DEFAULT NULL,
  `mission_id` bigint(20) DEFAULT NULL,
  `mouvement_status_from_date` datetime DEFAULT NULL,
  `mouvement_is_canceled` tinyint(1) NOT NULL DEFAULT '0',
  `mouvement_cancel_dale` datetime DEFAULT NULL,
  `mouvement_created_by` bigint(20) DEFAULT NULL,
  `mouvement_created_date` datetime DEFAULT NULL,
  `mouvement_created_date_day` date DEFAULT NULL,
  `mouvement_date` datetime DEFAULT NULL,
  `mouvement_date_day` date DEFAULT NULL,
  `mouvement_date_echeance` datetime DEFAULT NULL,
  `mouvement_date_echeance_day` date DEFAULT NULL,
  `mouvement_numero_prefixe` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_numero_sequentiel` bigint(20) DEFAULT NULL,
  `mouvement_numero_complet` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_annee_exercice` int(11) DEFAULT NULL,
  `mouvement_commentaire` text COLLATE utf8_unicode_ci,
  `mouvement_footer_text` text COLLATE utf8_unicode_ci,
  `livraison_date_souhaite` datetime DEFAULT NULL,
  `livraison_date_souhaite_day` date DEFAULT NULL,
  `livraison_livreur_souhaite` bigint(20) DEFAULT NULL,
  `livraison_is_delivered` tinyint(1) DEFAULT NULL,
  `livraison_deliver_date` datetime DEFAULT NULL,
  `livraison_deliver_date_day` date DEFAULT NULL,
  `livraison_livreur_id` bigint(20) DEFAULT NULL,
  `is_validated` tinyint(1) DEFAULT NULL,
  `validator_user_id` bigint(20) DEFAULT NULL,
  `project_id` bigint(20) DEFAULT NULL,
  `montant_total_fidelite` double DEFAULT NULL,
  `comptable_compte_id` bigint(20) DEFAULT NULL,
  `mouvement_monnaie_id` bigint(20) DEFAULT NULL,
  `montant_remise` double DEFAULT NULL,
  `taux_remise` double DEFAULT NULL,
  `montant_total_ht_apres_remise` double DEFAULT NULL,
  `montant_total_ht` double DEFAULT NULL,
  `tva_status` tinyint(1) DEFAULT NULL,
  `mouvement_add_tva` tinyint(1) DEFAULT NULL,
  `mouvement_hide_tva` tinyint(1) DEFAULT NULL,
  `montant_total_tva` double NOT NULL DEFAULT '0',
  `montant_total_autres_taxes` double DEFAULT NULL,
  `montant_total_ttc` double DEFAULT NULL,
  `montant_lettre` text COLLATE utf8_unicode_ci,
  `is_espece` tinyint(1) DEFAULT NULL,
  `is_timbre` tinyint(1) DEFAULT NULL,
  `taux_timbre` double DEFAULT NULL,
  `montant_timbre` double DEFAULT NULL,
  `montant_total` double DEFAULT NULL,
  `montant_regle` double DEFAULT NULL,
  `is_paid` tinyint(1) DEFAULT NULL,
  `mouvement_update_lock_status` tinyint(1) DEFAULT NULL,
  `mouvement_update_lock_date` datetime DEFAULT NULL,
  `mouvement_paiement_delai_id` bigint(20) DEFAULT NULL,
  `is_offre_to_us` tinyint(1) DEFAULT NULL,
  `is_offre_request` tinyint(1) DEFAULT NULL,
  `offre_type_id` bigint(20) DEFAULT NULL,
  `offre_date_debut` datetime DEFAULT NULL,
  `offre_date_fin` datetime DEFAULT NULL,
  `offre_is_expired` tinyint(1) DEFAULT NULL,
  `offre_send_response` tinyint(1) DEFAULT NULL,
  `offre_send_response_date` datetime DEFAULT NULL,
  `offre_is_cancel` tinyint(1) DEFAULT NULL,
  `urgence` tinyint(1) DEFAULT NULL,
  `comptabilite_type_id` bigint(20) DEFAULT NULL,
  `is_printed` tinyint(1) DEFAULT NULL,
  `structure` bigint(20) DEFAULT NULL,
  `ressource_id` bigint(20) DEFAULT NULL,
  `demande_activated` tinyint(1) DEFAULT NULL,
  `demande_activated_date` datetime DEFAULT NULL,
  `validation_livraison_demandeur` tinyint(1) DEFAULT NULL,
  `validation_livraison_magasinier` tinyint(1) DEFAULT NULL,
  `commentaire_magasinier` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `damande_validated_date` datetime DEFAULT NULL,
  `temps_traitement_demande` bigint(20) DEFAULT NULL,
  `entrepot_source` bigint(20) DEFAULT NULL,
  `entrepot_destination` bigint(20) DEFAULT NULL,
  `is_stocked` tinyint(1) DEFAULT NULL,
  `stockage_date` date DEFAULT NULL,
  `carburant` tinyint(1) DEFAULT NULL,
  `invoiced` tinyint(2) DEFAULT NULL,
  `charche` tinyint(2) DEFAULT NULL,
  `is_package` tinyint(2) DEFAULT NULL,
  `Livraison_dediee` tinyint(4) DEFAULT NULL,
  `finance_mode_paiement_id` bigint(20) DEFAULT NULL,
  `is_validated_source` tinyint(1) DEFAULT NULL,
  `validator_source_user_id` bigint(20) DEFAULT NULL,
  `is_validated_destination` tinyint(1) DEFAULT NULL,
  `validator_destination_user_id` bigint(20) DEFAULT NULL,
  `validated_source_date` date DEFAULT NULL,
  `validated_destination_date` date DEFAULT NULL,
  `recived_by_id` bigint(20) DEFAULT NULL,
  `recived_date` date DEFAULT NULL,
  `latitude_decimal` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `longitude_decimal` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_inventaire_id1` bigint(20) DEFAULT NULL,
  `contact_inventaire_id2` bigint(20) DEFAULT NULL,
  `contact_inventaire_id3` bigint(20) DEFAULT NULL,
  `num_bl_fournisseur` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sync_mode` tinyint(4) DEFAULT '0',
  `validation_credit` tinyint(2) DEFAULT NULL,
  `credit_validated_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `date_validation_credit` date DEFAULT NULL,
  `package_cost` double DEFAULT '0',
  `is_promo` tinyint(4) NOT NULL DEFAULT '0',
  `sync_id` tinyint(1) DEFAULT NULL,
  `sync_data` tinyint(1) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='voir la relation projet_id';

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

INSERT INTO `mouvement` (`mouvement_id`, `entreprise_id`, `concern_contact_id`, `mouvement_type_id`, `mouvement_response_to_mouvement_id`, `mouvement_status_id`, `mission_id`, `mouvement_status_from_date`, `mouvement_is_canceled`, `mouvement_cancel_dale`, `mouvement_created_by`, `mouvement_created_date`, `mouvement_created_date_day`, `mouvement_date`, `mouvement_date_day`, `mouvement_date_echeance`, `mouvement_date_echeance_day`, `mouvement_numero_prefixe`, `mouvement_numero_sequentiel`, `mouvement_numero_complet`, `mouvement_annee_exercice`, `mouvement_commentaire`, `mouvement_footer_text`, `livraison_date_souhaite`, `livraison_date_souhaite_day`, `livraison_livreur_souhaite`, `livraison_is_delivered`, `livraison_deliver_date`, `livraison_deliver_date_day`, `livraison_livreur_id`, `is_validated`, `validator_user_id`, `project_id`, `montant_total_fidelite`, `comptable_compte_id`, `mouvement_monnaie_id`, `montant_remise`, `taux_remise`, `montant_total_ht_apres_remise`, `montant_total_ht`, `tva_status`, `mouvement_add_tva`, `mouvement_hide_tva`, `montant_total_tva`, `montant_total_autres_taxes`, `montant_total_ttc`, `montant_lettre`, `is_espece`, `is_timbre`, `taux_timbre`, `montant_timbre`, `montant_total`, `montant_regle`, `is_paid`, `mouvement_update_lock_status`, `mouvement_update_lock_date`, `mouvement_paiement_delai_id`, `is_offre_to_us`, `is_offre_request`, `offre_type_id`, `offre_date_debut`, `offre_date_fin`, `offre_is_expired`, `offre_send_response`, `offre_send_response_date`, `offre_is_cancel`, `urgence`, `comptabilite_type_id`, `is_printed`, `structure`, `ressource_id`, `demande_activated`, `demande_activated_date`, `validation_livraison_demandeur`, `validation_livraison_magasinier`, `commentaire_magasinier`, `damande_validated_date`, `temps_traitement_demande`, `entrepot_source`, `entrepot_destination`, `is_stocked`, `stockage_date`, `carburant`, `invoiced`, `charche`, `is_package`, `Livraison_dediee`, `finance_mode_paiement_id`, `is_validated_source`, `validator_source_user_id`, `is_validated_destination`, `validator_destination_user_id`, `validated_source_date`, `validated_destination_date`, `recived_by_id`, `recived_date`, `latitude_decimal`, `longitude_decimal`, `contact_inventaire_id1`, `contact_inventaire_id2`, `contact_inventaire_id3`, `num_bl_fournisseur`, `sync_mode`, `validation_credit`, `credit_validated_by`, `date_validation_credit`, `package_cost`, `is_promo`, `sync_id`, `sync_data`, `updated_at`) VALUES
(-3, NULL, NULL, 8, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2, '2/2023', 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, NULL, 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, 0, 0, NULL, NULL, '2023-12-26 16:34:42'),
(-2, NULL, NULL, 8, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, '1/2023', 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, NULL, 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, 0, 0, NULL, NULL, '2023-12-26 16:33:52');

--
-- Déclencheurs `mouvement`
--
DELIMITER $$
CREATE TRIGGER `Balance_fournisseur_update` AFTER UPDATE ON `mouvement` FOR EACH ROW BEGIN
DECLARE mt double;
/*select total_dettes into mt from balance_fournisseur where fournisseur_id=old.concern_contact_id order by id desc limit 1;
if(new.is_stocked=1 and old.mouvement_type_id=45) THEN
		insert into balance_fournisseur(id,fournisseur_id,type_id,montant,total_dettes,date_day,date) 		  		
        values(null,old.concern_contact_id,1,
        -old.montant_total,(mt-old.montant_total),CURRENT_DATE(),CURRENT_TIMESTAMP()) ;
END IF;
if(new.is_stocked=1 and old.mouvement_type_id=55) THEN
		insert into balance_fournisseur(id,fournisseur_id,type_id,montant,total_dettes,date_day,date) 		  		  		
        values(null,old.concern_contact_id,2,
        old.montant_total,(mt+old.montant_total),CURRENT_DATE(),CURRENT_TIMESTAMP()) ;
        -- ON DUPLICATE KEY UPDATE 
		-- montant=montant+new.montant_encaissements,
        -- montant_ecart=(case when  new.montant_encaissements <>0 then 		    montant_ecart+new.montant_encaissements else 		
        -- montant_ecart+new.montant_ecart end ) ;
END IF;
*/
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `deleted_id_mobile` AFTER DELETE ON `mouvement` FOR EACH ROW BEGIN
if(old.mission_id is not null)THEN
insert into mobile_deleted_data values(null,'mouvement',old.mouvement_id,0,old.mission_id);
end if ;
end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `insert_bl_into_balance` AFTER UPDATE ON `mouvement` FOR EACH ROW begin
 -- Declare  a int;
 if(new.mouvement_type_id=8 and new.mission_id is null and old.is_stocked=0 AND new.is_stocked=1)then
INSERT INTO reglement_caisse(vendeur_id,mode_reglement,reglement_description,mouvement_type_id,date,date_day,date_mission,montant_ventes,montant_encaissements,montant_recouvrement,montant_declare,montant_credits,montant_ecart,reglement_type_id,is_validated,reglement_id) values(new.livraison_livreur_id,1,'livraison sans mission',24,NOW(),CURRENT_DATE(),CURRENT_DATE(),new.montant_total_ht_apres_remise,0,0,0,0,-new.montant_total_ht_apres_remise,0,1,new.mouvement_id);
end if;	
end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `send_to_trash` BEFORE DELETE ON `mouvement` FOR EACH ROW BEGIN
insert into mouvement_trash select * from mouvement where old.mouvement_id=mouvement_id;
end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trigger_generation_numComplet` BEFORE INSERT ON `mouvement` FOR EACH ROW begin
 Declare  ref_num int;
 if(new.mouvement_type_id is not null)then
	SELECT m.mouvement_numero_sequentiel+1 into ref_num FROM mouvement m where m.mouvement_numero_sequentiel is not null and m.mouvement_type_id=new.mouvement_type_id
ORDER by m.mouvement_numero_sequentiel desc limit 1 ; 
if(ref_num is null )then
set ref_num=1;
end if;
	 SET new.mouvement_numero_complet=CONCAT(ref_num,"/",YEAR(CURRENT_DATE()));
	 SET new.mouvement_numero_sequentiel=ref_num;
 end if ;
end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trigger_generation_numComplet_onUpdate` BEFORE UPDATE ON `mouvement` FOR EACH ROW begin
 Declare  ref_num int;
 if(new.mouvement_type_id is not null
    and new.mouvement_numero_complet is null 
    and old.mouvement_numero_complet is null)then
SELECT m.mouvement_numero_sequentiel+1 into ref_num FROM mouvement m where m.mouvement_numero_sequentiel is not null and m.mouvement_type_id=new.mouvement_type_id
ORDER by m.mouvement_numero_sequentiel desc limit 1;
if(ref_num is null )then
   set ref_num=1;
end if;	
SET new.mouvement_numero_complet=CONCAT(ref_num,"/",YEAR(CURRENT_DATE()));
	 SET new.mouvement_numero_sequentiel=ref_num;
 end if ;
end
$$
DELIMITER ;

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

--
-- Structure de la table `mouvement_client`
--

CREATE TABLE `mouvement_client` (
  `mouvement_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) NOT NULL,
  `concern_contact_id` bigint(20) DEFAULT NULL,
  `mouvement_type_id` bigint(20) DEFAULT NULL,
  `mouvement_created_by` bigint(20) DEFAULT NULL,
  `mouvement_date` datetime DEFAULT NULL,
  `mouvement_numero_complet` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `montant_remise` double DEFAULT NULL,
  `montant_total_ht_apres_remise` double DEFAULT NULL,
  `montant_total_ht` double DEFAULT NULL,
  `montant_total` double DEFAULT NULL,
  `montant_regle` double DEFAULT NULL,
  `is_paid` tinyint(1) DEFAULT NULL,
  `is_stocked` tinyint(1) DEFAULT NULL,
  `sync_id` tinyint(1) DEFAULT NULL,
  `sync_data` tinyint(1) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='voir la relation projet_id';

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

--
-- Structure de la table `mouvement_documentfile`
--

CREATE TABLE `mouvement_documentfile` (
  `document_file_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_finance_compte_operation`
--

CREATE TABLE `mouvement_finance_compte_operation` (
  `mouvement_id` bigint(20) NOT NULL,
  `compte_operation_id` bigint(20) NOT NULL,
  `montant` double NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_fournisseur_type`
--

CREATE TABLE `mouvement_fournisseur_type` (
  `mouvement_fournisseur_type` bigint(20) NOT NULL,
  `mouvement_fournisseur_type_designation` varchar(100) CHARACTER SET latin1 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mouvement_fournisseur_type` (`mouvement_fournisseur_type`, `mouvement_fournisseur_type_designation`) VALUES
(1, 'Réglement fournisseur'),
(2, 'Bon de réception'),
(3, 'Retour fournisseur');

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

--
-- Structure de la table `mouvement_id_confirmation`
--

CREATE TABLE `mouvement_id_confirmation` (
  `mouvement_ligne_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `type` int(11) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_ligne`
--

CREATE TABLE `mouvement_ligne` (
  `mouvement_ligne_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_ordre_affichage` int(11) DEFAULT NULL,
  `mouvement_ligne_is_comment_line` tinyint(1) DEFAULT NULL,
  `article_id` bigint(20) DEFAULT NULL,
  `article_reference` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_designation_lang_text_id` bigint(20) DEFAULT NULL,
  `article_designation_lang_id` bigint(20) DEFAULT NULL,
  `article_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_unite_id` int(11) DEFAULT NULL,
  `article_quantite` double DEFAULT NULL,
  `article_quantite_delivered` double DEFAULT NULL,
  `article_quantite_reste` double DEFAULT NULL,
  `article_quantite_retour` int(11) DEFAULT '0',
  `is_stock_managed` tinyint(1) DEFAULT NULL,
  `delais_livraison` int(11) DEFAULT NULL,
  `date_prevue_livraison` datetime DEFAULT NULL,
  `date_prevue_livraison_day` date DEFAULT NULL,
  `adresse_livraison` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_delivered` tinyint(1) DEFAULT NULL,
  `date_livraison` datetime DEFAULT NULL,
  `date_livraison_day` date DEFAULT NULL,
  `article_etat_id` bigint(20) DEFAULT NULL,
  `is_subscription` tinyint(1) DEFAULT NULL,
  `subscription_ressource_id` bigint(20) DEFAULT NULL,
  `subscription_date_start` datetime DEFAULT NULL,
  `subscription_date_start_day` date DEFAULT NULL,
  `subscription_date_end` datetime DEFAULT NULL,
  `subscription_date_end_day` date DEFAULT NULL,
  `subscription_duree_jour` int(11) DEFAULT NULL,
  `is_validated_before_sell` tinyint(1) DEFAULT NULL,
  `validator_user_id_before_sell` bigint(20) DEFAULT NULL,
  `validated_before_sell_date` datetime DEFAULT NULL,
  `is_validated_after_sell` tinyint(1) DEFAULT NULL,
  `validator_user_id_after_sell` bigint(20) DEFAULT NULL,
  `validated_after_sell_date` datetime DEFAULT NULL,
  `is_packaged` tinyint(1) NOT NULL DEFAULT '0',
  `package_type_id` bigint(20) DEFAULT NULL,
  `package_cost` double DEFAULT NULL,
  `is_command_traited` tinyint(1) DEFAULT NULL,
  `is_customer_canceled` tinyint(1) DEFAULT NULL,
  `customer_cancel_date` datetime DEFAULT NULL,
  `customer_cancel_date_day` date DEFAULT NULL,
  `taux_fidelite` double DEFAULT NULL,
  `is_fidelite_appliquee` tinyint(1) DEFAULT NULL,
  `fidelite_montant` double DEFAULT NULL,
  `fidelite_is_refund` tinyint(1) DEFAULT NULL,
  `fidelite_payment_date` datetime DEFAULT NULL,
  `fidelite_payment_date_day` date DEFAULT NULL,
  `fidelite_mouvement_id` bigint(20) DEFAULT NULL,
  `fidelite_is_expired` tinyint(1) DEFAULT NULL,
  `fidelite_expire_date` datetime DEFAULT NULL,
  `fidelite_expire_date_day` date DEFAULT NULL,
  `fidelite_date_consommation` datetime DEFAULT NULL,
  `fidelite_date_consommation_day` date DEFAULT NULL,
  `is_paye_normal` tinyint(1) DEFAULT NULL,
  `is_paye_fidelite` tinyint(1) DEFAULT NULL,
  `montant_paye_normal` double DEFAULT NULL,
  `prix_total_ht_apres_remise` double DEFAULT NULL,
  `prix_revient_unitaire` double DEFAULT NULL,
  `prix_revient` double DEFAULT NULL,
  `prix_unitaire_ht` double DEFAULT NULL,
  `montant_remise` double DEFAULT NULL,
  `taux_remise` double DEFAULT NULL,
  `prix_total_ht` double DEFAULT NULL,
  `mouvement_ligne_add_tva` tinyint(1) DEFAULT NULL,
  `mouvement_ligne_hide_tva` tinyint(1) DEFAULT NULL,
  `tva_status` tinyint(1) DEFAULT NULL,
  `tva_raison` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `taux_tva` double DEFAULT NULL,
  `montant_tva` double NOT NULL DEFAULT '0',
  `prix_unitaire_ttc` double DEFAULT NULL,
  `prix_ttc` double DEFAULT NULL,
  `montant_benefice` double DEFAULT NULL,
  `comptable_compte_id` bigint(20) DEFAULT NULL,
  `comptable_journal_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_monnaie_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_project_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_task_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_ordre` int(11) DEFAULT NULL,
  `mouvement_ligne_response_to_mouvement_ligne` tinyint(1) DEFAULT NULL,
  `mouvement_ligne_priorite_livraison_ordre` int(11) DEFAULT NULL,
  `offre_date_debut` datetime DEFAULT NULL,
  `offre_date_debut_day` date DEFAULT NULL,
  `offre_date_fin` datetime DEFAULT NULL,
  `offre_date_fin_day` date DEFAULT NULL,
  `comptabilite_type_id` bigint(20) DEFAULT NULL,
  `demande_validated` tinyint(1) DEFAULT NULL,
  `demande_activated_date` date DEFAULT NULL,
  `demande_activated` tinyint(1) DEFAULT NULL,
  `demande_validated_date` date DEFAULT NULL,
  `demande_cancel_request` tinyint(1) DEFAULT NULL,
  `demande_cancel_request_date` date DEFAULT NULL,
  `demande_cancel_request_avis` tinyint(1) DEFAULT NULL COMMENT 'accéptée ou refusée',
  `demande_cancel_request_avis_date` date DEFAULT NULL,
  `demande_cancel_request_avis_motif` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_stocked` tinyint(1) DEFAULT NULL,
  `ressource_to_be_place_in` bigint(20) DEFAULT NULL,
  `ressource_id` bigint(20) DEFAULT NULL,
  `is_ressource` tinyint(1) DEFAULT NULL,
  `km_debut` double DEFAULT NULL,
  `km_fin` double DEFAULT NULL,
  `ordre_mission` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_destination` bigint(20) DEFAULT NULL,
  `Livraison_dediee` tinyint(4) DEFAULT NULL,
  `remarque` text COLLATE utf8_unicode_ci,
  `is_promo` tinyint(4) NOT NULL DEFAULT '0',
  `article_quantite_delivered2` double DEFAULT NULL,
  `article_quantite_delivered3` double DEFAULT NULL,
  `article_poids` double DEFAULT '0',
  `article_volume` double DEFAULT '0',
  `sync_mode` tinyint(4) DEFAULT '0',
  `quantite_paid` bigint(20) DEFAULT NULL,
  `relation_etat_id` tinyint(4) DEFAULT '0',
  `relation_mouvement_ligne_id` bigint(20) DEFAULT NULL,
  `Promotion_id` bigint(20) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déclencheurs `mouvement_ligne`
--
DELIMITER $$
CREATE TRIGGER `prix_total` BEFORE UPDATE ON `mouvement_ligne` FOR EACH ROW BEGIN
declare uniteId int;
if(new.article_quantite<>old.article_quantite or new.prix_unitaire_ht<>old.prix_unitaire_ht
  or  new.prix_unitaire_ttc<>old.prix_unitaire_ttc )then
set new.prix_total_ht =new.prix_unitaire_ht*new.article_quantite;
set new.prix_ttc =new.prix_unitaire_ttc*new.article_quantite;
    if(new.prix_total_ht_apres_remise=old.prix_total_ht_apres_remise
      and new.relation_mouvement_ligne_id is null) then
			set new.prix_total_ht_apres_remise=
    		(new.prix_unitaire_ht*new.article_quantite)-	COALESCE(new.montant_remise,0);
	end if;
end if;
if(new.prix_total_ht_apres_remise is null)
THEN
set new.prix_total_ht_apres_remise=new.prix_unitaire_ht*new.article_quantite;
end if;
if(new.article_id is not null and new.article_unite_id is null)
THEN
SELECT  article_unite_id into uniteId FROM article_article_unite  where article_id=new.article_id and is_default=1 limit 1;
set new.article_unite_id=uniteId;
end if;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `quota_quantite_reste` BEFORE INSERT ON `mouvement_ligne` FOR EACH ROW begin declare type int; 
 select mouvement_type_id into type from mouvement where mouvement_id=new.mouvement_id; 
 if(type=53)THEN set new.article_quantite_reste=0 ;
 end if; 
 if(new.prix_total_ht_apres_remise is null and new.prix_unitaire_ht is not null and  new.article_quantite is not null)
THEN
set new.prix_total_ht_apres_remise=new.prix_unitaire_ht*new.article_quantite;
end if;
 end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `send_ligne_to_trash` BEFORE DELETE ON `mouvement_ligne` FOR EACH ROW BEGIN
insert IGNORE into mouvement_ligne_trash select * from mouvement_ligne where mouvement_ligne_id=old.mouvement_ligne_id;
end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trigger_update_montant_mouvement` AFTER INSERT ON `mouvement_ligne` FOR EACH ROW BEGIN
declare tva,ht,cost,remise double;
declare type int;
if(new.mouvement_id is not null )then
select 
sum(ml.prix_total_ht),
sum(COALESCE(ml.montant_tva,0)),
sum(ml.package_cost),
sum(COALESCE(ml.prix_total_ht_apres_remise,0)) into ht,tva,cost,remise from mouvement_ligne ml where ml.mouvement_id=new.mouvement_id;
update mouvement  set 
    montant_total_ht=ht,
    montant_total_tva=tva,
    montant_total_ht_apres_remise=remise,
    -- montant_total_ttc=tva+COALESCE(remise,ht),
    montant_total_ttc=COALESCE(remise,ht),
    package_cost=COALESCE(cost,0),
    -- montant_remise=ht-remise,
    montant_remise=(case when montant_total_ht_apres_remise>montant_total_ht then 0 else ht-remise end),
    -- montant_total=remise
    montant_total=montant_total_ttc+COALESCE(montant_timbre,0)
where mouvement_id=new.mouvement_id;
end if;
if( new.mouvement_id is not null and new.is_promo>1 and  new.demande_cancel_request_avis is null)THEN
insert ignore into promotion_mouvement values(new.mouvement_id,new.Promotion_id);
end if;
end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trigger_update_montant_mouvement2` AFTER UPDATE ON `mouvement_ligne` FOR EACH ROW BEGIN
declare tva,ht,cost,remise double;
declare type int;
if(new.mouvement_id is not null  )then
select 
sum(ml.prix_total_ht),
sum(COALESCE(ml.montant_tva,0)),
sum(ml.package_cost),
sum(COALESCE(ml.prix_total_ht_apres_remise,0)) into ht,tva,cost,remise from mouvement_ligne ml where ml.mouvement_id=new.mouvement_id;
update mouvement  set 
    montant_total_ht=ht,
    montant_total_tva=tva,
    montant_total_ht_apres_remise=remise,
    -- montant_total_ttc=tva+COALESCE(remise,ht),
    montant_total_ttc=COALESCE(remise,ht),
    package_cost=COALESCE(cost,0),
    -- montant_remise=ht-remise,
    montant_remise=(case when montant_total_ht_apres_remise>montant_total_ht then 0 else ht-remise end),
  montant_total=montant_total_ttc+COALESCE(montant_timbre,0)
where mouvement_id=new.mouvement_id;
end if;
if(old.mouvement_id is null and new.mouvement_id is not null and new.is_promo>1 and new.Promotion_id is not null)THEN
insert ignore into promotion_mouvement values(new.mouvement_id,new.Promotion_id);
end if;
end
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trigger_update_montant_mouvement3` AFTER DELETE ON `mouvement_ligne` FOR EACH ROW BEGIN
declare tva,ht,cost,remise double;
declare type int;
if(old.mouvement_id is not null)then
select 
sum(ml.prix_total_ht),
sum(COALESCE(ml.montant_tva,0)),
sum(ml.package_cost),
sum(COALESCE(ml.prix_total_ht_apres_remise,ml.prix_total_ht)) into ht,tva,cost,remise from mouvement_ligne ml where ml.mouvement_id=old.mouvement_id;
update mouvement  set 
    montant_total_ht=ht,
    montant_total_tva=COALESCE(tva,0),
    montant_total_ht_apres_remise=remise,
    montant_total_ttc=tva+COALESCE(remise,ht),
    package_cost=COALESCE(cost,0),
    montant_remise=ht-remise,
    montant_total=montant_total_ttc+COALESCE(montant_timbre,0)
where mouvement_id=old.mouvement_id;
end if;
end
$$
DELIMITER ;

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

--
-- Structure de la table `mouvement_ligne_client`
--

CREATE TABLE `mouvement_ligne_client` (
  `mouvement_ligne_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `entreprise_id` bigint(20) NOT NULL,
  `article_id` bigint(20) DEFAULT NULL,
  `article_unite_id` int(11) DEFAULT NULL,
  `article_quantite` double DEFAULT NULL,
  `prix_unitaire_ht` double DEFAULT NULL,
  `prix_total_ht` double DEFAULT NULL,
  `is_promo` tinyint(4) NOT NULL DEFAULT '0',
  `Promotion_id` bigint(20) DEFAULT NULL,
  `taux_remise` double DEFAULT NULL,
  `montant_remise` double DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_ligne_composant_param`
--

CREATE TABLE `mouvement_ligne_composant_param` (
  `mouvement_ligne_id` bigint(20) NOT NULL,
  `article_composant_id` bigint(20) NOT NULL,
  `param_id` int(11) NOT NULL,
  `value` varchar(200) CHARACTER SET latin1 NOT NULL,
  `article_composant_quantite` int(11) NOT NULL,
  `ordre` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_ligne_mouvement_ligne`
--

CREATE TABLE `mouvement_ligne_mouvement_ligne` (
  `mouvement_ligne_id` bigint(20) NOT NULL,
  `mouvement_ligne_id2` bigint(20) NOT NULL,
  `mouvement_operation_type_id` bigint(20) DEFAULT NULL,
  `mouvement_operation_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mission_id` bigint(20) DEFAULT NULL,
  `is_updated` tinyint(4) NOT NULL DEFAULT '0',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_ligne_param`
--

CREATE TABLE `mouvement_ligne_param` (
  `mouvement_ligne_id` bigint(20) NOT NULL,
  `param_id` bigint(20) NOT NULL,
  `value` varchar(256) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_ligne_trash`
--

CREATE TABLE `mouvement_ligne_trash` (
  `mouvement_ligne_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_ordre_affichage` int(11) DEFAULT NULL,
  `mouvement_ligne_is_comment_line` tinyint(1) DEFAULT NULL,
  `article_id` bigint(20) DEFAULT NULL,
  `article_reference` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_designation_lang_text_id` bigint(20) DEFAULT NULL,
  `article_designation_lang_id` bigint(20) DEFAULT NULL,
  `article_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_unite_id` int(11) DEFAULT NULL,
  `article_quantite` double DEFAULT NULL,
  `article_quantite_delivered` double DEFAULT NULL,
  `article_quantite_reste` double DEFAULT NULL,
  `article_quantite_retour` int(11) DEFAULT '0',
  `is_stock_managed` tinyint(1) DEFAULT NULL,
  `delais_livraison` int(11) DEFAULT NULL,
  `date_prevue_livraison` datetime DEFAULT NULL,
  `date_prevue_livraison_day` date DEFAULT NULL,
  `adresse_livraison` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_delivered` tinyint(1) DEFAULT NULL,
  `date_livraison` datetime DEFAULT NULL,
  `date_livraison_day` date DEFAULT NULL,
  `article_etat_id` bigint(20) DEFAULT NULL,
  `is_subscription` tinyint(1) DEFAULT NULL,
  `subscription_ressource_id` bigint(20) DEFAULT NULL,
  `subscription_date_start` datetime DEFAULT NULL,
  `subscription_date_start_day` date DEFAULT NULL,
  `subscription_date_end` datetime DEFAULT NULL,
  `subscription_date_end_day` date DEFAULT NULL,
  `subscription_duree_jour` int(11) DEFAULT NULL,
  `is_validated_before_sell` tinyint(1) DEFAULT NULL,
  `validator_user_id_before_sell` bigint(20) DEFAULT NULL,
  `validated_before_sell_date` datetime DEFAULT NULL,
  `is_validated_after_sell` tinyint(1) DEFAULT NULL,
  `validator_user_id_after_sell` bigint(20) DEFAULT NULL,
  `validated_after_sell_date` datetime DEFAULT NULL,
  `is_packaged` tinyint(1) NOT NULL DEFAULT '0',
  `package_type_id` bigint(20) DEFAULT NULL,
  `package_cost` double DEFAULT NULL,
  `is_command_traited` tinyint(1) DEFAULT NULL,
  `is_customer_canceled` tinyint(1) DEFAULT NULL,
  `customer_cancel_date` datetime DEFAULT NULL,
  `customer_cancel_date_day` date DEFAULT NULL,
  `taux_fidelite` double DEFAULT NULL,
  `is_fidelite_appliquee` tinyint(1) DEFAULT NULL,
  `fidelite_montant` double DEFAULT NULL,
  `fidelite_is_refund` tinyint(1) DEFAULT NULL,
  `fidelite_payment_date` datetime DEFAULT NULL,
  `fidelite_payment_date_day` date DEFAULT NULL,
  `fidelite_mouvement_id` bigint(20) DEFAULT NULL,
  `fidelite_is_expired` tinyint(1) DEFAULT NULL,
  `fidelite_expire_date` datetime DEFAULT NULL,
  `fidelite_expire_date_day` date DEFAULT NULL,
  `fidelite_date_consommation` datetime DEFAULT NULL,
  `fidelite_date_consommation_day` date DEFAULT NULL,
  `is_paye_normal` tinyint(1) DEFAULT NULL,
  `is_paye_fidelite` tinyint(1) DEFAULT NULL,
  `montant_paye_normal` double DEFAULT NULL,
  `prix_total_ht_apres_remise` double DEFAULT NULL,
  `prix_revient_unitaire` double DEFAULT NULL,
  `prix_revient` double DEFAULT NULL,
  `prix_unitaire_ht` double DEFAULT NULL,
  `montant_remise` double DEFAULT NULL,
  `taux_remise` double DEFAULT NULL,
  `prix_total_ht` double DEFAULT NULL,
  `mouvement_ligne_add_tva` tinyint(1) DEFAULT NULL,
  `mouvement_ligne_hide_tva` tinyint(1) DEFAULT NULL,
  `tva_status` tinyint(1) DEFAULT NULL,
  `tva_raison` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `taux_tva` double DEFAULT NULL,
  `montant_tva` double NOT NULL DEFAULT '0',
  `prix_unitaire_ttc` double DEFAULT NULL,
  `prix_ttc` double DEFAULT NULL,
  `montant_benefice` double DEFAULT NULL,
  `comptable_compte_id` bigint(20) DEFAULT NULL,
  `comptable_journal_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_monnaie_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_project_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_task_id` bigint(20) DEFAULT NULL,
  `mouvement_ligne_ordre` int(11) DEFAULT NULL,
  `mouvement_ligne_response_to_mouvement_ligne` tinyint(1) DEFAULT NULL,
  `mouvement_ligne_priorite_livraison_ordre` int(11) DEFAULT NULL,
  `offre_date_debut` datetime DEFAULT NULL,
  `offre_date_debut_day` date DEFAULT NULL,
  `offre_date_fin` datetime DEFAULT NULL,
  `offre_date_fin_day` date DEFAULT NULL,
  `comptabilite_type_id` bigint(20) DEFAULT NULL,
  `demande_validated` tinyint(1) DEFAULT NULL,
  `demande_activated_date` date DEFAULT NULL,
  `demande_activated` tinyint(1) DEFAULT NULL,
  `demande_validated_date` date DEFAULT NULL,
  `demande_cancel_request` tinyint(1) DEFAULT NULL,
  `demande_cancel_request_date` date DEFAULT NULL,
  `demande_cancel_request_avis` tinyint(1) DEFAULT NULL COMMENT 'accéptée ou refusée',
  `demande_cancel_request_avis_date` date DEFAULT NULL,
  `demande_cancel_request_avis_motif` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_stocked` tinyint(1) DEFAULT NULL,
  `ressource_to_be_place_in` bigint(20) DEFAULT NULL,
  `ressource_id` bigint(20) DEFAULT NULL,
  `is_ressource` tinyint(1) DEFAULT NULL,
  `km_debut` double DEFAULT NULL,
  `km_fin` double DEFAULT NULL,
  `ordre_mission` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `depot_destination` bigint(20) DEFAULT NULL,
  `Livraison_dediee` tinyint(4) DEFAULT NULL,
  `remarque` text COLLATE utf8_unicode_ci,
  `is_promo` tinyint(4) NOT NULL DEFAULT '0',
  `article_quantite_delivered2` double DEFAULT NULL,
  `article_quantite_delivered3` double DEFAULT NULL,
  `article_poids` double DEFAULT '0',
  `article_volume` double DEFAULT '0',
  `sync_mode` tinyint(4) DEFAULT '0',
  `quantite_paid` bigint(20) DEFAULT NULL,
  `relation_etat_id` tinyint(4) DEFAULT '0',
  `relation_mouvement_ligne_id` bigint(20) DEFAULT NULL,
  `Promotion_id` bigint(20) DEFAULT NULL,
  `sync_id` tinyint(4) DEFAULT NULL,
  `sync_data` tinyint(4) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_modele_document`
--

CREATE TABLE `mouvement_modele_document` (
  `mouvement_modele_document_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `mouvement_modele_document_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_type_id` bigint(20) DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT NULL,
  `is_systeme` tinyint(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_mouvement`
--

CREATE TABLE `mouvement_mouvement` (
  `mouvement_id` bigint(20) NOT NULL,
  `mouvement_id2` bigint(20) NOT NULL,
  `mouvement_operation_type_id` bigint(20) DEFAULT NULL,
  `mouvement_operation_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_offer_is_response` tinyint(1) DEFAULT NULL,
  `mouvement_offer_is_accepted` tinyint(1) DEFAULT NULL,
  `mouvement_offer_accepted_by` bigint(20) DEFAULT NULL,
  `mouvement_offer_accepted_date` datetime DEFAULT NULL,
  `mouvement_offer_accepted_date_day` date DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_mouvement_ligne`
--

CREATE TABLE `mouvement_mouvement_ligne` (
  `mouvement_id` bigint(20) NOT NULL,
  `mouvement_ligne_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_mouvement_taxe`
--

CREATE TABLE `mouvement_mouvement_taxe` (
  `mouvement_id` bigint(20) NOT NULL,
  `taxe_id` bigint(20) NOT NULL,
  `mouvement_taxe_taux` double DEFAULT NULL,
  `mouvement_taxe_montant` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_note`
--

CREATE TABLE `mouvement_note` (
  `mouvement_note_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(20) DEFAULT NULL,
  `comment_by` bigint(20) DEFAULT NULL,
  `comment_date` datetime DEFAULT NULL,
  `comment_texte` text COLLATE utf8_unicode_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_notification_programme`
--

CREATE TABLE `mouvement_notification_programme` (
  `mouvement_id` bigint(20) NOT NULL,
  `notification_info_type_id` bigint(20) NOT NULL,
  `notification_info_value` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `notification_date` datetime DEFAULT NULL,
  `notification_date_day` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_operation_type`
--

CREATE TABLE `mouvement_operation_type` (
  `mouvement_operation_type_id` bigint(20) NOT NULL,
  `mouvement_operation_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mouvement_operation_type` (`mouvement_operation_type_id`, `mouvement_operation_type_designation`) VALUES
(1, 'Recouvrement mobile'),
(2, 'Consigne');

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

--
-- Structure de la table `mouvement_parametre`
--

CREATE TABLE `mouvement_parametre` (
  `mouvement_parametre_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `mouvement_type_id` bigint(20) DEFAULT NULL,
  `mouvement_codification` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_codification_patern` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_codification_nb_positions` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_params_contact`
--

CREATE TABLE `mouvement_params_contact` (
  `mouvement_type_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) NOT NULL,
  `mouvement_numero_initial` bigint(20) DEFAULT NULL,
  `mouvement_numero_reset` bigint(20) DEFAULT NULL,
  `mouvement_prefixe_form_example` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_prefixe_form_regexp` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_anotation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_footer` text COLLATE utf8_unicode_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_status`
--

CREATE TABLE `mouvement_status` (
  `mouvement_status_id` bigint(20) NOT NULL,
  `mouvement_status_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_status_ordre` tinyint(4) DEFAULT NULL,
  `mouvement_type_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mouvement_status` (`mouvement_status_id`, `mouvement_status_designation`, `mouvement_status_ordre`, `mouvement_type_id`) VALUES
(0, 'Brouillon', NULL, NULL),
(1, 'Créé', NULL, NULL);

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

--
-- Structure de la table `mouvement_trash`
--

CREATE TABLE `mouvement_trash` (
  `mouvement_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `concern_contact_id` bigint(20) DEFAULT NULL,
  `mouvement_type_id` bigint(20) DEFAULT NULL,
  `mouvement_response_to_mouvement_id` bigint(20) DEFAULT NULL,
  `mouvement_status_id` bigint(20) DEFAULT NULL,
  `mission_id` bigint(20) DEFAULT NULL,
  `mouvement_status_from_date` datetime DEFAULT NULL,
  `mouvement_is_canceled` tinyint(1) DEFAULT NULL,
  `mouvement_cancel_dale` datetime DEFAULT NULL,
  `mouvement_created_by` bigint(20) DEFAULT NULL,
  `mouvement_created_date` datetime DEFAULT NULL,
  `mouvement_created_date_day` date DEFAULT NULL,
  `mouvement_date` datetime DEFAULT NULL,
  `mouvement_date_day` date DEFAULT NULL,
  `mouvement_date_echeance` datetime DEFAULT NULL,
  `mouvement_date_echeance_day` date DEFAULT NULL,
  `mouvement_numero_prefixe` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_numero_sequentiel` bigint(20) DEFAULT NULL,
  `mouvement_numero_complet` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_annee_exercice` int(11) DEFAULT NULL,
  `mouvement_commentaire` text COLLATE utf8_unicode_ci,
  `mouvement_footer_text` text COLLATE utf8_unicode_ci,
  `livraison_date_souhaite` datetime DEFAULT NULL,
  `livraison_date_souhaite_day` date DEFAULT NULL,
  `livraison_livreur_souhaite` bigint(20) DEFAULT NULL,
  `livraison_is_delivered` tinyint(1) DEFAULT NULL,
  `livraison_deliver_date` datetime DEFAULT NULL,
  `livraison_deliver_date_day` date DEFAULT NULL,
  `livraison_livreur_id` bigint(20) DEFAULT NULL,
  `is_validated` tinyint(1) DEFAULT NULL,
  `validator_user_id` bigint(20) DEFAULT NULL,
  `project_id` bigint(20) DEFAULT NULL,
  `montant_total_fidelite` double DEFAULT NULL,
  `comptable_compte_id` bigint(20) DEFAULT NULL,
  `mouvement_monnaie_id` bigint(20) DEFAULT NULL,
  `montant_remise` double DEFAULT NULL,
  `taux_remise` double DEFAULT NULL,
  `montant_total_ht_apres_remise` double DEFAULT NULL,
  `montant_total_ht` double DEFAULT NULL,
  `tva_status` tinyint(1) DEFAULT NULL,
  `mouvement_add_tva` tinyint(1) DEFAULT NULL,
  `mouvement_hide_tva` tinyint(1) DEFAULT NULL,
  `montant_total_tva` double NOT NULL DEFAULT '0',
  `montant_total_autres_taxes` double DEFAULT NULL,
  `montant_total_ttc` double DEFAULT NULL,
  `montant_lettre` text COLLATE utf8_unicode_ci,
  `is_espece` tinyint(1) DEFAULT NULL,
  `is_timbre` tinyint(1) DEFAULT NULL,
  `taux_timbre` double DEFAULT NULL,
  `montant_timbre` double DEFAULT NULL,
  `montant_total` double DEFAULT NULL,
  `montant_regle` double DEFAULT NULL,
  `is_paid` tinyint(1) DEFAULT NULL,
  `mouvement_update_lock_status` tinyint(1) DEFAULT NULL,
  `mouvement_update_lock_date` datetime DEFAULT NULL,
  `mouvement_paiement_delai_id` bigint(20) DEFAULT NULL,
  `is_offre_to_us` tinyint(1) DEFAULT NULL,
  `is_offre_request` tinyint(1) DEFAULT NULL,
  `offre_type_id` bigint(20) DEFAULT NULL,
  `offre_date_debut` datetime DEFAULT NULL,
  `offre_date_fin` datetime DEFAULT NULL,
  `offre_is_expired` tinyint(1) DEFAULT NULL,
  `offre_send_response` tinyint(1) DEFAULT NULL,
  `offre_send_response_date` datetime DEFAULT NULL,
  `offre_is_cancel` tinyint(1) DEFAULT NULL,
  `urgence` tinyint(1) DEFAULT NULL,
  `comptabilite_type_id` bigint(20) DEFAULT NULL,
  `is_printed` tinyint(1) DEFAULT NULL,
  `structure` bigint(20) DEFAULT NULL,
  `ressource_id` bigint(20) DEFAULT NULL,
  `demande_activated` tinyint(1) DEFAULT NULL,
  `demande_activated_date` datetime DEFAULT NULL,
  `validation_livraison_demandeur` tinyint(1) DEFAULT NULL,
  `validation_livraison_magasinier` tinyint(1) DEFAULT NULL,
  `commentaire_magasinier` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `damande_validated_date` datetime DEFAULT NULL,
  `temps_traitement_demande` bigint(20) DEFAULT NULL,
  `entrepot_source` bigint(20) DEFAULT NULL,
  `entrepot_destination` bigint(20) DEFAULT NULL,
  `is_stocked` tinyint(1) DEFAULT NULL,
  `stockage_date` date DEFAULT NULL,
  `carburant` tinyint(1) DEFAULT NULL,
  `invoiced` tinyint(2) DEFAULT NULL,
  `charche` tinyint(2) DEFAULT NULL,
  `is_package` tinyint(2) DEFAULT NULL,
  `Livraison_dediee` tinyint(4) DEFAULT NULL,
  `finance_mode_paiement_id` bigint(20) DEFAULT NULL,
  `is_validated_source` tinyint(1) DEFAULT NULL,
  `validator_source_user_id` bigint(20) DEFAULT NULL,
  `is_validated_destination` tinyint(1) DEFAULT NULL,
  `validator_destination_user_id` bigint(20) DEFAULT NULL,
  `validated_source_date` date DEFAULT NULL,
  `validated_destination_date` date DEFAULT NULL,
  `recived_by_id` bigint(20) DEFAULT NULL,
  `recived_date` date DEFAULT NULL,
  `latitude_decimal` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `longitude_decimal` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `contact_inventaire_id1` bigint(20) DEFAULT NULL,
  `contact_inventaire_id2` bigint(20) DEFAULT NULL,
  `contact_inventaire_id3` bigint(20) DEFAULT NULL,
  `num_bl_fournisseur` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `sync_mode` tinyint(4) DEFAULT '0',
  `validation_credit` tinyint(2) DEFAULT NULL,
  `credit_validated_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `date_validation_credit` date DEFAULT NULL,
  `package_cost` double DEFAULT '0',
  `is_promo` tinyint(4) NOT NULL DEFAULT '0',
  `sync_id` tinyint(1) DEFAULT NULL,
  `sync_data` tinyint(1) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='voir la relation projet_id';

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

--
-- Structure de la table `mouvement_type`
--

CREATE TABLE `mouvement_type` (
  `mouvement_type_id` bigint(20) NOT NULL,
  `mouvement_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mouvement_type_groupe_id` bigint(20) DEFAULT NULL,
  `Code` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `stock_operation` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mouvement_type` (`mouvement_type_id`, `mouvement_type_designation`, `mouvement_type_groupe_id`, `Code`, `stock_operation`) VALUES
(1, 'Bon d\'achat', 1, 'BA', 0),
(2, 'Bon de commande', 1, 'BC', 0),
(3, 'Devis', 1, 'D', 0),
(4, 'Facture', 1, 'F', 0),
(5, 'Facture d\'avoir', 1, 'FA', 0),
(6, 'Facture Fournisseur', 1, 'FF', 0),
(7, 'Bon pour', 1, 'BP', 0),
(8, 'Bon de livraison', 2, 'BL', -1),
(9, 'Bon de retour', 2, 'BR', 1),
(10, 'Bon de sortie', 2, 'BS', -1),
(11, 'Bon d\'entrée', 2, 'BE', 1),
(12, 'Demande de moyens', 2, 'DM', 0),
(33, 'Devis fournisseur', 1, 'DF', 0),
(34, 'BL fournisseur', 3, 'BL', 1),
(35, 'Inventaire initial', 3, 'II', 1),
(36, 'Bon de commande fournisseur', 3, 'BCF', 0),
(37, 'Demande d\'achat', 1, 'DA', 0),
(38, 'Mise à disposition', 4, 'MAD', -1),
(39, 'Restitution', 4, 'REST', 1),
(40, 'Demande Véhicules /\n Équipements', 2, 'DVE', 0),
(41, 'BL interne', NULL, 'BLI', -1),
(42, 'Bon pour fournisseur', 1, 'BPF', 0),
(43, 'Bons de Sortie Dons', NULL, 'BSD', -1),
(44, 'Bon de commandes achats', 1, 'BC-A', 0),
(45, 'Bons de réception', 1, 'BR', 1),
(46, 'Facture Fornisseur', 1, 'FF', 0),
(47, 'Bon de chargement', 1, 'BC', 0),
(48, 'Bon de consommation', 2, 'BC', -1),
(49, 'Bon Retoure Fournisseur ', 1, 'BRF', -1),
(50, 'Facture avoir fournisseur ', 1, 'FAF', 0),
(51, 'Bon de Transfert', 1, 'BT', 1),
(52, 'inventaire MG', 2, 'IMG', 1),
(53, 'Quota', 1, 'QT', NULL),
(54, 'Avariés', 1, 'A', -1),
(55, 'bons de retour fournisseur', 1, 'BRF', -1),
(61, 'Bon de récupération', 1, 'BR', -1),
(56, 'Dégustation', 1, 'DG', -1),
(57, 'Avaries Clients', 1, 'AC', 1),
(81, 'Bon de Consommation Production', 2, 'BCP', -1),
(82, 'Bon de Réception Production', 2, 'BRP', 1),
(83, 'Eclatement Bobine', 2, 'EB', NULL);

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

--
-- Structure de la table `mouvement_type_contact`
--

CREATE TABLE `mouvement_type_contact` (
  `contact_id` bigint(20) NOT NULL,
  `mouvement_type_id` bigint(20) NOT NULL,
  `date_debut` datetime DEFAULT NULL,
  `date_debut_day` date DEFAULT NULL,
  `date_fin` datetime DEFAULT NULL,
  `date_fin_day` date DEFAULT NULL,
  `autorisation_create` tinyint(1) DEFAULT NULL,
  `autorisation_read` tinyint(1) DEFAULT NULL,
  `autorisation_update` tinyint(1) DEFAULT NULL,
  `autorisation_delete` tinyint(1) DEFAULT NULL,
  `autorized_by` bigint(20) DEFAULT NULL,
  `autorized_date` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_type_groupe`
--

CREATE TABLE `mouvement_type_groupe` (
  `mouvement_type_groupe_id` bigint(20) NOT NULL,
  `mouvement_type_groupe_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `mouvement_type_groupe` (`mouvement_type_groupe_id`, `mouvement_type_groupe_designation`) VALUES
(1, 'Commercial'),
(2, 'Moyens généraux'),
(3, 'Approvisionnement'),
(4, 'Equipements');

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

--
-- Structure de la table `mouvement_validateur`
--

CREATE TABLE `mouvement_validateur` (
  `mouvement_id` bigint(20) NOT NULL,
  `validator_user_id` bigint(20) NOT NULL,
  `is_validated` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `mouvement_vente_operation_type`
--

CREATE TABLE `mouvement_vente_operation_type` (
  `vente_operation_type_id` tinyint(4) NOT NULL,
  `vente_operation_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `notification`
--

CREATE TABLE `notification` (
  `notification_id` int(10) NOT NULL,
  `notification_designation` varchar(256) CHARACTER SET latin1 NOT NULL,
  `is_active` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `notification` (`notification_id`, `notification_designation`, `is_active`) VALUES
(1, 'Salam Alaykum', 1);

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

--
-- Structure de la table `objectif`
--

CREATE TABLE `objectif` (
  `objectif_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `objectif_type_id` bigint(20) NOT NULL,
  `mission_zone_id` bigint(20) NOT NULL,
  `objectif_annee` int(11) NOT NULL,
  `objectif_mois` int(11) DEFAULT NULL,
  `objectif_value` double NOT NULL DEFAULT '0',
  `objectif_value_percent` double NOT NULL DEFAULT '0',
  `objectif_realized` double DEFAULT NULL,
  `objectif_previsionnel` double DEFAULT NULL,
  `query_month` text COLLATE utf8_unicode_ci,
  `query_day` text COLLATE utf8_unicode_ci,
  `query_hour` text COLLATE utf8_unicode_ci,
  `query_minute` text COLLATE utf8_unicode_ci,
  `objectif_jour` double DEFAULT NULL,
  `route_type_id` int(11) DEFAULT NULL,
  `contact_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `objectif` (`objectif_id`, `entreprise_id`, `objectif_type_id`, `mission_zone_id`, `objectif_annee`, `objectif_mois`, `objectif_value`, `objectif_value_percent`, `objectif_realized`, `objectif_previsionnel`, `query_month`, `query_day`, `query_hour`, `query_minute`, `objectif_jour`, `route_type_id`, `contact_id`) VALUES
(1, 305, 1, 1, 2022, 1, 35653, 45, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(11, 305, 141, -1, 2021, 3, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

--
-- Déclencheurs `objectif`
--
DELIMITER $$
CREATE TRIGGER `update_objectif_vendeur_if_exists` AFTER UPDATE ON `objectif` FOR EACH ROW BEGIN
  if(new.mission_zone_id is not null and new.mission_zone_id > 0 
      and new.objectif_value<>old.objectif_value)THEN
 		update  contact_vendeur_objectif cvo 
        inner join mission_zone_contact mzc 
        	      on  mzc.contact_id=cvo.vendeur_id 
                  and mzc.type_id=1
                   and  mzc.zone_id=new.mission_zone_id 
                   and cvo.annee=new.objectif_annee 
                   and cvo.mois=new.objectif_mois
        set cvo.montant_objectif=new.objectif_value;
     end if ;
END
$$
DELIMITER ;

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

--
-- Structure de la table `objectif_drop_size`
--

CREATE TABLE `objectif_drop_size` (
  `id` bigint(20) NOT NULL,
  `drop_size_du` double NOT NULL,
  `drop_size_au` double NOT NULL,
  `commission` double NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `objectif_drop_size` (`id`, `drop_size_du`, `drop_size_au`, `commission`) VALUES
(99881, 50, 54, 1500);

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

--
-- Structure de la table `objectif_edit_permission`
--

CREATE TABLE `objectif_edit_permission` (
  `year` int(11) NOT NULL,
  `month` int(11) NOT NULL,
  `date_start` date NOT NULL,
  `date_end` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `objectif_fonction_authorization`
--

CREATE TABLE `objectif_fonction_authorization` (
  `objectif_type_id` bigint(20) NOT NULL,
  `fonction_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `objectif_prime`
--

CREATE TABLE `objectif_prime` (
  `id` int(11) NOT NULL,
  `pourcentage_start` bigint(20) NOT NULL,
  `pourcentage_end` bigint(20) NOT NULL,
  `prime` double NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `objectif_prime_famille`
--

CREATE TABLE `objectif_prime_famille` (
  `famille_id` int(11) NOT NULL,
  `objectif_id` int(11) NOT NULL,
  `values` json NOT NULL,
  `total` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `objectif_prime_groupe_value`
--

CREATE TABLE `objectif_prime_groupe_value` (
  `objectif_prime_id` int(11) NOT NULL,
  `month` int(11) NOT NULL,
  `year` int(11) NOT NULL,
  `groupe_id` int(11) NOT NULL,
  `value` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `objectif_prime_value`
--

CREATE TABLE `objectif_prime_value` (
  `objectif_prime_id` int(11) NOT NULL,
  `objectif_id` int(11) NOT NULL,
  `value` float NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `objectif_produit`
--

CREATE TABLE `objectif_produit` (
  `objectif_id` bigint(20) NOT NULL,
  `produit_famille_id` bigint(20) NOT NULL,
  `pourcentage` double DEFAULT NULL,
  `montant` double DEFAULT NULL,
  `quantite` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `objectif_report_mailing`
--

CREATE TABLE `objectif_report_mailing` (
  `report_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `objectif_report_mail_day` int(11) NOT NULL,
  `objectif_report_mail_adress` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `objectif_report_mail_time` time NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `objectif_taux_succes`
--

CREATE TABLE `objectif_taux_succes` (
  `id` bigint(20) NOT NULL,
  `pourcentage_start` double NOT NULL,
  `pourcentage_end` double NOT NULL,
  `commission` double NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `objectif_taux_succes` (`id`, `pourcentage_start`, `pourcentage_end`, `commission`) VALUES
(11, 20, 30, 1600),
(51, 50, 60, 20000);

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

--
-- Structure de la table `objectif_type`
--

CREATE TABLE `objectif_type` (
  `objectif_type_id` bigint(20) NOT NULL,
  `objectif_type_reference` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `objectif_type_designation` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `objectif_type_parent_id` bigint(20) DEFAULT NULL,
  `is_target` tinyint(1) NOT NULL,
  `is_monthly` tinyint(1) NOT NULL,
  `is_daily` tinyint(1) NOT NULL,
  `is_yearly` tinyint(1) NOT NULL,
  `unit` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `preference` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `valeurReference` bigint(20) NOT NULL,
  `ordre` int(11) NOT NULL,
  `is_accumul` tinyint(1) NOT NULL,
  `min_value_tmp` double DEFAULT NULL,
  `max_value_tmp` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `objectif_type` (`objectif_type_id`, `objectif_type_reference`, `objectif_type_designation`, `objectif_type_parent_id`, `is_target`, `is_monthly`, `is_daily`, `is_yearly`, `unit`, `preference`, `valeurReference`, `ordre`, `is_accumul`, `min_value_tmp`, `max_value_tmp`) VALUES
(1, '', 'L’entreprise', NULL, 0, 0, 0, 0, '', '', 0, 1, 0, 1, NULL),
(2, 'ENT001', 'Objet et secteur d’activité', 1, 0, 0, 0, 0, 'Unite', '', 0, 2, 0, NULL, NULL),
(3, 'ENT002', 'Sites immobiliers (ZI) (Nombre)', 1, 0, 0, 0, 0, 'N', '', 0, 3, 0, NULL, NULL),
(4, 'ENT004', 'Départements et services (nombre)', 1, 0, 0, 0, 0, 'N', '', 0, 5, 0, NULL, NULL),
(5, 'ENT005', 'Moyens matériels et équipements (Nombre)', 1, 0, 0, 0, 0, 'N', '', 0, 6, 0, NULL, NULL),
(6, 'ENT007', 'Moyens généraux (Nombre)', 1, 0, 0, 0, 0, 'N', '', 0, 8, 0, NULL, NULL),
(7, 'ENT009', 'Ressources humaines (nombre)', 1, 0, 0, 0, 0, 'N', '', 0, 10, 0, NULL, NULL),
(8, 'ENT010', 'Porte feuilles clients (nombre)', 1, 0, 0, 0, 0, 'N', '', 0, 11, 0, NULL, NULL),
(9, 'ENT011', 'Produits et services (nombre)', 1, 0, 0, 0, 0, 'N', '', 0, 12, 0, NULL, NULL),
(10, '', 'Digitalisation, présence et réputation', NULL, 0, 0, 0, 0, 'unite', '', 0, 13, 0, NULL, NULL),
(11, 'DIG001', 'Messagerie (comm. Active ou non)', 10, 0, 0, 0, 0, 'Bool', '1', 1, 14, 0, NULL, NULL),
(12, 'DIG002', 'Site web (MAJ)', 10, 0, 0, 0, 0, 'Bool', '1', 1, 15, 0, NULL, NULL),
(13, 'DIG003', 'Système d’information en place (suivi docs et procédures)', 10, 0, 0, 0, 0, 'Bool', '1', 1, 16, 0, NULL, NULL),
(14, 'DIG004', 'Communication & newsletter', 10, 0, 0, 0, 0, 'Bool', '1', 1, 17, 0, NULL, NULL),
(15, 'DIG005', 'Présence sur les réseaux sociaux (linkedIn Maj, …)', 10, 0, 0, 0, 0, 'Bool', '1', 1, 18, 0, NULL, NULL),
(16, 'DIG006', 'Réputation interne (RH) % de satisf.', 10, 0, 0, 0, 0, '%', '1', 70, 19, 0, NULL, NULL),
(17, 'DIG007', 'Réputation partenaires (clients & fournisseurs) %', 10, 0, 0, 0, 0, '%', '1', 80, 20, 0, NULL, NULL),
(18, 'DIG008', 'Fidélité clients (%)', 10, 0, 0, 0, 0, '%', '1', 80, 21, 0, NULL, NULL),
(19, '', 'Parc en chiffres', NULL, 0, 0, 0, 0, '', '', 0, 22, 0, 1, NULL),
(20, 'PARC001', 'Parc roulant', 19, 0, 0, 0, 0, 'N', '', 0, 23, 0, NULL, NULL),
(21, 'PARC002', 'Chauffeurs', 19, 0, 0, 0, 0, 'N', '', 0, 24, 0, NULL, NULL),
(22, 'PARC003', 'Age moyen véhicules (en mois)', 19, 0, 0, 0, 0, 'N', '-1', 5, 25, 0, NULL, NULL),
(23, 'PARC004', 'Km moyens du parc', 19, 0, 0, 0, 0, 'N', '', 0, 26, 0, NULL, NULL),
(24, 'PARC005', 'Evaluations (Aquisition, cote)', 19, 0, 0, 0, 0, 'DA', '', 0, 27, 0, NULL, NULL),
(25, 'PARC006', 'Véhicules légers', 19, 0, 0, 0, 0, 'N', '', 0, 28, 0, NULL, NULL),
(26, 'PARC007', 'Véhicules utilitaires', 19, 0, 0, 0, 0, 'N', '', 0, 29, 0, NULL, NULL),
(27, 'PARC008', 'Véhicules Lourds - Porteurs', 19, 0, 0, 0, 0, 'N', '', 0, 30, 0, NULL, NULL),
(28, 'PARC009', 'Véhicules Lourds - Remorques', 19, 0, 0, 0, 0, 'N', '', 0, 31, 0, NULL, NULL),
(29, 'PARC010', 'Véhicules Lourds - Tracteurs', 19, 0, 0, 0, 0, 'N', '', 0, 32, 0, NULL, NULL),
(30, 'PARC011', 'Véhicules Bus', 19, 0, 0, 0, 0, 'N', '', 0, 33, 0, NULL, NULL),
(31, 'PARC012', 'Taux gérés en interne', 19, 0, 0, 0, 0, '%', '', 0, 34, 0, NULL, NULL),
(32, 'PARC013', 'Taux gérés par la soutraitance', 19, 0, 0, 0, 0, '%', '', 0, 35, 0, NULL, NULL),
(33, '', 'Ressources humaines', NULL, 0, 0, 0, 0, '', '', 0, 36, 0, NULL, NULL),
(34, 'RH001', 'Toute l’équipe', 33, 0, 0, 0, 0, 'N', '', 0, 37, 0, NULL, NULL),
(35, 'RH002', 'Age moyen', 33, 0, 0, 0, 0, 'N', '', 0, 38, 0, NULL, NULL),
(36, 'RH003', 'Nombre hommes', 33, 0, 0, 0, 0, 'N', '', 0, 39, 0, NULL, NULL),
(37, 'RH004', 'Nombre femmes', 33, 0, 0, 0, 0, 'N', '', 0, 40, 0, NULL, NULL),
(38, 'RH005', 'Facteur de stabilité (moyenne durée travaille en mois)', 33, 0, 0, 0, 0, 'N', '', 0, 41, 0, NULL, NULL),
(39, 'RH006', 'Conducteurs', 33, 0, 0, 0, 0, 'N', '', 0, 42, 0, NULL, NULL),
(41, '', 'Finance', NULL, 0, 0, 0, 0, '', '', 0, 44, 0, NULL, NULL),
(42, 'FIN001', 'Echéanciers leasing & locations', 41, 0, 0, 0, 0, 'DA', '', 0, 45, 0, NULL, NULL),
(43, 'FIN002', 'Charge mensuelle salariale', 41, 0, 0, 0, 0, 'DA', '', 0, 46, 0, NULL, NULL),
(44, 'FIN003', 'Charge mensuelle moyens généraux', 41, 0, 0, 0, 0, 'DA', '', 0, 47, 0, NULL, NULL),
(45, 'FIN004', 'Charge mensuelle consommation', 41, 0, 0, 0, 0, 'DA', '', 0, 48, 0, NULL, NULL),
(46, 'FIN005', 'Total charge mensuelle', 41, 0, 0, 0, 0, 'DA', '', 0, 49, 0, NULL, NULL),
(47, 'FIN006', 'Coût de la possession', 41, 0, 0, 0, 0, 'DA', '', 0, 50, 0, NULL, NULL),
(48, 'FIN007', 'Coût de la mobilité mensuel & acquisition matériel', 41, 0, 0, 0, 0, 'DA', '', 0, 51, 0, NULL, NULL),
(49, 'FIN008', 'Coût de la mobilité au Kilomètre', 41, 0, 0, 0, 0, 'DA', '', 0, 52, 0, NULL, NULL),
(50, 'FIN009', 'Prévision charges du mois', 41, 0, 0, 0, 0, 'DA', '', 0, 53, 0, NULL, NULL),
(51, 'FIN010', 'Prévision charges du mois prochain', 41, 0, 0, 0, 0, 'DA', '', 0, 54, 0, NULL, NULL),
(52, 'FIN011', 'Prévision charges à la fin de l’année', 41, 0, 0, 0, 0, 'DA', '', 0, 55, 0, NULL, NULL),
(53, '', 'Etat du parc & situation aujourd’hui', NULL, 0, 0, 0, 0, '', '', 0, 56, 0, 1, NULL),
(54, 'ETAT001', 'En service aujourd’hui', 54, 0, 0, 0, 0, 'N', '', 0, 57, 0, NULL, NULL),
(55, 'ETAT002', 'En panne aujourd’hui', 54, 0, 0, 0, 0, 'N', '', 0, 58, 0, NULL, NULL),
(56, 'ETAT003', 'En maintenance (atelier)', 54, 0, 0, 0, 0, 'N', '', 0, 59, 0, NULL, NULL),
(57, 'ETAT004', 'En mission à l’instant', 54, 0, 0, 0, 0, 'N', '', 0, 60, 0, NULL, NULL),
(58, 'ETAT005', 'Libres sans missions', 54, 0, 0, 0, 0, 'N', '', 0, 61, 0, NULL, NULL),
(59, 'ETAT006', 'Kilométrages du jour', 54, 0, 0, 0, 0, 'N', '', 0, 62, 0, NULL, NULL),
(60, 'ETAT007', 'Bons carburant du jours', 54, 0, 0, 0, 0, 'DA', '', 0, 63, 0, NULL, NULL),
(61, 'ETAT008', 'Consommation du jour', 54, 0, 0, 0, 0, 'DA', '', 0, 64, 0, NULL, NULL),
(62, 'ETAT009', 'Anomalies du jours', 54, 0, 0, 0, 0, 'N', '', 0, 65, 0, NULL, NULL),
(63, 'ETAT010', 'Consommation pièces (Total DA)', 54, 0, 0, 0, 0, 'DA', '', 0, 66, 0, NULL, NULL),
(64, 'ETAT011', 'Alertes évènements (arrivées à dates ou Km maint, ...)', 54, 0, 0, 0, 0, 'N', '', 0, 67, 0, NULL, NULL),
(65, 'ETAT012', 'Conducteurs présents du jours', 54, 0, 0, 0, 0, 'N', '', 0, 68, 0, NULL, NULL),
(66, 'ETAT013', 'Conducteurs en missions aujourd’hui', 54, 0, 0, 0, 0, 'N', '', 0, 69, 0, NULL, NULL),
(67, '', 'Résumé du mois', NULL, 0, 0, 0, 0, '', '', 0, 70, 0, 1, NULL),
(68, 'RMEN001', 'Taux d’utilisation', 67, 0, 0, 0, 0, '%', '1', 50, 71, 0, NULL, NULL),
(69, 'RMEN002', 'Pannes et immob.', 67, 0, 0, 0, 0, 'N', '-1', 0, 72, 1, NULL, NULL),
(70, 'RMEN003', 'Infractions', 67, 0, 0, 0, 0, 'N', '-1', 0, 73, 1, NULL, NULL),
(71, 'RMEN004', 'Sinistres', 67, 0, 0, 0, 0, 'N', '-1', 0, 74, 1, NULL, NULL),
(72, 'RMEN005', 'Missions', 67, 0, 0, 0, 0, 'N', '', 0, 75, 1, NULL, NULL),
(73, 'RMEN006', 'Assurance Remboursement fait', 67, 0, 0, 0, 0, 'Bool', '', 0, 76, 0, NULL, NULL),
(74, 'RMEN007', 'Assurance Remboursement restant', 67, 0, 0, 0, 0, 'DA', '', 0, 77, 0, NULL, NULL),
(75, 'RMEN008', 'Interventions et opérations Ateliers', 67, 0, 0, 0, 0, 'N', '', 0, 78, 1, NULL, NULL),
(76, 'RMEN009', 'Taux d’utilisation (temps)', 67, 0, 0, 0, 0, '%', '', 0, 79, 0, NULL, NULL),
(77, 'RMEN010', 'Taux d’utilisation utile (temps)', 67, 0, 0, 0, 0, '%', '', 0, 80, 0, NULL, NULL),
(78, '', 'Evaluations des missions et comportements', NULL, 0, 0, 0, 0, '', '', 0, 81, 0, NULL, NULL),
(79, 'EVAL001', 'Déplacement utile', 78, 1, 0, 0, 0, 'N', '1', 0, 82, 1, NULL, NULL),
(80, 'EVAL002', 'Optimisation de la route', 78, 1, 0, 0, 0, 'N', '1', 0, 83, 1, NULL, NULL),
(81, 'EVAL003', 'Consommation modérée', 78, 1, 0, 0, 0, 'N', '1', 0, 84, 1, NULL, NULL),
(82, 'EVAL004', 'Constatations', 78, 1, 0, 0, 0, 'N', '-1', 0, 85, 1, NULL, NULL),
(83, 'EVAL005', 'Infractions', 78, 1, 0, 0, 0, 'N', '-1', 0, 86, 1, NULL, NULL),
(84, 'EVAL006', 'Bonne conduite', 78, 1, 0, 0, 0, 'N', '1', 0, 87, 1, NULL, NULL),
(85, 'EVAL007', 'Utilisation rationnelle', 78, 1, 0, 0, 0, 'N', '1', 0, 88, 1, NULL, NULL),
(86, 'EVAL008', 'Optimisation (groupements de taches, covoiturage...etc)', 78, 1, 0, 0, 0, 'N', '1', 0, 89, 1, NULL, NULL),
(87, 'EVAL009', 'Déclarations de pannes ou soucis', 78, 1, 0, 0, 0, 'N', '-1', 0, 90, 1, NULL, NULL),
(88, 'EVAL010', 'Nettoyage et entretien', 78, 1, 0, 0, 0, 'N', '1', 0, 91, 1, NULL, NULL),
(89, 'EVAL011', 'Respect délai de route', 78, 1, 0, 0, 0, 'N', '1', 0, 92, 1, NULL, NULL),
(90, 'EVAL012', 'Respect temps de repos', 78, 1, 0, 0, 0, 'N', '1', 0, 93, 1, NULL, NULL),
(91, '', 'Finance du mois', NULL, 0, 0, 0, 0, '', '', 0, 94, 0, NULL, NULL),
(92, 'FINM001', 'Frais et coûts de la gestion de parc', 91, 1, 0, 0, 0, 'DA', '', 0, 95, 1, NULL, NULL),
(93, 'FINM002', 'Assurances', 91, 1, 0, 0, 0, 'DA', '', 0, 96, 1, NULL, NULL),
(94, 'FINM003', 'Vignettes', 91, 1, 0, 0, 0, 'DA', '', 0, 97, 1, NULL, NULL),
(95, 'FINM004', 'Carburant', 91, 1, 0, 0, 0, 'DA', '', 0, 98, 1, NULL, NULL),
(96, 'FINM005', 'Pannes', 91, 1, 0, 0, 0, 'DA', '', 0, 99, 1, NULL, NULL),
(97, 'FINM006', 'Amendes', 91, 1, 0, 0, 0, 'DA', '', 0, 100, 1, NULL, NULL),
(98, 'FINM007', 'Contrôles technique', 91, 1, 0, 0, 0, 'DA', '', 0, 101, 1, NULL, NULL),
(99, 'FINM008', 'Maintenances et révisions périodiques', 91, 1, 0, 0, 0, 'DA', '', 0, 102, 1, NULL, NULL),
(100, 'FINM009', 'Accidents', 91, 1, 0, 0, 0, 'DA', '', 0, 103, 1, NULL, NULL),
(101, 'FINM010', 'Moyens généraux et PDR', 91, 1, 0, 0, 0, 'DA', '', 0, 104, 1, NULL, NULL),
(102, 'FINM011', 'Prestations et autres', 91, 1, 0, 0, 0, 'DA', '', 0, 105, 1, NULL, NULL),
(103, 'FINM012', 'Masse salariale', 91, 1, 0, 0, 0, 'DA', '', 0, 106, 1, NULL, NULL),
(104, 'FINM013', 'Total dépenses du mois', 91, 1, 0, 0, 0, 'DA', '', 0, 107, 1, NULL, NULL),
(105, '', 'Stock et consommation du mois', NULL, 0, 0, 0, 0, '', '', 0, 108, 0, 1, NULL),
(106, 'STCK001', 'Consommation carburant bons', 105, 1, 0, 0, 0, 'DA', '', 0, 109, 1, NULL, NULL),
(107, 'STCK002', 'Consommation carburant bons d’achats', 105, 1, 0, 0, 0, 'DA', '', 0, 110, 1, NULL, NULL),
(108, 'STCK003', 'Stock et PDR : Achat', 105, 1, 0, 0, 0, 'DA', '', 0, 111, 1, NULL, NULL),
(109, 'STCK004', 'Stock : Consommation', 105, 1, 0, 0, 0, 'DA', '', 0, 112, 1, NULL, NULL),
(110, 'STCK005', 'Stock : impayées du mois', 105, 1, 0, 0, 0, 'DA', '', 0, 113, 1, NULL, NULL),
(111, 'STCK006', 'Stock : cumul total des impayées', 105, 1, 0, 0, 0, 'DA', '', 0, 114, 1, NULL, NULL),
(112, 'STCK007', 'Stock : coût de stockage (magasinage, gestion, sécurité, réfrigération ...etc)', 105, 1, 0, 0, 0, 'DA', '', 0, 115, 1, NULL, NULL),
(113, '', 'Performaces atelier', NULL, 0, 0, 0, 0, '', '', 0, 116, 0, 1, NULL),
(114, 'ATL001', 'Temps moyens attente avant prise en charge (jours)', 113, 1, 0, 0, 0, 'N', '-1', 1, 117, 1, NULL, NULL),
(115, 'ATL002', 'Durée moyennes de réparation (jours)', 113, 1, 0, 0, 0, 'N', '-1', 1, 118, 1, NULL, NULL),
(116, 'ATL003', 'Evaluations opérations de maintenance', 113, 1, 0, 0, 0, 'R', '1', 10, 119, 0, NULL, NULL),
(117, '', 'Performances suivi doc. & maintenances préventives', NULL, 0, 0, 0, 0, '', '', 0, 120, 0, NULL, NULL),
(118, 'SUIV001', 'Documents à jours (%)', 117, 1, 0, 0, 0, '%', '1', 100, 121, 1, NULL, NULL),
(119, 'SUIV002', 'Maintenances préventives à jours (%)', 117, 1, 0, 0, 0, '%', '1', 100, 122, 1, NULL, NULL),
(120, '', 'Sécurité', NULL, 0, 0, 0, 0, '', '', 0, 123, 0, NULL, NULL),
(121, 'SEC001', 'Infractions', 120, 1, 0, 0, 0, 'N', '-1', 0, 124, 1, NULL, NULL),
(122, 'SEC002', 'Constatations', 120, 1, 0, 0, 0, 'N', '-1', 0, 125, 1, NULL, NULL),
(123, 'SEC003', 'Sinistres', 120, 1, 0, 0, 0, 'N', '-1', 0, 126, 1, NULL, NULL),
(124, 'SEC004', 'Dep. vitesse', 120, 1, 0, 0, 0, 'N', '-1', 0, 127, 1, NULL, NULL),
(125, 'SEC005', 'Conduite hors régime', 120, 1, 0, 0, 0, 'N', '-1', 0, 128, 1, NULL, NULL),
(126, 'SEC006', 'Sortie zone autorisé', 120, 1, 0, 0, 0, 'N', '-1', 0, 129, 1, NULL, NULL),
(127, 'SEC007', 'Conduite horaires non autorisé', 120, 1, 0, 0, 0, 'N', '-1', 0, 130, 1, NULL, NULL),
(128, 'SEC008', 'Conduite jours non autorisé', 120, 1, 0, 0, 0, 'N', '-1', 0, 131, 1, NULL, NULL),
(129, 'SEC009', 'Freinage brusque', 120, 1, 0, 0, 0, 'N', '-1', 0, 132, 1, NULL, NULL),
(130, 'SEC010', 'Accélération brusque', 120, 1, 0, 0, 0, 'N', '-1', 0, 133, 1, NULL, NULL),
(131, 'SEC011', 'Cond. longue durée', 120, 1, 0, 0, 0, 'N', '-1', 0, 134, 1, NULL, NULL),
(132, 'SEC012', 'Repos négligé', 120, 1, 0, 0, 0, 'N', '-1', 0, 135, 1, NULL, NULL),
(133, 'SEC013', 'Retrait permis', 120, 1, 0, 0, 0, 'N', '-1', 0, 136, 1, NULL, NULL),
(134, 'ENT008', 'Moyens généraux (valeurs)', 1, 0, 0, 0, 0, 'DA', '', 0, 9, 0, NULL, NULL),
(135, 'ENT006', 'Moyens matériels et équipements (valeurs)', 1, 0, 0, 0, 0, 'DAN', '', 0, 7, 0, NULL, NULL),
(136, 'ENT003', 'Sites immobiliers (ZI) (valeurs)', 1, 0, 0, 0, 0, 'DA', '', 0, 4, 0, NULL, NULL),
(137, 'FIN004', 'Total dépense parc (Loyers, électricité, eau, travaux et prestations)', 41, 0, 0, 0, 0, 'DA', '', 0, 48, 0, NULL, NULL),
(138, 'STCK008', 'Factures fournisseurs du mois', 105, 1, 0, 0, 0, 'DA', '', 0, 116, 1, NULL, NULL),
(139, 'RMEN011', 'Taux d\'immobilisation', 67, 0, 0, 0, 0, '%', '1', 50, 81, 0, NULL, NULL),
(140, 'RMEN012', 'Taux d\'état accidenté', 67, 0, 0, 0, 0, '%', '1', 50, 82, 0, NULL, NULL),
(141, 'CA', 'Chiffre d\'affaire', NULL, 0, 0, 0, 0, '', '', 0, 0, 0, NULL, NULL),
(142, 'SKU', 'Nombre des produits', NULL, 0, 0, 0, 0, 'nbr', '0', 0, 0, 0, NULL, NULL);

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

--
-- Structure de la table `operation_cout`
--

CREATE TABLE `operation_cout` (
  `operation_id` bigint(20) NOT NULL,
  `operation_cout_type_id` int(11) NOT NULL,
  `valeur_cout` double NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `operation_cout_type`
--

CREATE TABLE `operation_cout_type` (
  `operation_cout_type_id` int(11) NOT NULL,
  `operation_cout_type_designation` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `operation_cout_type_ref` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `operation_cout_type` (`operation_cout_type_id`, `operation_cout_type_designation`, `operation_cout_type_ref`) VALUES
(1, 'MO', 'Main d\'œuvre'),
(2, 'PC', 'Pièces et consommables'),
(3, 'MG', 'Manque à gagner');

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

--
-- Structure de la table `optimisation`
--

CREATE TABLE `optimisation` (
  `optimisation_id` bigint(20) NOT NULL,
  `optimisation_date` datetime DEFAULT NULL,
  `optimisation_date_day` date DEFAULT NULL,
  `duree_calcul` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `is_missions_created` tinyint(1) DEFAULT NULL,
  `param_is_use_capacite_max` tinyint(1) DEFAULT NULL,
  `param_capacite_max` int(11) DEFAULT NULL,
  `param_is_use_poids_max` tinyint(1) DEFAULT NULL,
  `param_poids_max` int(11) DEFAULT NULL,
  `param_is_distance_optimization` tinyint(1) DEFAULT NULL,
  `param_is_duree_optimization` tinyint(1) DEFAULT NULL,
  `param_cout_km` double DEFAULT NULL,
  `param_distance_max` int(11) DEFAULT NULL,
  `param_duree_moyenne_client` int(11) DEFAULT NULL,
  `param_duree_max_mission` time DEFAULT NULL,
  `param_nb_clients_max` int(11) DEFAULT NULL,
  `param_vitesse_moyenne` int(11) DEFAULT NULL,
  `param_heure_sortie` time DEFAULT NULL,
  `res_nb_vehicules` double DEFAULT NULL,
  `res_nb_clients_per_mission` double DEFAULT NULL,
  `res_distance_moyenne` bigint(20) DEFAULT NULL,
  `res_duree_moyenne` bigint(20) DEFAULT NULL,
  `res_duree_min` bigint(20) DEFAULT NULL,
  `res_duree_max` bigint(20) DEFAULT NULL,
  `res_cout_moyen` double DEFAULT NULL,
  `res_cout_total` double DEFAULT NULL,
  `res_date_latest_delivery` datetime DEFAULT NULL,
  `optimisation_type_id` bigint(20) DEFAULT NULL,
  `zone_id` bigint(20) DEFAULT NULL,
  `nbr_iterations` bigint(20) DEFAULT NULL,
  `montant_chargement_min` double DEFAULT NULL,
  `montant_chargement_max` double DEFAULT NULL,
  `res_distance_total` int(11) DEFAULT NULL,
  `optimisation_designation` varchar(56) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `optimisation_mission`
--

CREATE TABLE `optimisation_mission` (
  `optimisation_mission_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) DEFAULT NULL,
  `driver_id` bigint(20) DEFAULT NULL,
  `depot_id` bigint(20) DEFAULT NULL,
  `nb_clients` int(11) DEFAULT NULL,
  `distance` double DEFAULT NULL,
  `duree` time DEFAULT NULL,
  `cout` double DEFAULT NULL,
  `is_mission_created` tinyint(1) DEFAULT NULL,
  `mission_id` bigint(20) DEFAULT NULL,
  `optimisation_id` bigint(20) DEFAULT NULL,
  `montant_chargement` double DEFAULT '0',
  `geometry` text CHARACTER SET latin1,
  `color` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `montant` int(11) DEFAULT '0',
  `nbr_colis` int(11) DEFAULT '0',
  `volume` float DEFAULT NULL,
  `poids` double DEFAULT NULL,
  `update_geometry` tinyint(4) DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déclencheurs `optimisation_mission`
--
DELIMITER $$
CREATE TRIGGER `set_color` BEFORE INSERT ON `optimisation_mission` FOR EACH ROW BEGIN
    SET NEW.color = CONCAT('#', LPAD(CONV(FLOOR(RAND() * 256), 10, 16), 2, '0'),
                              LPAD(CONV(FLOOR(RAND() * 256), 10, 16), 2, '0'),
                              LPAD(CONV(FLOOR(RAND() * 96) + 32, 10, 16), 2, '0'));
    SET NEW.driver_id = COALESCE((SELECT r.default_user_id FROM ressource r WHERE r.ressource_id = NEW.vehicule_id LIMIT 1), NEW.driver_id);
END
$$
DELIMITER ;

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

--
-- Structure de la table `optimisation_mission_point`
--

CREATE TABLE `optimisation_mission_point` (
  `optimisation_mission_point_id` bigint(20) NOT NULL,
  `optimisation_mission_id` bigint(20) DEFAULT NULL,
  `client_id` bigint(20) DEFAULT NULL,
  `ordre` int(11) DEFAULT NULL,
  `distance` double DEFAULT NULL,
  `duree` time DEFAULT NULL,
  `cout` double DEFAULT NULL,
  `heure_arrivee` time DEFAULT NULL,
  `heure_depart` time DEFAULT NULL,
  `color` varchar(8) CHARACTER SET latin1 DEFAULT '#FF0000',
  `montant` float DEFAULT '0',
  `capacite` double NOT NULL DEFAULT '0',
  `poids` double NOT NULL DEFAULT '0',
  `nbr_colis` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Déclencheurs `optimisation_mission_point`
--
DELIMITER $$
CREATE TRIGGER `set_color_after_edit` BEFORE UPDATE ON `optimisation_mission_point` FOR EACH ROW BEGIN
    IF NEW.optimisation_mission_id <> OLD.optimisation_mission_id THEN
        SET NEW.color = (SELECT color FROM optimisation_mission om WHERE om.optimisation_mission_id = NEW.optimisation_mission_id);
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `set_color_client` BEFORE INSERT ON `optimisation_mission_point` FOR EACH ROW BEGIN
    IF NEW.optimisation_mission_id IS NOT NULL THEN
        SET NEW.color = (SELECT color FROM optimisation_mission om WHERE om.optimisation_mission_id = NEW.optimisation_mission_id);
    END IF;
END
$$
DELIMITER ;

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

--
-- Structure de la table `optimisation_mission_point_commande`
--

CREATE TABLE `optimisation_mission_point_commande` (
  `commande_id` bigint(20) NOT NULL,
  `optimisation_mission_point_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Structure de la table `optimisation_param_client`
--

CREATE TABLE `optimisation_param_client` (
  `optimisation_id` bigint(20) NOT NULL,
  `client_id` bigint(20) NOT NULL,
  `mouvement_id` bigint(11) NOT NULL,
  `mouvement_poid` double NOT NULL DEFAULT '0',
  `mouvement_volume` double NOT NULL DEFAULT '0',
  `mouvement_montant` double DEFAULT NULL,
  `mouvement_nbr_colis` int(11) DEFAULT NULL,
  `clauster_id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `optimisation_param_depot`
--

CREATE TABLE `optimisation_param_depot` (
  `optimisation_id` bigint(20) NOT NULL,
  `depot_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `optimisation_param_vehicule`
--

CREATE TABLE `optimisation_param_vehicule` (
  `optimisation_id` bigint(20) NOT NULL,
  `vehicule_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `optimisation_status`
--

CREATE TABLE `optimisation_status` (
  `optimisation_status_id` bigint(20) NOT NULL,
  `optimisation_status_designation` varchar(100) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

INSERT INTO `optimisation_status` (`optimisation_status_id`, `optimisation_status_designation`) VALUES
(0, 'En cours'),
(1, 'Accepté'),
(2, 'Appliquée');

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

--
-- Structure de la table `optimisation_type`
--

CREATE TABLE `optimisation_type` (
  `optimisation_type_id` bigint(20) NOT NULL,
  `optimisation_type_designation` text CHARACTER SET latin1
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `optimisation_type` (`optimisation_type_id`, `optimisation_type_designation`) VALUES
(1, 'Construction'),
(2, 'Clack & Right'),
(11, 'Génétique');

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

--
-- Structure de la table `paiement_mode`
--

CREATE TABLE `paiement_mode` (
  `paiement_mode_id` int(11) NOT NULL,
  `paiement_mode_designation` varchar(256) CHARACTER SET latin1 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `param`
--

CREATE TABLE `param` (
  `param_id` bigint(20) NOT NULL,
  `param_designation` varchar(256) CHARACTER SET latin1 NOT NULL,
  `param_type_id` int(11) DEFAULT NULL,
  `param_formule_id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `parametres`
--

CREATE TABLE `parametres` (
  `compte_id` bigint(20) NOT NULL,
  `is_adresse_local` tinyint(1) DEFAULT NULL,
  `adresse_local` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `adresse_local_port` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
  `is_adresse_distance` tinyint(1) DEFAULT NULL,
  `adresse_distance` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `synchronisation_auto` tinyint(1) DEFAULT NULL,
  `gps_tracking` tinyint(1) DEFAULT NULL,
  `synchronisation_wifi` tinyint(1) DEFAULT NULL,
  `parametres_ftp` tinyint(1) DEFAULT NULL,
  `protocole_ftp_sftp` tinyint(1) DEFAULT NULL,
  `ftp_adresse` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `ftp_adresse_port` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
  `user_name` varchar(20) CHARACTER SET latin1 DEFAULT NULL,
  `password` varchar(20) CHARACTER SET latin1 DEFAULT NULL,
  `dossier` varchar(30) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `parc_alert`
--

CREATE TABLE `parc_alert` (
  `parc_alert_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) NOT NULL,
  `contact_id` bigint(20) NOT NULL,
  `contact_email` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
  `display_popup` tinyint(1) NOT NULL,
  `days_before_operation` int(11) NOT NULL,
  `km_before_operation` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `parc_anomalie_frais`
--

CREATE TABLE `parc_anomalie_frais` (
  `anomalie_frais_id` bigint(20) NOT NULL,
  `anomalie_operation_id` bigint(20) DEFAULT NULL,
  `anomalie_frais_article_id` bigint(20) DEFAULT NULL,
  `anomalie_frais_qte` double DEFAULT NULL,
  `anomalie_frais_prix_unitaite` double DEFAULT NULL,
  `anomalie_frais_poids` double DEFAULT NULL,
  `anomalie_frais_parent_id` bigint(20) DEFAULT NULL,
  `anomalie_frais_magasin` double DEFAULT NULL,
  `anomalie_frais_ressource_id` bigint(20) DEFAULT NULL,
  `anomalie_frais_montant_ordre_by` bigint(20) DEFAULT NULL,
  `anomalie_frais_order_date` datetime DEFAULT NULL,
  `anomalie_frais_provided_by` bigint(20) DEFAULT NULL,
  `anomalie_frais_provided_date` datetime DEFAULT NULL,
  `anomalie_frais_installed_date` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `parc_anomalie_operation`
--

CREATE TABLE `parc_anomalie_operation` (
  `anomalie_operation_id` bigint(20) NOT NULL,
  `anomalie_operation_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `parc_anomalie_type`
--

CREATE TABLE `parc_anomalie_type` (
  `anomalie_type_id` bigint(20) NOT NULL,
  `anomalie_type_designation` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `parc_assurance`
--

CREATE TABLE `parc_assurance` (
  `assurance_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `numero_serie` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `assurance_contrat_id` bigint(20) DEFAULT NULL,
  `vehicle_id` bigint(20) DEFAULT NULL,
  `assurance_montant` double DEFAULT NULL,
  `archive` tinyint(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `parc_assurance_contrat`
--

CREATE TABLE `parc_assurance_contrat` (
  `assurance_contrat_id` bigint(20) NOT NULL,
  `entreprise_id` bigint(20) DEFAULT NULL,
  `assurance_agence_id` bigint(20) DEFAULT NULL,
  `numero_contrat` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `pays_id` int(4) DEFAULT NULL,
  `start_date` datetime DEFAULT NULL,
  `start_date_day` date DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `end_date_day` date DEFAULT NULL,
  `assurance_montant_total` double DEFAULT NULL,
  `archive` tinyint(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Structure de la table `parc_assurance_detail`
--

