#
# Mises à niveau version 0.9.9f
#

#
# Table structure for table `smi_ccat`
#

ALTER TABLE `smi_ccat`  COMMENT = 'Catégories clients' ;

#
# Table structure for table `smi_cage`
#

DROP TABLE IF EXISTS `smi_cage`;
CREATE TABLE IF NOT EXISTS `smi_cage` (
  `cage_id` int(10) unsigned NOT NULL auto_increment,
  `cage_datecrea` date NOT NULL default '0000-00-00',
  `cage_datemod` date NOT NULL default '0000-00-00',
  `cage_codeage` varchar(20) NOT NULL,
  `cage_codefonc` varchar(5) NOT NULL,
  `cage_civilite` varchar(5) NOT NULL,
  `cage_prenom` varchar(50) NOT NULL,
  `cage_nom` varchar(50) NOT NULL,
  `cage_telf` varchar(20) NOT NULL,
  `cage_fax` varchar(20) NOT NULL,
  `cage_telp` varchar(20) NOT NULL,
  `cage_email` varchar(50) default NULL,
  `cage_mess` varchar(50) default NULL,
  `cage_nota` text,
  PRIMARY KEY  (`cage_id`),
  KEY `cage_codeage` (`cage_codeage`),
  KEY `cage_codefonc` (`cage_codefonc`),
  KEY `cage_civilite` (`cage_civilite`),
  KEY `cage_nom` (`cage_nom`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Contacts agences';

#
# Dumping data for table `smi_cage`
#

#
# Table structure for table `smi_cdo`
#

DROP TABLE IF EXISTS `smi_cdo`;
CREATE TABLE IF NOT EXISTS `smi_cdo` (
  `cdo_id` int(10) unsigned NOT NULL auto_increment,
  `cdo_datecrea` date NOT NULL default '0000-00-00',
  `cdo_datemod` date NOT NULL default '0000-00-00',
  `cdo_codedo` varchar(20) NOT NULL,
  `cdo_codefonc` varchar(5) NOT NULL,
  `cdo_civilite` varchar(5) NOT NULL,
  `cdo_prenom` varchar(50) NOT NULL,
  `cdo_nom` varchar(50) NOT NULL,
  `cdo_telf` varchar(20) NOT NULL,
  `cdo_fax` varchar(20) NOT NULL,
  `cdo_telp` varchar(20) NOT NULL,
  `cdo_email` varchar(50) default NULL,
  `cdo_mess` varchar(50) default NULL,
  `cdo_nota` text,
  PRIMARY KEY  (`cdo_id`),
  KEY `cdo_codedo` (`cdo_codedo`),
  KEY `cdo_codefonc` (`cdo_codefonc`),
  KEY `cdo_civilite` (`cdo_civilite`),
  KEY `cdo_nom` (`cdo_nom`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Contacts donneurs d''ordres';


#
# Dumping data for table `smi_cdo`
#

#
# Table structure for table `smi_cst`
#

DROP TABLE IF EXISTS `smi_cst`;
CREATE TABLE IF NOT EXISTS `smi_cst` (
  `cst_id` int(10) unsigned NOT NULL auto_increment,
  `cst_datecrea` date NOT NULL default '0000-00-00',
  `cst_datemod` date NOT NULL default '0000-00-00',
  `cst_codest` varchar(20) NOT NULL,
  `cst_codefonc` varchar(5) NOT NULL,
  `cst_civilite` varchar(5) NOT NULL,
  `cst_prenom` varchar(50) NOT NULL,
  `cst_nom` varchar(50) NOT NULL,
  `cst_telf` varchar(20) NOT NULL,
  `cst_fax` varchar(20) NOT NULL,
  `cst_telp` varchar(20) NOT NULL,
  `cst_email` varchar(50) default NULL,
  `cst_mess` varchar(50) default NULL,
  `cst_nota` text,
  PRIMARY KEY  (`cst_id`),
  KEY `cst_codest` (`cst_codest`),
  KEY `cst_codefonc` (`cst_codefonc`),
  KEY `cst_civilite` (`cst_civilite`),
  KEY `cst_nom` (`cst_nom`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Contacts sous-traitants';

#
# Dumping data for table `smi_cst`
#

#
# Table structure for table `smi_dos`
#

DROP TABLE IF EXISTS `smi_dos`;
CREATE TABLE IF NOT EXISTS `smi_dos` (
  `dos_id` int(10) unsigned NOT NULL auto_increment,
  `dos_code` varchar(20) NOT NULL,
  `dos_codecli` varchar(20) NOT NULL,
  `dos_titre` varchar(50) NOT NULL,
  `dos_res` text NOT NULL,
  `dos_datecrea` date NOT NULL default '0000-00-00',
  `dos_codecrea` varchar(20) NOT NULL,
  `dos_datemod` date NOT NULL default '0000-00-00',
  `dos_codemod` varchar(20) NOT NULL,
  `dos_datedde` date NOT NULL default '0000-00-00',
  `dos_datefinp` date NOT NULL default '0000-00-00',
  `dos_codeage` varchar(20) NOT NULL,
  `dos_urg` tinyint(3) unsigned NOT NULL default '0',
  `dos_codesuiv` varchar(20) NOT NULL,
  `dos_codedosc` varchar(5) NOT NULL,
  `dos_codedoss` varchar(5) NOT NULL,
  `dos_proba` tinyint(3) NOT NULL default '0',
  `dos_avance` tinyint(3) NOT NULL default '0',
  `dos_datefin` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`dos_id`),
  KEY `dos_code` (`dos_code`),
  KEY `dos_codecrea` (`dos_codecrea`),
  KEY `dos_codemod` (`dos_codemod`),
  KEY `dos_codedosc` (`dos_codedosc`),
  KEY `dos_codedoss` (`dos_codedoss`),
  KEY `dos_codeage` (`dos_codeage`),
  KEY `dos_codecli` (`dos_codecli`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Dossiers de suivi';


#
# Dumping data for table `smi_dos`
#

#
# Table structure for table `smi_dosc`
#

DROP TABLE IF EXISTS `smi_dosc`;
CREATE TABLE IF NOT EXISTS `smi_dosc` (
  `dosc_id` tinyint(3) unsigned NOT NULL auto_increment,
  `dosc_code` varchar(5) NOT NULL,
  `dosc_desc` varchar(50) NOT NULL,
  `dosc_img` varchar(200) NOT NULL,
  `dosc_delok` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`dosc_id`),
  KEY `dosc_code` (`dosc_code`),
  KEY `dosc_img` (`dosc_img`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Catégories dossiers';


#
# Dumping data for table `smi_dosc`
#

INSERT INTO `smi_dosc` VALUES(1, 'CIAL', 'COMMERCIAL', '../icones/nuvola/ooo_writer_tpl.png', 0);
INSERT INTO `smi_dosc` VALUES(2, 'TEC', 'TECHNIQUE', '../icones/nuvola/kcontrol.png', 0);

#
# Table structure for table `smi_dosd`
#

DROP TABLE IF EXISTS `smi_dosd`;
CREATE TABLE IF NOT EXISTS `smi_dosd` (
  `dosd_id` int(10) unsigned NOT NULL auto_increment,
  `dosd_codedos` varchar(20) NOT NULL,
  `dosd_codedosta` varchar(5) NOT NULL,
  `dosd_dateact` date NOT NULL default '0000-00-00',
  `dosd_heured` time NOT NULL default '00:00:00',
  `dosd_heuref` time NOT NULL default '00:00:00',
  `dosd_obj` text NOT NULL,
  `dosd_res` text,
  `dosd_concl` text,
  `dosd_clos` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`dosd_id`),
  KEY `dosd_codedos` (`dosd_codedos`),
  KEY `dosd_codedosta` (`dosd_codedosta`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Détails des dossiers';

#
# Dumping data for table `smi_dosd`
#

#
# Table structure for table `smi_dosdi`
#

DROP TABLE IF EXISTS `smi_dosdi`;
CREATE TABLE IF NOT EXISTS `smi_dosdi` (
  `dosdi_id` int(10) NOT NULL auto_increment,
  `dosdi_iddosd` int(10) unsigned NOT NULL,
  `dosdi_typinter` tinyint(1) NOT NULL,
  `dosdi_idctact` varchar(10) NOT NULL,
  `dosdi_codeinter` varchar(20) NOT NULL,
  PRIMARY KEY  (`dosdi_id`),
  KEY `dosdi_typinter` (`dosdi_typinter`),
  KEY `dosdi_idctact` (`dosdi_idctact`),
  KEY `dosdi_codeinter` (`dosdi_codeinter`),
  KEY `dosdi_iddosd` (`dosdi_iddosd`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Intervenants détails dossiers';

#
# Dumping data for table `smi_dosdi`
#

#
# Table structure for table `smi_doss`
#

DROP TABLE IF EXISTS `smi_doss`;
CREATE TABLE IF NOT EXISTS `smi_doss` (
  `doss_id` tinyint(3) unsigned NOT NULL auto_increment,
  `doss_code` varchar(5) NOT NULL,
  `doss_desc` varchar(50) NOT NULL,
  `doss_img` varchar(200) NOT NULL,
  `doss_delok` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`doss_id`),
  KEY `doss_code` (`doss_code`),
  KEY `doss_img` (`doss_img`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Statuts dossiers';

#
# Dumping data for table `smi_doss`
#

INSERT INTO `smi_doss` VALUES(1, 'DNT', 'DOSSIER NON TRAITE', '../icones/nuvola/cache.png', 0);
INSERT INTO `smi_doss` VALUES(2, 'INFO', 'PRISE D''INFORMATIONS CLIENT', '../icones/nuvola/help.png', 0);
INSERT INTO `smi_doss` VALUES(3, 'ETU', 'ETUDE EN COURS', '../icones/nuvola/log.png', 0);
INSERT INTO `smi_doss` VALUES(4, 'OAE', 'OFFRE A ETABLIR', '../icones/nuvola/kcalc.png', 0);
INSERT INTO `smi_doss` VALUES(5, 'OE', 'OFFRE ENVOYEE', '../icones/nuvola/mail_post_to.png', 0);
INSERT INTO `smi_doss` VALUES(6, 'OA', 'OFFRE ACCEPTEE', '../icones/EmotiKons/smile.png', 0);
INSERT INTO `smi_doss` VALUES(7, 'OR', 'OFFRE REFUSEE', '../icones/EmotiKons/sad.png', 0);
INSERT INTO `smi_doss` VALUES(8, 'CLOT', 'DOSSIER CLOT', '../icones/nuvola/lock.png', 0);

#
# Table structure for table `smi_dosta`
#

DROP TABLE IF EXISTS `smi_dosta`;
CREATE TABLE IF NOT EXISTS `smi_dosta` (
  `dosta_id` tinyint(3) unsigned NOT NULL auto_increment,
  `dosta_code` varchar(5) NOT NULL,
  `dosta_desc` varchar(50) NOT NULL,
  `dosta_img` varchar(200) NOT NULL,
  `dosta_delok` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`dosta_id`),
  KEY `dosta_code` (`dosta_code`),
  KEY `dosta_img` (`dosta_img`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Types opérations  dossiers';

#
# Dumping data for table `smi_doss`
#

INSERT INTO `smi_dosta` VALUES(1, 'RA', 'REUNION (AGENCE)', '../icones/EmotiKons/boy.png', 0);
INSERT INTO `smi_dosta` VALUES(2, 'RS', 'REUNION (SUR SITE)', '../icones/EmotiKons/boy_hug.png', 0);
INSERT INTO `smi_dosta` VALUES(3, 'AT', 'APPEL TELEPHONIQUE', '../icones/EmotiKons/phone 2.png', 0);
INSERT INTO `smi_dosta` VALUES(4, 'EE', 'ENVOI EMAIL', '../icones/glaze/message.png', 0);
INSERT INTO `smi_dosta` VALUES(5, 'ET', 'ENVOI TELECOPIE', '../icones/glaze/postscript.png', 0);
INSERT INTO `smi_dosta` VALUES(6, 'EC', 'ENVOI COURRIER', '../icones/glaze/mail_forward.png', 0);
INSERT INTO `smi_dosta` VALUES(7, 'DD', 'DEMONSTRATION DISTANTE', '../icones/glaze/network.png', 0);

#
# Table structure for table `smi_cons`
#

ALTER TABLE `smi_cons` ADD `cons_rdos` VARCHAR( 10 ) NOT NULL DEFAULT 'DS08';
ALTER TABLE `smi_cons` ADD `cons_ndos` INT( 10 ) NOT NULL DEFAULT '0';

#
# Table structure for table `smi_barloc`
#

ALTER TABLE `smi_barloc` ADD `barloc_typarr` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `barloc_mult` ;

#
# Table structure for table `smi_pdtlbl`
#

ALTER TABLE `smi_pdtlbl` CHANGE `pdtlbl_qte` `pdtlbl_qte` FLOAT( 10, 2 ) NOT NULL DEFAULT '0.00' ;

#
# Table structure for table `smi_inth`
#

 ALTER TABLE `smi_inth` ADD INDEX ( `inth_codelieu` ) ;


#
# Mises à niveau version 0.9.9g
#


INSERT INTO `smi_txt` VALUES('', '2008-03-25', 'Administrateur', '2008-03-25', 'Administrateur', 'ST_MDP_XXX_ST', '', 'SOUS-TRAITANT : Email envoyé vers le sous-traitant suite à changement de MDP', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%st_nom%</strong><br />\r\n%st_adr1%<br />\r\n%st_adr2%<br />\r\n%cp_st% %ville_st%<br />\r\nTel : %st_telf%<br />\r\nFax : %st_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p><strong>A l''attention de %st_resp_civilite% %st_resp_prenom% %st_resp_nom%</strong></p>\r\n<p>%civiliter1M_st%,<br />\r\n<br />\r\nC''est avec plaisir que nous vous confirmons la mise &agrave;  jour de votre compte.  Voici vos codes de connexion et mot de passe :</p>\r\n<blockquote>Code de connexion : <strong>%st_code%</strong><br />\r\nMot de passe          : <strong>%pass%</strong></blockquote>\r\n<p><br />\r\nConservez pr&eacute;cieusement ces informations pour pouvoir vous connecter et suivre vos dossiers techniques sur notre site <a href="http://%cge_web%">%cge_web%</a> (menu &quot;Espace priv&eacute;&quot;).<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-03-30', 'Administrateur', '2008-03-30', 'Administrateur', 'DOS_CRE_XXX_AGE', '', 'DOSSIERS : Email envoyé vers l''agence suite à un nouveau dossier', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%age_nom%</strong><br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age%<br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %age_resp_civilite% %age_resp_prenom% %age_resp_nom%</strong></p>\r\n<p>%civiliter1M_age%,<br />\r\n<br />\r\nNous vous signalons la saisie d''un nouveau dossier de suivi (N&deg; <strong>%dos_code%</strong>, client %cli_code%).<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>\r\n<p>Le centre de gestion.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-03-30', 'Administrateur', '2008-03-30', 'Administrateur', 'DOS_CRE_XXX_CDG', '', 'DOSSIER : Email envoyé vers le CDG suite à création', '<p>Bonjour,<br />\r\n<br />\r\nNous vous signalons la cr&eacute;ation d''un nouveau dossier de suivi (N&deg; <strong>%dos_code%</strong>).<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-03-30', 'Administrateur', '2008-03-30', 'Administrateur', 'DOS_MOD_XXX_CDG', '', 'DOSSIER : Email envoyé vers le CDG suite à modification', '<p>Bonjour,<br />\r\n<br />\r\nNous vous signalons la modification du dossier de suivi N&deg; <strong>%dos_code%</strong>.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-03-30', 'Administrateur', '2008-03-30', 'Administrateur', 'DOS_MOD_XXX_AGE', '', 'DOSSIER : Email envoyé vers l''agence suite à modification', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%age_nom%</strong><br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age%<br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %age_resp_civilite% %age_resp_prenom% %age_resp_nom%</strong></p>\r\n<p>%civiliter1M_age%,<br />\r\n<br />\r\nNous vous signalons la mise &agrave; jour du dossier de suivi N&deg; <strong>%dos_code%</strong> (client %cli_code%).<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>\r\n<p>Le centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-03-30', 'Administrateur', '2008-03-30', 'Administrateur', 'DOS_DEL_XXX_AGE', '', 'DOS : Email envoyé vers une agence suite à suppression', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%age_nom%</strong><br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age%<br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %age_resp_civilite% %age_resp_prenom% %age_resp_nom%</strong></p>\r\n<p>%civiliter1M_age%,<br />\r\n<br />\r\nNous vous signalons l''annulation du dossier de suivi N&deg;<strong> %dos_code%</strong> (client %cli_code%).<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-03-30', 'Administrateur', '2008-03-30', 'Administrateur', 'DOS_DEL_XXX_CDG', '', 'DOSSIER : Email envoyé vers le CDG suite à suppression', '<p>Bonjour,<br />\r\n<br />\r\nNous vous signalons l''annulation du dossier de suivi N&deg;<strong> %dos_code%</strong>.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>', 0);


#
# Mises à niveau version 0.9.9h
#

#
# Table structure for table `smi_tecpr`
#

DROP TABLE IF EXISTS `smi_tecpr`;
CREATE TABLE IF NOT EXISTS `smi_tecpr` (
  `tecpr_id` int(10) unsigned NOT NULL auto_increment,
  `tecpr_codetec` varchar(20) NOT NULL,
  `tecpr_date` date NOT NULL,
  `tecpr_couth` float(10,2) NOT NULL,
  PRIMARY KEY  (`tecpr_id`),
  KEY `tecpr_codetec` (`tecpr_codetec`),
  KEY `tecpr_date` (`tecpr_date`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Prix de revient techniciens';

#
# Table structure for table `smi_age`
#

ALTER TABLE `smi_age` ADD `age_resp_telp` VARCHAR( 20 ) NULL AFTER `age_resp_telf` ;

#
# Table structure for table `smi_agepr`
#

DROP TABLE IF EXISTS `smi_agepr`;
CREATE TABLE IF NOT EXISTS `smi_agepr` (
  `agepr_id` int(10) unsigned NOT NULL auto_increment,
  `agepr_codeage` varchar(20) NOT NULL,
  `agepr_date` date NOT NULL,
  `agepr_couth` float(10,2) NOT NULL,
  PRIMARY KEY  (`agepr_id`),
  KEY `agepr_codeage` (`agepr_codeage`),
  KEY `agepr_date` (`agepr_date`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Prix de revient resp agence';

#
# Table structure for table `smi_do`
#

ALTER TABLE `smi_do` ADD `do_resp_telp` VARCHAR( 20 ) NULL AFTER `do_resp_telf` ;

#
# Table structure for table `smi_st`
#

ALTER TABLE `smi_st` ADD `st_resp_telp` VARCHAR( 20 ) NULL AFTER `st_resp_telf` ;

#
# Table structure for table `smi_cagepr`
#

DROP TABLE IF EXISTS `smi_cagepr`;
CREATE TABLE IF NOT EXISTS `smi_cagepr` (
  `cagepr_id` int(10) unsigned NOT NULL auto_increment,
  `cagepr_idcage` int(10) unsigned NOT NULL,
  `cagepr_date` date NOT NULL,
  `cagepr_couth` float(10,2) NOT NULL,
  PRIMARY KEY  (`cagepr_id`),
  KEY `cagepr_idcage` (`cagepr_idcage`),
  KEY `cagepr_date` (`cagepr_date`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Prix de revient contacts agence';

#
# Mises à niveau version 0.9.9i
#

#
# Table structure for table `smi_lieu`
#

ALTER TABLE `smi_lieu` ADD `lieu_depl` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `lieu_img` ;

#
# Table structure for table `smi_dosta`
#

ALTER TABLE `smi_dosta` ADD `dosta_depl` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `dosta_img` ;


#
# Table structure for table `smi_inth`
#

ALTER TABLE `smi_inth` ADD `inth_acodemt` VARCHAR( 20 ) NULL ;
ALTER TABLE `smi_inth` ADD `inth_aheured` TIME NOT NULL DEFAULT '00:00:00' ;
ALTER TABLE `smi_inth` ADD `inth_aheuref` TIME NOT NULL DEFAULT '00:00:00';
ALTER TABLE `smi_inth` ADD `inth_akm` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_inth` ADD `inth_acd` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_inth` ADD `inth_afrais` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_inth` ADD `inth_afraisd` TEXT NULL;
ALTER TABLE `smi_inth` ADD `inth_rcodemt` VARCHAR( 20 ) NULL ;
ALTER TABLE `smi_inth` ADD `inth_rheured` TIME NOT NULL DEFAULT '00:00:00';
ALTER TABLE `smi_inth` ADD `inth_rheuref` TIME NOT NULL DEFAULT '00:00:00';
ALTER TABLE `smi_inth` ADD `inth_rkm` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_inth` ADD `inth_rcd` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_inth` ADD `inth_rfrais` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_inth` ADD `inth_rfraisd` TEXT NULL;

#
# Table structure for table `smi_mt`
#

DROP TABLE IF EXISTS `smi_mt`;
CREATE TABLE IF NOT EXISTS `smi_mt` (
  `mt_id` int(10) NOT NULL auto_increment,
  `mt_code` varchar(20) NOT NULL,
  `mt_des` varchar(50) NOT NULL,
  `mt_notes` text,
  `mt_valid` tinyint(1) NOT NULL default '1',
  `mt_coutk` float(10,2) NOT NULL default '0.00',
  `mt_coutf` float(10,2) NOT NULL default '0.00',
  `mt_coutas` tinyint(1) NOT NULL default '0',
  `mt_kmi` float(10,2) NOT NULL default '0.00',
  `mt_kmill` tinyint(1) NOT NULL default '0',
  `mt_kms` float(10,2) NOT NULL default '0.00',
  `mt_coutc` float(10,2) NOT NULL default '0.00',
  `mt_tpsdi` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`mt_id`),
  KEY `mt_code` (`mt_code`),
  KEY `mt_des` (`mt_des`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Moyens de transport';

#
# Table structure for table `smi_dosd`
#

ALTER TABLE `smi_dosd` ADD `dosd_acodemt` VARCHAR( 20 ) NULL ;
ALTER TABLE `smi_dosd` ADD `dosd_aheured` TIME NOT NULL DEFAULT '00:00:00' ;
ALTER TABLE `smi_dosd` ADD `dosd_aheuref` TIME NOT NULL DEFAULT '00:00:00';
ALTER TABLE `smi_dosd` ADD `dosd_akm` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_dosd` ADD `dosd_acd` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_dosd` ADD `dosd_afrais` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_dosd` ADD `dosd_afraisd` TEXT NULL;
ALTER TABLE `smi_dosd` ADD `dosd_rcodemt` VARCHAR( 20 ) NULL ;
ALTER TABLE `smi_dosd` ADD `dosd_rheured` TIME NOT NULL DEFAULT '00:00:00';
ALTER TABLE `smi_dosd` ADD `dosd_rheuref` TIME NOT NULL DEFAULT '00:00:00';
ALTER TABLE `smi_dosd` ADD `dosd_rkm` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_dosd` ADD `dosd_rcd` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_dosd` ADD `dosd_rfrais` FLOAT( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_dosd` ADD `dosd_rfraisd` TEXT NULL;

#
# Mises à niveau version 0.9.9k
#

INSERT INTO `smi_txt` VALUES(183, '2008-05-15', 'Administrateur', '2008-05-15', 'Administrateur', 'INT_CRE_XXX_TEC', '', 'INTERVENTION : Email envoyé vers le tech resp suite à saisie intervention', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%tec_nom%</strong><br />\r\n%tec_adr1%<br />\r\n%tec_adr2%<br />\r\n%cp_tec% %ville_tec%<br />\r\n&nbsp;</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>%civilite1M_tec%,<br />\r\n<br />\r\nNous vous signalons qu''une nouvelle intervention (N&deg;<strong> %int_code%</strong>, client %cli_code%), qui vous a &eacute;t&eacute; affect&eacute;e.<br />\r\n<br />\r\nMerci de rapidement la g&eacute;rer.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);

#
# Mises à niveau version 0.9.9l
#

#
# Table structure for table `smi_tacc`
#

DROP TABLE IF EXISTS `smi_tacc`;
CREATE TABLE IF NOT EXISTS `smi_tacc` (
  `tacc_id` tinyint(3) unsigned NOT NULL auto_increment,
  `tacc_code` varchar(5) NOT NULL,
  `tacc_desc` varchar(50) NOT NULL,
  `tacc_img` varchar(200) NOT NULL,
  `tacc_delok` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`tacc_id`),
  KEY `dosc_code` (`tacc_code`),
  KEY `dosc_img` (`tacc_img`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Catégories tâches';

#
# Dumping data for table `smi_tacc`
#

INSERT INTO `smi_tacc` VALUES(1, 'CIAL', 'COMMERCIAL', '../icones/nuvola/ooo_writer_tpl.png', 0);
INSERT INTO `smi_tacc` VALUES(2, 'TEC', 'TECHNIQUE', '../icones/nuvola/kcontrol.png', 0);


#
# Table structure for table `smi_tac`
#

DROP TABLE IF EXISTS `smi_tac`;
CREATE TABLE IF NOT EXISTS `smi_tac` (
  `tac_id` int(10) unsigned NOT NULL auto_increment,
  `tac_code` varchar(20) NOT NULL,
  `tac_titre` varchar(50) NOT NULL,
  `tac_afaire` text NOT NULL,
  `tac_datecrea` date NOT NULL default '0000-00-00',
  `tac_codecrea` varchar(20) NOT NULL,
  `tac_datemod` date NOT NULL default '0000-00-00',
  `tac_codemod` varchar(20) NOT NULL,
  `tac_typdest` smallint(2) NOT NULL default '0',
  `tac_codedest` varchar(20) NOT NULL,
  `tac_typrat` smallint(2) NOT NULL default '0',
  `tac_coderat` varchar(20) default NULL,
  `tac_datefinp` date NOT NULL default '0000-00-00',
  `tac_urg` tinyint(3) unsigned NOT NULL default '0',
  `tac_codetacc` varchar(5) NOT NULL,
  `tac_avance` tinyint(3) NOT NULL default '0',
  `tac_datefin` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`tac_id`),
  KEY `tac_code` (`tac_code`),
  KEY `tac_datecrea` (`tac_datecrea`),
  KEY `tac_codecrea` (`tac_codecrea`),
  KEY `tac_datemod` (`tac_datemod`),
  KEY `tac_codemod` (`tac_codemod`),
  KEY `tac_typdest` (`tac_typdest`),
  KEY `tac_codedest` (`tac_codedest`),
  KEY `tac_typrat` (`tac_typrat`),
  KEY `tac_coderat` (`tac_coderat`),
  KEY `tac_datefinp` (`tac_datefinp`),
  KEY `tac_codetacc` (`tac_codetacc`),
  KEY `tac_datefin` (`tac_datefin`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Tâches';

#
# Dumping data for table `smi_tac`
#


#
# Table structure for table `smi_cons`
#

ALTER TABLE `smi_cons` ADD `cons_rtac` VARCHAR( 10 ) NOT NULL DEFAULT 'TA08';
ALTER TABLE `smi_cons` ADD `cons_ntac` INT( 10 ) NOT NULL DEFAULT '0';

ALTER TABLE `smi_cons` CHANGE `cons_ncer` `cons_ncer` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_ndde` `cons_ndde` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_nrel` `cons_nrel` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_nrlic` `cons_nrlic` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_nrpdt` `cons_nrpdt` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_nord` `cons_nord` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_nretp` `cons_nretp` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_nrete` `cons_nrete` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_nloc` `cons_nloc` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_ndos` `cons_ndos` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_cons` CHANGE `cons_ntac` `cons_ntac` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';

#
# Table structure for table `smi_scli`
#

DROP TABLE `smi_sclii`;

#
# Table structure for table `smi_int`
#

ALTER TABLE `smi_int` CHANGE `int_idsite` `int_idsite` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `smi_int` ADD INDEX ( `int_idsite` ) ;

#
# Table structure for table `smi_txt`
#


INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_CRE_XXX_TEC', '', 'TACHE : Email envoyé vers un tech suite à saisie tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%tec_nom%</strong><br />\r\n%tec_adr1%<br />\r\n%tec_adr2%<br />\r\n%cp_tec% %ville_tec%<br />\r\n&nbsp;</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>%civilite1M_tec%,<br />\r\n<br />\r\nNous vous signalons qu''une nouvelle t&acirc;che (N&deg;<strong> %tac_code%</strong>) vous a &eacute;t&eacute; affect&eacute;e.<br />\r\n<br />\r\nMerci de rapidement la g&eacute;rer.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_CRE_XXX_AGE', '', 'TACHES : Email envoyé vers l''agence suite à une nouvelle tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%age_nom%</strong><br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age%<br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %age_resp_civilite% %age_resp_prenom% %age_resp_nom%</strong></p>\r\n<p>%civiliter1M_age%,<br />\r\n<br />\r\nNous vous signalons qu''une nouvelle t&acirc;che (N&deg; <strong>%tac_code%</strong>) vous a &eacute;t&eacute; affect&eacute;e.<br />\r\n<br />\r\nMerci de la traiter rapidement.</p>\r\n<p>Bonne fin de journ&eacute;e.</p>\r\n<p>Le centre de gestion.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_CRE_XXX_CDG', '', 'TACHES : Email envoyé vers le CDG suite à nouvelle tâche', '<p>Bonjour,<br />\r\n<br />\r\nNous vous signalons qu''une nouvelle t&acirc;che&nbsp; (N&deg;<strong> %tac_code%</strong>) vous a &eacute;t&eacute; affect&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_CRE_XXX_ST', '', 'TACHES : Email envoyé vers sous-traitant suite à nouvelle tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%st_nom%</strong><br />\r\n%st_adr1%<br />\r\n%st_adr2%<br />\r\n%cp_st% %ville_st%<br />\r\nTel : %st_telf%<br />\r\nFax : %st_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %st_resp_civilite% %st_resp_prenom% %st_resp_nom%</strong></p>\r\n<p>%civiliter1M_st%,<br />\r\n<br />\r\nNous vous signalons qu''une nouvelle t&acirc;che&nbsp; (N&deg;<strong> %tac_code%</strong>) vous a &eacute;t&eacute; effect&eacute;e.</p>\r\n<p>Merci de la traiter rapidement.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_MOD_XXX_AGE', '', 'TACHES : Email envoyé vers l''agence suite à modif de tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%age_nom%</strong><br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age%<br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %age_resp_civilite% %age_resp_prenom% %age_resp_nom%</strong></p>\r\n<p>%civiliter1M_age%,<br />\r\n<br />\r\nNous vous signalons que la t&acirc;che N&deg; <strong>%tac_code%</strong> a &eacute;t&eacute; modifi&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>\r\n<p>Le centre de gestion.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_MOD_XXX_CDG', '', 'TACHES : Email envoyé vers le CDG suite à modif de tâche', '<p>Bonjour,<br />\r\n<br />\r\nNous vous signalons que la t&acirc;che&nbsp; N&deg;<strong> %tac_code%</strong> a &eacute;t&eacute; modifi&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_MOD_XXX_ST', '', 'TACHES : Email envoyé vers sous-traitant suite à modif de tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%st_nom%</strong><br />\r\n%st_adr1%<br />\r\n%st_adr2%<br />\r\n%cp_st% %ville_st%<br />\r\nTel : %st_telf%<br />\r\nFax : %st_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %st_resp_civilite% %st_resp_prenom% %st_resp_nom%</strong></p>\r\n<p>%civiliter1M_st%,<br />\r\n<br />\r\nNous vous signalons que la t&acirc;che&nbsp; N&deg;<strong> %tac_code%</strong> a &eacute;t&eacute; modifi&eacute;e.</p>\r\n<p>Bonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_MOD_XXX_TEC', '', 'TACHES : Email envoyé vers un tech suite à modif de tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%tec_nom%</strong><br />\r\n%tec_adr1%<br />\r\n%tec_adr2%<br />\r\n%cp_tec% %ville_tec%<br />\r\n&nbsp;</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>%civilite1M_tec%,<br />\r\n<br />\r\nNous vous signalons que la t&acirc;che N&deg;<strong> %tac_code%</strong> a &eacute;t&eacute; modifi&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_DEL_XXX_AGE', '', 'TACHES : Email envoyé vers l''agence suite à suppression de tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%age_nom%</strong><br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age%<br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %age_resp_civilite% %age_resp_prenom% %age_resp_nom%</strong></p>\r\n<p>%civiliter1M_age%,<br />\r\n<br />\r\nNous vous signalons que la t&acirc;che N&deg; <strong>%tac_code%</strong> a &eacute;t&eacute; supprim&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>\r\n<p>Le centre de gestion.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_DEL_XXX_CDG', '', 'TACHES : Email envoyé vers le CDG suite à suppression de tâche', '<p>Bonjour,<br />\r\n<br />\r\nNous vous signalons que la t&acirc;che&nbsp; N&deg;<strong> %tac_code%</strong> a &eacute;t&eacute; supprim&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_DEL_XXX_ST', '', 'TACHES : Email envoyé vers sous-traitant suite à suppression de tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%st_nom%</strong><br />\r\n%st_adr1%<br />\r\n%st_adr2%<br />\r\n%cp_st% %ville_st%<br />\r\nTel : %st_telf%<br />\r\nFax : %st_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;&nbsp;</p>\r\n<p><strong>A l''attention de %st_resp_civilite% %st_resp_prenom% %st_resp_nom%</strong></p>\r\n<p>%civiliter1M_st%,<br />\r\n<br />\r\nNous vous signalons que la t&acirc;che&nbsp; N&deg;<strong> %tac_code%</strong> a &eacute;t&eacute; supprim&eacute;e.</p>\r\n<p>Bonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-05-26', 'Administrateur', '2008-05-26', 'Administrateur', 'TAC_DEL_XXX_TEC', '', 'TACHES : Email envoyé vers un tech suite à suppression de tâche', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%tec_nom%</strong><br />\r\n%tec_adr1%<br />\r\n%tec_adr2%<br />\r\n%cp_tec% %ville_tec%<br />\r\n&nbsp;</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>%civilite1M_tec%,<br />\r\n<br />\r\nNous vous signalons que la t&acirc;che N&deg;<strong> %tac_code%</strong> a &eacute;t&eacute; supprim&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);


#
# Mises à niveau version 0.9.9n
#

#
# Table structure for table `smi_pdtlocr`
#

DROP TABLE IF EXISTS `smi_pdtlocr`;
CREATE TABLE IF NOT EXISTS `smi_pdtlocr` (
  `pdtlocr_id` int(10) unsigned NOT NULL auto_increment,
  `pdtlocr_codepdtloc` varchar(20) NOT NULL,
  `pdtlocr_codeage` varchar(10) NOT NULL,
  `pdtlocr_codetec` varchar(20) NOT NULL,
  `pdtlocr_date` date NOT NULL default '0000-00-00',
  `pdtlocr_durees` int(6) unsigned NOT NULL default '0',
  `pdtlocr_mtp` float(10,2) unsigned NOT NULL default '0.00',
  `pdtlocr_fait` text NOT NULL,
  PRIMARY KEY  (`pdtlocr_id`),
  KEY `pdtlocr_codepdtloc` (`pdtlocr_codepdtloc`),
  KEY `pdtlocr_codetec` (`pdtlocr_codetec`),
  KEY `pdtlocr_codeage` (`pdtlocr_codeage`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Table des réparations de pdt location';


#
# Table structure for table `smi_mque`
#

ALTER TABLE `smi_mque` CHANGE `mque_dep` `mque_dep` CHAR( 30 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ;

#
# Table structure for table `smi_cage`
#

ALTER TABLE `smi_cage` ADD `cage_adr1` VARCHAR( 50 ) NOT NULL AFTER `cage_nom` ;
ALTER TABLE `smi_cage` ADD `cage_adr2` VARCHAR( 50 ) NULL AFTER `cage_adr1` ;
ALTER TABLE `smi_cage` ADD `cage_dep` VARCHAR( 30 ) NOT NULL AFTER `cage_adr2` ;
ALTER TABLE `smi_cage` ADD `cage_ville` INT( 10 ) UNSIGNED NOT NULL AFTER `cage_dep` ;
ALTER TABLE `smi_cage` ADD `cage_codepays` CHAR( 3 ) NOT NULL AFTER `cage_ville` ;
ALTER TABLE `smi_cage` ADD INDEX ( `cage_dep` ) ;
ALTER TABLE `smi_cage` ADD INDEX ( `cage_codepays` )  ;

#
# Table structure for table `smi_age`
#

ALTER TABLE `smi_age` CHANGE `age_ville` `age_ville` INT( 10 ) UNSIGNED NOT NULL ;

#
# Table structure for table `smi_cdo`
#

ALTER TABLE `smi_cdo` ADD `cdo_adr1` VARCHAR( 50 ) NOT NULL AFTER `cdo_nom` ;
ALTER TABLE `smi_cdo` ADD `cdo_adr2` VARCHAR( 50 ) NULL AFTER `cdo_adr1` ;
ALTER TABLE `smi_cdo` ADD `cdo_dep` VARCHAR( 30 ) NOT NULL AFTER `cdo_adr2` ;
ALTER TABLE `smi_cdo` ADD `cdo_ville` INT( 10 ) UNSIGNED NOT NULL AFTER `cdo_dep` ;
ALTER TABLE `smi_cdo` ADD `cdo_codepays` CHAR( 3 ) NOT NULL AFTER `cdo_ville` ;
ALTER TABLE `smi_cdo` ADD INDEX ( `cdo_dep` ) ;
ALTER TABLE `smi_cdo` ADD INDEX ( `cdo_codepays` )  ;

#
# Table structure for table `smi_do`
#

ALTER TABLE `smi_do` CHANGE `do_ville` `do_ville` INT( 10 ) UNSIGNED NOT NULL ;


#
# Table structure for table `smi_cmque`
#

ALTER TABLE `smi_cmque` ADD `cmque_adr1` VARCHAR( 50 ) NOT NULL AFTER `cmque_nom` ;
ALTER TABLE `smi_cmque` ADD `cmque_adr2` VARCHAR( 50 ) NULL AFTER `cmque_adr1` ;
ALTER TABLE `smi_cmque` ADD `cmque_dep` VARCHAR( 30 ) NOT NULL AFTER `cmque_adr2` ;
ALTER TABLE `smi_cmque` ADD `cmque_ville` INT( 10 ) UNSIGNED NOT NULL AFTER `cmque_dep` ;
ALTER TABLE `smi_cmque` ADD `cmque_codepays` CHAR( 3 ) NOT NULL AFTER `cmque_ville` ;
ALTER TABLE `smi_cmque` ADD INDEX ( `cmque_dep` ) ;
ALTER TABLE `smi_cmque` ADD INDEX ( `cmque_codepays` )  ;

#
# Table structure for table `smi_mque`
#

ALTER TABLE `smi_mque` CHANGE `mque_ville` `mque_ville` INT( 10 ) UNSIGNED NOT NULL ;

#
# Table structure for table `smi_cst`
#

ALTER TABLE `smi_cst` ADD `cst_adr1` VARCHAR( 50 ) NOT NULL AFTER `cst_nom` ;
ALTER TABLE `smi_cst` ADD `cst_adr2` VARCHAR( 50 ) NULL AFTER `cst_adr1` ;
ALTER TABLE `smi_cst` ADD `cst_dep` VARCHAR( 30 ) NOT NULL AFTER `cst_adr2` ;
ALTER TABLE `smi_cst` ADD `cst_ville` INT( 10 ) UNSIGNED NOT NULL AFTER `cst_dep` ;
ALTER TABLE `smi_cst` ADD `cst_codepays` CHAR( 3 ) NOT NULL AFTER `cst_ville` ;
ALTER TABLE `smi_cst` ADD INDEX ( `cst_dep` ) ;
ALTER TABLE `smi_cst` ADD INDEX ( `cst_codepays` ) ;

#
# Table structure for table `smi_st`
#

ALTER TABLE `smi_st` CHANGE `st_ville` `st_ville` INT( 10 ) UNSIGNED NOT NULL ;

#
# Table structure for table `smi_ccli`
#

ALTER TABLE `smi_ccli` ADD `ccli_adr1` VARCHAR( 50 ) NOT NULL AFTER `ccli_nom` ;
ALTER TABLE `smi_ccli` ADD `ccli_adr2` VARCHAR( 50 ) NULL AFTER `ccli_adr1` ;
ALTER TABLE `smi_ccli` ADD `ccli_dep` VARCHAR( 30 ) NOT NULL AFTER `ccli_adr2` ;
ALTER TABLE `smi_ccli` ADD `ccli_ville` INT( 10 ) UNSIGNED NOT NULL AFTER `ccli_dep` ;
ALTER TABLE `smi_ccli` ADD `ccli_codepays` CHAR( 3 ) NOT NULL AFTER `ccli_ville` ;
ALTER TABLE `smi_ccli` ADD INDEX ( `ccli_dep` ) ;
ALTER TABLE `smi_ccli` ADD INDEX ( `ccli_codepays` )  ;

#
# Table structure for table `smi_cli`
#

ALTER TABLE `smi_cli` CHANGE `cli_ville` `cli_ville` INT( 10 ) UNSIGNED NOT NULL ;

#
# Table structure for table `smi_ope`
#

ALTER TABLE `smi_ope` CHANGE `ope_ville` `ope_ville` INT( 10 ) UNSIGNED NOT NULL ;

#
# Table structure for table `smi_dde`
#

ALTER TABLE `smi_dde` CHANGE `dde_ville` `dde_ville` INT( 10 ) UNSIGNED NOT NULL ;

#
# Table structure for table `smi_scli`
#

ALTER TABLE `smi_scli` CHANGE `scli_ville` `scli_ville` INT( 10 ) UNSIGNED NOT NULL ;

#
# Table structure for table `smi_tec`
#

ALTER TABLE `smi_tec` CHANGE `tec_ville` `tec_ville` INT( 10 ) UNSIGNED NOT NULL ;


#
# Mises à niveau version 0.9.9o
#

INSERT INTO `smi_txt` VALUES('', '2008-07-13', 'Administrateur', '2008-07-13', 'Administrateur', 'INT_COP_XXX_CLI', '', 'CLIENT : Email envoyé vers le client pour copie intervention', '<p>%logo_age%<br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age%<br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%cli_ste%<br />\r\n%cli_civilite% %cli_prenom% %cli_nom%</strong><br />\r\n%cli_adr1%<br />\r\n%cli_adr2%<br />\r\n%cp_cli% %ville_cli%<br />\r\nTel : %cli_telf%<br />\r\nFax : %cli_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>%civilite1M_cli%, <br />\r\n<br />\r\nNous avons le plaisir de vous faire parvenir une copie de votre intervention <em><strong>%int_code%</strong></em>.</p>\r\n<p>Nous restons bien entendu &agrave; votre enti&egrave;re disposition pour tout renseignement compl&eacute;mentaire.</p>\r\n<p>Vous remerciant encore de votre confiance,</p>\r\n<p>Nous vous prions d''agr&eacute;er, %civilite1M_cli%, l''expression de nos sentiments les plus d&eacute;vou&eacute;s.</p>\r\n<p>Le centre technique</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-07-13', 'Administrateur', '2008-07-13', 'Administrateur', 'CON_COP_XXX_CLI', '', 'CLIENT : Email envoyé vers le client pour copie contrat', '<p>%logo_age%<br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age%<br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%cli_ste%<br />\r\n%cli_civilite% %cli_prenom% %cli_nom%</strong><br />\r\n%cli_adr1%<br />\r\n%cli_adr2%<br />\r\n%cp_cli% %ville_cli%<br />\r\nTel : %cli_telf%<br />\r\nFax : %cli_fax%</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>%civilite1M_cli%, <br />\r\n<br />\r\nNous avons le plaisir de vous faire parvenir une copie de votre contrat <em><strong>%cocl_code%</strong></em>.</p>\r\n<p>Nous restons bien entendu &agrave; votre enti&egrave;re disposition pour tout renseignement compl&eacute;mentaire.</p>\r\n<p>Vous remerciant encore de votre confiance,</p>\r\n<p>Nous vous prions d''agr&eacute;er, %civilite1M_cli%, l''expression de nos sentiments les plus d&eacute;vou&eacute;s.</p>\r\n<p>Le centre technique</p>', 0);

#
# Mises à niveau version 0.9.9p
#

ALTER TABLE `smi_coloc` ADD `coloc_typcli` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `coloc_codeage` ;
ALTER TABLE `smi_coloc` ADD INDEX ( `coloc_typcli` ) ;

#
# Mises à niveau version 0.9.9q
#

#
# Table structure for table `smi_st`
#

ALTER TABLE `smi_st` ADD `st_codeage` VARCHAR( 10 ) NULL AFTER `st_code` ;
ALTER TABLE `smi_st` ADD INDEX ( `st_codeage` ) ;
ALTER TABLE `smi_st` DROP `st_zone` ;

#
# Table structure for table `smi_scli`
#

ALTER TABLE `smi_scli` ADD `scli_prop` VARCHAR( 20 ) NOT NULL DEFAULT '0' AFTER `scli_datemod` ;
ALTER TABLE `smi_scli` ADD INDEX ( `scli_prop` ) ;
ALTER TABLE `smi_scli` ADD `scli_codecrea` VARCHAR( 20 ) NOT NULL AFTER `scli_datecrea` ;
ALTER TABLE `smi_scli` ADD INDEX ( `scli_codecrea` ) ;
ALTER TABLE `smi_scli` ADD `scli_codemod` VARCHAR( 20 ) NOT NULL AFTER `scli_datemod` ;
ALTER TABLE `smi_scli` ADD INDEX ( `scli_codemod` )  ;

#
# Table structure for table `smi_dde`
#

ALTER TABLE `smi_dde` ADD `dde_scli` INT( 10 ) NOT NULL DEFAULT '-1';
ALTER TABLE `smi_dde` ADD INDEX ( `dde_scli` ) ;
ALTER TABLE `smi_dde` ADD `dde_urg` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';


#
# Table structure for table `smi_txt`
#

UPDATE `smi`.`smi_txt` SET `txt_texte` = '<p>Bonjour,<br /> <br /> Un nouveau message depuis l''espace <strong>priv&eacute;</strong> vous a &eacute;t&eacute; exp&eacute;di&eacute; le %dde_datecrea%. <br /> <br /> En voici le d&eacute;tail :<br /> &nbsp;==================================== <br /> <strong>OBJET :</strong> <br /> %ddet_desc% <strong><br /> Exp&eacute;diteur :</strong> <br /> %dde_ste% <br /> %dde_civilite% %dde_prenom% %dde_nom% <br /> %dde_adr1% <br /> %dde_adr2% <br /> %cp_dde% %ville_dde% <br /> Tel. : %dde_telf% <br /> Fax : %dde_fax% <br /> Por : %dde_telp% <strong><br /> Email :</strong> <a href="mailto:%dde_email%">%dde_email%</a> <br /> <strong> Site concern&eacute; :</strong><br /> %txt_scliv%</p> <p><strong>Message :</strong></p> <p>%dde_txtdde% <br /> ==================================== <br /> <br /> Bonne fin de journ&eacute;e.</p>' WHERE `smi_txt`.`txt_code` ='DDE_CRE_PRI_XXX';

INSERT INTO `smi_txt` VALUES('', '2008-09-05', 'Administrateur', '2008-09-05', 'Administrateur', 'INT_CLOT_XXX_AGE', '', 'INTERVENTION : Email envoyé vers une agence si intervention close', '<p>%logo_cge%<br />\r\n<strong>%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</strong></p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><strong>%age_nom%</strong><br />\r\n%age_adr1%<br />\r\n%age_adr2%<br />\r\n%cp_age% %ville_age% <br />\r\nTel : %age_telf%<br />\r\nFax : %age_fax%</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>&nbsp;</p>\r\n<p>A l''attention de <strong>%age_resp_civilite% %age_resp_prenom% %age_resp_nom%</strong><br />\r\n<br />\r\n%civiliter1M_age%,</p>\r\n<p>C''est avec plaisir que nous vous annon&ccedil;ons que l''intervention <strong>%int_code%</strong> est close.  <br />\r\n<br />\r\nVous pouvez en obtenir le d&eacute;tail sur notre site :  <a href="http://%cge_web%">%cge_web%</a>  .<br />\r\n<br />\r\nNous vous souhaitons une excellente fin de journ&eacute;e et vous prions d''agr&eacute;er, %civiliter1M_age%,&nbsp; l''expression de nos sentiments les plus d&eacute;vou&eacute;s.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);
INSERT INTO `smi_txt` VALUES('', '2008-09-10', 'Administrateur', '2008-09-10', 'Administrateur', 'INT_MOD_XXX_TEC', '', 'INTERVENTION : Email envoyé vers le tech resp suite à modif intervention', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax : %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%tec_civilite% %tec_prenom%&nbsp; %tec_nom%</strong><br />\r\n%tec_adr1%<br />\r\n%tec_adr2%<br />\r\n%cp_tec% %ville_tec%<br />\r\n&nbsp;</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>%civilite1M_tec%,<br />\r\n<br />\r\nNous vous signalons qu''une l''intervention <strong>%int_code%</strong> (client %cli_code%), dont vous avez le suivi, a &eacute;t&eacute; modifi&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 1);
INSERT INTO `smi_txt` VALUES('', '2008-09-10', 'Administrateur', '2008-09-10', 'Administrateur', 'INT_DEL_XXX_TEC', '', 'INTERVENTION : Email envoyé vers le tech resp suite à modif intervention', '<p>%logo_cge%<br />\r\n%cge_adr1%<br />\r\n%cge_adr2%<br />\r\n%cp_cge% %ville_cge%<br />\r\nTel : %cge_telf%<br />\r\nFax :   %cge_fax%</p>\r\n<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote>\r\n<p><strong>%tec_civilite% %tec_prenom% %tec_nom%<!--\r\nstrong--><br />\r\n</strong> %tec_adr1%<br />\r\n%tec_adr2%<br />\r\n%cp_tec% %ville_tec%<br />\r\n&nbsp;</p>\r\n</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>\r\n<p>%civilite1M_tec%,<br />\r\n<br />\r\nNous vous signalons qu''une l''intervention %int_code% (client %cli_code%), dont vous avez le suivi, a &eacute;t&eacute; supprim&eacute;e.<br />\r\n<br />\r\nBonne fin de journ&eacute;e.  <br />\r\n<br />\r\nLe centre de gestion</p>', 0);

#
# Table structure for table `smi_int`
#

ALTER TABLE `smi_int` ADD `int_codeages` VARCHAR( 10 ) NOT NULL DEFAULT '';
ALTER TABLE `smi_int` ADD INDEX ( `int_codeages` ) ;
ALTER TABLE `smi_int` CHANGE `int_acpte` `int_acpte` FLOAT( 10, 2 ) NOT NULL DEFAULT '0.00' ;

#
# Table structure for table `smi_ot`
#

ALTER TABLE `smi_ot` CHANGE `ot_codetec` `ot_codetec` VARCHAR( 20 ) NOT NULL DEFAULT '-1' 


#
# Mises à niveau version 0.9.9r
#

#
# Table structure for table `smi_ot`
#

ALTER TABLE `smi_ot` ADD `ot_codecli` VARCHAR( 20 ) NOT NULL AFTER `ot_code` ;
ALTER TABLE `smi_ot` ADD `ot_idsite` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `ot_codecli` ;
ALTER TABLE `smi_ot` ADD INDEX ( `ot_codecli` ) ;
ALTER TABLE `smi_ot` ADD INDEX ( `ot_idsite` ) ;
ALTER TABLE `smi_ot` DROP INDEX `int_code` ;
ALTER TABLE `smi_ot` ADD INDEX ( `ot_code` ) ;
ALTER TABLE `smi_ot` DROP INDEX `int_codestatut` ;
ALTER TABLE `smi_ot` ADD INDEX ( `ot_codestatut` ) ;
ALTER TABLE `smi_ot` DROP INDEX `int_codelieu` ;
ALTER TABLE `smi_ot` ADD INDEX ( `ot_codelieu` ) ;
ALTER TABLE `smi_ot` DROP INDEX `int_codetec` ;
ALTER TABLE `smi_ot` ADD INDEX ( `ot_codetec` ) ;
ALTER TABLE `smi_ot` ADD `ot_ccli` VARCHAR( 10 ) NOT NULL DEFAULT '-1' AFTER `ot_codecli` ;
ALTER TABLE `smi_ot` ADD INDEX ( `ot_ccli` ) ;



#
# Table structure for table `smi_coclh`
#

ALTER TABLE `smi_coclh` ADD INDEX ( `coclh_codeint` )  ;


#
# Mises à niveau version 0.9.9s
#

#
# Table structure for table `smi_int`
#

ALTER TABLE `smi_int` ADD `int_fact` TINYINT( 1 ) NOT NULL DEFAULT '0';
ALTER TABLE `smi_int` ADD INDEX ( `int_fact` ) ;
ALTER TABLE `smi_int` ADD `int_forfait` FLOAT( 10, 2 ) UNSIGNED NOT NULL DEFAULT '0.00';

#
# Table structure for table `smi_intf`
#

DROP TABLE IF EXISTS `smi_intf`;
CREATE TABLE IF NOT EXISTS `smi_intf` (
  `intf_id` int(10) unsigned NOT NULL auto_increment,
  `intf_datecrea` date NOT NULL default '0000-00-00',
  `intf_codecrea` varchar(20) NOT NULL,
  `intf_datemod` date NOT NULL default '0000-00-00',
  `intf_codemod` varchar(20) NOT NULL,
  `intf_fnulle` tinyint(1) NOT NULL default '0',
  `intf_datefac` date NOT NULL default '0000-00-00',
  `intf_numf` varchar(20) NOT NULL,
  `intf_nomf` varchar(50) NOT NULL,
  `intf_codeint` varchar(20) NOT NULL,
  `intf_codeme` varchar(10) NOT NULL,
  `intf_nota` text,
  PRIMARY KEY  (`intf_id`),
  KEY `intf_datefac` (`intf_datefac`),
  KEY `intf_numf` (`intf_numf`),
  KEY `intf_nomf` (`intf_nomf`),
  KEY `intf_codeint` (`intf_codeint`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Intervention : Suivi facturation';

#
# Table structure for table `smi_tpf`
#

ALTER TABLE `smi_tpf` CHANGE `tpf_desc` `tpf_desc` VARCHAR( 100 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ;
ALTER TABLE `smi_tpf` ADD `tpf_codema` VARCHAR( 20 ) NOT NULL AFTER `tpf_code` ;
ALTER TABLE `smi_tpf` ADD INDEX ( `tpf_codema` ) ;

#
# Table structure for table `smi_cge`
#

ALTER TABLE `smi_cge` ADD `cge_ape` VARCHAR( 10 ) NOT NULL AFTER `cge_rcs` ;
ALTER TABLE `smi_cge` ADD `cge_tvai` VARCHAR( 50 ) NOT NULL AFTER `cge_ape` ;


#
# Table structure for table `smi_age`
#

ALTER TABLE `smi_age` ADD `age_ape` VARCHAR( 10 ) NOT NULL AFTER `age_rcs` ;
ALTER TABLE `smi_age` ADD `age_tvai` VARCHAR( 50 ) NOT NULL AFTER `age_ape` ;
ALTER TABLE `smi_age` CHANGE `age_datec` `age_datec` DATE NOT NULL DEFAULT '0000-00-00' ;

#
# Table structure for table `smi_st`
#

ALTER TABLE `smi_st` ADD `st_ape` VARCHAR( 10 ) NOT NULL AFTER `st_rcs` ;
ALTER TABLE `smi_st` ADD `st_tvai` VARCHAR( 50 ) NOT NULL AFTER `st_ape` ;
ALTER TABLE `smi_st` CHANGE `st_datec` `st_datec` DATE NOT NULL DEFAULT '0000-00-00';

#
# Table structure for table `smi_do`
#

ALTER TABLE `smi_do` ADD `do_ape` VARCHAR( 10 ) NOT NULL AFTER `do_rcs` ;
ALTER TABLE `smi_do` ADD `do_tvai` VARCHAR( 50 ) NOT NULL AFTER `do_ape` ;
ALTER TABLE `smi_do` CHANGE `do_datec` `do_datec` DATE NOT NULL DEFAULT '0000-00-00' ;

#
# Table structure for table `smi_cli`
#

ALTER TABLE `smi_cli` ADD `cli_ape` VARCHAR( 10 ) NOT NULL AFTER `cli_rcs` ;
ALTER TABLE `smi_cli` ADD `cli_tvai` VARCHAR( 50 ) NOT NULL AFTER `cli_ape` ;

#
# Table structure for table `smi_scli`
#

ALTER TABLE `smi_scli` ADD `scli_rcs` VARCHAR( 50 ) NOT NULL AFTER `scli_ste` ;
ALTER TABLE `smi_scli` ADD `scli_ape` VARCHAR( 10 ) NOT NULL AFTER `scli_rcs` ;
ALTER TABLE `smi_scli` ADD `scli_tvai` VARCHAR( 50 ) NOT NULL AFTER `scli_ape` ;

#
# Table structure for table `smi_mque`
#

ALTER TABLE `smi_mque` ADD `mque_rcs` VARCHAR( 50 ) NOT NULL AFTER `mque_ste` ;
ALTER TABLE `smi_mque` ADD `mque_ape` VARCHAR( 10 ) NOT NULL AFTER `mque_rcs` ;
ALTER TABLE `smi_mque` ADD `mque_tvai` VARCHAR( 50 ) NOT NULL AFTER `mque_ape` ;

#
# Table structure for table `smi_tec`
#

ALTER TABLE `smi_tec` ADD `tec_niveau` VARCHAR( 5 ) NULL AFTER `tec_codemod` ;
ALTER TABLE `smi_tec` ADD `tec_echelon` VARCHAR( 5 ) NULL AFTER `tec_niveau` ;
ALTER TABLE `smi_tec` ADD `tec_coeff` VARCHAR( 5 ) NULL AFTER `tec_echelon` ;
ALTER TABLE `smi_tec` ADD `tec_emploi` VARCHAR( 50 ) NOT NULL AFTER `tec_codemod` ;
ALTER TABLE `smi_tec` ADD `tec_qualif` VARCHAR( 50 ) NOT NULL AFTER `tec_emploi` ;
ALTER TABLE `smi_tec` CHANGE `tec_congd` `tec_congd` DATE NOT NULL DEFAULT '0000-00-00';
ALTER TABLE `smi_tec` CHANGE `tec_congf` `tec_congf` DATE NOT NULL DEFAULT '0000-00-00';
ALTER TABLE `smi_tec` CHANGE `tec_dateout` `tec_dateout` DATE NOT NULL DEFAULT '0000-00-00';

#
# Table structure for table `smi_tecpr`
#

ALTER TABLE `smi_tecpr` ADD `tecpr_hjs` INT ( 5 ) NOT NULL DEFAULT '0' AFTER `tecpr_date` ;
ALTER TABLE `smi_tecpr` ADD `tecpr_hhs` INT ( 6 ) NOT NULL DEFAULT '0' AFTER `tecpr_hjs` ;
ALTER TABLE `smi_tecpr` ADD `tecpr_hms` INT ( 7 ) NOT NULL DEFAULT '0' AFTER `tecpr_hhs` ;
ALTER TABLE `smi_tecpr` ADD `tecpr_salm` FLOAT( 10, 2 ) NOT NULL DEFAULT '0.00' AFTER `tecpr_hms` ;
ALTER TABLE `smi_tecpr` CHANGE `tecpr_date` `tecpr_date` DATE NOT NULL DEFAULT '0000-00-00';
ALTER TABLE `smi_tecpr` CHANGE `tecpr_couth` `tecpr_couth` FLOAT( 10, 2 ) NOT NULL DEFAULT '0.00' ;
ALTER TABLE `smi_tecpr` ADD `tecpr_j1m1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j1m2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j1a1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j1a2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j2m1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j2m2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j2a1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j2a2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j3m1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j3m2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j3a1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j3a2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j4m1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j4m2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j4a1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j4a2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j5m1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j5m2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j5a1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j5a2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j6m1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j6m2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j6a1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j6a2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j7m1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j7m2` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j7a1` time NOT NULL default '00:00:00';
ALTER TABLE `smi_tecpr` ADD `tecpr_j7a2` time NOT NULL default '00:00:00';

#
# Mises à niveau version 0.9.9t
#

#
# Table structure for table `smi_ind`
#

DROP TABLE IF EXISTS `smi_ind`;
CREATE TABLE IF NOT EXISTS `smi_ind` (
  `ind_id` int(10) unsigned NOT NULL auto_increment,
  `ind_code` varchar(5) NOT NULL,
  `ind_desc` varchar(40) NOT NULL,
  `ind_coeff` float(10,2) NOT NULL default '1.00',
  `ind_nota` text NOT NULL,
  `ind_actif` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`ind_id`),
  KEY `ind_code` (`ind_code`),
  KEY `ind_desc` (`ind_desc`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 PACK_KEYS=0 COMMENT='Indices horaires';


#
# Table structure for table `smi_inth`
#

ALTER TABLE `smi_inth` ADD `inth_codeind` VARCHAR( 5 ) NOT NULL DEFAULT '-1' AFTER `inth_heured` ;
ALTER TABLE `smi_inth` ADD INDEX ( `inth_codeind` ) ;

#
# Table structure for table `smi_rcli`
#

DROP TABLE IF EXISTS `smi_rcli`;
CREATE TABLE IF NOT EXISTS `smi_rcli` (
  `rcli_id` int(10) NOT NULL auto_increment,
  `rcli_maitre` varchar(20) NOT NULL,
  `rcli_esclave` varchar(20) NOT NULL,
  PRIMARY KEY  (`rcli_id`),
  KEY `rcli_maitre` (`rcli_maitre`),
  KEY `rcli_esclave` (`rcli_esclave`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Regroupements clients';

