-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 05-02-2019 a las 10:02:01
-- Versión del servidor: 5.6.32-78.1
-- Versión de PHP: 5.6.30

START TRANSACTION;



--
-- Base de datos: `cometdev_sigeni`
--

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

--
-- Estructura de tabla para la tabla `Companies`
--

CREATE TABLE `Companies` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `idWorkingPeriod` int(11) NOT NULL,
  `address` text NOT NULL,
  `payDays` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `Companies`
--

INSERT INTO `Companies` (`id`, `name`, `idWorkingPeriod`, `address`, `payDays`) VALUES
(41, 'Human Resource, S.A. de C.V.', 5, 'Mza', 'quince y último');

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

--
-- Estructura de tabla para la tabla `CompaniesDepartments`
--

CREATE TABLE `CompaniesDepartments` (
  `idCompany` int(11) NOT NULL,
  `idDepartment` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `CompaniesDepartments`
--

INSERT INTO `CompaniesDepartments` (`idCompany`, `idDepartment`) VALUES
(41, 18),
(41, 23);

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

--
-- Estructura de tabla para la tabla `Contracts`
--

CREATE TABLE `Contracts` (
  `id` int(11) NOT NULL,
  `idEmployee` int(11) NOT NULL,
  `idDepartment` int(11) NOT NULL,
  `salary` float NOT NULL DEFAULT '0',
  `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updateDate` datetime NOT NULL,
  `creationUser` int(11) NOT NULL,
  `updateUser` int(11) NOT NULL,
  `idContractType` int(11) NOT NULL,
  `idJob` int(11) NOT NULL,
  `startDate` date NOT NULL,
  `salaries` float NOT NULL DEFAULT '0',
  `minimumSalary` float NOT NULL DEFAULT '0',
  `testDays` int(11) DEFAULT '0',
  `endDate` date DEFAULT NULL,
  `entryDateCompany` date NOT NULL,
  `entryDateSaav` date NOT NULL,
  `freeTime` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `Contracts`
--

INSERT INTO `Contracts` (`id`, `idEmployee`, `idDepartment`, `salary`, `creationDate`, `updateDate`, `creationUser`, `updateUser`, `idContractType`, `idJob`, `startDate`, `salaries`, `minimumSalary`, `testDays`, `endDate`, `entryDateCompany`, `entryDateSaav`, `freeTime`) VALUES
(1, 1, 23, 0, '2017-02-10 03:04:13', '2017-02-09 21:04:13', 4, 4, 5, 25, '2017-02-09', 25, 80.04, 0, '0000-00-00', '2016-12-01', '2016-12-01', 10);

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

--
-- Estructura de tabla para la tabla `ContractTypes`
--

CREATE TABLE `ContractTypes` (
  `id` int(11) NOT NULL,
  `name` text NOT NULL,
  `description` text NOT NULL,
  `viewName` varchar(50) NOT NULL,
  `testDays` tinyint(1) NOT NULL DEFAULT '0',
  `needEndDate` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `ContractTypes`
--

INSERT INTO `ContractTypes` (`id`, `name`, `description`, `viewName`, `testDays`, `needEndDate`) VALUES
(5, 'Indeterminado', 'Contrato de tiempo indeterminado', 'indeterminado', 0, 0),
(6, 'Tiempo indeterminado con periodo de prueba', 'Tiempo indeterminado con periodo de prueba', 'indeterminado_tiempo_prueba', 1, 0);

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

--
-- Estructura de tabla para la tabla `Departments`
--

CREATE TABLE `Departments` (
  `id` int(11) NOT NULL,
  `name` text NOT NULL,
  `description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `Departments`
--

INSERT INTO `Departments` (`id`, `name`, `description`) VALUES
(15, 'CONTABILIDAD', '.'),
(16, 'ATENCIÓN AL CLIENTE', '.'),
(17, 'OPERACIONES', '.'),
(18, 'ADMINISTRACIÓN', '.'),
(19, 'AGENCIA DE VIAJE', '.'),
(20, 'ASEGURADORA', '.'),
(21, 'BCL', '.'),
(22, 'BODAS', '.'),
(23, 'DIRECCIÓN GENERAL', '.'),
(24, 'DISEÑO', '.'),
(25, 'FUMIGACIÓN', '.'),
(26, 'HDC MÉXICO', '.'),
(28, 'HRC', '.'),
(29, 'HRR', '.'),
(30, 'HRV', '.'),
(31, 'COMPOSTA', '.'),
(32, 'TRASLADOS', '.'),
(33, 'PDR', '.'),
(34, 'SVKI', '.'),
(35, 'SVKI Y BLG', '.'),
(36, 'BLG', '.'),
(37, 'COMERCIAL', '.'),
(38, 'KOOLKLIK SISTEMAS', '.'),
(39, 'MANTENIMIENTO', '.'),
(40, 'OCEAN', '.'),
(41, 'PRODUCCIÓN', '.'),
(42, 'MERIDA', '.'),
(43, 'SAT', '.'),
(44, 'COMBAY 94', '.'),
(45, 'COMBAY 220', '.'),
(46, 'CASA BLANCA', '.'),
(48, 'VENTAS', '.'),
(49, 'MARINA', '.'),
(50, 'SISTEMAS', '.');

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

--
-- Estructura de tabla para la tabla `EmployeesChanges`
--

CREATE TABLE `EmployeesChanges` (
  `id` int(11) NOT NULL,
  `idEmployee` int(11) NOT NULL,
  `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `salaries` float NOT NULL,
  `status` tinyint(4) NOT NULL,
  `idCreationUser` int(11) NOT NULL,
  `changeType` tinyint(4) NOT NULL,
  `applyDate` date NOT NULL,
  `minimumSalary` float NOT NULL,
  `entryDateCompany` date NOT NULL,
  `entryDateSaav` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `EmployeesChanges`
--

INSERT INTO `EmployeesChanges` (`id`, `idEmployee`, `creationDate`, `salaries`, `status`, `idCreationUser`, `changeType`, `applyDate`, `minimumSalary`, `entryDateCompany`, `entryDateSaav`) VALUES
(1, 1, '2016-12-09 22:29:26', 25, 1, 25, 1, '2016-12-01', 73.04, '2016-12-01', '2016-12-01'),
(2, 2, '2017-02-03 16:11:18', 1.5, 1, 25, 1, '2017-01-16', 80.04, '2017-01-16', '2017-01-16'),
(3, 3, '2017-02-03 17:04:23', 1.5, 1, 25, 1, '2017-01-16', 80.04, '2017-01-16', '2017-01-16'),
(4, 3, '2017-03-14 01:10:23', 10.5, 1, 25, 4, '2017-03-16', 80.04, '2017-01-16', '2017-01-16'),
(5, 3, '2017-03-14 01:16:16', 10.5, 2, 25, 2, '2017-03-18', 80.04, '2017-01-16', '2017-01-16');

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

--
-- Estructura de tabla para la tabla `Holidays`
--

CREATE TABLE `Holidays` (
  `date` date NOT NULL,
  `description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `Holidays`
--

INSERT INTO `Holidays` (`date`, `description`) VALUES
('2016-11-04', 'asdas'),
('2016-11-06', 'asdas');

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

--
-- Estructura de tabla para la tabla `IncidentCategories`
--

CREATE TABLE `IncidentCategories` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `tag` varchar(10) NOT NULL,
  `orderx` int(11) NOT NULL,
  `usedByRequest` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `IncidentCategories`
--

INSERT INTO `IncidentCategories` (`id`, `name`, `description`, `type`, `tag`, `orderx`, `usedByRequest`) VALUES
(12, 'Asistencia', 'asistencia', 1, '-', 0, 0),
(13, 'Domingo laborado', 'domingo laborado', 1, 'DL', 10, 0),
(14, 'Día festivo laborado', 'Día festivo laborado', 1, 'FL', 20, 1),
(15, 'Descanso trabajado', 'Descanso trabajado', 1, 'DT', 30, 1),
(16, 'Turno doble', 'turno doble', 1, 'TD', 40, 1),
(17, 'Falta', 'Falta', 1, 'F', 50, 0),
(18, 'Incapacidad', 'incapacidad', 1, 'INC', 60, 0),
(19, 'Permiso con goce', 'permiso con goce', 1, 'PCG', 70, 1),
(20, 'Permiso sin goce', 'permiso sin goce', 1, 'PSG', 80, 1),
(21, 'Retardo', 'Retardo', 1, 'R', 90, 0),
(22, 'Vacaciones', 'vacaciones', 1, 'V', 11, 1),
(23, 'Día festivo', 'Día festivo', 1, 'DF', 1, 0),
(25, 'Descanso', 'Descanso', 1, 'D', 12, 0);

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

--
-- Estructura de tabla para la tabla `Incidents`
--

CREATE TABLE `Incidents` (
  `id` int(11) NOT NULL,
  `idEmployee` int(11) NOT NULL,
  `idIncidentCategory` int(11) NOT NULL,
  `date` date NOT NULL,
  `creationUser` int(11) NOT NULL,
  `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updateUser` int(11) NOT NULL,
  `updateDate` datetime NOT NULL,
  `notes` text NOT NULL,
  `idRequest` int(11) NOT NULL DEFAULT '-1',
  `requestType` tinyint(4) NOT NULL DEFAULT '-1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Estructura de tabla para la tabla `Jobs`
--

CREATE TABLE `Jobs` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `Jobs`
--

INSERT INTO `Jobs` (`id`, `name`, `description`) VALUES
(1, 'GERENTE DE CONTABILIDAD', '.'),
(2, 'EJECUTIVO DE ATENCIÓN AL CLIENTE', '.'),
(3, 'GERENTE DE OPERACIONES', '.'),
(4, 'FOTÓGRAFO DE ANIMALES', '.'),
(5, 'GERENTE ADMINISTRATIVO', '.'),
(6, 'COORDINADOR DE BODAS', '.'),
(7, 'FOTÓGRAFO DE SESIONES', '.'),
(8, 'SUPERVISOR', '.'),
(9, 'COORDINADOR DE BODAS Y SUPERVISOR', '.\r\n'),
(10, 'ADMINISTRADOR', '.'),
(11, 'FUMIGADOR', '.'),
(12, 'JEFE DE FUMIGACIÓN', '.'),
(13, 'AYUDANTE DE CHOFER', '.'),
(14, 'COMPOSTERO', '.'),
(15, 'CHOFER', '.'),
(16, 'VETERINARIO', '.'),
(17, 'VENDEDOR', '.'),
(18, 'AUDITOR', '.'),
(19, 'AUXILIAR DE C X C', '.'),
(20, 'AUXILIAR DE ACABADOS', '.'),
(21, 'AUXILIAR DE MANTENIMIENTO', '.'),
(22, 'CAJERO', '.'),
(23, 'CAMAROGRAFO', '.'),
(24, 'CONTROL DE CALIDAD', '.'),
(25, 'DIRECTOR GENERAL', '.'),
(26, 'DIRECTOR DE OPERACIONES', '.'),
(27, 'DISEÑADOR', '.'),
(28, 'DISEÑADOR SR', '.'),
(29, 'EDITOR DE FOTOGRAFÍA', '.'),
(30, 'EJECUTIVA DE VENTAS', '.'),
(31, 'ESPECIALISTA EN INFRAESTRUCTURA Y REDES', '.'),
(32, 'FOTÓGRAFO', '.'),
(33, 'FOTÓGRAFO DE MEMORIES', '.'),
(34, 'FOTÓGRAFO ELITE', '.'),
(35, 'GERENTE', '.'),
(36, 'GERENTE DE PRODUCCIÓN', '.'),
(37, 'GERENTE DE RECURSOS HUMANOS', '.'),
(38, 'RECEPCIONISTA', '.'),
(40, 'PELUQUERO', '.'),
(41, 'DIRECTOR DE DISEÑO', '.'),
(42, 'COORDINADOR ADMINISTRATIVO', '.'),
(43, 'CONTADOR', '.'),
(44, 'SOPORTE TECNICO', '.'),
(45, 'ASESOR DE SISTEMAS', '.'),
(46, 'COORDINADOR DE SOPORTE', '.'),
(47, 'PROJECT MANAGER', '.'),
(48, 'RESPONSABLE DE SERVICIO TÉCNICO', '.'),
(49, 'MANAGER ASSISTANT', '.'),
(50, 'CAPITAN', '.'),
(51, 'MARINERO', '.'),
(52, 'AYUDANTE DE MARINERO', '.'),
(53, 'AJUSTADOR', '.'),
(54, 'AUXILIAR ADMINISTRATIVO', '.'),
(55, 'ASISTENTE DE INFORMATICA', '.'),
(56, 'AYUDANTE GENERAL', '.'),
(57, 'AUXILIAR DE CONTABILIDAD', '.'),
(58, 'ASISTENTE ADMINISTRATIVO', '.'),
(59, 'COORDINADOR DE VENTAS', '.'),
(60, 'SUB SUPERVISOR', '.'),
(61, 'COCINERO', '.'),
(62, 'AYUDANTE DE COCINA', '.'),
(63, 'TAQUERO', '.'),
(64, 'GERENTE ADMINISTRATIVO Y RH', '.'),
(65, 'COMPRAS', '.'),
(66, 'MANTENIMIENTO', '.');

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

--
-- Estructura de tabla para la tabla `MinimumSalaries`
--

CREATE TABLE `MinimumSalaries` (
  `startDate` date NOT NULL,
  `amount` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `MinimumSalaries`
--

INSERT INTO `MinimumSalaries` (`startDate`, `amount`) VALUES
('2016-12-01', 73.04),
('2017-01-01', 80.04);

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

--
-- Estructura de tabla para la tabla `NoticeRequests`
--

CREATE TABLE `NoticeRequests` (
  `id` int(11) NOT NULL,
  `idEmployee` int(11) NOT NULL,
  `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idJob` int(11) NOT NULL,
  `idDepartment` int(11) NOT NULL,
  `workDays` int(11) NOT NULL,
  `extraHours` int(11) NOT NULL,
  `doubleWorkDay` int(11) NOT NULL,
  `eventDate` date NOT NULL,
  `notes` text NOT NULL,
  `idCreationUser` int(11) NOT NULL,
  `noticeType` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Estructura de tabla para la tabla `PayrollConcepts`
--

CREATE TABLE `PayrollConcepts` (
  `idPeriod` int(11) NOT NULL,
  `idEmployee` int(11) NOT NULL,
  `horasExtraP` float NOT NULL,
  `comisionesP` float NOT NULL,
  `anticiposP` float NOT NULL,
  `bonosP` float NOT NULL,
  `compensacionesP` float NOT NULL,
  `otrosP` float NOT NULL,
  `prestamosD` float NOT NULL,
  `anticiposD` float NOT NULL,
  `cxcD` float NOT NULL,
  `otrosD` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `PayrollConcepts`
--

INSERT INTO `PayrollConcepts` (`idPeriod`, `idEmployee`, `horasExtraP`, `comisionesP`, `anticiposP`, `bonosP`, `compensacionesP`, `otrosP`, `prestamosD`, `anticiposD`, `cxcD`, `otrosD`) VALUES
(745, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(745, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(745, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

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

--
-- Estructura de tabla para la tabla `Periods`
--

CREATE TABLE `Periods` (
  `id` int(11) NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date NOT NULL,
  `idCompany` int(11) NOT NULL,
  `idUserClosure` int(11) NOT NULL DEFAULT '-1',
  `closureDate` datetime NOT NULL,
  `status` tinyint(4) NOT NULL,
  `idUserAproval` int(11) NOT NULL DEFAULT '-1',
  `aprovalDate` datetime NOT NULL,
  `incidentsLastDate` date NOT NULL,
  `closeAllDays` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `Periods`
--

INSERT INTO `Periods` (`id`, `startDate`, `endDate`, `idCompany`, `idUserClosure`, `closureDate`, `status`, `idUserAproval`, `aprovalDate`, `incidentsLastDate`, `closeAllDays`) VALUES
(734, '2016-10-01', '2016-10-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(735, '2016-10-16', '2016-10-31', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(736, '2016-11-01', '2016-11-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(737, '2016-11-16', '2016-11-30', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(738, '2016-12-01', '2016-12-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(739, '2016-12-16', '2016-12-31', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(740, '2017-01-01', '2017-01-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(741, '2017-01-16', '2017-01-31', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(742, '2017-02-01', '2017-02-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(743, '2017-02-16', '2017-02-28', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(744, '2017-03-01', '2017-03-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(745, '2017-03-16', '2017-03-31', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(746, '2017-04-01', '2017-04-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(747, '2017-04-16', '2017-04-30', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(748, '2017-05-01', '2017-05-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(749, '2017-05-16', '2017-05-31', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(750, '2017-06-01', '2017-06-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(751, '2017-06-16', '2017-06-30', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(752, '2017-07-01', '2017-07-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(753, '2017-07-16', '2017-07-31', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(754, '2017-08-01', '2017-08-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(755, '2017-08-16', '2017-08-31', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(756, '2017-09-01', '2017-09-15', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0),
(757, '2017-09-16', '2017-09-30', 41, -1, '0000-00-00 00:00:00', 1, -1, '0000-00-00 00:00:00', '0000-00-00', 0);

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

--
-- Estructura de tabla para la tabla `PermissionRequests`
--

CREATE TABLE `PermissionRequests` (
  `id` int(11) NOT NULL,
  `idEmployee` int(11) NOT NULL,
  `idJob` int(11) NOT NULL,
  `idDepartment` int(11) NOT NULL,
  `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `daysToUse` int(11) NOT NULL,
  `jsonRequiredBreakDays` text NOT NULL,
  `startDate` date NOT NULL,
  `notes` text NOT NULL,
  `idCreationUser` int(11) NOT NULL,
  `endDate` date NOT NULL,
  `workDate` date NOT NULL,
  `idIncidentCategory` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Estructura de tabla para la tabla `PermitsDepartments`
--

CREATE TABLE `PermitsDepartments` (
  `idDepartment` int(11) NOT NULL,
  `idUser` int(11) NOT NULL,
  `idCompany` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `PermitsDepartments`
--

INSERT INTO `PermitsDepartments` (`idDepartment`, `idUser`, `idCompany`) VALUES
(18, 4, 41),
(18, 25, 41),
(23, 25, 41);

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

--
-- Estructura de tabla para la tabla `Settings`
--

CREATE TABLE `Settings` (
  `id` varchar(30) NOT NULL,
  `value` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `Settings`
--

INSERT INTO `Settings` (`id`, `value`) VALUES
('companyAddress', 'Cancún Q. Roo Smza 32 Mza 01 Lote 01 Local 18 Plaza Hollywood C'),
('companyName', 'GEN Human Resources, S.A. de C.V.'),
('managerEmail', 'info@lamhi.com.mx'),
('minimumSalary', '80.04');

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

--
-- Estructura de tabla para la tabla `SettlementRequests`
--

CREATE TABLE `SettlementRequests` (
  `id` int(11) NOT NULL,
  `idEmployee` int(11) NOT NULL,
  `fechaBaja` date NOT NULL,
  `fechaDePago` datetime NOT NULL,
  `lugarDePago` varchar(50) NOT NULL,
  `bajaImss` tinyint(1) NOT NULL,
  `diasGratificacion` int(11) NOT NULL,
  `vacacionesGozadas` int(11) NOT NULL,
  `primaVacacionesPagadas` int(11) NOT NULL,
  `diasDevengados` float NOT NULL,
  `horasExtra` float NOT NULL,
  `diaFestivo` float NOT NULL,
  `primaDominical` float NOT NULL,
  `compensacion` float NOT NULL,
  `bono` float NOT NULL,
  `otrasPercepciones` float NOT NULL,
  `ausentismos` float NOT NULL,
  `sueldoPagadoDeMas` float NOT NULL,
  `cxc` float NOT NULL,
  `prestamo` float NOT NULL,
  `otrosDescuentos` float NOT NULL,
  `observaciones` text NOT NULL,
  `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idCreationUser` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Estructura de tabla para la tabla `UsersCompanies`
--

CREATE TABLE `UsersCompanies` (
  `idCompany` int(11) NOT NULL,
  `idUser` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `UsersCompanies`
--

INSERT INTO `UsersCompanies` (`idCompany`, `idUser`) VALUES
(41, 25),
(41, 4);

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

--
-- Estructura de tabla para la tabla `VacationRequests`
--

CREATE TABLE `VacationRequests` (
  `id` int(11) NOT NULL,
  `idEmployee` int(11) NOT NULL,
  `idJob` int(11) NOT NULL,
  `idDepartment` int(11) NOT NULL,
  `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `periodStartYear` int(11) NOT NULL,
  `periodEndYear` int(11) NOT NULL,
  `totalDays` int(11) NOT NULL,
  `usedDays` int(11) NOT NULL,
  `availableDays` int(11) NOT NULL,
  `daysToUse` int(11) NOT NULL,
  `startDate` date NOT NULL,
  `notes` text NOT NULL,
  `idCreationUser` int(11) NOT NULL,
  `endDate` date NOT NULL,
  `workDate` date NOT NULL,
  `jsonRequiredBreakDays` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Estructura de tabla para la tabla `WorkingPeriods`
--

CREATE TABLE `WorkingPeriods` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `days` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `WorkingPeriods`
--

INSERT INTO `WorkingPeriods` (`id`, `name`, `days`) VALUES
(4, 'Semanal', 7),
(5, 'Quincenal', 15.2083),
(6, 'Mensual', 30.4166);

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `Companies`
--
ALTER TABLE `Companies`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `CompaniesDepartments`
--
ALTER TABLE `CompaniesDepartments`
  ADD PRIMARY KEY (`idCompany`,`idDepartment`);

--
-- Indices de la tabla `Contracts`
--
ALTER TABLE `Contracts`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `ContractTypes`
--
ALTER TABLE `ContractTypes`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `Departments`
--
ALTER TABLE `Departments`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `EmployeesChanges`
--
ALTER TABLE `EmployeesChanges`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `Holidays`
--
ALTER TABLE `Holidays`
  ADD PRIMARY KEY (`date`);

--
-- Indices de la tabla `IncidentCategories`
--
ALTER TABLE `IncidentCategories`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `Incidents`
--
ALTER TABLE `Incidents`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `Jobs`
--
ALTER TABLE `Jobs`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `MinimumSalaries`
--
ALTER TABLE `MinimumSalaries`
  ADD PRIMARY KEY (`startDate`);

--
-- Indices de la tabla `NoticeRequests`
--
ALTER TABLE `NoticeRequests`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `PayrollConcepts`
--
ALTER TABLE `PayrollConcepts`
  ADD PRIMARY KEY (`idPeriod`,`idEmployee`);

--
-- Indices de la tabla `Periods`
--
ALTER TABLE `Periods`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `PermissionRequests`
--
ALTER TABLE `PermissionRequests`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `PermitsDepartments`
--
ALTER TABLE `PermitsDepartments`
  ADD PRIMARY KEY (`idDepartment`,`idUser`,`idCompany`);

--
-- Indices de la tabla `Settings`
--
ALTER TABLE `Settings`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `SettlementRequests`
--
ALTER TABLE `SettlementRequests`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `VacationRequests`
--
ALTER TABLE `VacationRequests`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `WorkingPeriods`
--
ALTER TABLE `WorkingPeriods`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `Companies`
--
ALTER TABLE `Companies`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;

--
-- AUTO_INCREMENT de la tabla `Contracts`
--
ALTER TABLE `Contracts`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `ContractTypes`
--
ALTER TABLE `ContractTypes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT de la tabla `Departments`
--
ALTER TABLE `Departments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;

--
-- AUTO_INCREMENT de la tabla `EmployeesChanges`
--
ALTER TABLE `EmployeesChanges`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT de la tabla `IncidentCategories`
--
ALTER TABLE `IncidentCategories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- AUTO_INCREMENT de la tabla `Incidents`
--
ALTER TABLE `Incidents`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `Jobs`
--
ALTER TABLE `Jobs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67;

--
-- AUTO_INCREMENT de la tabla `NoticeRequests`
--
ALTER TABLE `NoticeRequests`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `Periods`
--
ALTER TABLE `Periods`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=758;

--
-- AUTO_INCREMENT de la tabla `PermissionRequests`
--
ALTER TABLE `PermissionRequests`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `SettlementRequests`
--
ALTER TABLE `SettlementRequests`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `VacationRequests`
--
ALTER TABLE `VacationRequests`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `WorkingPeriods`
--
ALTER TABLE `WorkingPeriods`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
COMMIT;

