From b453bb2f68d5ddbe4fd60dfa402a78640e57e9f1 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 1 Jul 2016 13:58:43 +0200 Subject: [PATCH] Ajout schema db backoffice, execution, facturation --- Metier/schema/backoffice.indiscores.sql | 13 +++++++++++++ Metier/schema/backoffice.session.sql | 7 +++++++ Metier/schema/backoffice.surveillances.sql | 19 +++++++++++++++++++ .../backoffice.surveillances_entity.sql | 13 +++++++++++++ Metier/schema/execution.process.sql | 9 +++++++++ Metier/schema/execution.process_jobs.sql | 14 ++++++++++++++ Metier/schema/execution.process_out.sql | 10 ++++++++++ Metier/schema/facturation.client.sql | 5 +++++ Metier/schema/facturation.client_adresse.sql | 14 ++++++++++++++ Metier/schema/facturation.client_contact.sql | 11 +++++++++++ Metier/schema/facturation.contrat.sql | 14 ++++++++++++++ .../schema/facturation.contrat_articles.sql | 8 ++++++++ .../schema/facturation.contrat_category.sql | 5 +++++ Metier/schema/facturation.contrat_conso.sql | 11 +++++++++++ Metier/schema/facturation.contrat_detail.sql | 11 +++++++++++ Metier/schema/facturation.contrat_forfait.sql | 9 +++++++++ Metier/schema/facturation.contrat_link.sql | 10 ++++++++++ Metier/schema/facturation.facture.sql | 19 +++++++++++++++++++ Metier/schema/facturation.facture_line.sql | 12 ++++++++++++ .../schema/facturation.facture_zoneclient.sql | 7 +++++++ 20 files changed, 221 insertions(+) create mode 100644 Metier/schema/backoffice.indiscores.sql create mode 100644 Metier/schema/backoffice.session.sql create mode 100644 Metier/schema/backoffice.surveillances.sql create mode 100644 Metier/schema/backoffice.surveillances_entity.sql create mode 100644 Metier/schema/execution.process.sql create mode 100644 Metier/schema/execution.process_jobs.sql create mode 100644 Metier/schema/execution.process_out.sql create mode 100644 Metier/schema/facturation.client.sql create mode 100644 Metier/schema/facturation.client_adresse.sql create mode 100644 Metier/schema/facturation.client_contact.sql create mode 100644 Metier/schema/facturation.contrat.sql create mode 100644 Metier/schema/facturation.contrat_articles.sql create mode 100644 Metier/schema/facturation.contrat_category.sql create mode 100644 Metier/schema/facturation.contrat_conso.sql create mode 100644 Metier/schema/facturation.contrat_detail.sql create mode 100644 Metier/schema/facturation.contrat_forfait.sql create mode 100644 Metier/schema/facturation.contrat_link.sql create mode 100644 Metier/schema/facturation.facture.sql create mode 100644 Metier/schema/facturation.facture_line.sql create mode 100644 Metier/schema/facturation.facture_zoneclient.sql diff --git a/Metier/schema/backoffice.indiscores.sql b/Metier/schema/backoffice.indiscores.sql new file mode 100644 index 0000000..10ae1a1 --- /dev/null +++ b/Metier/schema/backoffice.indiscores.sql @@ -0,0 +1,13 @@ +CREATE TABLE `indiscores` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `refCmd` varchar(13) CHARACTER SET latin1 NOT NULL, + `nbLine` int(11) NOT NULL, + `nbLineAdd` int(11) DEFAULT NULL, + `nbLineIdValid` int(11) DEFAULT NULL, + `dateAdded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `dateLoaded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `nbLineProcess` int(11) DEFAULT NULL, + `dateStart` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `dateEnd` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=0 TRANSACTIONAL=0; diff --git a/Metier/schema/backoffice.session.sql b/Metier/schema/backoffice.session.sql new file mode 100644 index 0000000..f9e75c9 --- /dev/null +++ b/Metier/schema/backoffice.session.sql @@ -0,0 +1,7 @@ +CREATE TABLE `session` ( + `id` char(32) CHARACTER SET utf8 NOT NULL DEFAULT '', + `modified` int(11) DEFAULT NULL COMMENT 'Timestamp de modification', + `lifetime` int(11) DEFAULT NULL COMMENT 'Durée de vie de la session', + `data` text CHARACTER SET utf8 COMMENT 'data pour la session', + PRIMARY KEY (`id`) +) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=0 TRANSACTIONAL=0 COMMENT='Clés de session pour authentification backoffice'; diff --git a/Metier/schema/backoffice.surveillances.sql b/Metier/schema/backoffice.surveillances.sql new file mode 100644 index 0000000..c006ef3 --- /dev/null +++ b/Metier/schema/backoffice.surveillances.sql @@ -0,0 +1,19 @@ +CREATE TABLE `surveillances` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `refCmd` varchar(13) CHARACTER SET utf8 NOT NULL, + `nbLine` int(11) NOT NULL, + `nbLineLoaded` int(11) NOT NULL, + `nbLineIdValid` int(11) NOT NULL, + `reportNbAdd` int(11) DEFAULT NULL, + `reportNbUpdate` int(11) DEFAULT NULL, + `reportNbDelete` int(11) DEFAULT NULL, + `dateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `dateLoaded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `dateExec` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `dateReport` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `toReplace` tinyint(1) DEFAULT NULL, + `processNbLine` int(11) DEFAULT NULL, + `processDateStart` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `processDateEnd` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=0 TRANSACTIONAL=0 COMMENT='Gestion des chargement surveillances'; diff --git a/Metier/schema/backoffice.surveillances_entity.sql b/Metier/schema/backoffice.surveillances_entity.sql new file mode 100644 index 0000000..23b642f --- /dev/null +++ b/Metier/schema/backoffice.surveillances_entity.sql @@ -0,0 +1,13 @@ +CREATE TABLE `surveillances_entity` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `RefCmd` varchar(13) CHARACTER SET utf8 NOT NULL, + `Siren` varchar(9) CHARACTER SET utf8 NOT NULL, + `Nic` varchar(5) CHARACTER SET utf8 NOT NULL, + `Ref` varchar(255) CHARACTER SET utf8 NOT NULL, + `Source` varchar(50) CHARACTER SET utf8 DEFAULT NULL, + `Login` varchar(50) CHARACTER SET utf8 NOT NULL, + `Email` varchar(255) CHARACTER SET utf8 NOT NULL, + `IsValid` tinyint(1) NOT NULL, + `Done` enum('added','updated','deleted') CHARACTER SET utf8 DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci PAGE_CHECKSUM=0 TRANSACTIONAL=0 COMMENT='Surveillances - Stockage des lignes '; diff --git a/Metier/schema/execution.process.sql b/Metier/schema/execution.process.sql new file mode 100644 index 0000000..9281394 --- /dev/null +++ b/Metier/schema/execution.process.sql @@ -0,0 +1,9 @@ +CREATE TABLE `process` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `description` tinytext COLLATE utf8mb4_unicode_ci NOT NULL, + `category` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Catégorie du processus', + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Liste des traitements'; diff --git a/Metier/schema/execution.process_jobs.sql b/Metier/schema/execution.process_jobs.sql new file mode 100644 index 0000000..d1073cd --- /dev/null +++ b/Metier/schema/execution.process_jobs.sql @@ -0,0 +1,14 @@ +CREATE TABLE `process_jobs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `schedule` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `command` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `debug` tinyint(4) NOT NULL, + `runOnHost` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `maxRuntime` int(11) NOT NULL, + `enabled` tinyint(4) NOT NULL, + `haltDir` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `output` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Liste des jobs'; diff --git a/Metier/schema/execution.process_out.sql b/Metier/schema/execution.process_out.sql new file mode 100644 index 0000000..43697ee --- /dev/null +++ b/Metier/schema/execution.process_out.sql @@ -0,0 +1,10 @@ +CREATE TABLE `process_out` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `dateStart` datetime NOT NULL, + `dateEnd` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `unitTotal` int(11) NOT NULL DEFAULT '0', + `unitExec` int(11) NOT NULL DEFAULT '0', + `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Execution des processus'; diff --git a/Metier/schema/facturation.client.sql b/Metier/schema/facturation.client.sql new file mode 100644 index 0000000..7b83923 --- /dev/null +++ b/Metier/schema/facturation.client.sql @@ -0,0 +1,5 @@ +CREATE TABLE `client` ( + `id` int(11) NOT NULL, + `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Relation id client et code client'; diff --git a/Metier/schema/facturation.client_adresse.sql b/Metier/schema/facturation.client_adresse.sql new file mode 100644 index 0000000..ec6d6a8 --- /dev/null +++ b/Metier/schema/facturation.client_adresse.sql @@ -0,0 +1,14 @@ +CREATE TABLE `client_adresse` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `clientCode` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `L1` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `L2` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `L3` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `L4` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `L5` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `L6` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `L7` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `L8` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/Metier/schema/facturation.client_contact.sql b/Metier/schema/facturation.client_contact.sql new file mode 100644 index 0000000..a47f643 --- /dev/null +++ b/Metier/schema/facturation.client_contact.sql @@ -0,0 +1,11 @@ +CREATE TABLE `client_contact` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `clientCode` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `genre` enum('M','Mme','Mlle') COLLATE utf8mb4_unicode_ci NOT NULL, + `nom` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `prenom` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `tel` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/Metier/schema/facturation.contrat.sql b/Metier/schema/facturation.contrat.sql new file mode 100644 index 0000000..45e3c48 --- /dev/null +++ b/Metier/schema/facturation.contrat.sql @@ -0,0 +1,14 @@ +CREATE TABLE `contrat` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `category` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `ref` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `dateBegin` date NOT NULL, + `dateEnd` date NOT NULL, + `factBegin` date NOT NULL, + `factEnd` date NOT NULL, + `period` tinyint(4) NOT NULL, + `global` tinyint(1) NOT NULL, + `reconduction` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/Metier/schema/facturation.contrat_articles.sql b/Metier/schema/facturation.contrat_articles.sql new file mode 100644 index 0000000..0b96f01 --- /dev/null +++ b/Metier/schema/facturation.contrat_articles.sql @@ -0,0 +1,8 @@ +CREATE TABLE `contrat_articles` ( + `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `value` decimal(10,2) DEFAULT NULL, + `valueFormat` enum('montant','percent') COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `category` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`code`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Liste des codes articles'; diff --git a/Metier/schema/facturation.contrat_category.sql b/Metier/schema/facturation.contrat_category.sql new file mode 100644 index 0000000..74a9cc7 --- /dev/null +++ b/Metier/schema/facturation.contrat_category.sql @@ -0,0 +1,5 @@ +CREATE TABLE `contrat_category` ( + `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`code`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Liste des catégories de prestations'; diff --git a/Metier/schema/facturation.contrat_conso.sql b/Metier/schema/facturation.contrat_conso.sql new file mode 100644 index 0000000..ca76131 --- /dev/null +++ b/Metier/schema/facturation.contrat_conso.sql @@ -0,0 +1,11 @@ +CREATE TABLE `contrat_conso` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `contratId` int(11) NOT NULL, + `detailId` int(11) NOT NULL, + `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `type` enum('ForfaitNoLimit','ForfaitLimit','Unitaire') COLLATE utf8mb4_unicode_ci NOT NULL, + `montant` decimal(10,2) NOT NULL, + `max` int(11) NOT NULL, + `doublon` enum('none','day','month','period') COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Détail des éléments unitaire pour la facturation'; diff --git a/Metier/schema/facturation.contrat_detail.sql b/Metier/schema/facturation.contrat_detail.sql new file mode 100644 index 0000000..7d168a9 --- /dev/null +++ b/Metier/schema/facturation.contrat_detail.sql @@ -0,0 +1,11 @@ +CREATE TABLE `contrat_detail` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `contratId` int(11) NOT NULL, + `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `type` enum('forfait','conso') COLLATE utf8mb4_unicode_ci NOT NULL, + `terme` enum('debut','fin') COLLATE utf8mb4_unicode_ci NOT NULL, + `taxe` decimal(4,2) NOT NULL, + `itemOrder` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Détail d''un contrat'; diff --git a/Metier/schema/facturation.contrat_forfait.sql b/Metier/schema/facturation.contrat_forfait.sql new file mode 100644 index 0000000..0281c17 --- /dev/null +++ b/Metier/schema/facturation.contrat_forfait.sql @@ -0,0 +1,9 @@ +CREATE TABLE `contrat_forfait` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `contratId` int(11) NOT NULL, + `detailId` int(11) NOT NULL, + `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `periodNum` int(2) NOT NULL, + `montant` decimal(10,2) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Détail des éléments forfaitaires pour la facturation'; diff --git a/Metier/schema/facturation.contrat_link.sql b/Metier/schema/facturation.contrat_link.sql new file mode 100644 index 0000000..da2f2c3 --- /dev/null +++ b/Metier/schema/facturation.contrat_link.sql @@ -0,0 +1,10 @@ +CREATE TABLE `contrat_link` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `contratId` int(11) NOT NULL, + `clientId` int(11) NOT NULL, + `code` int(11) NOT NULL, + `type` enum('service','presta') COLLATE utf8mb4_unicode_ci NOT NULL, + `adresseId` int(11) NOT NULL, + `contactId` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='lien contrat / prestation'; diff --git a/Metier/schema/facturation.facture.sql b/Metier/schema/facturation.facture.sql new file mode 100644 index 0000000..9d094cf --- /dev/null +++ b/Metier/schema/facturation.facture.sql @@ -0,0 +1,19 @@ +CREATE TABLE `facture` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `num` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, + `clientCode` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `type` enum('facture','avoir') COLLATE utf8mb4_unicode_ci NOT NULL, + `paiement` enum('none','virement','cheque') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'none', + `date` date NOT NULL, + `dateDue` date NOT NULL, + `periodBegin` date NOT NULL, + `periodEnd` date NOT NULL, + `mtHT` decimal(10,2) NOT NULL DEFAULT '0.00', + `mtTTC` decimal(10,2) NOT NULL DEFAULT '0.00', + `valid` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Factures'; diff --git a/Metier/schema/facturation.facture_line.sql b/Metier/schema/facturation.facture_line.sql new file mode 100644 index 0000000..8d4d2ab --- /dev/null +++ b/Metier/schema/facturation.facture_line.sql @@ -0,0 +1,12 @@ +CREATE TABLE `facture_line` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `factId` int(11) NOT NULL, + `num` int(11) NOT NULL, + `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `zonetxt` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, + `qte` decimal(10,2) NOT NULL, + `montantUnit` decimal(10,2) NOT NULL, + `montantLine` decimal(10,2) NOT NULL, + `tva` decimal(5,2) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Ligne facturation'; diff --git a/Metier/schema/facturation.facture_zoneclient.sql b/Metier/schema/facturation.facture_zoneclient.sql new file mode 100644 index 0000000..17caf77 --- /dev/null +++ b/Metier/schema/facturation.facture_zoneclient.sql @@ -0,0 +1,7 @@ +CREATE TABLE `facture_zoneclient` ( + `factId` int(11) NOT NULL, + `lnum` tinyint(2) NOT NULL, + `lvalue` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `lstyle` enum('normal','italic','bold') COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`factId`,`lnum`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Info zone client en ligne';