-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 21-03-2018 a las 23:30:37
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 5.6.30




--
-- Base de datos: `saturno`
--

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

--
-- Estructura de tabla para la tabla `almacen`
--

CREATE TABLE `almacen` (
  `id` bigint(20) NOT NULL,
  `Tipo` tinyint(4) NOT NULL COMMENT '1 Entrada / 2 Salida / 3 Devolucion',
  `Usuario_id` int(11) NOT NULL,
  `Producto_id` int(11) NOT NULL,
  `ProductoNombre` varchar(100) COLLATE utf16_spanish_ci NOT NULL,
  `UnidadMedida_id` varchar(10) COLLATE utf16_spanish_ci DEFAULT NULL,
  `Cantidad` decimal(10,2) NOT NULL,
  `Precio` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Fecha` varchar(10) COLLATE utf16_spanish_ci NOT NULL,
  `Empresa_id` int(11) NOT NULL,
  `Comprobante_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `almacen` (`id`, `Tipo`, `Usuario_id`, `Producto_id`, `ProductoNombre`, `UnidadMedida_id`, `Cantidad`, `Precio`, `Fecha`, `Empresa_id`, `Comprobante_id`) VALUES
(28, 2, 6, 1, '[UTD] - Cable', 'Metro', '100.00', '610.00', '2017/08/19', 4, 2),
(29, 2, 6, 1, '[UTD] - Cable', 'Metro', '1000.00', '6100.00', '2017/08/19', 4, 3),
(30, 1, 14, 4, '[Luv] - Foco', 'Uni', '20.00', '4.76', '2017/08/21', 4, NULL),
(31, 2, 14, 3, '[DIsma] - Interruptor', 'Uni', '1.00', '6.10', '2017/08/22', 4, 4),
(32, 1, 15, 8, '[Hino] - Fusible 20w', 'uni', '10.00', '0.35', '2017/08/23', 4, NULL),
(33, 1, 15, 9, '[solaritech] - panel solar', 'uni', '8.00', '2450.00', '2017/08/24', 4, NULL),
(34, 2, 15, 3, '[DIsma] - Interruptor', 'Uni', '100.00', '610.00', '2017/08/29', 4, 5),
(35, 2, 15, 7, 'Antena', 'uni', '1000.00', '12300.00', '2017/08/29', 4, 6),
(36, 2, 15, 10, '[Wilson] - Brochas', 'uni', '1.00', '3.69', '2017/08/29', 4, 7),
(37, 2, 15, 1, '[UTD] - Cable', 'Metro', '10.00', '61.00', '2017/08/28', 4, 8),
(38, 3, 15, 1, '[UTD] - Cable', 'Metro', '10.00', '0.00', '2017/08/28', 4, 8),
(39, 2, 15, 8, '[Hino] - Fusible 20w', 'uni', '15.00', '7.50', '2017/08/30', 4, 10),
(40, 3, 15, 8, '[Hino] - Fusible 20w', 'uni', '15.00', '0.00', '2017/08/30', 4, 10),
(41, 3, 15, 10, '[Wilson] - Brochas', 'uni', '1.00', '0.00', '2017/08/30', 4, 7),
(42, 2, 15, 8, '[Hino] - Fusible 20w', 'uni', '10.00', '6.50', '2017/08/30', 4, 11),
(43, 2, 15, 4, '[Luv] - Foco', 'Uni', '1.00', '5.50', '2017/08/30', 4, 13),
(44, 2, 15, 3, '[DIsma] - Interruptor', 'Uni', '1.00', '6.10', '2017/08/31', 4, 14),
(45, 2, 15, 7, 'Antena', 'uni', '1.00', '12.30', '2017/08/31', 4, 15),
(46, 2, 15, 8, '[Hino] - Fusible 20w', 'uni', '1.00', '0.50', '2018/03/20', 4, 17),
(47, 2, 15, 5, 'Canaleta', 'uni', '1.00', '5.10', '2018/03/20', 4, 19);

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

--
-- Estructura de tabla para la tabla `cliente`
--

CREATE TABLE `cliente` (
  `id` int(11) NOT NULL,
  `Ruc` varchar(13) COLLATE utf16_spanish_ci DEFAULT NULL,
  `Dni` varchar(10) COLLATE utf16_spanish_ci DEFAULT NULL,
  `Nombre` varchar(100) COLLATE utf16_spanish_ci NOT NULL,
  `Empresa` text COLLATE utf16_spanish_ci NOT NULL,
  `Correo` varchar(50) COLLATE utf16_spanish_ci NOT NULL,
  `Telefono` varchar(20) COLLATE utf16_spanish_ci NOT NULL,
  `Celular` varchar(20) COLLATE utf16_spanish_ci NOT NULL,
  `Direccion` text COLLATE utf16_spanish_ci NOT NULL,
  `Empresa_id` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `cliente` (`id`, `Ruc`, `Dni`, `Nombre`, `Empresa`, `Correo`, `Telefono`, `Celular`, `Direccion`, `Empresa_id`) VALUES
(1, '1715549992001', '1715549992', 'Sebastián Llerena', '', 'sebastianllg@hotmail.com', '023464764', '0984548191', 'Ponceano', 4),
(2, '', '1234567890', 'Daniela Emilia Castillo', '', 'daniela@ho.com', '023464764', '0984548191', '\n', 4),
(3, '', '1722219597', 'Luisa Castillo', '', 'aziul@hotmail.com', '00000', '11111', 'ponceano', 4),
(4, '', '1111111111', 'a', '', '', '', '', '', 4),
(5, '', '2222222222', 'a', '', '', '', '', '', 4),
(8, '8787878787878', '', 'sul', 'sul', '', '', '', 'casad', 4),
(9, '1545454545454', '1545454545', 'a', 'empresa a', '', '', '', 'direcion aa', 4),
(10, '1787878787878', '1787878787', 'patricio Castillo', 'COPROELETRICOS', '', '', '', 'sur de quito', 4);

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

--
-- Estructura de tabla para la tabla `comprobante`
--

CREATE TABLE `comprobante` (
  `id` bigint(20) NOT NULL,
  `Empresa_id` int(11) NOT NULL DEFAULT '0',
  `Serie` varchar(6) COLLATE utf16_spanish_ci DEFAULT NULL,
  `Correlativo` varchar(20) COLLATE utf16_spanish_ci DEFAULT NULL,
  `Cliente_id` int(11) NOT NULL DEFAULT '0',
  `ClienteIdentidad` varchar(11) COLLATE utf16_spanish_ci DEFAULT '',
  `ClienteNombre` varchar(100) COLLATE utf16_spanish_ci NOT NULL DEFAULT '',
  `ClienteEmpresa` text COLLATE utf16_spanish_ci NOT NULL,
  `ClienteCorreo` varchar(50) COLLATE utf16_spanish_ci NOT NULL,
  `ClienteDireccion` text COLLATE utf16_spanish_ci,
  `ComprobanteTipo_id` tinyint(4) NOT NULL DEFAULT '0',
  `Estado` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1 Pendiente 2 Aprobada 3 Anulada',
  `FechaRegistro` varchar(10) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `FechaEmitido` varchar(10) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `Iva` decimal(10,2) NOT NULL DEFAULT '0.00',
  `IvaTotal` decimal(10,2) NOT NULL DEFAULT '0.00',
  `SubTotal` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Total` decimal(10,2) NOT NULL DEFAULT '0.00',
  `TotalCompra` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Ganancia` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Usuario_id` int(11) NOT NULL DEFAULT '0',
  `Observaciones` text COLLATE utf16_spanish_ci,
  `Impresion` tinyint(4) NOT NULL DEFAULT '0',
  `UsuarioImprimiendo_id` int(11) DEFAULT NULL,
  `Devolucion` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0 Pendiente 1 Cerrado'
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `comprobante` (`id`, `Empresa_id`, `Serie`, `Correlativo`, `Cliente_id`, `ClienteIdentidad`, `ClienteNombre`, `ClienteEmpresa`, `ClienteCorreo`, `ClienteDireccion`, `ComprobanteTipo_id`, `Estado`, `FechaRegistro`, `FechaEmitido`, `Iva`, `IvaTotal`, `SubTotal`, `Total`, `TotalCompra`, `Ganancia`, `Usuario_id`, `Observaciones`, `Impresion`, `UsuarioImprimiendo_id`, `Devolucion`) VALUES
(1, 4, NULL, '00001', 1, '12345678909', 'Ajd', '', '', 'Sdfds', 1, 3, '2017/08/19', '2017/08/19', '0.00', '0.00', '0.00', '4880.00', '4320.00', '560.00', 6, '', 0, NULL, 0),
(2, 4, '002', '00002', 1, '12345678909', 'Ajd', '', '', 'Sdfds', 3, 2, '2017/08/19', '2017/08/19', '12.00', '65.36', '544.64', '610.00', '540.00', '70.00', 6, '', 2, NULL, 0),
(3, 4, '002', '00003', 1, '12345678909', 'Ajd', '', '', 'Sdfds', 3, 2, '2017/08/19', '2017/08/19', '12.00', '653.57', '5446.43', '6100.00', '5400.00', '700.00', 6, '', 2, NULL, 0),
(4, 4, '002', '00004', 1, '12345678909', 'Ajd', '', '', 'Sdfds', 3, 2, '2017/08/22', '2017/08/22', '12.00', '0.65', '5.45', '6.10', '4.60', '1.50', 14, '', 2, NULL, 0),
(5, 4, '002', '00005', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 2, '2017/08/29', '2017/08/29', '12.00', '65.36', '544.64', '610.00', '460.00', '150.00', 15, '', 2, NULL, 0),
(6, 4, '002', '00006', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 2, '2017/08/29', '2017/08/27', '12.00', '1317.86', '10982.14', '12300.00', '10800.00', '1500.00', 15, '', 2, NULL, 0),
(7, 4, '002', '00007', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 3, '2017/08/29', '2017/08/28', '12.00', '0.40', '3.29', '3.69', '3.00', '0.69', 15, '', 2, NULL, 1),
(8, 4, '002', '00008', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 3, '2017/08/28', '2017/08/28', '12.00', '6.54', '54.46', '61.00', '54.00', '7.00', 15, '', 2, NULL, 1),
(9, 4, NULL, '00002', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 1, 3, '2017/08/28', '2017/08/28', '0.00', '0.00', '0.00', '61.00', '54.00', '7.00', 15, '', 0, NULL, 0),
(10, 4, NULL, NULL, 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 3, '2017/08/30', '2017/08/30', '12.00', '0.80', '6.70', '7.50', '5.25', '2.25', 15, '', 0, NULL, 1),
(11, 4, NULL, NULL, 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 2, '2017/08/30', '2017/08/30', '12.00', '11.41', '95.09', '106.50', '18.50', '88.00', 15, '', 0, NULL, 0),
(12, 4, NULL, '00003', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 1, 3, '2017/08/30', '2017/08/30', '0.00', '0.00', '0.00', '0.50', '0.35', '0.15', 15, '', 0, NULL, 0),
(13, 4, NULL, NULL, 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 2, '2017/08/30', '2017/08/30', '12.00', '0.59', '4.91', '5.50', '4.76', '0.74', 15, '', 0, NULL, 0),
(14, 4, '001001', '00009', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 2, '2017/08/31', '2017/08/31', '12.00', '0.65', '5.45', '6.10', '4.60', '1.50', 15, '', 2, NULL, 0),
(15, 4, NULL, NULL, 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 2, '2017/08/31', '2017/08/31', '12.00', '1.32', '10.98', '12.30', '10.80', '1.50', 15, '', 0, NULL, 0),
(16, 4, NULL, '00004', 2, '1234567890', 'Daniela Emilia Castillo', '', '', '', 1, 3, '2018/03/20', '2018/03/20', '0.00', '0.00', '0.00', '6.10', '4.60', '1.50', 15, '', 0, NULL, 0),
(17, 4, NULL, NULL, 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 2, '2018/03/20', '2018/03/20', '12.00', '0.05', '0.45', '0.50', '0.35', '0.15', 15, '', 0, NULL, 0),
(18, 4, NULL, '00005', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 1, 2, '2018/03/20', '2018/03/20', '0.00', '0.00', '0.00', '6.10', '4.60', '1.50', 15, '', 0, NULL, 0),
(19, 4, NULL, NULL, 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 3, 2, '2018/03/20', '2018/03/20', '12.00', '0.55', '4.55', '5.10', '4.56', '0.54', 15, '', 0, NULL, 0),
(20, 4, NULL, '00006', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 1, 2, '2018/03/20', '2018/03/20', '0.00', '0.00', '0.00', '3400.00', '2450.00', '950.00', 15, '', 2, NULL, 0),
(21, 4, NULL, '00007', 1, '17155499920', 'Sebastián Llerena', '', '', 'Ponceano', 1, 2, '2018/03/20', '2018/03/20', '0.00', '0.00', '0.00', '1.00', '0.70', '0.30', 15, '', 0, NULL, 0),
(22, 4, NULL, '00008', 2, '1234567890', 'Daniela Emilia Castillo', '', '', '', 1, 2, '2018/03/21', '2018/03/21', '0.00', '0.00', '0.00', '0.50', '0.35', '0.15', 15, '', 0, NULL, 0),
(23, 4, NULL, '00009', 8, '87878787878', 'sul', '', '', 'casad', 1, 2, '2018/03/21', '2018/03/21', '0.00', '0.00', '0.00', '0.50', '0.35', '0.15', 15, '', 0, NULL, 0),
(24, 4, NULL, '00010', 10, '17878787878', 'patricio Castillo', 'COPROELETRICOS', '', 'sur de quito', 1, 2, '2018/03/21', '2018/03/21', '0.00', '0.00', '0.00', '5.50', '4.76', '0.74', 15, '', 0, NULL, 0),
(25, 4, NULL, '00011', 10, '17878787878', 'patricio Castillo', 'COPROELETRICOS', '', 'sur de quito', 1, 2, '2018/03/21', '2018/03/21', '0.00', '0.00', '0.00', '5.50', '4.76', '0.74', 15, 'Inlcuasidoasi odjasj askdj skldj kasdj kaslj dklsj dklasj dklsa djksl djklas djklas djks djkls jksjdkla dInlcuasidoasi odjasj askdj skldj kasdj kaslj dklsj dklasj dklsa djksl djklas djklas djks djkls jksjdkla dInlcuasidoasi odjasj askdj skldj kasdj kaslj dklsj dklasj dklsa djksl djklas djklas djks djkls jksjdkla d', 0, NULL, 0),
(26, 4, NULL, '00012', 8, '87878787878', 'sul', 'sul', '', 'casad', 1, 2, '2018/03/21', '2018/03/21', '0.00', '0.00', '0.00', '50.00', '45.70', '4.30', 15, 'asdsf has hdjkas hdkjas hdkjas hdkjs hdjs dhjs hdkjash kjash fkjah fjashf kjash fkjl', 0, NULL, 0);

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

--
-- Estructura de tabla para la tabla `comprobantedetalle`
--

CREATE TABLE `comprobantedetalle` (
  `id` bigint(20) NOT NULL,
  `Tipo` tinyint(4) DEFAULT NULL COMMENT '1 Producto / 2 Servicio',
  `Comprobante_Id` bigint(20) NOT NULL DEFAULT '0',
  `Producto_id` int(11) NOT NULL DEFAULT '0',
  `ProductoNombre` varchar(100) COLLATE utf16_spanish_ci DEFAULT NULL,
  `PrecioUnitarioCompra` decimal(10,2) NOT NULL DEFAULT '0.00',
  `PrecioTotalCompra` decimal(10,2) NOT NULL DEFAULT '0.00',
  `UnidadMedida_id` char(10) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `PrecioUnitario` decimal(10,2) NOT NULL DEFAULT '0.00',
  `PrecioTotal` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Cantidad` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Devuelto` decimal(10,2) DEFAULT '0.00',
  `Ganancia` decimal(10,2) NOT NULL DEFAULT '0.00'
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `comprobantedetalle` (`id`, `Tipo`, `Comprobante_Id`, `Producto_id`, `ProductoNombre`, `PrecioUnitarioCompra`, `PrecioTotalCompra`, `UnidadMedida_id`, `PrecioUnitario`, `PrecioTotal`, `Cantidad`, `Devuelto`, `Ganancia`) VALUES
(1, 1, 1, 1, '[UTD] - Cable', '5.40', '4320.00', 'Metro', '6.10', '4880.00', '800.00', '0.00', '560.00'),
(2, 1, 2, 1, '[UTD] - Cable', '5.40', '540.00', 'Metro', '6.10', '610.00', '100.00', '0.00', '70.00'),
(3, 1, 3, 1, '[UTD] - Cable', '5.40', '5400.00', 'Metro', '6.10', '6100.00', '1000.00', '0.00', '700.00'),
(4, 1, 4, 3, '[DIsma] - Interruptor', '4.60', '4.60', 'Uni', '6.10', '6.10', '1.00', '0.00', '1.50'),
(5, 1, 5, 3, '[DIsma] - Interruptor', '4.60', '460.00', 'Uni', '6.10', '610.00', '100.00', '0.00', '150.00'),
(6, 1, 6, 7, 'Antena', '10.80', '10800.00', 'uni', '12.30', '12300.00', '1000.00', '0.00', '1500.00'),
(7, 1, 7, 10, '[Wilson] - Brochas', '3.00', '3.00', 'uni', '3.69', '3.69', '1.00', '1.00', '0.69'),
(8, 1, 8, 1, '[UTD] - Cable', '5.40', '54.00', 'Metro', '6.10', '61.00', '10.00', '10.00', '7.00'),
(9, 1, 9, 1, '[UTD] - Cable', '5.40', '54.00', 'Metro', '6.10', '61.00', '10.00', '0.00', '7.00'),
(10, 1, 10, 8, '[Hino] - Fusible 20w', '0.35', '5.25', 'uni', '0.50', '7.50', '15.00', '15.00', '2.25'),
(11, 2, 11, 1, '[Servicio] - cableado eléctrico', '15.00', '15.00', 'UND', '100.00', '100.00', '1.00', '0.00', '85.00'),
(12, 1, 11, 8, '[Hino] - Fusible 20w', '0.35', '3.50', 'uni', '0.65', '6.50', '10.00', '0.00', '3.00'),
(13, 1, 12, 8, '[Hino] - Fusible 20w', '0.35', '0.35', 'uni', '0.50', '0.50', '1.00', '0.00', '0.15'),
(14, 1, 13, 4, '[Luv] - Foco', '4.76', '4.76', 'Uni', '5.50', '5.50', '1.00', '0.00', '0.74'),
(15, 1, 14, 3, '[DIsma] - Interruptor', '4.60', '4.60', 'Uni', '6.10', '6.10', '1.00', '0.00', '1.50'),
(16, 1, 15, 7, 'Antena', '10.80', '10.80', 'uni', '12.30', '12.30', '1.00', '0.00', '1.50'),
(17, 1, 16, 3, '[DIsma] - Interruptor', '4.60', '4.60', 'Uni', '6.10', '6.10', '1.00', '0.00', '1.50'),
(18, 1, 17, 8, '[Hino] - Fusible 20w', '0.35', '0.35', 'uni', '0.50', '0.50', '1.00', '0.00', '0.15'),
(19, 1, 18, 3, '[DIsma] - Interruptor', '4.60', '4.60', 'Uni', '6.10', '6.10', '1.00', '0.00', '1.50'),
(20, 1, 19, 5, 'Canaleta', '4.56', '4.56', 'uni', '5.10', '5.10', '1.00', '0.00', '0.54'),
(21, 1, 20, 9, '[solaritech] - panel solar', '2450.00', '2450.00', 'uni', '3400.00', '3400.00', '1.00', '0.00', '950.00'),
(22, 1, 21, 8, '[Hino] - Fusible 20w', '0.35', '0.70', 'uni', '0.50', '1.00', '2.00', '0.00', '0.30'),
(23, 1, 22, 8, '[Hino] - Fusible 20w', '0.35', '0.35', 'uni', '0.50', '0.50', '1.00', '0.00', '0.15'),
(24, 1, 23, 8, '[Hino] - Fusible 20w', '0.35', '0.35', 'uni', '0.50', '0.50', '1.00', '0.00', '0.15'),
(25, 1, 24, 4, '[Luv] - Foco', '4.76', '4.76', 'Uni', '5.50', '5.50', '1.00', '0.00', '0.74'),
(26, 1, 25, 4, '[Luv] - Foco', '4.76', '4.76', 'Uni', '5.50', '5.50', '1.00', '0.00', '0.74'),
(27, 1, 26, 6, '[hitachi] - Multimetro', '45.70', '45.70', 'uni', '50.00', '50.00', '1.00', '0.00', '4.30');

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

--
-- Estructura de tabla para la tabla `configuracion`
--

CREATE TABLE `configuracion` (
  `Empresa_id` int(11) NOT NULL,
  `RazonSocial` varchar(100) COLLATE utf16_spanish_ci NOT NULL,
  `Ruc` varchar(13) COLLATE utf16_spanish_ci NOT NULL,
  `Direccion` text COLLATE utf16_spanish_ci,
  `telefono` varchar(30) COLLATE utf16_spanish_ci NOT NULL,
  `Iva` decimal(4,2) NOT NULL,
  `Moneda_id` varchar(10) COLLATE utf16_spanish_ci NOT NULL,
  `SBoleta` varchar(5) COLLATE utf16_spanish_ci NOT NULL,
  `NBoleta` varchar(20) COLLATE utf16_spanish_ci NOT NULL,
  `SFactura` varchar(7) COLLATE utf16_spanish_ci NOT NULL,
  `NFactura` varchar(20) COLLATE utf16_spanish_ci NOT NULL,
  `BoletaFormato` text COLLATE utf16_spanish_ci NOT NULL,
  `FacturaFormato` text COLLATE utf16_spanish_ci NOT NULL,
  `BoletaFoto` varchar(50) COLLATE utf16_spanish_ci DEFAULT NULL,
  `FacturaFoto` varchar(50) COLLATE utf16_spanish_ci DEFAULT NULL,
  `Lineas` tinyint(4) NOT NULL DEFAULT '15',
  `Impresion` tinyint(4) NOT NULL DEFAULT '1',
  `Zeros` tinyint(4) DEFAULT '5',
  `Anio` int(4) DEFAULT '2013'
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `configuracion` (`Empresa_id`, `RazonSocial`, `Ruc`, `Direccion`, `telefono`, `Iva`, `Moneda_id`, `SBoleta`, `NBoleta`, `SFactura`, `NFactura`, `BoletaFormato`, `FacturaFormato`, `BoletaFoto`, `FacturaFoto`, `Lineas`, `Impresion`, `Zeros`, `Anio`) VALUES
(4, 'SATURNO Computing Services', '1715549992001', 'Av. Jorge Perez Concha y Eucaliptos', '0984548191 - 023464764', '12.00', 'USD.', '001', '14', '001001', '', '#fecha?left: 674px; top: 58px;|#cliente?left: 94px; top: 105px;|#ruc?left: 94px; top: 196px;|#direccion?left: 93px; top: 134px;|#serie?left: 674px; top: 41px;|#SubTotal?left: 708px; top: 413px;|#total?left: 701px; top: 429px;|#TotalLetras?left: 175px; top: 472px;|#IvaTotal?left: 220px; top: 474px;|#Iva?left: 743px; top: 406px;|#detalle?left: 23px; top: 214px;|#detalle .row?width: 74px;!width: 428px;!width: 107px;!width: 110px;', '#fecha?left: 674px; top: 219px;|#cliente?left: 93px; top: 192px;|#ruc?left: 90px; top: 234px;|#direccion?left: 93px; top: 213px;|#serie?left: 653px; top: 99px;|#SubTotal?left: 691px; top: 490px;|#total?left: 686px; top: 533px;|#TotalLetras?left: 111px; top: 486px;|#IvaTotal?left: 695px; top: 512px;|#Iva?left: 611px; top: 512px;|#detalle?left: 26px; top: 281px;|#detalle .row?width: 74px;!width: 428px;!width: 107px; height: 20px;!width: 110px;', '4_boleta.jpg', '4_factura.jpg', 15, 1, 5, 2017);

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

--
-- Estructura de tabla para la tabla `empresa`
--

CREATE TABLE `empresa` (
  `id` int(11) NOT NULL,
  `Nombre` varchar(100) COLLATE utf16_spanish_ci NOT NULL,
  `Estado` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `empresa` (`id`, `Nombre`, `Estado`) VALUES
(4, 'Saturno Computing Services', 1);

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

--
-- Estructura de tabla para la tabla `menu`
--

CREATE TABLE `menu` (
  `id` int(11) NOT NULL,
  `Class` varchar(50) COLLATE utf16_spanish_ci NOT NULL DEFAULT '',
  `Css` varchar(50) COLLATE utf16_spanish_ci NOT NULL DEFAULT '',
  `Nombre` varchar(50) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `Url` varchar(100) COLLATE utf16_spanish_ci NOT NULL DEFAULT '',
  `Padre` int(11) NOT NULL DEFAULT '0',
  `Orden` tinyint(4) DEFAULT '1',
  `Separador` tinyint(4) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `menu` (`id`, `Class`, `Css`, `Nombre`, `Url`, `Padre`, `Orden`, `Separador`) VALUES
(1, 'inicio', 'glyphicon-home', 'Inicio', 'index.php', 0, 1, 0),
(2, 'inicio', 'glyphicon-wrench', 'Servicios', 'mantenimiento/servicios', 0, 4, 0),
(3, 'mantenimiento', 'glyphicon-cog', 'Mantenimiento', '#', 0, 8, 0),
(4, '', 'glyphicon-credit-card', 'Ventas', 'ventas/comprobantes', 0, 2, 0),
(5, '', 'glyphicon-stats', 'Reportes', 'ventas/reportes', 0, 7, 1),
(6, '', 'glyphicon-user', 'Usuarios', 'mantenimiento/usuarios', 0, 6, 0),
(7, '', 'glyphicon-globe', 'Clientes', 'comprador/clientes', 0, 3, 0),
(8, '', 'glyphicon-shopping-cart', 'Productos', 'mantenimiento/productos', 0, 4, 0),
(10, '', 'glyphicon-cog', 'Configuración', 'mantenimiento/configuracion', 3, 6, 1),
(12, 'almacen', 'glyphicon-th', 'Bodega', 'almacen/index', 0, 6, 0);

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

--
-- Estructura de tabla para la tabla `menuhorizontal`
--

CREATE TABLE `menuhorizontal` (
  `id` int(11) NOT NULL,
  `Class` varchar(50) COLLATE utf16_spanish_ci NOT NULL DEFAULT '',
  `Css` varchar(50) COLLATE utf16_spanish_ci NOT NULL DEFAULT '',
  `Nombre` varchar(50) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `Url` varchar(100) COLLATE utf16_spanish_ci NOT NULL DEFAULT '',
  `Padre` int(11) NOT NULL DEFAULT '0',
  `Orden` tinyint(4) DEFAULT '1',
  `Separador` tinyint(4) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `menuhorizontal` (`id`, `Class`, `Css`, `Nombre`, `Url`, `Padre`, `Orden`, `Separador`) VALUES
(3, 'mantenimiento', 'glyphicon-cog', 'Mantenimiento', '#', 0, 4, 0),
(4, '', '', 'Comprobantes', 'ventas/comprobantes', 2, 1, 0),
(5, '', '', 'Reportes', 'ventas/reportes', 2, 2, 1),
(6, '', '', 'Usuarios', 'mantenimiento/usuarios', 3, 1, 0),
(7, '', '', 'Clientes', 'cliente/clientes', 3, 2, 0),
(8, '', '', 'Productos', 'mantenimiento/productos', 3, 3, 0),
(9, '', '', 'Servicios', 'mantenimiento/servicios', 3, 4, 0),
(10, '', '', 'Configuración', 'mantenimiento/configuracion', 3, 6, 1),
(11, '', '', 'Copia De Seguridad', 'respaldo/index', 3, 5, 1),
(13, '', '', 'Entrada/Salida', 'almacen/index', 12, 1, 0),
(14, '', '', 'Kardex', 'almacen/kardex', 12, 2, 1);

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

--
-- Estructura de tabla para la tabla `menusuario`
--

CREATE TABLE `menusuario` (
  `UsuarioTipo_id` int(11) NOT NULL,
  `Menu_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `menusuario` (`UsuarioTipo_id`, `Menu_id`) VALUES
(1, 1),
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(1, 6),
(1, 7),
(1, 8),
(1, 9),
(1, 10),
(1, 11),
(1, 12),
(1, 13),
(1, 14),
(2, 1),
(2, 2),
(2, 4),
(2, 7),
(2, 8),
(2, 10),
(2, 13),
(4, 1),
(4, 2),
(4, 8),
(4, 9),
(4, 12),
(4, 13),
(5, 1),
(5, 2),
(5, 3),
(5, 4),
(5, 5),
(5, 6),
(5, 7),
(5, 8),
(5, 9),
(5, 10),
(5, 11),
(5, 12),
(5, 13),
(5, 14);

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

--
-- Estructura de tabla para la tabla `producto`
--

CREATE TABLE `producto` (
  `id` int(11) NOT NULL,
  `Nombre` varchar(100) COLLATE utf16_spanish_ci NOT NULL,
  `UnidadMedida_id` char(5) COLLATE utf16_spanish_ci NOT NULL,
  `PrecioCompra` decimal(10,2) NOT NULL,
  `Precio` decimal(10,2) NOT NULL,
  `Stock` decimal(10,2) NOT NULL DEFAULT '0.00',
  `StockMinimo` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Marca` varchar(50) COLLATE utf16_spanish_ci NOT NULL,
  `Empresa_id` int(11) NOT NULL DEFAULT '0',
  `Serie` varchar(15) COLLATE utf16_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf16 CHECKSUM=1 COLLATE=utf16_spanish_ci;

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

INSERT INTO `producto` (`id`, `Nombre`, `UnidadMedida_id`, `PrecioCompra`, `Precio`, `Stock`, `StockMinimo`, `Marca`, `Empresa_id`, `Serie`) VALUES
(1, 'Cable', 'Metro', '5.40', '6.10', '10.00', '0.00', 'UTD', 4, 'CAB-UIO-BOD-1'),
(2, 'Tornillo', 'Uni', '0.30', '0.40', '0.00', '0.00', 'Tompo', 4, 'FER-UIO-BOD-2'),
(3, 'Interruptor', 'Uni', '4.60', '6.10', '0.00', '10.00', 'DIsma', 4, 'FER-UIO-BOD-2'),
(4, 'Foco', 'Uni', '4.76', '5.50', '29.00', '0.00', 'Luv', 4, 'ELEC-UIO-BOD-1'),
(5, 'Canaleta', 'uni', '4.56', '5.10', '9.00', '0.00', 'S/M', 4, 'CAB-UIO-BOD-1'),
(6, 'Multimetro', 'uni', '45.70', '50.00', '3.00', '10.00', 'hitachi', 4, 'ELEC-UIO-BOD-2'),
(7, 'Antena', 'uni', '10.80', '12.30', '0.00', '10.00', 'S/M', 4, 'ELEC-UIO-BOD-2'),
(8, 'Fusible 20w', 'uni', '0.35', '0.50', '5.00', '10.00', 'Hino', 4, 'ELEC-UIO-BOD-2'),
(9, 'panel solar', 'uni', '2450.00', '3400.00', '8.00', '10.00', 'solaritech', 4, 'ELEC-UIO-BOD-2'),
(10, 'Brochas', 'uni', '3.00', '3.69', '1.00', '10.00', 'Wilson', 4, 'FER-UIO-BOD-1'),
(11, 'Paneles solares', 'uni', '2500.00', '3000.00', '0.00', '10.00', 'Sun', 4, 'ELEC-UIO-BOD-2');

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

--
-- Estructura de tabla para la tabla `servicio`
--

CREATE TABLE `servicio` (
  `id` int(11) NOT NULL,
  `Nombre` varchar(100) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `PrecioCompra` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Precio` decimal(10,2) NOT NULL DEFAULT '0.00',
  `UnidadMedida_id` char(5) COLLATE utf16_spanish_ci NOT NULL DEFAULT 'UND',
  `Empresa_id` int(11) NOT NULL,
  `EmpresaCliente` varchar(50) COLLATE utf16_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `servicio` (`id`, `Nombre`, `PrecioCompra`, `Precio`, `UnidadMedida_id`, `Empresa_id`, `EmpresaCliente`) VALUES
(1, 'cableado eléctrico', '15.00', '20.00', 'UND', 4, '');

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

--
-- Estructura de tabla para la tabla `tabladato`
--

CREATE TABLE `tabladato` (
  `id` int(11) NOT NULL,
  `Relacion` varchar(20) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `Value` varchar(10) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `Nombre` varchar(50) COLLATE utf16_spanish_ci NOT NULL DEFAULT '0',
  `Orden` tinyint(4) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_spanish_ci;

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

INSERT INTO `tabladato` (`id`, `Relacion`, `Value`, `Nombre`, `Orden`) VALUES
(1, 'comprobantetipo', '1', 'Proforma', 1),
(3, 'comprobantetipo', '3', 'Factura', 3),
(5, 'comprobanteestado', '2', 'Aprobado', 1),
(6, 'comprobanteestado', '3', 'Anulado', 2),
(8, 'moneda', 'USD.', 'Dollar', 1),
(9, 'comprobanteestado', '1', 'Pendiente', 1),
(10, 'comprobanteestado', '4', 'Revisión', 2),
(11, 'usuariotipo', '1', 'Administrador', 1),
(12, 'usuariotipo', '2', 'Vendedor', 3),
(13, 'usuariotipo', '3', 'Super Usuario', 2),
(14, 'estilo', 'light', 'Light Theme', 0),
(15, 'estilo', 'dark', 'Dark Theme', 0),
(16, 'almacentipo', '1', 'Entrada', 0),
(17, 'almacentipo', '2', 'Salida', 0),
(18, 'almacentipo', '3', 'Devolución', 0),
(19, 'usuariotipo', '4', 'Bodeguero', 4),
(21, 'estadousuario', '1', 'Suspendido', 1),
(22, 'estadousuario', '2', 'Activo', 2);

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `almacen`
--
ALTER TABLE `almacen`
  ADD PRIMARY KEY (`id`),
  ADD KEY `almacen_producto` (`Producto_id`);

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

--
-- Indices de la tabla `comprobante`
--
ALTER TABLE `comprobante`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `Serie_Correlativo_Empresa_id` (`Serie`,`Correlativo`,`Empresa_id`);

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

--
-- Indices de la tabla `configuracion`
--
ALTER TABLE `configuracion`
  ADD PRIMARY KEY (`Empresa_id`);

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

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

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

--
-- Indices de la tabla `menusuario`
--
ALTER TABLE `menusuario`
  ADD PRIMARY KEY (`UsuarioTipo_id`,`Menu_id`);

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

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

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

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `almacen`
--
ALTER TABLE `almacen`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48;
--
-- AUTO_INCREMENT de la tabla `cliente`
--
ALTER TABLE `cliente`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT de la tabla `comprobante`
--
ALTER TABLE `comprobante`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
--
-- AUTO_INCREMENT de la tabla `comprobantedetalle`
--
ALTER TABLE `comprobantedetalle`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT de la tabla `empresa`
--
ALTER TABLE `empresa`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT de la tabla `menu`
--
ALTER TABLE `menu`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT de la tabla `menuhorizontal`
--
ALTER TABLE `menuhorizontal`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT de la tabla `producto`
--
ALTER TABLE `producto`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT de la tabla `servicio`
--
ALTER TABLE `servicio`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `tabladato`
--
ALTER TABLE `tabladato`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
