CREATE TABLE `ec_ventas_back` (
  `id_venta` int(11) NOT NULL,
  `fecha` date NOT NULL,
  `hora` time NOT NULL,
  `monto` float NOT NULL,
  `folio` varchar(45) COLLATE utf8_bin NOT NULL,
  `id_venta_back` int(11) NOT NULL,
  `id_forma_pago` int(11) NOT NULL,
  `se_importo` tinyint(4) NOT NULL,
  `secuencia` int(11) NOT NULL,
  `id_cliente` int(11) NOT NULL,
  `id_uso_cfdi` int(2) NOT NULL DEFAULT '2'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

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

INSERT INTO `ec_ventas_back` (`id_venta`, `fecha`, `hora`, `monto`, `folio`, `id_venta_back`, `id_forma_pago`, `se_importo`, `secuencia`, `id_cliente`, `id_uso_cfdi`) VALUES
(1, '2024-09-30', '12:31:50', 3220, 'CS1', 8287, 1, 1, 3, 1334, 14),
(2, '2024-09-30', '12:31:50', 169000, 'CS2', 8288, 1, 1, 3, 1, 9);

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

--
-- Estructura de tabla para la tabla `ec_venta_pagos`
--

CREATE TABLE `ec_venta_pagos` (
  `id_venta_pago` int(11) NOT NULL,
  `id_forma_pago` int(11) NOT NULL,
  `id_venta` int(11) NOT NULL,
  `monto` float(15,4) NOT NULL,
  `fecha_alta` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Estructura de tabla para la tabla `ec_venta_tienda_linea`
--

CREATE TABLE `ec_venta_tienda_linea` (
  `id` int(11) NOT NULL,
  `id_venta` int(11) NOT NULL,
  `metodo_pago` varchar(100) DEFAULT NULL,
  `forma_pago` varchar(100) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Estructura de tabla para la tabla `sys_ambientes_facturacion`
--

CREATE TABLE `sys_ambientes_facturacion` (
  `id_ambiente` int(11) NOT NULL,
  `nombre_ambiente` varchar(80) NOT NULL,
  `url_ambiente` varchar(200) NOT NULL,
  `usuario_integrador` varchar(80) NOT NULL,
  `activo` int(1) NOT NULL DEFAULT '1',
  `fecha_alta` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_ambientes_facturacion` (`id_ambiente`, `nombre_ambiente`, `url_ambiente`, `usuario_integrador`, `activo`, `fecha_alta`) VALUES
(1, 'Pruebas', 'https://cfdi33-pruebas.buzoncfdi.mx/Timbrado.asmx?wsdl', 'mvpNUXmQfK8=', 1, '2024-11-06 00:36:30'),
(2, 'Producción', 'http://timbracfdi33.mx/Timbrado.asmx?wsdl', '5B9R7VyF4IPL/hpgH21kAQ==', 1, '2024-11-06 00:36:30');

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

--
-- Estructura de tabla para la tabla `sys_catalogos`
--

CREATE TABLE `sys_catalogos` (
  `id_catalogo` int(11) UNSIGNED NOT NULL,
  `tabla` varchar(120) CHARACTER SET latin1 NOT NULL,
  `no_tabla` int(2) NOT NULL DEFAULT '0',
  `tab` varchar(60) CHARACTER SET latin1 NOT NULL DEFAULT 'NO',
  `campo` varchar(60) CHARACTER SET latin1 NOT NULL,
  `display` varchar(60) CHARACTER SET latin1 NOT NULL,
  `orden` int(10) UNSIGNED NOT NULL,
  `tipo` varchar(30) CHARACTER SET latin1 NOT NULL,
  `es_llave` tinyint(1) UNSIGNED DEFAULT '0',
  `visible` tinyint(1) UNSIGNED DEFAULT '1',
  `modificable` tinyint(1) UNSIGNED DEFAULT '1',
  `requerido` tinyint(1) NOT NULL DEFAULT '0',
  `valor_inicial` varchar(120) CHARACTER SET latin1 DEFAULT NULL,
  `clase` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `longitud` int(3) UNSIGNED DEFAULT NULL,
  `sql_combo` text CHARACTER SET latin1,
  `where_combo` text CHARACTER SET latin1,
  `order_combo` text CHARACTER SET latin1,
  `on_focus` text CHARACTER SET latin1,
  `on_blur` text CHARACTER SET latin1,
  `on_click` text CHARACTER SET latin1,
  `on_change` text CHARACTER SET latin1,
  `on_keypress` text CHARACTER SET latin1,
  `on_keydown` text CHARACTER SET latin1,
  `on_keyup` text CHARACTER SET latin1,
  `max_length` int(11) UNSIGNED DEFAULT NULL,
  `extensiones` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
  `especificacion` text CHARACTER SET latin1,
  `clase_esp` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `depende` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

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

INSERT INTO `sys_catalogos` (`id_catalogo`, `tabla`, `no_tabla`, `tab`, `campo`, `display`, `orden`, `tipo`, `es_llave`, `visible`, `modificable`, `requerido`, `valor_inicial`, `clase`, `longitud`, `sql_combo`, `where_combo`, `order_combo`, `on_focus`, `on_blur`, `on_click`, `on_change`, `on_keypress`, `on_keydown`, `on_keyup`, `max_length`, `extensiones`, `especificacion`, `clase_esp`, `depende`) VALUES
(1, 'sys_users', 0, 'NO', 'id_usuario', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(2, 'sys_users', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(3, 'sys_users', 0, 'NO', 'apellido_paterno', 'Apellido paterno', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(4, 'sys_users', 0, 'NO', 'apellido_materno', 'Apellido materno', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(5, 'sys_users', 0, 'NO', 'login', 'Login', 5, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(6, 'sys_users', 0, 'NO', 'telefono', 'Teléfono', 6, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(7, 'sys_users', 0, 'NO', 'correo', 'E-mail', 7, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(8, 'sys_users', 0, 'NO', 'contrasena', 'Cambiar contraseña', 8, 'PASSWORD', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(9, 'sys_users', 0, 'NO', 'puesto', 'Puesto', 12, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(10, 'sys_users', 0, 'NO', 'administrador', 'Es administrador', 19, 'BINARY', 0, 1, 1, 0, NULL, 'barra_dos', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(11, 'sys_users', 0, 'NO', 'id_sucursal', 'Sucursal', 20, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 1, 'SELECT\r\nid_sucursal,\r\nnombre\r\nFROM\r\n(\r\nSELECT\r\nid_sucursal,\r\nnombre\r\nFROM sys_sucursales\r\nUNION\r\nSELECT\r\n-1 as id_sucursal,\r\n\'-Multisucursal-\' as nombre\r\n) aux\r\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(12, 'sys_sucursales', 0, 'NO', 'id_sucursal', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(13, 'sys_sucursales', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 45, NULL, NULL, NULL, NULL),
(14, 'sys_sucursales', 0, 'NO', 'telefono', 'Teléfono', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, NULL, NULL, NULL),
(15, 'sys_sucursales', 0, 'NO', 'direccion', 'Dirección', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(16, 'sys_sucursales', 0, 'NO', 'descripcion', 'Descripción', 5, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(17, 'sys_sucursales', 0, 'NO', 'id_encargado', 'Encargado', 6, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT\r\nid,\r\nnombre\r\nFROM\r\n(\r\nSELECT\r\nid_usuario as id,\r\nCONCAT(nombre,\' \', apellido_paterno) as nombre\r\nFROM sys_users\r\nUNION\r\nSELECT\r\n-1 as id,\r\n\'-No aplica-\' as nombre\r\n) aux\r\nWHERE 1', ' AND id=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(18, 'sys_sucursales', 0, 'NO', 'id_razon_social', 'Razón social', 8, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT\r\nid,\r\nnombre\r\nFROM\r\n(\r\nSELECT\r\nid_sucursal as id,\r\nnombre\r\nFROM sys_sucursales\r\nUNION\r\nSELECT\r\n-1 as id,\r\n\'-No aplica-\' as nombre\r\n)aux\r\nWHERE 1', ' AND id=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(19, 'sys_conf_pantalla', 0, 'NO', 'id_configuracion_pantalla', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(20, 'sys_conf_pantalla', 0, 'NO', 'id_plantilla', 'Plantilla', 2, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_plantilla, nombre FROM sys_plantilla WHERE 1', ' AND id_plantilla=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(21, 'sys_conf_pantalla', 0, 'NO', 'imagen_logo', 'Logo', 3, 'FILE', 0, 1, 1, 0, NULL, 'barra_dos', 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(22, 'sys_paises', 0, 'NO', 'id_pais', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(23, 'sys_paises', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(24, 'sys_estados', 0, 'NO', 'id_estado', 'ID', 1, 'INT', 1, 1, 1, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(25, 'sys_estados', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(26, 'sys_estados', 0, 'NO', 'id_pais', 'País', 3, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_pais, nombre FROM sys_paises WHERE 1', ' AND id_pais=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(27, 'ec_conf_pedidos', 0, 'NO', 'id_conf_pedidos', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(28, 'ec_conf_pedidos', 0, 'NO', 'genera_aut_nv', 'Generar notas de venta automaticamente', 2, 'BINARY', 0, 1, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(29, 'ec_conf_pedidos', 0, 'NO', 'autorizar_pedidos', 'Autorizar notas de venta', 2, 'BINARY', 0, 1, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30, 'ec_conf_pedidos', 0, 'NO', 'surtir_aut_pedidos', 'Sustir pedidos automáticamente', 3, 'BINARY', 0, 1, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(31, 'ec_conf_pedidos', 0, 'NO', 'manejar_envios', 'Manejar envíos', 5, 'BINARY', 0, 1, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(32, 'ec_conf_pedidos', 0, 'NO', 'permitir_creditos', 'Permitir pagos diferidos', 6, 'BINARY', 0, 1, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(33, 'ec_conf_oc', 0, 'NO', 'id_conf_oc', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(34, 'ec_conf_oc', 0, 'NO', 'genera_aut_oc', 'Generar OC automáticamente', 2, 'BINARY', 0, 0, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(35, 'ec_conf_oc', 0, 'NO', 'autorizar_oc', 'Autorizar OC', 3, 'BINARY', 0, 0, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(36, 'ec_conf_oc', 0, 'NO', 'sutir_oc_aut', 'Surtir OC automáticamente', 4, 'BINARY', 0, 1, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(37, 'ec_conf_gral', 0, 'NO', 'id_configuracion', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(38, 'ec_conf_gral', 0, 'NO', 'smtp_server', 'Servidor SMTP', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(39, 'ec_conf_gral', 0, 'NO', 'smtp_user', 'Usuario SMTP', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(40, 'ec_conf_gral', 0, 'NO', 'smtp_pass', 'Password SMTP', 4, 'PASSWORD', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(41, 'ec_conf_gral', 0, 'NO', 'correo_envios', 'Correo de envío', 5, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(42, 'ec_conf_gral', 0, 'NO', 'nombre_correo', 'Nombre de envío', 6, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(43, 'ec_conf_gral', 0, 'NO', 'iva', 'IVA', 7, 'FLOAT', 0, 1, 1, 1, '16', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(44, 'ec_conf_gral', 0, 'NO', 'acceso_de', 'Permitir acceso desde', 8, 'TIME', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(45, 'ec_conf_gral', 0, 'NO', 'acceso_a', 'Permitir acceso hasta', 9, 'TIME', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(46, 'ec_proveedor', 0, 'NO', 'id_proveedor', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(47, 'ec_proveedor', 0, 'NO', 'nombre_comercial', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(48, 'ec_proveedor', 0, 'NO', 'dias_credito', 'Días de credito', 6, 'INT', 0, 1, 1, 0, '1', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL),
(49, 'ec_proveedor', 0, 'NO', 'monto_credito', 'Crédito maximo', 7, 'FLOAT', 0, 1, 1, 0, '0', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(50, 'ec_proveedor', 0, 'NO', 'rfc', 'RFC', 8, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, 'getMayus(this.value,this.id)', NULL, NULL, NULL, NULL, NULL, 15, NULL, NULL, NULL, NULL),
(51, 'ec_proveedor', 0, 'NO', 'razon_social', 'Razón social', 9, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(52, 'ec_proveedor', 0, 'NO', 'calle', 'Calle', 10, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(53, 'ec_proveedor', 0, 'NO', 'no_int', 'No. interior', 11, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(54, 'ec_proveedor', 0, 'NO', 'no_ext', 'No. Exterior', 12, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(55, 'ec_proveedor', 0, 'NO', 'colonia', 'Colonia', 13, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(56, 'ec_proveedor', 0, 'NO', 'del_municipio', 'Delegación/Municipio', 14, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(57, 'ec_proveedor', 0, 'NO', 'cp', 'CP', 15, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(60, 'ec_proveedor', 0, 'NO', 'id_sucursal', 'Sucursal', 18, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(61, 'ec_categoria', 0, 'NO', 'id_categoria', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(62, 'ec_categoria', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(63, 'ec_categoria', 0, 'NO', 'imagen', 'Imagen', 3, 'FILE', 0, 0, 1, 0, NULL, 'barra_dos', 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(64, 'ec_subcategoria', 0, 'NO', 'id_subcategoria', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(65, 'ec_subcategoria', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(66, 'ec_subcategoria', 0, 'NO', 'id_categoria', 'Familia', 3, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_categoria, nombre FROM ec_categoria WHERE 1', ' AND id_categoria=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(67, 'ec_subcategoria', 0, 'NO', 'imagen', 'Imagen', 4, 'FILE', 0, 0, 1, 0, NULL, 'barra_dos', 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(68, 'ec_productos', 0, 'NO', 'id_productos', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(69, 'ec_productos', 0, 'NO', 'clave', 'Código', 2, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, NULL, NULL, NULL),
(70, 'ec_productos', 0, 'NO', 'nombre', 'Nombre', 5, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(73, 'ec_productos', 0, 'NO', 'precio_venta', 'Precio de venta', 9, 'FLOAT', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(74, 'ec_productos', 0, 'NO', 'precio_compra', 'Precio de compra', 10, 'FLOAT', 0, 1, 0, 0, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(75, 'ec_productos', 0, 'NO', 'marca', 'Marca', 15, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(76, 'ec_productos', 0, 'NO', 'min_existencia', 'Mínimo en existencia', 15, 'INT', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(77, 'ec_productos', 0, 'NO', 'imagen', 'Imagen', 17, 'FILE', 0, 1, 1, 0, NULL, 'barra_dos', 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(78, 'ec_productos', 0, 'NO', 'observaciones', 'Observaciones', 17, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(79, 'ec_productos', 0, 'NO', 'inventariado', 'Es inventariado', 18, 'BINARY', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(81, 'ec_productos', 0, 'NO', 'genera_iva', 'Genera IVA', 0, 'BINARY', 0, 0, 1, 1, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'cambiaGI(this)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(82, 'ec_productos', 0, 'NO', 'genera_ieps', 'Genera IEPS', 0, 'BINARY', 0, 0, 1, 1, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'cambiaGIE(this)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(83, 'ec_productos', 0, 'NO', 'porc_iva', 'Porcentaje de IVA', 0, 'DECIMAL', 0, 0, 0, 1, '16', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL),
(84, 'ec_productos', 0, 'NO', 'porc_ieps', 'Porcentaje de IEPS', 0, 'BINARY', 0, 0, 0, 1, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL),
(93, 'ec_oc', 0, 'NO', 'id_orden_compra', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(94, 'ec_oc', 0, 'NO', 'folio', 'Folio', 5, 'CHAR', 0, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(95, 'ec_oc', 0, 'NO', 'id_proveedor', 'Proveedor', 2, 'BUSCADOR', 0, 1, 1, 1, NULL, 'barra_tres', 20, 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE nombre_comercial LIKE \'%$LLAVE%\' OR id_proveedor = \'$LLAVE\'', 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE id_proveedor=', 'ORDER BY nombre_comercial', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(96, 'ec_oc', 0, 'NO', 'fecha', 'Fecha', 6, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(98, 'ec_oc', 0, 'NO', 'id_usuario', 'Creada por', 8, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1 ', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(99, 'ec_oc', 0, 'NO', 'subtotal', 'Subtotal', 10, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(100, 'ec_oc', 0, 'NO', 'iva', 'IVA', 9, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(101, 'ec_oc', 0, 'NO', 'total', 'Total', 11, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(102, 'ec_oc', 0, 'NO', 'dias_pago', 'Plazo de pago', 15, 'INT', 0, 1, 1, 0, '0', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, 'Días', 'text_legend', NULL),
(103, 'ec_oc', 0, 'NO', 'observaciones', 'Observaciones', 14, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(104, 'ec_oc', 0, 'NO', 'pagada', 'Pagada', 13, 'BINARY', 0, 1, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(105, 'ec_oc', 0, 'NO', 'surtida', 'Recibida', 16, 'BINARY', 0, 1, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(106, 'ec_oc', 0, 'NO', 'id_sucursal', 'Sucursal', 12, 'COMBO', 0, 0, 0, 1, '$SUCURSAL', 'barra', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(107, 'ec_oc', 0, 'NO', 'fue_req', 'fue_req', 17, 'BINARY', 0, 0, 0, 1, '0', 'barra', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(108, 'ec_movimiento_almacen', 0, 'NO', 'id_movimiento_almacen', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(109, 'ec_movimiento_almacen', 0, 'NO', 'id_tipo_movimiento', 'Tipo de movimiento', 3, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 1, 'SELECT id_tipo_movimiento, nombre FROM ec_tipos_movimiento WHERE 1', 'AND id_tipo_movimiento=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(110, 'ec_movimiento_almacen', 0, 'NO', 'fecha', 'Fecha', 4, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(111, 'ec_movimiento_almacen', 0, 'NO', 'id_usuario', 'Creada por', 6, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(112, 'ec_movimiento_almacen', 0, 'NO', 'hora', 'Hora', 5, 'TIME', 0, 1, 0, 1, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(113, 'ec_movimiento_almacen', 0, 'NO', 'lote', 'Lote', 7, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, NULL, NULL, NULL),
(114, 'ec_movimiento_almacen', 0, 'NO', 'id_pedido', 'Pedido', 8, 'BUSCADOR', 0, 1, 0, 0, '-1', 'barra', 15, 'SELECT id_pedido, folio_pedido FROM ec_pedidos', 'SELECT\r\nid_pedido,\r\nfolio_pedido\r\nFROM\r\n(\r\nSELECT id_pedido, folio_pedido FROM ec_pedidos\r\nUNION SELECT -1 AS id_pedido, \'No aplica\' AS folio_pedido\r\n)aux WHERE id_pedido=', 'ORDER BY folio_pedido', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(115, 'ec_movimiento_almacen', 0, 'NO', 'id_orden_compra', 'Orden de compra', 9, 'BUSCADOR', 0, 1, 0, 0, '-1', 'barra', 15, 'SELECT\r\nid_orden_compra,\r\nfolio\r\nFROM\r\n(\r\nSELECT id_orden_compra, folio FROM ec_ordenes_compra\r\nUNION\r\nSELECT -1 AS id_orden_compra, \'No aplica\' AS folio\r\n)aux', 'SELECT\r\nid_orden_compra,\r\nfolio\r\nFROM\r\n(\r\nSELECT id_orden_compra, folio FROM ec_ordenes_compra\r\nUNION\r\nSELECT -1 AS id_orden_compra, \'No aplica\' AS folio\r\n)aux WHERE id_orden_compra=', 'ORDER BY folio', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(116, 'ec_movimiento_almacen', 0, 'NO', 'observaciones', 'Observaciones', 11, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(117, 'ec_movimiento_almacen', 0, 'NO', 'id_sucursal', 'Sucursal', 12, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(118, 'ec_guias', 0, 'NO', 'id_guia', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(119, 'ec_guias', 0, 'NO', 'numero', 'Número', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(120, 'ec_guias', 0, 'NO', 'id_tipo_guia', 'Tipo de guía', 3, 'COMBO', 0, 1, 1, 1, '', 'barra_tres', 11, 'SELECT id_tipo_guia, CONCAT(empresa, \', \', kilogramos, \' Kg\', \', \', kilometros, \' Km\') FROM ec_tipos_guia', 'AND id_tipo_guia=', 'ORDER BY CONCAT(empresa, \', \', kilogramos, \' Kg\', \', \', kilometros, \' Km\')', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(121, 'ec_guias', 0, 'NO', 'id_pedido', 'Pedido', 4, 'BUSCADOR', 0, 1, 0, 0, '-1', 'barra', 15, 'SELECT id_pedido, folio_pedido FROM ec_pedidos', 'SELECT\r\nid_pedido,\r\nfolio_pedido\r\nFROM\r\n(\r\nSELECT id_pedido, folio_pedido FROM ec_pedidos\r\nUNION SELECT -1 AS id_pedido, \'No aplica\' AS folio_pedido\r\n)aux WHERE id_pedido=', 'ORDER BY folio_pedido', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(122, 'ec_guias', 0, 'NO', 'usada', 'Utilizada', 5, 'BINARY', 0, 1, 1, 1, '0', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(123, 'ec_tipos_guia', 0, 'NO', 'id_tipo_guia', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(124, 'ec_tipos_guia', 0, 'NO', 'kilometros', 'Kilometros', 2, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(125, 'ec_tipos_guia', 0, 'NO', 'kilogramos', 'Kilogramos', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(126, 'ec_tipos_guia', 0, 'NO', 'empresa', 'Empresa', 4, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(127, 'ec_repartidores', 0, 'NO', 'id_repartidor', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(128, 'ec_repartidores ', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(129, 'ec_repartidores ', 0, 'NO', 'apellido_paterno', 'Apellido paterno', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(130, 'ec_repartidores', 0, 'NO', 'apellido_materno', 'Apellido materno', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(131, 'ec_repartidores', 0, 'NO', 'telefono', 'Teléfono', 5, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(132, 'ec_repartidores', 0, 'NO', 'direccion', 'Dirección', 6, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(133, 'ec_repartidores', 0, 'NO', 'movil', 'Télefono cel.', 7, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(134, 'ec_repartidores', 0, 'NO', 'id_sucursal', 'Sucursal', 8, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(135, 'ec_transportes', 0, 'NO', 'id_transporte', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(136, 'ec_transportes', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(137, 'ec_transportes', 0, 'NO', 'placas', 'Placas', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(138, 'ec_transportes', 0, 'NO', 'marca', 'Marca', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(139, 'ec_transportes', 0, 'NO', 'modelo', 'Modelo', 5, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(140, 'ec_transportes', 0, 'NO', 'anio', 'Año', 6, 'INT', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(141, 'ec_transportes', 0, 'NO', 'id_sucursal', 'Sucursal', 7, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(142, 'ec_rutas', 0, 'NO', 'id_ruta', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(143, 'ec_rutas', 0, 'NO', 'id_repartidor', 'Repartidor', 2, 'COMBO', 0, 1, 1, 1, '', 'barra_tres', 11, 'SELECT id_repartidor, CONCAT(nombre, \' \', apellido_paterno) FROM ec_repartidores WHERE 1', 'AND id_repartidor=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(144, 'ec_rutas', 0, 'NO', 'id_transporte', 'Transporte', 3, 'COMBO', 0, 1, 1, 1, '', 'barra_tres', 11, 'SELECT id_transporte, nombre FROM ec_transportes WHERE 1', 'AND id_transporte=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(145, 'ec_rutas', 0, 'NO', 'id_ayudante_1', 'Ayudante', 4, 'COMBO', 0, 1, 1, 0, '', 'barra_dos', 11, 'SELECT\r\nid_repartidor,\r\nnombre\r\nFROM\r\n(\r\nSELECT id_repartidor, CONCAT(nombre, \' \', apellido_paterno) AS nombre FROM ec_repartidores\r\nUNION\r\nSELECT -1, \'-No aplica-\'\r\n)aux WHERE 1', 'AND id_repartidor=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(146, 'ec_rutas', 0, 'NO', 'id_ayudante_2', '2º ayudante', 5, 'COMBO', 0, 1, 1, 0, '', 'barra_dos', 11, 'SELECT\r\nid_repartidor,\r\nnombre\r\nFROM\r\n(\r\nSELECT id_repartidor, CONCAT(nombre, \' \', apellido_paterno) AS nombre FROM ec_repartidores\r\nUNION\r\nSELECT -1, \'-No aplica-\'\r\n)aux WHERE 1', 'AND id_repartidor=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(147, 'ec_rutas', 0, 'NO', 'fecha_partida', 'Fecha de partida', 6, 'DATE', 0, 1, 1, 1, '$DATE', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(148, 'ec_rutas', 0, 'NO', 'hora_partida', 'Hora de partida', 7, 'TIME', 0, 1, 1, 1, '$TIME', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(149, 'ec_rutas', 0, 'NO', 'fecha_regreso', 'Fecha de regreso', 8, 'DATE', 0, 1, 1, 0, '', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(150, 'ec_rutas', 0, 'NO', 'hora_regreso', 'Hora de regreso', 9, 'TIME', 0, 1, 1, 0, '', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(151, 'ec_rutas', 0, 'NO', 'id_usuario', 'Creada por', 10, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(152, 'ec_rutas', 0, 'NO', 'entregado', 'Terminado', 11, 'BINARY', 0, 1, 1, 1, '0', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(153, 'ec_rutas', 0, 'NO', 'id_sucursal', 'Sucursal', 12, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(154, 'ec_tipos_movimiento', 0, 'NO', 'id_tipo_movimiento', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(155, 'ec_tipos_movimiento', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(156, 'ec_tipos_movimiento', 0, 'NO', 'afecta', 'Tipo', 3, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT\r\nid,\r\nnombre\r\nFROM\r\n(\r\nSELECT 1 AS id, \'Suma\' AS nombre\r\nUNION\r\nSELECT -1 AS id, \'Resta\' AS nombre\r\n)aux\r\nWHERE 1', ' AND id=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(157, 'ec_tipos_envio', 0, 'NO', 'id_tipo_envio', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(158, 'ec_tipos_envio', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(159, 'ec_notas_credito', 0, 'NO', 'id_nota_credito', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(160, 'ec_notas_credito', 0, 'NO', 'id_cliente', 'Cliente', 2, 'BUSCADOR', 0, 0, 0, 0, '-1', 'barra', 15, 'SELECT id_cliente, nombre FROM ec_clientes', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(161, 'ec_notas_credito', 0, 'NO', 'folio', 'Folio', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(162, 'ec_notas_credito', 0, 'NO', 'id_proveedor', 'Proveedor', 4, 'BUSCADOR', 0, 1, 1, 1, NULL, 'barra_tres', 20, 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE nombre_comercial LIKE \'%$LLAVE%\' OR id_proveedor = \'$LLAVE\'', 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE id_proveedor=', 'ORDER BY nombre_comercial', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(163, 'ec_notas_credito', 0, 'NO', 'id_concepto_nc', 'Concepto', 5, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_concepto, nombre FROM ec_concepto_nc WHERE 1', ' AND id_concepto=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(164, 'ec_notas_credito', 0, 'NO', 'fecha', 'Fecha', 7, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(165, 'ec_notas_credito', 0, 'NO', 'id_usuario', 'Creada por', 8, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(166, 'ec_notas_credito', 0, 'NO', 'subtotal', 'Subtotal', 8, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(167, 'ec_notas_credito', 0, 'NO', 'iva', 'IVA', 9, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(168, 'ec_notas_credito', 0, 'NO', 'total', 'Total', 10, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(169, 'ec_notas_credito', 0, 'NO', 'id_oc', 'Orden de compra', 11, 'BUSCADOR', 0, 1, 1, 0, '', 'barra_dos', 15, 'SELECT id_orden_compra, folio FROM ec_ordenes_compra WHERE id_estatus_oc IN(4,5,7) AND (folio LIKE \'%$LLAVE%\' OR id_orden_compra=\'$LLAVE\')', 'SELECT id_orden_compra, folio FROM ec_ordenes_compra WHERE id_orden_compra=', 'ORDER BY folio', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(170, 'ec_notas_credito', 0, 'NO', 'observaciones', 'Observaciones', 12, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(171, 'ec_notas_credito', 0, 'NO', 'tipo_nc', 'tipo_nc', 12, 'INT', 0, 0, 0, 0, '1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(172, 'ec_notas_credito', 0, 'NO', 'id_pedido', 'id_pedido', 13, 'INT', 0, 0, 0, 0, '-1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(173, 'ec_notas_credito', 0, 'NO', 'id_sucursal', 'Sucursal', 14, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(174, 'ec_nota_cargo', 0, 'NO', 'id_nota_cargo', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(175, 'ec_nota_cargo', 0, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(176, 'ec_nota_cargo', 0, 'NO', 'id_proveedor', 'Proveedor', 3, 'BUSCADOR', 0, 1, 1, 1, '', 'barra_tres', 20, 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE nombre_comercial LIKE \'%$LLAVE%\' OR id_proveedor = \'$LLAVE\'', 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE id_proveedor=', 'ORDER BY nombre_comercial', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(177, 'ec_nota_cargo', 0, 'NO', 'fecha', 'Fecha', 4, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(178, 'ec_nota_cargo', 0, 'NO', 'id_concepto_ncg', 'Concepto', 5, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_concepto, nombre FROM ec_concepto_ncg WHERE 1', ' AND id_concepto=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(179, 'ec_nota_cargo', 0, 'NO', 'subtotal', 'Subtotal', 6, 'FLOAT', 0, 1, 1, 1, '0', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(180, 'ec_nota_cargo', 0, 'NO', 'iva', 'IVA', 7, 'FLOAT', 0, 1, 1, 1, '0', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(181, 'ec_nota_cargo', 0, 'NO', 'total', 'Total', 8, 'FLOAT', 0, 1, 1, 1, '0', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(182, 'ec_nota_cargo', 0, 'NO', 'observaciones', 'Observaciones', 9, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(183, 'ec_nota_cargo', 0, 'NO', 'id_cliente', 'id_cliente', 10, 'INT', 0, 0, 0, 0, '-1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(184, 'ec_nota_cargo', 0, 'NO', 'tipo_nc', 'tipo_nc', 12, 'INT', 0, 0, 0, 0, '1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(185, 'ec_nota_cargo', 0, 'NO', 'id_sucursal', 'Sucursal', 13, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(186, 'ec_clientes', 0, 'NO', 'id_cliente', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(187, 'ec_clientes', 0, 'NO', 'nombre', 'RFC', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(188, 'ec_clientes', 0, 'NO', 'telefono', 'Teléfono', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(189, 'ec_clientes', 0, 'NO', 'telefono_2', 'Teléfono 2', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(190, 'ec_clientes', 0, 'NO', 'movil', 'Teléfono cel.', 5, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(191, 'ec_clientes', 0, 'NO', 'email', 'E-mail', 6, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(192, 'ec_clientes', 0, 'NO', 'contacto', 'Contacto', 7, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(193, 'ec_clientes', 0, 'NO', 'dias_credito', 'Plazo de cobro', 8, 'INT', 0, 1, 1, 0, '0', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, 'Días', 'text_legend', NULL),
(194, 'ec_clientes', 0, 'NO', 'maximo_adeudo', 'Deuda máxima', 9, 'FLOAT', 0, 1, 1, 0, '0', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(195, 'ec_clientes', 0, 'NO', 'es_cliente', 'es_cliente', 13, 'BINARY', 0, 0, 0, 0, '1', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(196, 'ec_clientes', 0, 'NO', 'id_sucursal', 'Sucursal', 14, 'COMBO', 0, 0, 0, 1, '$SUCURSAL', 'barra', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(197, 'ec_pedidos', 0, 'NO', 'id_pedido', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(198, 'ec_pedidos', 0, 'NO', 'folio_pedido', 'Folio', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(199, 'ec_pedidos', 0, 'NO', 'id_cliente', 'Cliente', 3, 'BUSCADOR', 0, 1, 1, 1, '', 'barra_tres', 20, 'SELECT id_cliente, nombre FROM ec_clientes WHERE nombre LIKE \'%$LLAVE%\' OR id_cliente = \'$LLAVE\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(200, 'ec_pedidos', 0, 'NO', 'fecha_alta', 'Fecha', 4, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(201, 'ec_pedidos', 0, 'NO', 'id_direccion', 'Dirección de entrega', 6, 'COMBO', 0, 1, 1, 1, '-1', 'barra_tres', 11, 'SELECT\r\nid_clientes_de,\r\ndireccion\r\nFROM\r\n(\r\nSELECT\r\nid_clientes_de,\r\nCONCAT(calle, \' #\', no_ext, \', Col. \', colonia) AS direccion\r\nFROM ec_clientes_domentrega\r\nWHERE id_cliente=\'$llaveDep\'\r\nUNION\r\nSELECT\r\n-1,\r\n\'No aplica\'\r\n)aux', 'AND id_clientes_de=', 'ORDER BY direccion', NULL, NULL, 'habilitaDir(this.value)', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 199),
(202, 'ec_pedidos', 0, 'NO', 'direccion', 'Dirección', 7, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(203, 'ec_pedidos', 0, 'NO', 'subtotal', 'Subtotal', 8, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(204, 'ec_pedidos', 0, 'NO', 'iva', 'IVA', 10, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(205, 'ec_pedidos', 0, 'NO', 'total', 'Total', 12, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(206, 'ec_pedidos', 0, 'NO', 'ieps', 'IEPS', 11, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(207, 'ec_pedidos', 0, 'NO', 'id_usuario', 'Creada por', 13, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(208, 'ec_pedidos', 0, 'NO', 'pagado', 'Pagado', 14, 'BINARY', 0, 1, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(209, 'ec_pedidos', 0, 'NO', 'surtido', 'Surtido', 15, 'BINARY', 0, 1, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(210, 'ec_pedidos', 0, 'NO', 'enviado', 'Entregado', 16, 'BINARY', 0, 1, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(211, 'ec_pedidos', 0, 'NO', 'id_moneda', 'id_moneda', 17, 'INT', 0, 0, 0, 0, '1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(212, 'ec_pedidos', 0, 'NO', 'id_razon_social', 'id_razon_social', 18, 'INT', 0, 0, 0, 0, '-1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(213, 'ec_pedidos', 0, 'NO', 'id_sucursal', 'Sucursal', 19, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(214, 'ec_pedidos', 0, 'NO', 'fue_cot', 'fue_cot', 20, 'INT', 0, 0, 0, 0, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(215, 'ec_pedidos', 0, 'NO', 'id_estatus', 'Estatus', 5, 'COMBO', 0, 1, 0, 1, '1', 'barra_tres', 11, 'SELECT id_estatus, nombre FROM ec_estatus_pedido WHERE 1', 'AND id_estatus=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(216, 'ec_pedidos', 1, 'NO', 'id_pedido', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(217, 'ec_pedidos', 1, 'NO', 'folio_nv', 'Folio', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(218, 'ec_pedidos', 1, 'NO', 'id_cliente', 'Cliente', 3, 'BUSCADOR', 0, 1, 1, 1, '', 'barra_tres', 20, 'SELECT id_cliente, nombre FROM ec_clientes WHERE nombre LIKE \'%$LLAVE%\' OR id_cliente = \'$LLAVE\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(219, 'ec_pedidos', 1, 'NO', 'fecha_alta', 'Fecha', 4, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(220, 'ec_pedidos', 1, 'NO', 'id_estatus', 'Estatus', 5, 'COMBO', 0, 0, 0, 1, '2', 'barra_tres', 11, 'SELECT id_estatus, nombre FROM ec_estatus_pedido WHERE 1', 'AND id_estatus=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(221, 'ec_pedidos', 1, 'NO', 'id_direccion', 'Dirección de entrega', 6, 'COMBO', 0, 1, 1, 1, '-1', 'barra_tres', 11, 'SELECT\r\nid_clientes_de,\r\ndireccion\r\nFROM\r\n(\r\nSELECT\r\nid_clientes_de,\r\nCONCAT(calle, \' #\', no_ext, \', Col. \', colonia) AS direccion\r\nFROM ec_clientes_domentrega\r\nWHERE id_cliente=\'$llaveDep\'\r\nUNION\r\nSELECT\r\n-1,\r\n\'No aplica\'\r\n)aux', 'AND id_clientes_de=', 'ORDER BY direccion', NULL, NULL, 'habilitaDir(this.value)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 218),
(222, 'ec_pedidos', 1, 'NO', 'direccion', 'Dirección', 7, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(223, 'ec_pedidos', 1, 'NO', 'id_moneda', 'Moneda', 8, 'COMBO', 0, 1, 1, 1, '1', 'barra_tres', 15, 'SELECT id_moneda, nombre FROM ec_monedas WHERE 1', 'AND id_moneda=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(224, 'ec_pedidos', 1, 'NO', 'subtotal', 'Subtotal', 9, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(225, 'ec_pedidos', 1, 'NO', 'iva', 'IVA', 11, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(226, 'ec_pedidos', 1, 'NO', 'ieps', 'IEPS', 12, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(227, 'ec_pedidos', 1, 'NO', 'total', 'Total', 13, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(228, 'ec_pedidos', 1, 'NO', 'id_usuario', 'Creada por', 14, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(229, 'ec_pedidos', 1, 'NO', 'dias_proximo', 'Proxima llamada en', 15, 'INT', 0, 1, 1, 0, '0', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL),
(230, 'ec_pedidos', 1, 'NO', 'pagado', 'Pagado', 16, 'BINARY', 0, 1, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(231, 'ec_pedidos', 1, 'NO', 'surtido', 'Surtido', 17, 'BINARY', 0, 1, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(232, 'ec_pedidos', 1, 'NO', 'enviado', 'Entregado', 18, 'BINARY', 0, 1, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(233, 'ec_pedidos', 1, 'NO', 'id_razon_social', 'id_razon_social', 19, 'INT', 0, 0, 0, 0, '-1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(234, 'ec_pedidos', 1, 'NO', 'id_sucursal', 'Sucursal', 20, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(235, 'ec_pedidos', 1, 'NO', 'fue_cot', 'fue_cot', 21, 'INT', 0, 0, 0, 0, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(236, 'ec_pedidos', 2, 'NO', 'id_pedido', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL);
INSERT INTO `sys_catalogos` (`id_catalogo`, `tabla`, `no_tabla`, `tab`, `campo`, `display`, `orden`, `tipo`, `es_llave`, `visible`, `modificable`, `requerido`, `valor_inicial`, `clase`, `longitud`, `sql_combo`, `where_combo`, `order_combo`, `on_focus`, `on_blur`, `on_click`, `on_change`, `on_keypress`, `on_keydown`, `on_keyup`, `max_length`, `extensiones`, `especificacion`, `clase_esp`, `depende`) VALUES
(237, 'ec_pedidos', 2, 'NO', 'folio_cotizacion', 'Folio', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(238, 'ec_pedidos', 2, 'NO', 'id_cliente', 'Cliente', 3, 'BUSCADOR', 0, 1, 1, 1, '', 'barra_tres', 20, 'SELECT id_cliente, nombre FROM ec_clientes WHERE nombre LIKE \'%$LLAVE%\' OR id_cliente = \'$LLAVE\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(239, 'ec_pedidos', 2, 'NO', 'fecha_alta', 'Fecha', 4, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(240, 'ec_pedidos', 2, 'NO', 'id_estatus', 'Estatus', 5, 'COMBO', 0, 0, 0, 1, '8', 'barra_tres', 11, 'SELECT id_estatus, nombre FROM ec_estatus_pedido WHERE 1', 'AND id_estatus=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(241, 'ec_pedidos', 2, 'NO', 'id_direccion', 'Dirección de entrega', 6, 'COMBO', 0, 0, 0, 0, '-1', 'barra_tres', 11, 'SELECT id_clientes_de, CONCAT(calle, \' #\', no_ext, \', Col. \', colonia) FROM ec_clientes_domentrega WHERE 1', 'AND id_clientes_de=', 'ORDER BY CONCAT(calle, \' #\', no_ext, \', Col. \', colonia)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(242, 'ec_pedidos', 2, 'NO', 'subtotal', 'Subtotal', 7, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(243, 'ec_pedidos', 2, 'NO', 'iva', 'IVA', 8, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(244, 'ec_pedidos', 2, 'NO', 'ieps', 'IEPS', 9, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(245, 'ec_pedidos', 2, 'NO', 'total', 'Total', 10, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(246, 'ec_pedidos', 2, 'NO', 'id_usuario', 'Creada por', 11, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(247, 'ec_pedidos', 2, 'NO', 'id_moneda', 'id_moneda', 12, 'INT', 0, 0, 0, 0, '1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(248, 'ec_pedidos', 2, 'NO', 'id_razon_social', 'id_razon_social', 13, 'INT', 0, 0, 0, 0, '-1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(249, 'ec_pedidos', 2, 'NO', 'fue_cot', 'fue_cot', 14, 'INT', 0, 0, 0, 0, '1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(250, 'ec_pedidos', 2, 'NO', 'id_sucursal', 'Sucursal', 15, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(251, 'ec_clientes', 1, 'NO', 'id_cliente', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(252, 'ec_clientes', 1, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(253, 'ec_clientes', 1, 'NO', 'telefono', 'Teléfono', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(254, 'ec_clientes', 1, 'NO', 'email', 'E-mail', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(255, 'ec_clientes', 1, 'NO', 'es_cliente', 'es_cliente', 5, 'BINARY', 0, 0, 0, 0, '0', 'barra', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(256, 'ec_clientes', 1, 'NO', 'id_sucursal', 'Sucursal', 6, 'COMBO', 0, 0, 0, 1, '$SUCURSAL', 'barra', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(257, 'ec_notas_credito', 1, 'NO', 'id_nota_credito', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(258, 'ec_notas_credito', 1, 'NO', 'id_cliente', 'Cliente', 3, 'BUSCADOR', 0, 1, 1, 1, '', 'barra_tres', 20, 'SELECT id_cliente, nombre FROM ec_clientes WHERE nombre LIKE \'%$LLAVE%\' AND id_cliente=\'$LLAVE\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(259, 'ec_notas_credito', 1, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(260, 'ec_notas_credito', 1, 'NO', 'id_proveedor', 'Proveedor', 4, 'BUSCADOR', 0, 0, 0, 0, '1', 'barra_tres', 20, 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE nombre_comercial LIKE \'%$LLAVE%\' OR id_proveedor = \'$LLAVE\'', 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE id_proveedor=', 'ORDER BY nombre_comercial', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(261, 'ec_notas_credito', 1, 'NO', 'id_concepto_nc', 'Concepto', 5, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_concepto, nombre FROM ec_concepto_nc WHERE 1', ' AND id_concepto=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(262, 'ec_notas_credito', 1, 'NO', 'fecha', 'Fecha', 7, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(263, 'ec_notas_credito', 1, 'NO', 'id_usuario', 'Creada por', 8, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(264, 'ec_notas_credito', 1, 'NO', 'subtotal', 'Subtotal', 8, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(265, 'ec_notas_credito', 1, 'NO', 'iva', 'IVA', 9, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(266, 'ec_notas_credito', 1, 'NO', 'total', 'Total', 10, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(267, 'ec_notas_credito', 1, 'NO', 'id_oc', 'Orden de compra', 11, 'BUSCADOR', 0, 0, 0, 0, '-1', 'barra', 15, 'SELECT\r\nid_orden_compra,\r\nfolio\r\nFROM\r\n(\r\nSELECT id_orden_compra, folio FROM ec_ordenes_compra\r\nUNION\r\nSELECT -1 AS id_orden_compra, \'No aplica\' AS folio\r\n)aux', 'SELECT\r\nid_orden_compra,\r\nfolio\r\nFROM\r\n(\r\nSELECT id_orden_compra, folio FROM ec_ordenes_compra\r\nUNION\r\nSELECT -1 AS id_orden_compra, \'No aplica\' AS folio\r\n)aux WHERE id_orden_compra=', 'ORDER BY folio', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(268, 'ec_notas_credito', 1, 'NO', 'observaciones', 'Observaciones', 12, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(269, 'ec_notas_credito', 1, 'NO', 'tipo_nc', 'tipo_nc', 12, 'INT', 0, 0, 0, 0, '2', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(270, 'ec_notas_credito', 1, 'NO', 'id_pedido', 'Pedido', 13, 'BUSCADOR', 0, 1, 1, 1, '-1', 'barra_dos', 15, 'SELECT id_pedido, folio_pedido FROM ec_pedidos WHERE folio_pedido LIKE \'%$LLAVE%\' OR id_pedido=\'$LLAVE\'', 'SELECT id_pedido, folio_pedido FROM ec_pedidos WHERE id_pedido=', 'ORDER BY folio_pedido', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(271, 'ec_notas_credito', 1, 'NO', 'id_sucursal', 'Sucursal', 14, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(272, 'ec_nota_cargo', 1, 'NO', 'id_nota_cargo', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(273, 'ec_nota_cargo', 1, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(274, 'ec_nota_cargo', 1, 'NO', 'id_cliente', 'Cliente', 3, 'BUSCADOR', 0, 1, 1, 1, '', 'barra_tres', 15, 'SELECT id_cliente, nombre FROM ec_clientes WHERE nombre LIKE \'%$LLAVE%\' OR id_cliente = \'$LLAVE\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(275, 'ec_nota_cargo', 1, 'NO', 'fecha', 'Fecha', 4, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(276, 'ec_nota_cargo', 1, 'NO', 'id_concepto_ncg', 'Concepto', 5, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_concepto, nombre FROM ec_concepto_ncg WHERE 1', ' AND id_concepto=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(277, 'ec_nota_cargo', 1, 'NO', 'subtotal', 'Subtotal', 6, 'FLOAT', 0, 1, 1, 1, '0', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(278, 'ec_nota_cargo', 1, 'NO', 'iva', 'IVA', 7, 'FLOAT', 0, 1, 1, 1, '0', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(279, 'ec_nota_cargo', 1, 'NO', 'total', 'Total', 8, 'FLOAT', 0, 1, 1, 1, '0', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(280, 'ec_nota_cargo', 1, 'NO', 'id_proveedor', 'id_proveedor', 10, 'INT', 0, 0, 0, 0, '1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(281, 'ec_nota_cargo', 1, 'NO', 'tipo_nc', 'tipo_nc', 12, 'INT', 0, 0, 0, 0, '1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(282, 'ec_nota_cargo', 1, 'NO', 'id_sucursal', 'Sucursal', 13, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(283, 'ec_precios', 0, 'NO', 'id_precio', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(285, 'ec_precios', 0, 'NO', 'fecha', 'Fecha', 3, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(286, 'ec_precios', 0, 'NO', 'id_usuario', 'Creada por', 4, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(288, 'ec_vendedores', 0, 'NO', 'id_vendedor', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(289, 'ec_vendedores', 0, 'NO', 'id_usuario', 'Usuario asignado', 2, 'COMBO', 0, 1, 1, 1, '', 'barra_tres', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(290, 'ec_vendedores', 0, 'NO', 'es_porcxventa', 'Porcentaje por venta', 3, 'BINARY', 0, 1, 1, 0, '0', 'barra_dos', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(291, 'ec_vendedores', 0, 'NO', 'porc_venta', 'Porcentaje', 4, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, '%', NULL, NULL),
(292, 'ec_vendedores', 0, 'NO', 'es_montoxventa', 'Monto por venta', 5, 'BINARY', 0, 1, 1, 1, '0', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(293, 'ec_vendedores', 0, 'NO', 'montoxventa', 'Monto', 6, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, '', NULL, NULL),
(294, 'ec_vendedores', 0, 'NO', 'es_metas_venta', 'Metas de venta', 7, 'BINARY', 0, 1, 1, 1, '0', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(295, 'ec_vendedores', 0, 'NO', 'id_sucursal', 'Sucursal', 8, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(296, 'ec_cuentas_por_pagar', 0, 'NO', 'id_cxp', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(297, 'ec_cuentas_por_pagar', 0, 'NO', 'id_proveedor', 'Proveedor', 2, 'BUSCADOR', 0, 1, 0, 1, NULL, 'barra', 20, 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE nombre_comercial LIKE \'%$LLAVE%\' OR id_proveedor = \'$LLAVE\'', 'SELECT id_proveedor, nombre_comercial FROM ec_proveedor WHERE id_proveedor=', 'ORDER BY nombre_comercial', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(298, 'ec_cuentas_por_pagar', 0, 'NO', 'monto', 'Monto', 3, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, '', NULL, NULL),
(299, 'ec_cuentas_por_pagar', 0, 'NO', 'abonado', 'Abonado', 4, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, '', NULL, NULL),
(300, 'ec_cuentas_por_pagar', 0, 'NO', 'dias_pago', 'Días para pago', 5, 'INT', 0, 1, 1, 0, '1', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL),
(301, 'ec_cuentas_por_pagar', 0, 'NO', 'fecha_ultimo_pago', 'Fecha de ultimo pago', 6, 'DATE', 0, 1, 0, 1, '', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(302, 'ec_cuentas_por_pagar', 0, 'NO', 'id_oc', 'Orden de compra', 7, 'BUSCADOR', 0, 1, 0, 0, '-1', 'barra', 15, 'SELECT id_orden_compra, folio FROM ec_ordenes_compra\r\n', 'SELECT id_orden_compra, folio FROM ec_ordenes_compra WHERE id_orden_compra=', 'ORDER BY folio', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(303, 'ec_cuentas_por_pagar', 0, 'NO', 'id_nc', 'Nota de cargo', 8, 'BUSCADOR', 0, 1, 0, 0, '-1', 'barra', 15, 'SELECT id_nota_cargo, folio FROM ec_nota_cargo\r\n', 'SELECT id_nota_cargo, folio FROM ec_nota_cargo WHERE id_nota_cargo=', 'ORDER BY folio', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(304, 'ec_cuentas_por_pagar', 0, 'NO', 'id_sucursal', 'Sucursal', 9, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(305, 'ec_cuentas_por_cobrar', 0, 'NO', 'id_cxc', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(306, 'ec_cuentas_por_cobrar', 0, 'NO', 'id_cliente', 'Cliente', 2, 'BUSCADOR', 0, 1, 0, 1, NULL, 'barra', 20, 'SELECT id_cliente, nombre FROM ec_clientes WHERE nombre LIKE \'%$LLAVE%\' OR id_cliente = \'$LLAVE\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(307, 'ec_cuentas_por_cobrar', 0, 'NO', 'monto', 'Monto', 3, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, '', NULL, NULL),
(308, 'ec_cuentas_por_cobrar', 0, 'NO', 'abonado', 'Abonado', 4, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, '', NULL, NULL),
(309, 'ec_cuentas_por_cobrar', 0, 'NO', 'dias_pago', 'Días para cobro', 5, 'INT', 0, 1, 1, 0, '1', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL),
(310, 'ec_cuentas_por_cobrar', 0, 'NO', 'fecha_ultimo_cobro', 'Fecha de ultimo cobro', 6, 'DATE', 0, 1, 0, 1, '', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(311, 'ec_cuentas_por_cobrar', 0, 'NO', 'id_pedido', 'Pedido', 7, 'BUSCADOR', 0, 1, 0, 0, '-1', 'barra', 15, 'SELECT id_pedido, folio_pedido FROM ec_pedido\r\n', 'SELECT id_pedido, folio_pedido FROM ec_pedidos WHERE id_pedido=', 'ORDER BY folio_pedido', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(312, 'ec_cuentas_por_cobrar', 0, 'NO', 'id_nc', 'Nota de cargo', 8, 'BUSCADOR', 0, 1, 0, 0, '-1', 'barra', 15, 'SELECT id_nota_cargo, folio FROM ec_nota_cargo\r\n', 'SELECT id_nota_cargo, folio FROM ec_nota_cargo WHERE id_nota_cargo=', 'ORDER BY folio', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(313, 'ec_cuentas_por_cobrar', 0, 'NO', 'id_sucursal', 'Sucursal', 9, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(314, 'ec_cuentas', 0, 'NO', 'id_cuenta', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(315, 'ec_cuentas', 0, 'NO', 'id_banco', 'Banco', 2, 'COMBO', 0, 1, 1, 1, '1', 'barra_tres', 11, 'SELECT\r\nid_banco,\r\nnombre\r\nFROM ec_bancos\r\nWHERE 1', 'AND id_banco=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(316, 'ec_cuentas', 0, 'NO', 'nombre', 'Nombre', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(317, 'ec_cuentas', 0, 'NO', 'no_cuenta', 'No. de cuentas', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, NULL, NULL, NULL),
(318, 'ec_cuentas', 0, 'NO', 'observaciones', 'Observaciones', 5, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(319, 'ec_cuentas', 0, 'NO', 'id_sucursal', 'Sucursal', 6, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(320, 'sys_razones_sociales', 0, 'NO', 'id_razon_social', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(321, 'sys_razones_sociales', 0, 'NO', 'rfc', 'RFC', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 13, NULL, NULL, NULL, NULL),
(322, 'sys_razones_sociales', 0, 'NO', 'razon_social', 'Razón social', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80, NULL, NULL, NULL, NULL),
(323, 'sys_razones_sociales', 0, 'NO', 'calle', 'Calle', 4, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80, NULL, NULL, NULL, NULL),
(324, 'sys_razones_sociales', 0, 'NO', 'no_int', 'No. int', 5, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(325, 'sys_razones_sociales', 0, 'NO', 'no_ext', 'No. exterior', 6, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(326, 'sys_razones_sociales', 0, 'NO', 'colonia', 'Colonia', 7, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80, NULL, NULL, NULL, NULL),
(327, 'sys_razones_sociales', 0, 'NO', 'del_municipio', 'Del. o municipio', 8, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(328, 'sys_razones_sociales', 0, 'NO', 'cp', 'CP', 9, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(329, 'sys_razones_sociales', 0, 'NO', 'id_pais', 'País', 10, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_pais, nombre FROM sys_paises WHERE 1', ' AND id_pais=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(330, 'sys_razones_sociales', 0, 'NO', 'id_estado', 'Estado', 11, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_estado, nombre FROM sys_estados WHERE 1', ' AND id_estado=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(331, 'ec_tipos_pago', 0, 'NO', 'id_tipo_pago', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(332, 'ec_tipos_pago', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(333, 'ec_tipos_pago', 0, 'NO', 'id_cuenta', 'Cuenta', 3, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_cuenta, nombre FROM ec_cuentas WHERE 1', ' AND id_cuenta=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(334, 'ec_tipos_pago', 0, 'NO', 'id_sucursal', 'Sucursal', 4, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(335, 'ec_bancos', 0, 'NO', 'id_banco', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(336, 'ec_bancos', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(337, 'ec_monedas', 0, 'NO', 'id_moneda', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(338, 'ec_monedas', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(339, 'ec_monedas', 0, 'NO', 'cambio', 'Cambio', 3, 'FLOAT', 0, 1, 1, 1, '0', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(340, 'ec_pedidos', 3, 'NO', 'id_pedido', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(341, 'ec_pedidos', 3, 'NO', 'folio_factura', 'Folio', 2, 'CHAR', 0, 1, 0, 1, NULL, 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(342, 'ec_pedidos', 3, 'NO', 'id_cliente', 'Cliente', 3, 'BUSCADOR', 0, 1, 0, 1, '', 'barra', 20, 'SELECT id_cliente, nombre FROM ec_clientes WHERE nombre LIKE \'%$LLAVE%\' OR id_cliente = \'$LLAVE\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(343, 'ec_pedidos', 3, 'NO', 'fecha_factura', 'Fecha', 6, 'DATE', 0, 1, 0, 1, '', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(344, 'ec_pedidos', 3, 'NO', 'id_moneda', 'Moneda', 7, 'COMBO', 0, 1, 0, 1, '1', 'barra', 15, 'SELECT id_moneda, nombre FROM ec_monedas WHERE 1', 'AND id_moneda=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(345, 'ec_pedidos', 3, 'NO', 'subtotal', 'Subtotal', 8, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(346, 'ec_pedidos', 3, 'NO', 'iva', 'IVA', 9, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(347, 'ec_pedidos', 3, 'NO', 'ieps', 'IEPS', 10, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(348, 'ec_pedidos', 3, 'NO', 'total', 'Total', 11, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(349, 'ec_pedidos', 3, 'NO', 'id_usuario', 'Creada por', 12, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(350, 'ec_pedidos', 3, 'NO', 'id_razon_social', 'Razón social', 4, 'COMBO', 0, 1, 1, 1, '', 'barra', 11, 'SELECT id_cliente_rs, razon_social FROM ec_clientes_razones_sociales WHERE id_cliente=\'$llaveDep\'', 'AND id_cliente_rs=', 'ORDER BY razon_social', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 342),
(351, 'ec_pendientes', 0, 'NO', 'id_pendiente', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(352, 'ec_pendientes', 0, 'NO', 'descripcion', 'Descripción', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(353, 'ec_pendientes', 0, 'NO', 'id_prioridad', 'Prioridad', 3, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_prioridad, nombre FROM ec_prioridades WHERE 1', ' AND id_prioridad=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(354, 'ec_pendientes', 0, 'NO', 'fecha', 'Fecha', 4, 'DATE', 0, 1, 1, 1, '$DATE', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(355, 'ec_pendientes', 0, 'NO', 'hora', 'Hora', 5, 'TIME', 0, 1, 1, 1, '', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(356, 'ec_pendientes', 0, 'NO', 'id_usuario', 'Asignado a', 6, 'COMBO', 0, 1, 1, 0, '$USUARIO', 'barra_dos', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(357, 'ec_pendientes', 0, 'NO', 'id_usuario', 'Creado por', 7, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(358, 'ec_pendientes', 0, 'NO', 'activo', 'Realizado', 8, 'BINARY', 0, 1, 1, 0, NULL, 'barra_dos', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(359, 'ec_pendientes', 0, 'NO', 'id_sucursal', 'Sucursal', 9, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(360, 'ec_prioridades', 0, 'NO', 'id_prioridad', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(361, 'ec_prioridades', 0, 'NO', 'descripcion', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(362, 'ec_prioridades', 0, 'NO', 'importancia', 'Importancia', 3, 'INT', 0, 1, 1, 1, '1', 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL),
(363, 'ec_maquila', 0, 'NO', 'id_maquila', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(364, 'ec_maquila', 0, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(365, 'ec_maquila', 0, 'NO', 'fecha', 'Fecha', 3, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(366, 'ec_maquila', 0, 'NO', 'id_usuario', 'Creada por', 4, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(367, 'ec_maquila', 0, 'NO', 'id_producto', 'Producto', 5, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT -1 AS id_productos,\r\n\'---- Selecciona un producto ----\' AS nombre\r\nUNION\r\nSELECT id_productos, nombre FROM ec_productos WHERE  id_productos > 0 AND es_maquilado=1 ', 'AND id_productos=\'\'', ' ORDER BY nombre', NULL, NULL, NULL, 'cambiaMaquila(this.value)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(368, 'ec_maquila', 0, 'NO', 'cantidad', 'Cantidad', 6, 'FLOAT', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(369, 'ec_maquila', 0, 'NO', 'id_sucursal', 'Sucursal', 7, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(370, 'ec_pedidos', 4, 'NO', 'id_pedido', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(371, 'ec_pedidos', 4, 'NO', 'folio_pedido', 'Folio', 2, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(372, 'ec_pedidos', 4, 'NO', 'id_cliente', 'Cliente', 3, 'BUSCADOR', 0, 1, 0, 1, '', 'barra', 20, 'SELECT id_cliente, nombre FROM ec_clientes WHERE nombre LIKE \'%$LLAVE%\' OR id_cliente = \'$LLAVE\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(373, 'ec_pedidos', 4, 'NO', 'id_estatus', 'Estatus', 4, 'COMBO', 0, 1, 0, 1, '1', 'barra_tres', 11, 'SELECT id_estatus, nombre FROM ec_estatus_pedido WHERE 1', 'AND id_estatus=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(374, 'ec_pedidos', 4, 'NO', 'fecha_alta', 'Fecha', 5, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(375, 'ec_pedidos', 4, 'NO', 'id_direccion', 'Dirección de entrega', 6, 'COMBO', 0, 1, 0, 1, '-1', 'barra', 11, 'SELECT id_clientes_de, CONCAT(calle, \' #\', no_ext, \', Col. \', colonia) FROM ec_clientes_domentrega WHERE 1', 'AND id_clientes_de=', 'ORDER BY CONCAT(calle, \' #\', no_ext, \', Col. \', colonia)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(376, 'ec_pedidos', 4, 'NO', 'direccion', 'Dirección', 7, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(383, 'ec_movimiento_almacen', 0, 'NO', 'id_maquila', 'Maquila', 10, 'BUSCADOR', 0, 1, 0, 0, '-1', 'barra', 15, 'SELECT\nid_maquila,\nfolio\nFROM\n(\nSELECT id_maquila, folio FROM ec_maquila\nUNION\nSELECT -1 AS id_maquila, \'No aplica\' AS folio\n)aux', 'SELECT\r\nid_maquila,\r\nfolio\r\nFROM\r\n(\r\nSELECT id_maquila, folio FROM ec_maquila\r\nUNION\r\nSELECT -1 AS id_maquila, \'No aplica\' AS folio\r\n)aux WHERE id_maquila=', 'ORDER BY folio', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(384, 'sys_sucursales', 0, 'NO', 'logo', 'Logo', 7, 'FILE', 0, 1, 1, 0, NULL, 'barra_dos', 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(385, 'ec_pedidos', 0, 'NO', 'id_tipo_envio', 'Forma de envio', 13, 'COMBO', 0, 1, 1, 1, '', 'barra_tres', 11, 'SELECT id_tipo_envio, nombre FROM ec_tipos_envio WHERE 1', 'AND id_tipo_envio=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(386, 'ec_pedidos', 1, 'NO', 'id_tipo_envio', 'Forma de envio', 14, 'COMBO', 0, 1, 1, 1, '', 'barra_tres', 11, 'SELECT id_tipo_envio, nombre FROM ec_tipos_envio WHERE 1', 'AND id_tipo_envio=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(387, 'ec_pedidos', 3, 'NO', 'facturado', 'facturado', 13, 'BINARY', 0, 0, 0, 0, '1', 'barra', 11, '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(388, 'ec_pedidos', 2, 'NO', 'id_tipo_envio', 'Forma de envio', 16, 'INT', 0, 0, 0, 1, '1', 'barra_tres', 11, '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(389, 'ec_conf_oc', 0, 'NO', 'folio_editable', 'Folio editable', 5, 'BINARY', 0, 1, 1, 1, '1', 'barra_tres', 1, NULL, NULL, NULL, NULL, NULL, 'cambiaEd(this)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(390, 'ec_conf_oc', 0, 'NO', 'prefijo_folio', 'Prefijo', 6, 'CHAR', 0, 1, 0, 0, '', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(391, 'ec_conf_oc', 0, 'NO', 'contador_folio', 'Ultimo folio', 7, 'INT', 0, 1, 0, 0, '-1', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(392, 'ec_acreedor', 0, 'NO', 'id_acreedor', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(393, 'ec_acreedor', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(394, 'ec_acreedor', 0, 'NO', 'rfc', 'RFC', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 15, NULL, NULL, NULL, NULL),
(395, 'ec_acreedor', 0, 'NO', 'razon_social', 'Razón social', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(396, 'ec_acreedor', 0, 'NO', 'calle', 'Calle', 5, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(397, 'ec_acreedor', 0, 'NO', 'no_int', 'No. interior', 6, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(398, 'ec_acreedor', 0, 'NO', 'no_ext', 'No. Exterior', 7, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(399, 'ec_acreedor', 0, 'NO', 'colonia', 'Colonia', 8, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(400, 'ec_acreedor', 0, 'NO', 'delegacion', 'Delegación/Municipio', 9, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(401, 'ec_acreedor', 0, 'NO', 'cp', 'CP', 10, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(402, 'ec_acreedor', 0, 'NO', 'id_pais', 'País', 11, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_pais, nombre FROM sys_paises WHERE 1', ' AND id_pais=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(403, 'ec_acreedor', 0, 'NO', 'id_estado', 'Estado', 12, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT id_estado, nombre FROM sys_estados WHERE id_pais=\'$llaveDep\'', 'AND id_estado=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 402),
(404, 'ec_acreedor', 0, 'NO', 'id_sucursal', 'Sucursal', 13, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 11, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', ' AND id_sucursal=1', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(405, 'ec_gastos_impuestos', 0, 'NO', 'id_gasto_impuesto', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(406, 'ec_gastos_impuestos', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(407, 'ec_clientes', 0, 'NO', 'monto_desc', 'Monto de descuento', 10, 'FLOAT', 0, 1, 1, 0, '0', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, '', 'documento.getElementById(\'porc_desc\').value=0;', NULL, '', 12, NULL, NULL, NULL, NULL),
(408, 'ec_clientes', 0, 'NO', 'porc_desc', 'Porcentaje de descuento', 11, 'FLOAT', 0, 1, 1, 0, '0', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, 'documento.getElementById(\'monto_desc\').value=0', NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(409, 'ec_clientes', 0, 'NO', 'min_compra_desc', 'Mínimo de compra para descuento', 12, 'FLOAT', 0, 1, 1, 0, '0', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(410, 'ec_pedidos', 0, 'NO', 'descuento', 'Descuento', 9, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(411, 'ec_pedidos', 1, 'NO', 'descuento', 'Descuento', 10, 'FLOAT', 0, 1, 0, 1, '0', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, NULL, NULL),
(412, 'ec_transferencias', 0, 'NO', 'id_transferencia', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(413, 'ec_transferencias', 0, 'NO', 'id_usuario', 'Creada por', 2, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(414, 'ec_transferencias', 0, 'NO', 'fecha', 'Fecha', 3, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(415, 'ec_transferencias', 0, 'NO', 'hora', 'Hora', 4, 'TIME', 0, 1, 0, 1, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(416, 'ec_transferencias', 0, 'NO', 'id_sucursal_origen', 'Sucursal origen', 6, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 1, 'SELECT\r\nid_sucursal,\r\nnombre\r\nFROM sys_sucursales\r\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(417, 'ec_transferencias', 0, 'NO', 'id_sucursal_destino', 'Sucursal destino', 8, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 1, 'SELECT\nid_sucursal,\nnombre\nFROM sys_sucursales\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(418, 'ec_pedidos', 3, 'NO', 'id_razon_factura', 'Razón social de facturacion', 5, 'COMBO', 0, 1, 1, 1, '', 'barra', 11, 'SELECT id_razon_social,razon_social FROM sys_razones_sociales WHERE 1 ', 'AND id_razon_social=', 'ORDER BY razon_social', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 0),
(419, 'sys_sucursales', 0, 'NO', 'multifacturacion', 'Multifacturación', 9, 'BINARY', 0, 1, 1, 1, '0', 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(420, 'ec_productos', 0, 'NO', 'desc_gral', 'Descuento general', 0, 'BINARY', 0, 0, 1, 1, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(421, 'ec_clientes_productos', 0, 'NO', 'desc_gral', 'Descuento general', 1, '', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(423, 'ec_transferencias', 0, 'NO', 'id_razon_social_venta', 'Razón social cliente', 100, 'BUSCADOR', 0, 0, 1, 0, '-1', NULL, 11, 'SELECT id_cliente_rs, razon_social\nFROM ec_clientes_razones_sociales WHERE razon_social LIKE \'%id%\'', 'SELECT id_cliente_rs, razon_social FROM ec_clientes_razones_sociales WHERE id_cliente_rs = ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(424, '', 0, 'NO', '', '', 0, 'CAMPO BUSCADOR', 0, 1, 1, 0, NULL, NULL, NULL, 'SELECT\nid_razon_social_venta,\nid_razon_social_venta\nFROM\n(\nSELECT id_razon_social_venta, id_razon_social_venta FROM ec_transferencias\nUNION\nSELECT -1 AS id_razon_social_venta, \'No aplica\' AS id_razon_social_venta\n)aux', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(425, '', 0, 'NO', '', '', 0, 'CAMPO BUSCADOR', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(426, 'ec_transferencias', 0, 'NO', 'id_razon_social_compra', 'Razón social proveedor', 100, 'BUSCADOR', 0, 0, 1, 0, '1', NULL, 11, 'SELECT id_proveedor, razon_social\nFROM ec_proveedor WHERE razon_social LIKE \'%id%\'', 'SELECT id_proveedor, razon_social FROM ec_proveedor WHERE id_proveedor = ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(427, 'ec_transferencias', 0, 'NO', 'facturable', 'Facturable', 100, 'BINARY', 0, 0, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(428, 'ec_transferencias', 0, 'NO', 'porc_ganancia', 'Porcentaje de la ganancia', 100, 'FLOAT', 0, 0, 1, 0, NULL, 'barra_tres', 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 15, NULL, NULL, NULL, NULL),
(429, 'ec_comparacion_inv', 0, 'NO', 'id_comparacion_inv', 'ID', 1, 'INT', 0, 1, 1, 0, NULL, 'barra', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(430, 'ec_comparacion_inv', 0, 'NO', 'id_usuario', 'Usuario', 2, 'COMBO', 0, 1, 0, 0, '$USUARIO', 'barra', 15, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(431, 'ec_comparacion_inv', 0, 'NO', 'id_sucursal', 'Sucursal', 3, 'COMBO', 0, 1, 0, 0, '$SUCURSAL', 'barra', 15, 'SELECT\nid_sucursal,\nnombre\nFROM sys_sucursales\nWHERE 1\n', 'AND id_sucursal=', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(432, 'ec_comparacion_inv', 0, 'NO', 'fecha', 'Fecha', 4, 'DATE', 0, 1, 0, 0, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(433, 'ec_comparacion_inv', 0, 'NO', 'hora', 'Hora', 5, 'TIME', 0, 1, 0, 0, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(434, 'ec_devolucion', 0, 'NO', 'id_devolucion', 'ID', 1, 'INT', 1, 1, 0, 0, '(automatico)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(435, 'ec_devolucion', 0, 'NO', 'id_usuario', 'Usuario', 3, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 15, 'SELECT id_usuario, CONCAT(nombre,\'\',apellido_paterno)FROM sys_users\nWHERE 1\n\n', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(436, 'ec_devolucion', 0, 'NO', 'fecha', 'Fecha', 3, 'DATE', 0, 1, 0, 0, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(437, 'ec_devolucion', 0, 'NO', 'id_sucursal', 'Sucursal', 3, 'COMBO', 0, 1, 0, 1, '$SUCURSAL', 'barra', 11, 'SELECT\nid_sucursal,\nnombre\nFROM sys_sucursales\nWHERE 1', 'AND id_sucursal=', 'ORDER BY id_sucursal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(438, 'ec_devolucion', 0, 'NO', 'hora', 'Hora', 5, 'TIME', 0, 1, 0, 0, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(439, 'ec_devolucion', 0, 'NO', 'id_pedido', 'Pedido', 6, 'BUSCADOR', 0, 1, 1, 0, NULL, 'barra_tres', 15, 'SELECT id_pedido, folio_pedido FROM ec_pedidos WHERE folio_pedido LIKE \'%$LLAVE%\' OR id_pedido=\'$LLAVE\'', 'SELECT id_pedido, folio_pedido FROM ec_pedidos WHERE folio_pedido=', 'ORDER BY folio_pedido', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(440, 'ec_devolucion', 0, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(441, 'ec_gastos', 0, 'NO', 'id_gastos', 'ID', 1, 'INT', 1, 1, 1, 0, '(Automatico)', 'barra', 10, 'SELECT\nid_gastos,\nnombre\nFROM ec_gastos\nWHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(442, 'ec_gastos', 0, 'NO', 'id_usuario', 'Usuario', 2, 'COMBO', 0, 1, 0, 0, '$USUARIO', 'barra', 15, 'SELECT\nid_usuario,\nnombre\nFROM sys_users\nWHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(443, 'ec_gastos', 0, 'NO', 'id_sucursal', 'Sucursal', 3, 'COMBO', 0, 1, 0, 0, '$SUCURSAL', 'barra', 15, 'SELECT\nid_sucursal,\nnombre\nFROM sys_sucursales\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(444, 'ec_gastos', 0, 'NO', 'fecha', 'Fecha', 4, 'DATE', 0, 1, 0, 0, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(445, 'ec_gastos', 0, 'NO', 'hora', 'Hora', 5, 'TIME', 0, 1, 0, 0, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(446, 'ec_gastos', 0, 'NO', 'id_concepto', 'Concepto', 6, 'COMBO', 0, 1, 1, 0, NULL, 'barra_dos', 15, 'SELECT id_concepto, nombre\nFROM ec_conceptos_gastos\nWHERE 1 \n', 'AND id_concepto=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(447, 'ec_gastos', 0, 'NO', 'monto', 'Monto', 7, 'FLOAT', 0, 1, 1, 0, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(448, 'ec_gastos', 0, 'NO', 'observaciones', 'Observaciones', 8, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 15, NULL, NULL, NULL, NULL),
(449, 'ec_conceptos_gastos', 0, 'NO', 'id_concepto', 'ID', 1, 'INT', 0, 1, 1, 0, '(Automatico)', 'barra', 11, 'SELECT id_concepto, nombre \nFROM ec_conceptos_gastos \nWHERE id_concepto=\'$llaveDep\'', 'AND id_concepto=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(450, 'ec_conceptos_gastos', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, 'SELECT id_concepto, nombre FROM ec_conceptos_gastos WHERE 1', 'AND id_concepto=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(453, 'ec_comparacion_inv', 0, 'NO', 'archivo', 'Archivo', 6, 'FILE', 0, 1, 1, 1, '', 'barra_dos', 20, '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(454, 'ec_subtipos', 0, 'NO', 'id_subtipos', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(455, 'ec_subtipos', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(456, 'ec_subtipos', 0, 'NO', 'id_tipo', 'Tipo', 3, 'COMBO', 0, 1, 1, 0, NULL, 'barra_dos', 15, 'SELECT id_subcategoria, nombre FROM ec_subcategoria WHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(457, 'ec_numero_luces', 0, 'NO', 'id_numero_luces', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(458, 'ec_numero_luces', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_catalogos` (`id_catalogo`, `tabla`, `no_tabla`, `tab`, `campo`, `display`, `orden`, `tipo`, `es_llave`, `visible`, `modificable`, `requerido`, `valor_inicial`, `clase`, `longitud`, `sql_combo`, `where_combo`, `order_combo`, `on_focus`, `on_blur`, `on_click`, `on_change`, `on_keypress`, `on_keydown`, `on_keyup`, `max_length`, `extensiones`, `especificacion`, `clase_esp`, `depende`) VALUES
(459, 'ec_numero_luces', 0, 'NO', 'id_categoria', 'Familia', 3, 'COMBO', 0, 1, 1, 0, NULL, 'barra_dos', 15, 'SELECT\r\nid_categoria, nombre\r\nFROM ec_categoria\r\nWHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(460, 'ec_colores', 0, 'NO', 'id_colores', 'ID', 1, 'INT', 0, 1, 1, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(461, 'ec_colores', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(462, 'ec_colores', 0, 'NO', 'id_categoria', 'Familia', 3, 'COMBO', 0, 1, 1, 0, NULL, 'barra_dos', 15, 'SELECT\r\nid_categoria,\r\nnombre\r\nFROM ec_categoria\r\nWHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(463, 'ec_tamanos', 0, 'NO', 'id_tamanos', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(464, 'ec_tamanos', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(465, 'ec_tamanos', 0, 'NO', 'id_categoria', 'Familia', 3, 'COMBO', 0, 1, 1, 0, NULL, 'barra_dos', 15, 'SELECT\r\nid_categoria, nombre\r\nFROM ec_categoria\r\nWHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(466, 'ec_productos', 0, 'NO', 'nombre_etiqueta', 'Nombre de la etiqueta', 20, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(467, 'ec_productos', 0, 'NO', 'orden_lista', 'Orden de lista', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(468, 'ec_productos', 0, 'NO', 'ubicacion_almacen', 'Ubicacion de almacen', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(469, '', 0, 'NO', '', '', 0, '', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(470, 'ec_productos', 0, 'NO', 'codigo_barras_1', 'Código de barras 1', 12, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(471, 'ec_productos', 0, 'NO', 'codigo_barras_2', 'Código de barras 2', 13, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(472, 'ec_productos', 0, 'NO', 'codigo_barras_3', 'Código de barras 3', 14, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(474, 'ec_productos', 0, 'NO', 'maximo_existencia', 'Máximo en existencias', 16, 'FLOAT', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(478, 'ec_productos', 0, 'NO', 'habilitado', 'Habilitado', 30, 'BINARY', 0, 1, 1, 0, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(479, 'ec_productos', 0, 'NO', 'omitir_alertas', 'Omitir en alertas', 31, 'BINARY', 0, 1, 1, 0, NULL, 'barra_dos', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(480, 'ec_tipo_precio', 0, 'NO', 'id_tipo_precio', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(481, 'ec_tipo_precio', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(482, 'ec_tipo_precio', 0, 'NO', 'es_oferta', 'Oferta', 3, 'BINARY', 0, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(487, 'ec_almacen', 0, 'NO', 'id_almacen', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(488, 'ec_almacen', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(489, 'ec_almacen', 0, 'NO', 'es_almacen', 'Es almacén', 4, 'BINARY', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(490, 'ec_almacen', 0, 'NO', 'prioridad', 'Prioridad', 5, 'INT', 0, 1, 1, 1, NULL, 'barra_tres', 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(491, 'ec_almacen', 0, 'NO', 'id_sucursal', 'Sucursal', 6, 'COMBO', 0, 0, 1, 1, '$SUCURSAL', 'barra_tres', 15, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(492, 'ec_devolucion_transferencia', 0, 'NO', 'id_devolucion_transferencia', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(493, 'ec_devolucion_transferencia', 0, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra', 20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(494, 'ec_devolucion_transferencia', 0, 'NO', 'id_transferencia', 'Trasferencias', 3, 'BUSCADOR', 0, 1, 1, 0, NULL, 'barra_tres', 30, 'SELECT\r\nid_transferencia, folio\r\nFROM ec_transferencias\r\nWHERE folio like\'%$LLAVE%\'', NULL, NULL, NULL, NULL, NULL, 'actualizaGridProd()', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(495, 'ec_devolucion_transferencia', 0, 'NO', 'fecha', 'Fecha', 4, 'DATE', 0, 1, 0, 1, '$DATE', 'barra_dos', 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(496, 'ec_devolucion_transferencia', 0, 'NO', 'hora', 'Hora', 5, 'TIME', 0, 1, 0, 1, '$TIME', 'barra_dos', 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(497, 'ec_devolucion_transferencia', 0, 'NO', 'id_almacen', 'Almacén', 6, 'COMBO', 0, 1, 0, 1, NULL, NULL, 15, 'SELECT id_almacen, nombre FROM ec_almacen', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(498, 'ec_devolucion_transferencia', 0, 'NO', 'id_estado', 'Estado', 5, 'BINARY', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(499, 'ec_devolucion_transferencia', 0, 'NO', 'id_usuario', '', 6, 'COMBO', 0, 0, 0, 1, '$USUARIO', NULL, NULL, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(500, 'ec_devolucion_transferencia', 0, 'NO', 'id_sucursal', '', 7, 'COMBO', 0, 0, 0, 1, '$SUCURSAL', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(501, 'ec_devolucion_transferencia', 0, 'NO', 'observaciones', 'Observaciones', 8, 'CHAR', 0, 1, 1, 0, NULL, NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(502, 'ec_periodos', 0, 'NO', 'id_periodos', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automatico)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(503, 'ec_periodos', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(504, 'ec_estacionalidad', 0, 'NO', 'id_estacionalidad', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(505, 'ec_estacionalidad', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(506, 'ec_estacionalidad', 0, 'NO', 'id_periodo', 'Periodo', 3, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 15, 'SELECT id_periodos, nombre FROM ec_periodos WHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(507, 'ec_estacionalidad', 0, 'NO', 'observaciones', 'Observaciones', 4, 'CHAR', 0, 1, 1, 0, NULL, NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(508, 'ec_estacionalidad', 0, 'NO', 'id_sucursal', 'Sucursal', 5, 'COMBO', 0, 1, 0, 1, '$SUCURSAL', 'barra', 15, 'SELECT id_sucursal, nombre FROM sys_sucursales WHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(509, 'ec_transferencias', 0, 'NO', 'folio', 'Folio', 10, 'CHAR', 0, 1, 0, 1, '(Automático)', 'barra', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(510, 'ec_empleado', 0, 'NO', 'id_empleado', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(511, 'ec_empleado', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(512, 'ec_empleado', 0, 'NO', 'apellido_paterno', 'Apellido Paterno', 3, 'CHAR', 0, 1, 1, 1, NULL, NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(513, 'ec_empleado', 0, 'NO', 'apellido_materno', 'Apellido Materno', 4, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(514, 'ec_empleado', 0, 'NO', 'fecha_nac', 'Fecha de nacimiento', 5, 'DATE', 0, 1, 1, 0, '$DATE', 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(515, 'ec_empleado', 0, 'NO', 'sexo', 'Sexo', 6, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 15, 'SELECT id_sexo, genero FROM ec_sexo WHERE 1', 'AND id_sexo=', 'ORDER BY genero', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(516, 'ec_empleado', 0, 'NO', 'telefono', 'Teléfono', 7, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(517, 'ec_empleado', 0, 'NO', 'direccion', 'Dirección', 8, 'CHAR', 0, 1, 1, 1, NULL, NULL, 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(518, 'ec_empleado', 0, 'NO', 'sueldo', 'Sueldo', 9, 'FLOAT', 0, 1, 1, 1, '0.00', 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(519, 'ec_empleado', 0, 'NO', 'clave_acceso', 'Clave de acceso', 10, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(520, 'ec_registro_nomina', 0, 'NO', 'id_registro_nomina', 'ID', 1, 'INT', 0, 1, 0, 1, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(521, 'ec_registro_nomina', 0, 'NO', 'fecha', 'Fecha', 2, 'DATE', 0, 1, 1, 1, '$DATE', 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(522, 'ec_registro_nomina', 0, 'NO', 'hora_entrada', 'Hora de entrada', 3, 'TIME', 0, 1, 1, 1, '$TIME', 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(523, 'ec_registro_nomina', 0, 'NO', 'hora_salida', 'Hora de salida', 4, 'TIME', 0, 1, 1, 1, '$TIME', 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(524, 'ec_registro_nomina', 0, 'NO', 'id_empleado', 'Empleado', 5, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 15, 'SELECT\r\nid_empleado,\r\nCONCAT(nombre,\' \',apellido_paterno,\' \', apellido_materno)\r\nFROM ec_empleado\r\nWHERE 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(525, 'ec_registro_nomina', 0, 'NO', 'id_sucursal', 'Sucursal', 6, 'COMBO', 0, 1, 0, 1, '$SUCURSAL', 'barra_tres', 15, 'SELECT id_sucursal, nombre\nFROM sys_sucursales\nWHERE 1 ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(526, 'ec_proveedor', 0, 'NO', 'nombre', 'Contacto', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(527, 'ec_proveedor', 0, 'NO', 'correo', 'Correo', 4, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(528, 'ec_proveedor', 0, 'NO', 'telefono', 'Teléfono', 6, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(529, 'ec_movimiento_almacen', 0, 'NO', 'id_almacen', 'Almacén', 2, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE id_sucursal=$SUCURSAL', 'AND id_almacen=', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(530, 'ec_transferencias', 0, 'NO', 'id_almacen_origen', 'Almacen origen', 7, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE id_sucursal =\'$llaveDep\'', 'AND id_almacen = ', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 416),
(531, 'ec_transferencias', 0, 'NO', 'id_almacen_destino', 'Almacen destino', 9, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE id_sucursal =\'$llaveDep\'', 'AND id_almacen = ', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 417),
(533, 'ec_transferencias', 0, 'NO', 'id_tipo', 'Tipo', 5, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 1, 'SELECT * FROM(\nSELECT 1 AS id_tipo, \'Urgente\' AS nombre\nUNION\nSELECT 2 AS id_tipo, \'Libre\' AS nombre\nUNION\nSELECT 3 AS id_tipo, \'Medio\' AS nombre\nUNION\nSELECT 4 AS id_tipo, \'Alto\' AS nombre) AS tipos\nWHERE 1\n', 'AND id_tipo = ', 'ORDER BY NOT nombre like \'%urgente%\'', NULL, NULL, '', 'cambiaSeleccionTransferencia ()', NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(534, 'ec_empleado', 0, 'NO', 'id_sucursal', 'Sucursal', 11, 'CHAR', 0, 0, 0, 1, '$SUCURSAL', 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(535, 'ec_nomina_configuracion', 0, 'NO', 'id_configuracion', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(536, 'ec_nomina_configuracion', 0, 'NO', 'tolerancia', 'Tiempo de tolerancia', 2, 'INT', 0, 1, 1, 1, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, 'Min', NULL, NULL),
(537, 'ec_nomina_configuracion', 0, 'NO', 'dia_corte', 'Día de corte', 3, 'COMBO', 0, 1, 1, 1, '1', 'barra_tres', 11, 'SELECT\r\nid,\r\nnombre\r\nFROM\r\n(\r\nSELECT 1 AS id, \'Lunes\' AS nombre\r\nUNION\r\nSELECT 2 AS id, \'Martes\' AS nombre\r\nUNION\r\nSELECT 3 AS id, \'Miércoles\' AS nombre\r\nUNION\r\nSELECT 4 AS id, \'Jueves\' AS nombre\r\nUNION\r\nSELECT 5 AS id, \'Viernes\' AS nombre\r\nUNION\r\nSELECT 6 AS id, \'Sábado\' AS nombre\r\nUNION\r\nSELECT 7 AS id, \'Domingo\' AS nombre\r\n)aux', 'AND id=', 'ORDER BY id', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(538, 'ec_nomina_configuracion', 0, 'NO', 'usuario_resp', 'Usuario responsable', 4, 'COMBO', 0, 1, 1, 1, '', 'barra_tres', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE id_sucursal=$SUCURSAL', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(539, 'ec_nomina_configuracion', 0, 'NO', 'id_sucursal', 'Sucursal', 5, 'CHAR', 0, 0, 0, 1, '$SUCURSAL', 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(540, 'sys_sucursales', 0, 'NO', 'prefijo', 'Prefijo', 10, 'CHAR', 0, 1, 1, 0, '', 'barra_dos', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(541, 'sys_sucursales', 0, 'NO', 'descuento', 'Descuento', 11, 'FLOAT', 0, 1, 1, 1, '0', 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(542, 'ec_autorizacion', 0, 'NO', 'id_autorizacion', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(543, 'ec_autorizacion', 0, 'NO', 'fecha', 'Fecha', 2, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(544, 'ec_autorizacion', 0, 'NO', 'hora', 'Hora', 3, 'TIME', 0, 1, 0, 1, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(545, 'ec_autorizacion', 0, 'NO', 'autorizado', 'Autorizado', 4, 'BINARY', 0, 1, 1, 1, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(546, 'ec_autorizacion', 0, 'NO', 'autorizado_por', 'Autorizado por', 5, 'COMBO', 0, 1, 1, 0, '$USUARIO', 'barra_tres', 15, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE id_usuario=$USUARIO', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(547, 'ec_autorizacion', 0, 'NO', 'id_vendedor', 'Vendedor', 6, 'COMBO', 0, 1, 0, 0, '', 'barra_tres', 15, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(548, 'ec_productos', 0, 'NO', 'codigo_barras_4', 'Código de barras 4', 15, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(549, 'ec_autorizacion', 0, 'NO', 'tipo_regalo', 'Tipo de regalo', 7, 'COMBO', 0, 1, 1, 1, '', 'barra_tres', 15, 'SELECT\r\nid_tipo,\r\nnombre\r\nFROM\r\n(\r\n SELECT 1 AS id_tipo, \'Producto de regalo\' AS nombre\r\n UNION\r\n SELECT 2 AS id_tipo, \'Porcentaje de descuento\' AS nombre\r\n UNION\r\n SELECT 3 AS id_tipo, \'Monto de descuento\' AS nombre\r\n)ax\r\nWHERE 1', 'AND id_tipo=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(550, 'ec_autorizacion', 0, 'NO', 'descuento', 'Descuento', 8, 'FLOAT', 0, 1, 1, 0, '', 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(551, 'sys_sucursales', 0, 'NO', 'id_precio', 'Lista de precios', 12, 'COMBO', 0, 0, 1, 0, '1', 'barra_tres', 11, 'SELECT id_precio, nombre FROM ec_precios', ' AND id_precio=', ' ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(552, 'sys_sucursales', 0, 'NO', 'alertas_resurtimiento', 'Timbrar mas de 72 hrs (cambia fecha de venta)', 13, 'BINARY', 0, 1, 1, 1, '0', 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(553, 'ec_precios', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(555, 'ec_empleado', 0, 'NO', 'notas', 'Notas', 12, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 500, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(556, 'ec_subcategoria', 0, 'NO', 'surtir_presentacion', 'Surtir por presentación', 4, 'BINARY', 0, 1, 1, 0, NULL, 'barra_dos', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL),
(557, 'ec_conceptos_oc', 0, 'NO', 'id_concepto_oc', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático) ', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(558, 'ec_conceptos_oc', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(559, 'ec_transferencias', 0, 'NO', 'id_estado', 'Estatus', 11, 'COMBO', 0, 1, 0, 1, '1', 'barra', 1, 'SELECT\r\nid_estatus,\r\nnombre\r\nFROM ec_estatus_transferencia\r\nWHERE 1', 'AND id_estatus=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(560, 'ec_transferencias', 1, 'NO', 'id_transferencia', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(561, 'ec_transferencias', 1, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 0, 1, '(Automático)', 'barra', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(562, 'ec_transferencias', 1, 'NO', 'fecha', 'Fecha', 3, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(563, 'ec_transferencias', 1, 'NO', 'hora', 'Hora', 4, 'TIME', 0, 1, 0, 1, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(564, 'ec_transferencias', 1, 'NO', 'id_sucursal_origen', 'Sucursal origen', 5, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT\r\nid_sucursal,\r\nnombre\r\nFROM sys_sucursales\r\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(565, 'ec_transferencias', 1, 'NO', 'id_almacen_origen', 'Almacen origen', 6, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE 1', 'AND id_almacen = ', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 0),
(566, 'ec_transferencias', 1, 'NO', 'id_sucursal_destino', 'Sucursal destino', 7, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT\r\nid_sucursal,\r\nnombre\r\nFROM sys_sucursales\r\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(567, 'ec_transferencias', 1, 'NO', 'id_almacen_destino', 'Almacen destino', 8, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE 1', 'AND id_almacen = ', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 417),
(568, 'ec_transferencias', 1, 'NO', 'id_usuario', 'Creada por', 9, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(569, 'ec_transferencias', 2, 'NO', 'id_transferencia', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(570, 'ec_transferencias', 2, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 0, 1, '(Automático)', 'barra', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(571, 'ec_transferencias', 2, 'NO', 'fecha', 'Fecha', 3, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(572, 'ec_transferencias', 2, 'NO', 'hora', 'Hora', 4, 'TIME', 0, 1, 0, 1, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(573, 'ec_transferencias', 2, 'NO', 'id_sucursal_origen', 'Sucursal origen', 5, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT\r\nid_sucursal,\r\nnombre\r\nFROM sys_sucursales\r\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(574, 'ec_transferencias', 2, 'NO', 'id_almacen_origen', 'Almacen origen', 6, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE 1', 'AND id_almacen = ', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 0),
(575, 'ec_transferencias', 2, 'NO', 'id_sucursal_destino', 'Sucursal destino', 7, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT\r\nid_sucursal,\r\nnombre\r\nFROM sys_sucursales\r\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(576, 'ec_transferencias', 2, 'NO', 'id_almacen_destino', 'Almacen destino', 8, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE 1', 'AND id_almacen = ', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 417),
(577, 'ec_transferencias', 2, 'NO', 'id_usuario', 'Creada por', 9, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(578, 'ec_transferencias', 3, 'NO', 'id_transferencia', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(579, 'ec_transferencias', 3, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 0, 1, '(Automático)', 'barra', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(580, 'ec_transferencias', 3, 'NO', 'fecha', 'Fecha', 3, 'DATE', 0, 1, 0, 1, '$DATE', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(581, 'ec_transferencias', 3, 'NO', 'id_sucursal_origen', 'Sucursal origen', 5, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT\r\nid_sucursal,\r\nnombre\r\nFROM sys_sucursales\r\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(582, 'ec_transferencias', 3, 'NO', 'hora', 'Hora', 4, 'TIME', 0, 1, 0, 1, '$TIME', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL),
(583, 'ec_transferencias', 3, 'NO', 'id_almacen_origen', 'Almacen origen', 6, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE 1', 'AND id_almacen = ', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 0),
(584, 'ec_transferencias', 3, 'NO', 'id_sucursal_destino', 'Sucursal destino', 7, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT\r\nid_sucursal,\r\nnombre\r\nFROM sys_sucursales\r\nWHERE 1', 'AND id_sucursal=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(585, 'ec_transferencias', 3, 'NO', 'id_almacen_destino', 'Almacen destino', 8, 'COMBO', 0, 1, 0, 1, NULL, 'barra', 1, 'SELECT id_almacen, nombre FROM ec_almacen WHERE 1', 'AND id_almacen = ', 'ORDER BY prioridad', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, 417),
(586, 'ec_transferencias', 3, 'NO', 'id_usuario', 'Creada por', 9, 'COMBO', 0, 1, 0, 1, '$USUARIO', 'barra', 11, 'SELECT id_usuario, CONCAT(nombre, \' \', apellido_paterno) FROM sys_users WHERE 1', 'AND id_usuario=', 'ORDER BY CONCAT(nombre, \' \', apellido_paterno)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(587, 'ec_oc', 0, 'NO', 'concepto', 'Concepto', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(588, 'ec_oc', 0, 'NO', 'hora', 'Hora', 7, 'TIME', 0, 1, 0, 1, '$TIME', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(597, 'ec_conf_rs', 0, 'NO', 'id_rs', 'ID', 1, 'INT', 1, 1, 1, 0, '(Automático)', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(598, 'ec_conf_rs', 0, 'NO', 'rfc', 'RFC', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, 'getMayus(this.value,this.id)', NULL, NULL, NULL, NULL, NULL, 15, NULL, NULL, NULL, NULL),
(599, 'ec_conf_rs', 0, 'NO', 'razon_social', 'Razón social', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(600, 'ec_conf_rs', 0, 'NO', 'calle', 'Calle', 4, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(601, 'ec_conf_rs', 0, 'NO', 'no_int', 'No. interior', 5, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(602, 'ec_conf_rs', 0, 'NO', 'colonia', 'Colonia', 6, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(603, 'ec_conf_rs', 0, 'NO', 'del_municipio', 'Delegación o municipio', 10, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(604, 'ec_conf_rs', 0, 'NO', 'cp', 'CP', 8, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(605, 'ec_conf_rs', 0, 'NO', 'no_ext', 'No. Exterior', 7, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(606, 'ec_conf_rs', 0, 'NO', 'localidad', 'Localidad', 11, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(621, 'ec_conf_rs', 0, 'NO', 'referencia', 'Referencia', 12, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(622, 'ec_conf_rs', 0, 'NO', 'estado', 'Estado', 13, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(623, 'ec_conf_rs', 0, 'NO', 'pais', 'País', 14, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(624, 'ec_conf_iva', 0, 'NO', 'id_conf_iva', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático) ', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(625, 'ec_conf_iva', 0, 'NO', 'porcentaje', 'Porcentaje', 2, 'FLOAT', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(626, 'ec_movimiento_inventario', 0, 'NO', 'id_movimiento_inventario', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático) ', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(627, 'ec_movimiento_inventario', 0, 'NO', 'id_tipo_movimiento', 'Tipo de movimiento', 2, 'COMBO', 0, 1, 1, 1, NULL, 'barra_dos', NULL, 'SELECT\r\nid_movimiento,\r\nnombre\r\nFROM ec_tipos_movimiento', 'AND id_movimiento=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(628, 'ec_movimiento_inventario', 0, 'NO', 'id_usuario', 'id_usuario', 3, 'INT', 0, 0, 1, 0, '$USUARIO', 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(629, 'ec_movimiento_inventario', 0, 'NO', 'folio', 'Folio', 4, 'CHAR', 0, 1, 0, 0, '(Automático) ', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(630, 'ec_movimiento_inventario', 0, 'NO', 'fecha', 'Fecha', 5, 'DATE', 0, 1, 0, 0, '$DATE', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, NULL, NULL, NULL),
(631, 'ec_movimiento_inventario', 0, 'NO', 'hora', 'Hora', 6, 'TIME', 0, 1, 0, 0, '$TIME', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 15, NULL, NULL, NULL, NULL),
(632, 'ec_movimiento_inventario', 0, 'NO', 'observaciones', 'Observaciones', 7, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 500, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(633, 'ec_movimiento_inventario', 0, 'NO', 'id_sucursal', 'id_sucursal', 8, 'INT', 0, 0, 1, 0, '$SUCURSAL', 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(636, 'ec_ventas', 0, 'NO', 'id_venta', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(637, 'ec_ventas', 0, 'NO', 'folio', 'Folio', 2, 'CHAR', 0, 1, 0, 0, '(Automático)', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(638, 'ec_ventas', 0, 'NO', 'folio_fiscal', 'Folio fiscal', 4, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1000, NULL, NULL, NULL, NULL),
(639, 'ec_ventas', 0, 'NO', 'certificado_csd', 'Certificado', 5, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 500, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1000, NULL, NULL, NULL, NULL),
(640, 'ec_ventas', 0, 'NO', 'sello_digital', 'Sello CFD', 6, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 500, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1000, NULL, NULL, NULL, NULL),
(641, 'ec_ventas', 0, 'NO', 'cadena_original', 'Cadena original', 7, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 500, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1000, NULL, NULL, NULL, NULL),
(642, 'ec_ventas', 0, 'NO', 'certificado_sat', 'Sello SAT', 8, 'CHAR', 0, 1, 0, 0, NULL, 'barra', 500, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1000, NULL, NULL, NULL, NULL),
(643, 'ec_ventas', 0, 'NO', 'fecha', 'Fecha', 9, 'DATE', 0, 1, 0, 0, '$DATE', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(644, 'ec_ventas', 0, 'NO', 'hora', 'Hora', 10, 'TIME', 0, 1, 0, 0, '$TIME', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 15, NULL, NULL, NULL, NULL),
(645, 'ec_ventas', 0, 'NO', 'subtotal', 'Subtotal', 11, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(646, 'ec_ventas', 0, 'NO', 'iva', 'iva', 12, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(647, 'ec_ventas', 0, 'NO', 'total', 'Total', 13, 'FLOAT', 0, 1, 0, 0, '0', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(648, 'ec_ventas', 0, 'NO', 'id_cliente', 'Cliente', 14, 'BUSCADOR', 0, 1, 1, 1, NULL, 'barra_dos', 0, 'SELECT\nid_cliente,\nCONCAT( nombre, \' - \', id_cliente ) AS nombre \nFROM ec_clientes\nWHERE id_cliente >= 10000 AND nombre LIKE \'%$LLAVE%\'', 'SELECT id_cliente, nombre FROM ec_clientes WHERE id_cliente=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(649, 'ec_ventas', 0, 'NO', 'id_usuario', 'id_usuario', 17, 'INT', 0, 0, 1, 1, '$USUARIO', 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(650, 'ec_ventas', 0, 'NO', 'id_sucursal', 'id_sucursal', 18, 'INT', 0, 0, 0, 0, '$SUCURSAL', 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(651, 'ec_emisor', 0, 'NO', 'id_emisor', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático) ', 'barra', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(652, 'ec_emisor', 0, 'NO', 'razon_social', 'Razón social', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80, NULL, NULL, NULL, NULL),
(653, 'ec_emisor', 0, 'NO', 'rfc', 'RFC', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 13, NULL, NULL, NULL, NULL),
(654, 'ec_emisor', 0, 'NO', 'calle', 'Calle', 5, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(655, 'ec_emisor', 0, 'NO', 'no_interior', 'No. interior', 6, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(656, 'ec_emisor', 0, 'NO', 'no_exterior', 'No. exterior', 7, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, NULL, NULL, NULL, NULL),
(657, 'ec_emisor', 0, 'NO', 'colonia', 'Colonia', 8, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 70, NULL, NULL, NULL, NULL),
(658, 'ec_emisor', 0, 'NO', 'delegacion', 'Delegación', 9, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 120, NULL, NULL, NULL, NULL),
(659, 'ec_emisor', 0, 'NO', 'id_estado', 'Estado', 10, 'COMBO', 0, 1, 1, 1, NULL, 'barra_dos', 0, 'SELECT id_estado,nombre FROM sys_estados\nWHERE 1', 'AND id_estado=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80, NULL, NULL, NULL, NULL),
(660, 'ec_emisor', 0, 'NO', 'id_pais', 'País', 12, 'COMBO', 0, 1, 1, 1, NULL, 'barra_dos', 0, 'SELECT id_pais,nombre FROM sys_paises\nWHERE 1', 'AND id_pais=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 80, NULL, NULL, NULL, NULL),
(661, 'ec_emisor', 0, 'NO', 'cp', 'C.P', 13, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(662, 'ec_emisor', 0, 'NO', 'certificado', 'Certificado', 14, 'FILE', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(663, 'ec_emisor', 0, 'NO', 'llave_fiel', 'Llave fiel', 15, 'FILE', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(664, 'ec_emisor', 0, 'NO', 'contrasena', 'Contraseña', 16, 'PASSWORD', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, NULL, NULL, NULL),
(665, 'ec_emisor', 0, 'NO', 'no_certificado', 'No. certificado', 17, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(666, 'ec_emisor', 0, 'NO', 'regimen_fiscal', 'Regimen fiscal', 19, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 90, NULL, NULL, NULL, NULL),
(667, 'ec_ventas', 0, 'NO', 'numero_orden', 'No. de orden', 3, 'CHAR', 0, 1, 1, 0, '', 'barra_tres', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(668, 'ec_ventas', 0, 'NO', 'id_forma_pago', 'Método de pago', 15, 'COMBO', 0, 1, 1, 1, NULL, 'barra_dos', 0, 'SELECT\r\nid_forma_pago,\r\nnombre \r\nFROM ec_forma_pago\r\nWHERE 1', 'AND id_forma_pago=', 'ORDER BY orden ASC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(669, 'ec_ventas', 0, 'NO', 'id_metodo_pago', 'Forma de pago', 16, 'COMBO', 0, 1, 1, 1, NULL, 'barra_dos', 0, 'SELECT\r\nid_metodo_pago,\r\nnombre \r\nFROM ec_metodos_pago\r\nWHERE 1', 'AND id_metodo_pago=', 'ORDER BY nombre', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, NULL),
(670, 'ec_forma_pago', 0, 'NO', 'id_forma_pago', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(671, 'ec_forma_pago', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(672, 'ec_metodos_pago', 0, 'NO', 'id_metodo_pago', 'ID', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(673, 'ec_metodos_pago', 0, 'NO', 'nombre', 'Nombre', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40, NULL, NULL, NULL, NULL),
(674, 'ec_ventas', 0, 'NO', 'clave_cliente', 'Numero de cuenta de pago', 19, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1000, NULL, NULL, NULL, NULL),
(675, 'ec_ventas', 0, 'NO', 'cfdi', 'CFDI:', 16, 'COMBO', 0, 1, 1, 1, NULL, 'barra_dos', NULL, 'SELECT id,\nCONCAT(nombre,\'(\',clave,\')\')\nFROM ec_cfdi\n\nWHERE 1', 'AND \nid=', 'ORDER BY orden ASC', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(676, 'ec_cfdi', 0, 'NO', 'id', 'ID', 1, 'INT', 0, 1, 0, 0, NULL, 'barra_dos', NULL, '300', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(677, 'ec_cfdi', 0, 'NO', 'clave', 'CLAVE', 2, 'CHAR', 0, 1, 1, 1, NULL, NULL, NULL, '300', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL),
(678, 'ec_cfdi', 0, 'NO', 'nombre', 'DESCRIPCION', 3, 'CHAR', 0, 1, 1, 0, NULL, NULL, 300, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 150, NULL, NULL, NULL, NULL),
(679, 'ec_cfdi', 0, 'NO', 'orden', 'ORDEN EN COMBO', 4, 'INT', 0, 1, 1, 0, NULL, NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(680, 'ec_emisor', 0, 'NO', 'descripcion_nota', 'Descripcion en la nota', 20, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 350, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1500, NULL, NULL, NULL, NULL),
(681, 'ec_emisor', 0, 'NO', 'prefijo_folio', 'Serie de Folio', 21, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(682, 'ec_forma_pago', 0, 'NO', 'clave', 'Clave SAT', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(683, 'ec_razon_afiliaciones', 0, 'NO', 'id_afiliacion', 'ID:', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(684, 'ec_razon_afiliaciones', 0, 'NO', 'no_afiliacion', 'Numero de Afiliacion', 2, 'INT', 0, 1, 1, 1, NULL, 'barra_dos', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL),
(685, 'ec_razon_afiliaciones', 0, 'NO', 'observaciones', 'Observaciones: ', 3, 'CHAR', 0, 1, 1, 0, NULL, 'barra_dos', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(686, 'ec_razon_afiliaciones', 0, 'NO', 'orden', 'Orden: ', 4, 'INT', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'NULLDELET', NULL),
(687, 'ec_emisor', 0, 'NO', 'porcentaje_utilidad', 'Porcentaje de Utilidad', 11, 'FLOAT', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(688, 'ec_emisor', 0, 'NO', 'monto_maximo_compras', 'Monto maximo de compras', 22, 'FLOAT', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(689, 'ec_emisor', 0, 'NO', 'monto_maximo_ventas', 'Monto maximo de ventas', 23, 'FLOAT', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(690, 'sys_correos_avisos', 0, 'NO', 'id_correo_aviso', 'ID:', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(691, 'sys_correos_avisos', 0, 'NO', 'nombre', 'Nombre:', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(692, 'sys_correos_avisos', 0, 'NO', 'direccion', 'correo', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(693, 'sys_correos_avisos', 0, 'NO', 'activo', 'Activo:', 4, 'BINARY', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(694, 'sys_correos_avisos', 0, 'NO', 'observaciones', 'Observaciones:', 5, 'CHAR', 0, 1, 1, 0, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(695, 'ec_razon_afiliaciones', 0, 'NO', 'activo', 'Activo: ', 5, 'BINARY', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(696, 'ec_configuracion_razon', 0, 'NO', 'id_config', 'ID: ', 1, 'INT', 1, 1, 1, 0, '(Automático)', 'barra', 11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(697, 'ec_configuracion_razon', 0, 'NO', 'id_emisor', 'Emisor Fiscal: ', 2, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT\r\nid_emisor,razon_social FROM ec_emisor WHERE 1', 'AND id_emisor=', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(698, 'ec_configuracion_razon', 0, 'NO', 'porcentaje_notas', 'Porcentaje de notas al azar', 3, 'FLOAT', 0, 1, 1, 1, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(699, 'ec_configuracion_razon', 0, 'NO', 'porcentaje_ventas', 'LIBRE', 4, 'FLOAT', 0, 1, 1, 1, NULL, 'barra_dos', 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(700, 'ec_configuracion_razon', 0, 'NO', 'color_sistema', 'Color del sistema: ', 5, 'CHAR', 0, 1, 1, 1, NULL, 'barra_dos', 20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(701, 'ec_configuracion_razon', 0, 'NO', 'observaciones', 'Nombre del sistema: ', 11, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 200, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(702, 'ec_ventas', 0, 'NO', 'facturacion_productos_especificos', 'Facturacion con productos especificos', 20, 'BINARY', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(703, 'ec_configuracion_razon', 0, 'NO', 'correo_smtp', 'Correo de envío (SMTP)', 6, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 50, NULL, NULL, NULL, NULL),
(704, 'ec_configuracion_razon', 0, 'NO', 'password_smtp', 'Password SMTP', 7, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 50, NULL, NULL, NULL, NULL),
(705, 'ec_configuracion_razon', 0, 'NO', 'host_smtp', 'Servidor SMTP', 8, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 50, NULL, NULL, NULL, NULL),
(706, 'ec_configuracion_razon', 0, 'NO', 'puerto_smtp', 'Puerto SMTP', 9, 'INT', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, NULL, NULL, NULL),
(707, 'ec_configuracion_razon', 0, 'NO', 'secure_smtp', 'Tipo de Conexión (ssl, tls) :', 10, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL),
(708, 'ec_tipos_regimenes_fiscales', 0, 'NO', 'id_tipo_regimen_fiscal', 'ID : ', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(709, 'ec_tipos_regimenes_fiscales', 0, 'NO', 'clave_numerica', 'Cave SAT :', 2, 'INT', 0, 1, 1, 1, NULL, 'barra_dos', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL),
(710, 'ec_tipos_regimenes_fiscales', 0, 'NO', 'nombre_tipo_regimen_fiscal', 'Descripción : ', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 200, NULL, NULL, NULL, NULL),
(711, 'ec_tipos_regimenes_fiscales', 0, 'NO', 'habilitado', 'Habilitado : ', 4, 'BINARY', 0, 1, 1, 0, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(712, 'ec_emisor', 0, 'NO', 'id_tipo_regimen_fiscal', 'Tipo de Régimen Fiscal', 18, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT\r\nid_tipo_regimen_fiscal,\r\nCONCAT( clave_numerica, \' - \', nombre_tipo_regimen_fiscal )\r\nFROM ec_tipos_regimenes_fiscales\r\nWHERE 1', 'AND id_tipo_regimen_fiscal= ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(713, 'ec_emisor', 0, 'NO', 'retencion_isr', 'Retención ISR', 18, 'BINARY', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(714, 'ec_clientes', 0, 'NO', 'idTipoPersona', 'Tipo de Persona : ', 15, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', NULL, 'SELECT\r\n	ax.idTipoPersona,\r\n	ax.TipoPersona\r\nFROM(\r\n	SELECT\r\n     \'\' AS idTipoPersona,\r\n     \'-- Seleccionar --\' AS TipoPersona\r\n     UNION(\r\n        SELECT \r\n            idTipoPersona,\r\n            TipoPersona\r\n        FROM cat_Tipo_Persona\r\n    )\r\n)ax\r\nWHERE 1', 'AND ax.idTipoPersona=', NULL, NULL, NULL, NULL, 'validate_rfc_type();', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(715, 'ec_clientes', 0, 'NO', 'EntregaConsSitFiscal', 'Entrega constancia de situación Fiscal', 16, 'BINARY', 0, 1, 1, 0, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_catalogos` (`id_catalogo`, `tabla`, `no_tabla`, `tab`, `campo`, `display`, `orden`, `tipo`, `es_llave`, `visible`, `modificable`, `requerido`, `valor_inicial`, `clase`, `longitud`, `sql_combo`, `where_combo`, `order_combo`, `on_focus`, `on_blur`, `on_click`, `on_change`, `on_keypress`, `on_keydown`, `on_keyup`, `max_length`, `extensiones`, `especificacion`, `clase_esp`, `depende`) VALUES
(716, 'ec_clientes', 0, 'NO', 'regimenFiscal', 'Tipo de Régimen Fiscal', 18, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', 11, 'SELECT\r\nclave_numerica,\r\nCONCAT( clave_numerica, \' - \', nombre_tipo_regimen_fiscal )\r\nFROM ec_tipos_regimenes_fiscales\r\nWHERE 1', 'AND clave_numerica= ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(717, 'ec_motivos_cancelacion_factura', 0, 'NO', 'id_motivo', 'Id : ', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(718, 'ec_motivos_cancelacion_factura', 0, 'NO', 'clave_motivo_sat', 'Clave SAT : ', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(719, 'ec_motivos_cancelacion_factura', 0, 'NO', 'descripcion', 'Descripcion : ', 3, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(720, 'ec_motivos_cancelacion_factura', 0, 'NO', 'orden', 'Orden : ', 4, 'INT', 0, 1, 1, 1, NULL, 'barra_dos', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(721, 'ec_motivos_cancelacion_factura', 0, 'NO', 'observaciones', 'Observaciones : ', 5, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(722, 'ec_productos', 0, 'NO', 'es_set', 'Es SET : ', 32, 'BINARY', 0, 1, 1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(723, 'ec_sets', 0, 'NO', 'id_set', 'ID : ', 1, 'INT', 1, 1, 0, 0, '(Automático)', 'barra', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(724, 'ec_sets', 0, 'NO', 'nombre', 'Nombre Set :', 2, 'CHAR', 0, 1, 1, 1, NULL, 'barra_tres', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(728, 'ec_emisor', 0, 'NO', 'tipo_asignacion_productos', 'Asignación de productos en ventas :', 24, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', NULL, 'SELECT\r\nax.tipo_asignacion,\r\nax.nombre_asignacion\r\nFROM(\r\n	( SELECT 0 AS tipo_asignacion, \'--Seleccionar--\' AS nombre_asignacion )\r\n    UNION\r\n	( SELECT \'directa\' AS tipo_asignacion, \'Directa\' AS nombre_asignacion )\r\n    UNION\r\n	( SELECT \'sets\' AS tipo_asignacion, \'Sets\' AS nombre_asignacion )\r\n)ax\r\nWHERE 1', 'AND ax.tipo_asignacion=', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(729, 'ec_configuracion_razon', 0, 'NO', 'id_ambiente', 'Ambiente : ', 2, 'COMBO', 0, 1, 1, 1, NULL, 'barra_tres', NULL, 'SELECT\r\nid_ambiente,\r\nnombre_ambiente\r\nFROM sys_ambientes_facturacion\r\nWHERE 1', 'AND id_ambiente = ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

--
-- Estructura de tabla para la tabla `sys_conf_pantalla`
--

CREATE TABLE `sys_conf_pantalla` (
  `id_configuracion_pantalla` int(11) NOT NULL,
  `id_plantilla` int(11) NOT NULL,
  `imagen_logo` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_conf_pantalla` (`id_configuracion_pantalla`, `id_plantilla`, `imagen_logo`) VALUES
(1, 4, '');

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

--
-- Estructura de tabla para la tabla `sys_correos_avisos`
--

CREATE TABLE `sys_correos_avisos` (
  `id_correo_aviso` int(11) NOT NULL,
  `nombre` varchar(40) NOT NULL,
  `direccion` varchar(40) NOT NULL,
  `activo` tinyint(1) NOT NULL DEFAULT '1',
  `observaciones` text NOT NULL,
  `fecha_alta` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ultima_modificacion` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `sys_correos_avisos` (`id_correo_aviso`, `nombre`, `direccion`, `activo`, `observaciones`, `fecha_alta`, `ultima_modificacion`) VALUES
(1, 'VERONICA ESTRADA', 'veroes_7934@hotmail.com', 1, '', '2019-10-25 20:28:05', '2020-10-26 23:27:27');

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

--
-- Estructura de tabla para la tabla `sys_estados`
--

CREATE TABLE `sys_estados` (
  `id_estado` int(11) NOT NULL,
  `nombre` varchar(60) NOT NULL,
  `id_pais` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_estados` (`id_estado`, `nombre`, `id_pais`) VALUES
(1, 'Aguascalientes', 1),
(2, ' Baja California Norte', 1),
(3, ' Baja California Sur', 1),
(4, ' Campeche', 1),
(5, 'Coahuila', 1),
(6, 'Chiapas', 1),
(7, 'Chihuahua', 1),
(8, 'Durango', 1),
(9, ' Estado de México', 1),
(10, 'Guanajuato', 1),
(11, 'Guerrero', 1),
(12, 'Hidalgo', 1),
(13, 'Jalisco', 1),
(14, ' Michoacán', 1),
(15, 'Morelos', 1),
(16, ' México, D.F.', 1),
(17, ' Nayarit', 1),
(18, ' Nuevo León', 1),
(19, 'Oaxaca', 1),
(20, 'Puebla', 1),
(21, ' Querétaro', 1),
(22, ' Quintana Roo', 1),
(23, ' San Luis Potosí', 1),
(24, ' Sinaloa', 1),
(25, 'Sonora', 1),
(26, ' Tabasco', 1),
(27, ' Tamaulipas', 1),
(28, ' Tlaxcala', 1),
(29, 'Veracruz', 1),
(30, 'Yucatán', 1),
(31, 'Zacatecas', 1);

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

--
-- Estructura de tabla para la tabla `sys_grid`
--

CREATE TABLE `sys_grid` (
  `id_grid` int(11) UNSIGNED NOT NULL,
  `nombre` varchar(45) NOT NULL,
  `display` varchar(60) NOT NULL,
  `max_width` int(11) UNSIGNED DEFAULT NULL,
  `funcion_final` varchar(60) DEFAULT NULL,
  `tabla_relacionada` varchar(90) NOT NULL,
  `funcion_nuevo` text,
  `funcion_eliminar` text,
  `scroll` varchar(1) DEFAULT 'S',
  `alto` int(11) UNSIGNED NOT NULL DEFAULT '150',
  `datosGrid` text,
  `fileGrid` text,
  `footer` varchar(1) DEFAULT 'N',
  `listado` varchar(1) DEFAULT 'N',
  `tabla_padre` varchar(90) NOT NULL,
  `no_tabla` int(2) NOT NULL DEFAULT '0',
  `orden` int(3) UNSIGNED NOT NULL,
  `campo_llave` varchar(60) NOT NULL,
  `query` text,
  `filas_inicial` int(11) UNSIGNED DEFAULT '0',
  `funcion_despues_eliminar` text,
  `buscador` bit(1) NOT NULL DEFAULT b'0',
  `campo_coinc` text NOT NULL,
  `campo_enfoque` text NOT NULL,
  `consulta_coinc` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `sys_grid` (`id_grid`, `nombre`, `display`, `max_width`, `funcion_final`, `tabla_relacionada`, `funcion_nuevo`, `funcion_eliminar`, `scroll`, `alto`, `datosGrid`, `fileGrid`, `footer`, `listado`, `tabla_padre`, `no_tabla`, `orden`, `campo_llave`, `query`, `filas_inicial`, `funcion_despues_eliminar`, `buscador`, `campo_coinc`, `campo_enfoque`, `consulta_coinc`) VALUES
(2, 'usuariosAccesos', 'Accesos', 1000, NULL, 'sys_permisos', 'false', 'false', 'S', 250, '../grid/datosGrid.php?tabla=sys_permisos&id=', '../grid/guardaGrid.php?tabla=sys_permisos&llave=', 'N', 'N', 'sys_users', 0, 1, 'id_usuario', 'SELECT\r\nIF(s.id_permiso IS NULL, \'NO\', s.id_permiso) AS id_permiso,\r\nIF(s.id_usuario IS NULL, CONCAT(\'$LL\',\'AVE\'), s.id_usuario) AS id_usuario,\r\nm.id_menu AS id_menu,\r\n(SELECT nombre FROM sys_menus WHERE id_menu=m.menu_padre),\r\nm.nombre AS nombre_permiso,\r\nIF(s.ver IS NULL, 0, s.ver) AS ver,\r\nIF(s.modificar IS NULL, 0, s.modificar) AS modificar,\r\nIF(s.eliminar IS NULL, 0, s.eliminar) AS eliminar,\r\nIF(s.nuevo IS NULL, 0, s.nuevo) AS nuevo,\r\nIF(s.imprimir IS NULL, 0, s.imprimir) AS imprimir,\r\nIF(s.generar IS NULL, 0, s.generar) AS generar\r\nFROM sys_menus m\r\nLEFT JOIN sys_permisos s ON m.id_menu = s.id_menu AND s.id_usuario=\'$llave\'\r\nWHERE m.en_permisos = 1\r\nAND m.id_menu != m.menu_padre\r\nAND m.menu_padre > 0\r\n', 0, NULL, b'0', '', '', ''),
(15, 'clientesRS', 'Razones sociales', 840, NULL, 'ec_clientes_razones_sociales', 'true', 'true', 'S', 250, '../grid/datosGrid.php?tabla=ec_clientes_razones_sociales&id=', '../grid/guardaGrid.php?tabla=ec_clientes_razones_sociales&llave=', 'S', 'N', 'ec_clientes', 0, 2, 'id_cliente', 'SELECT\r\nid_cliente_rs,\r\nid_cliente,\r\nrfc,\r\nrazon_social,\r\ncalle,\r\nno_int,\r\nno_ext,\r\ncolonia,\r\ndel_municipio,\r\ncp,\r\nlocalidad,\r\nreferencia,\r\nestado,\r\npais\r\nFROM ec_clientes_razones_sociales\r\nWHERE id_cliente=\'$llave\'', 0, NULL, b'0', '', '', ''),
(46, 'detalleMovimiento', 'Detalle de movimiento', 840, NULL, 'ec_detalle_movimiento', 'true', 'true', 'S', 250, '../grid/datosGrid.php?tabla=ec_detalle_movimiento&id=', '../grid/guardaGrid.php?tabla=ec_detalle_movimiento&llave=', 'S', 'N', 'ec_movimiento_inventario', 0, 1, 'id_movimiento_inventario', 'SELECT\r\nid_detalle_movimiento,\r\nid_movimiento_inventario,\r\nid_producto,\r\ncantidad\r\nFROM ec_detalle_movimiento\r\nWHERE id_movimiento_inventario =\'$llave\'', 0, NULL, b'0', '', '', ''),
(47, 'detalleVenta', 'Productos', 840, 'validaInventarios()', 'ec_detalle_venta', 'true', 'true', 'S', 250, '../grid/datosGrid.php?tabla=ec_detalle_venta&id=', '../grid/guardaGrid.php?tabla=ec_detalle_venta&llave=', 'S', 'N', 'ec_ventas', 0, 1, 'id_venta', 'SELECT\r\ndv.id_detalle_venta,\r\ndv.id_venta,\r\ndv.id_producto, \r\np.nombre,\r\np.nombre_etiqueta,\r\ndv.cantidad,\r\ndv.precio,\r\ndv.monto,\r\n\'-\'\r\nFROM ec_detalle_venta dv\r\nJOIN ec_productos p ON dv.id_producto = p.id_productos \r\nWHERE dv.id_venta =\'$llave\'', 0, 'TotalVentas()', b'1', 'p.nombre', '5|3', 'SELECT \n p.id_productos,\n CONCAT(p.nombre, \' ° \', p.nombre_etiqueta, \' ° inventario : \', sp.inventario)\nFROM ec_productos p\nLEFT JOIN ec_sucursal_producto sp ON p.id_productos = sp.id_producto WHERE :::'),
(50, 'detalleCompra', 'Detalle de compras', 840, NULL, 'ec_detalle_compra', 'true', 'actualizarC(1,\'#\')', 'S', 250, '../grid/datosGrid.php?tabla=ec_detalle_compra&id=', '../grid/guardaGrid.php?tabla=ec_detalle_compra&llave=', 'S', 'N', 'ec_oc', 0, 1, 'id_orden_compra', 'SELECT\ndc.id_compra_detalle,\ndc.id_orden_compra,\ndc.id_producto,\np.nombre,\np.nombre_etiqueta,\ndc.cantidad,\ndc.precio,\n\'\'\nFROM ec_detalle_compra dc\nLEFT JOIN ec_productos p ON p.id_productos=dc.id_producto\nWHERE dc.id_orden_compra =\'$llave\'', 0, 'actPrecComp()', b'1', 'nombre', '5|3', 'SELECT \r\n p.id_productos,\r\n CONCAT(p.nombre, \' ° \', p.nombre_etiqueta, \' ° inventario : \', sp.inventario)\r\nFROM ec_productos p\r\nLEFT JOIN ec_sucursal_producto sp ON p.id_productos = sp.id_producto WHERE :::'),
(51, 'limitesRS', 'Historial de límites de compra y venta', 1000, NULL, 'ec_limites_razon_social', 'true', 'true', 'S', 250, '../grid/datosGrid.php?tabla=ec_limites_razon_social&id=', '../grid/guardaGrid.php?tabla=ec_limites_razon_social&llave=', 'N', 'N', 'ec_emisor', 0, 1, 'id_emisor', 'SELECT\r\nid_limite_razon_social,\r\nid_emisor,\r\nid_usuario,\r\nperiodo,\r\nalerta_limite_compras,\r\nlimite_compras,\r\nalerta_limite_ventas,\r\nlimite_ventas,\r\nobservaciones\r\nFROM ec_limites_razon_social\r\nWHERE id_emisor=\'$llave\'', 0, NULL, b'0', '', '', ''),
(52, 'costumerContacts', 'Contactos de Razon Social', 1000, NULL, 'ec_clientes_contacto', 'true', 'false', 'S', 250, '../grid/datosGrid.php?tabla=ec_clientes_contacto&id=', '../grid/guardaGrid.php?tabla=ec_clientes_contacto&llave=', 'N', 'N', 'ec_clientes', 0, 2, 'id_cliente_facturacion', 'SELECT\r\nid_cliente_contacto,\r\nid_cliente_facturacion,\r\nnombre,\r\ntelefono,\r\ncelular,\r\ncorreo,\r\nuso_cfdi,\r\nfecha_alta,\r\nfecha_ultima_actualizacion,\r\nfolio_unico\r\nFROM ec_clientes_contacto\r\nWHERE id_cliente_facturacion = \'$llave\'', 0, NULL, b'0', '', '', ''),
(53, 'salePayments', 'Pagos de la venta', 1000, NULL, 'ec_venta_pagos', 'false', 'false', 'S', 250, '../grid/datosGrid.php?tabla=ec_venta_pagos&id=', '../grid/guardaGrid.php?tabla=ec_venta_pagos&llave=\r\n', 'N', 'N', 'ec_ventas', 0, 2, 'id_venta', 'SELECT\r\nid_venta_pago,\r\nid_venta,\r\nid_forma_pago,\r\nmonto,\r\nfecha_alta\r\nFROM ec_venta_pagos\r\nWHERE id_venta =\'$llave\'', 0, NULL, b'0', '', '', '');

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

--
-- Estructura de tabla para la tabla `sys_grid_detalle`
--

CREATE TABLE `sys_grid_detalle` (
  `id_grid_detalle` int(11) UNSIGNED NOT NULL,
  `id_grid` int(11) UNSIGNED NOT NULL,
  `display` varchar(45) NOT NULL,
  `campo_tabla` varchar(60) NOT NULL,
  `tipo` varchar(45) NOT NULL,
  `modificable` varchar(2) DEFAULT 'S',
  `mascara` varchar(50) DEFAULT NULL,
  `alineacion` varchar(10) DEFAULT NULL,
  `formula` text,
  `datosDB` text,
  `depende` varchar(10) DEFAULT NULL,
  `on_change` text,
  `largo_combo` int(3) UNSIGNED DEFAULT NULL,
  `sumatoria` varchar(1) DEFAULT 'N',
  `funcion_valida` text,
  `on_key` text,
  `valor_inicial` varchar(90) DEFAULT NULL,
  `requerido` varchar(1) DEFAULT 'N',
  `ancho` int(3) UNSIGNED NOT NULL,
  `html_value` text,
  `on_click` text,
  `orden` int(3) DEFAULT NULL,
  `multiseleccion` varchar(1) NOT NULL DEFAULT 'N'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `sys_grid_detalle` (`id_grid_detalle`, `id_grid`, `display`, `campo_tabla`, `tipo`, `modificable`, `mascara`, `alineacion`, `formula`, `datosDB`, `depende`, `on_change`, `largo_combo`, `sumatoria`, `funcion_valida`, `on_key`, `valor_inicial`, `requerido`, `ancho`, `html_value`, `on_click`, `orden`, `multiseleccion`) VALUES
(6, 2, 'id_permiso', 'id_permiso', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, 'NO', 'N', 0, NULL, NULL, 1, 'N'),
(7, 2, 'id_usuario', 'id_usuario', 'oculto', 'N', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '$LLAVE', 'N', 0, NULL, NULL, 2, 'N'),
(8, 2, 'id_menu', 'id_menu', 'oculto', 'N', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 0, NULL, NULL, 3, 'N'),
(9, 2, 'Módulo', 'NO', 'texto', 'N', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 150, NULL, NULL, 4, 'N'),
(10, 2, 'Nombre', 'NO', 'texto', 'N', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 250, NULL, NULL, 5, 'N'),
(11, 2, 'Ver', 'ver', 'binario', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '0', 'N', 70, NULL, NULL, 6, 'S'),
(12, 2, 'Modificar', 'modificar', 'binario', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '0', 'N', 70, NULL, NULL, 7, 'S'),
(13, 2, 'Eliminar', 'eliminar', 'binario', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '0', 'N', 70, NULL, NULL, 8, 'S'),
(14, 2, 'Nuevo', 'nuevo', 'binario', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '0', 'N', 70, NULL, NULL, 9, 'S'),
(15, 2, 'Imprimir', 'imprimir', 'binario', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '0', 'N', 70, NULL, NULL, 10, 'S'),
(16, 2, 'Generar', 'generar', 'binario', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '0', 'N', 70, NULL, NULL, 10, 'S'),
(95, 15, 'id_cliente_rs', 'id_cliente_rs', 'oculto', 'N', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, 'NO', 'N', 0, NULL, NULL, 1, 'N'),
(96, 15, 'id_cliente', 'id_cliente', 'oculto', 'N', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '$LLAVE', 'N', 0, NULL, NULL, 2, 'N'),
(97, 15, 'RFC', 'rfc', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 90, NULL, NULL, 3, 'N'),
(98, 15, 'Razón social', 'razon_social', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 150, NULL, NULL, 4, 'N'),
(99, 15, 'Calle', 'calle', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 150, NULL, NULL, 5, 'N'),
(100, 15, 'No. int.', 'no_int', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 50, NULL, NULL, 6, 'N'),
(101, 15, 'No. ext.', 'no_ext', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 50, NULL, NULL, 7, 'N'),
(102, 15, 'Colonia', 'colonia', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 150, NULL, NULL, 8, 'N'),
(103, 15, 'Del./Municipio', 'del_municipio', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 150, NULL, NULL, 9, 'N'),
(104, 15, 'CP', 'cp', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 60, NULL, NULL, 9, 'N'),
(353, 47, 'ID', 'id_detalle_venta', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, 'NO', 'N', 0, NULL, NULL, 1, 'N'),
(354, 47, 'ID', 'id_venta', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '$LLAVE', 'N', 150, NULL, NULL, 2, 'N'),
(355, 47, 'Id', 'id_producto', 'entero', 'N', NULL, 'center', NULL, 'SELECT \n	p.id_productos,\n 	CONCAT(p.nombre, \' ° \', p.nombre_etiqueta, \' ° inventario : \', sp.inventario)\nFROM ec_productos p\nLEFT JOIN ec_sucursal_producto sp ON p.id_productos = sp.id_producto\nWHERE (p.nombre LIKE \'%$LLAVE%\' OR p.id_productos = \'$LLAVE\')\nAND sp.id_sucursal = 1', 'null', 'cambiaDesc(\'#\', \'detalleVenta\', 2, 3,\'~\',\'___\',\'???\');getDatosC(\'#\');', NULL, 'N', NULL, NULL, NULL, 'N', 50, NULL, NULL, 3, 'N'),
(356, 47, 'Cantidad', 'cantidad', 'entero', 'S', NULL, NULL, NULL, NULL, NULL, 'TotalVentas()', NULL, 'N', NULL, NULL, '1', 'N', 100, NULL, NULL, 6, 'N'),
(357, 47, 'Precio', 'precio', 'decimal', 'S', '$#,###.##', NULL, NULL, NULL, NULL, 'TotalVentas()', NULL, 'N', NULL, NULL, NULL, 'N', 100, NULL, NULL, 7, 'N'),
(358, 47, 'Monto', 'monto', 'formula', 'N', '$#,###.##', NULL, '$Cantidad*$Precio', NULL, NULL, NULL, NULL, 'S', NULL, NULL, '0', 'N', 200, NULL, NULL, 8, 'N'),
(359, 50, 'ID', 'id_compra_detalle', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, 'NO', 'N', 0, NULL, NULL, 1, 'N'),
(360, 50, 'ID', 'id_orden_compra', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '$LLAVE', 'N', 150, NULL, NULL, 2, 'N'),
(361, 50, 'Id', 'id_producto', 'entero', 'N', NULL, 'center', NULL, 'SELECT \n	p.id_productos,\n 	CONCAT(p.nombre, \' °  \', p.nombre_etiqueta, \' ° inventario : \', sp.inventario)\nFROM ec_productos p\nLEFT JOIN ec_sucursal_producto sp ON p.id_productos = sp.id_producto\nWHERE (p.nombre LIKE \'%$LLAVE%\' OR p.id_productos = \'$LLAVE\')\nAND sp.id_sucursal = 1', 'null', 'cambiaDesc(\'#\', \'detalleCompra\', 2, 3,\'~\',\'___\',\'???\');getDatosC(\'#\');actPrecComp();', NULL, 'N', NULL, NULL, NULL, 'N', 50, NULL, NULL, 3, 'N'),
(362, 50, 'Cantidad', 'cantidad', 'entero', 'S', NULL, NULL, NULL, NULL, NULL, 'actPrecComp()', NULL, 'N', NULL, NULL, '1', 'N', 100, NULL, NULL, 6, 'N'),
(363, 50, 'Precio', 'precio', 'decimal', 'S', '$#,###.##', NULL, NULL, NULL, NULL, 'actPrecComp()', NULL, 'N', NULL, NULL, NULL, 'N', 100, NULL, NULL, 7, 'N'),
(364, 50, 'Monto', 'NO', 'formula', 'N', '$#,###.##', NULL, '$Cantidad*$Precio', NULL, NULL, NULL, NULL, 'S', NULL, NULL, '0', 'N', 200, NULL, NULL, 8, 'N'),
(365, 46, 'ID', 'id_detalle_movimiento', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, 'NO', 'N', 0, NULL, NULL, 1, 'N'),
(366, 46, 'ID', 'id_movimiento_inventario', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '$LLAVE', 'N', 150, NULL, NULL, 2, 'N'),
(367, 46, 'Producto', 'id_producto', 'combo', 'S', NULL, NULL, NULL, 'SELECT\r\nid_productos,\r\nCONCAT( id_productos, \' - \', nombre ) \r\nFROM ec_productos ', 'null', '', NULL, 'N', NULL, NULL, NULL, 'N', 300, NULL, NULL, 3, 'N'),
(368, 46, 'Cantidad', 'cantidad', 'entero', 'S', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '1', 'N', 100, NULL, NULL, 4, 'N'),
(369, 15, 'Localidad', 'localidad', 'texto', 'S', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 150, NULL, NULL, 9, 'N'),
(370, 15, 'Referencia', 'referencia', 'texto', 'S', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 150, NULL, NULL, 9, 'N'),
(371, 15, 'Estado', 'estado', 'texto', 'S', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 150, NULL, NULL, 9, 'N'),
(372, 15, 'País', 'pais', 'texto', 'S', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 150, NULL, NULL, 9, 'N'),
(373, 47, 'Inventario', 'NO', 'decimal', 'N', '#,###', 'right', '', NULL, NULL, NULL, NULL, 'N', NULL, NULL, '0', 'N', 100, NULL, NULL, 9, 'N'),
(374, 51, 'ID', 'id_limite_razon_social', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, 'NO', 'N', 0, NULL, NULL, 1, 'N'),
(375, 51, 'ID', 'id_emisor', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '$LLAVE', 'N', 0, NULL, NULL, 2, 'N'),
(376, 51, 'id_usuario', 'id_usuario', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '$USUARIO', 'N', 0, NULL, NULL, 3, 'N'),
(377, 51, 'Año', 'periodo', 'entero', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 70, NULL, NULL, 4, 'N'),
(378, 51, 'Alerta Compras', 'alerta_limite_compras', 'decimal', 'S', NULL, 'rigth', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 100, NULL, NULL, 5, 'N'),
(379, 51, 'Límite Compras', 'limite_compras', 'decimal', 'S', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 100, NULL, NULL, 6, 'N'),
(380, 51, 'Alerta Ventas', 'alerta_limite_ventas', 'decimal', 'S', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 100, NULL, NULL, 7, 'N'),
(381, 51, 'Limite Ventas', 'limite_ventas', 'decimal', 'S', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 100, NULL, NULL, 8, 'N'),
(382, 51, 'Observaciones', 'observaciones', 'texto', 'S', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 150, NULL, NULL, 9, 'N'),
(383, 47, 'Nombre', 'NO', 'texto', 'N', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 300, NULL, NULL, 4, 'N'),
(384, 50, 'Producto', 'NO', 'texto', 'N', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 300, NULL, NULL, 4, 'N'),
(385, 47, 'Nombre etiqueta', 'NO', 'CHAR', 'N', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 200, NULL, NULL, 5, 'N'),
(386, 50, 'Nombre etiqueta', 'NO', 'CHAR', 'N', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 200, NULL, NULL, 5, 'N'),
(387, 52, 'id', 'id_cliente_contacto', 'oculto', 'N', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 0, NULL, NULL, 1, 'N'),
(388, 52, 'id_cliente', 'id_cliente_facturacion', 'oculto', 'S', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, '$LLAVE', 'N', 0, NULL, NULL, 2, 'N'),
(389, 52, 'Nombre contacto', 'nombre', 'texto', 'S', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 200, NULL, NULL, 3, 'N'),
(390, 52, 'Telefono', 'telefono', 'entero', 'S', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 120, NULL, NULL, 4, 'N'),
(391, 52, 'Celular', 'celular', 'entero', 'S', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 120, NULL, NULL, 5, 'N'),
(392, 52, 'Correo', 'correo', 'texto', 'S', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'S', 150, NULL, NULL, 6, 'N'),
(393, 52, 'CFDI', 'uso_cfdi', 'combo', 'S', NULL, 'center', NULL, 'SELECT\r\nid, \r\nnombre\r\nFROM ec_cfdi\r\nWHERE 1', 'null', NULL, NULL, 'N', NULL, NULL, NULL, 'N', 150, NULL, NULL, 7, 'N'),
(394, 52, 'Fecha Alta', 'fecha_alta', 'texto', 'N', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 100, NULL, NULL, 8, 'N'),
(395, 52, 'Fecha Act.', 'fecha_ultima_actualizacion', 'texto', 'N', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 100, NULL, NULL, 9, 'N'),
(396, 52, 'Folio Unico', 'folio_unico', 'texto', 'N', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 100, NULL, NULL, 10, 'N'),
(397, 53, 'id', 'id_venta_pago', 'oculto', 'N', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 0, NULL, NULL, 1, 'N'),
(398, 53, 'id_venta', 'id_venta', 'oculto', 'N', NULL, 'center', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 0, NULL, NULL, 2, 'N'),
(399, 53, 'Forma de pago', 'id_forma_pago', 'combo', 'N', NULL, 'left', NULL, 'SELECT\r\nid_forma_pago,\r\nnombre\r\nFROM ec_forma_pago\r\nWHERE 1', 'null', NULL, NULL, 'N', NULL, NULL, NULL, 'N', 200, NULL, NULL, 3, 'N'),
(400, 53, 'Monto', 'monto', 'decimal', 'N', NULL, 'right', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 150, NULL, NULL, 4, 'N'),
(401, 53, 'Fecha alta', 'NO', 'texto', 'N', NULL, 'left', NULL, NULL, NULL, NULL, NULL, 'N', NULL, NULL, NULL, 'N', 200, NULL, NULL, 5, 'N');

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

--
-- Estructura de tabla para la tabla `sys_groups`
--

CREATE TABLE `sys_groups` (
  `id_grupo` int(11) UNSIGNED NOT NULL,
  `nombre` varchar(45) NOT NULL,
  `area` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Estructura de tabla para la tabla `sys_herramientas`
--

CREATE TABLE `sys_herramientas` (
  `id_herramienta` int(11) NOT NULL,
  `titulo` varchar(150) NOT NULL,
  `consulta` text NOT NULL,
  `descripcion` varchar(400) NOT NULL,
  `campo_filtro_sucursal` varchar(400) DEFAULT NULL,
  `campo_filtro_fecha1` varchar(400) DEFAULT NULL,
  `campo_filtro_fecha2` varchar(400) DEFAULT NULL,
  `campo_filtro_familia` varchar(400) DEFAULT NULL,
  `campo_filtro_tipo` varchar(400) DEFAULT NULL,
  `campo_filtro_subtipo` varchar(400) DEFAULT NULL,
  `campo_filtro_color` varchar(400) DEFAULT NULL,
  `campo_filtro_almacen` varchar(400) DEFAULT NULL,
  `campo_filtro_es_externo` varchar(400) DEFAULT NULL,
  `tipo_herramienta` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `sys_herramientas` (`id_herramienta`, `titulo`, `consulta`, `descripcion`, `campo_filtro_sucursal`, `campo_filtro_fecha1`, `campo_filtro_fecha2`, `campo_filtro_familia`, `campo_filtro_tipo`, `campo_filtro_subtipo`, `campo_filtro_color`, `campo_filtro_almacen`, `campo_filtro_es_externo`, `tipo_herramienta`) VALUES
(1, 'DETALLE DE MOVIMIENTOS', 'SELECT\np.id_productos AS \'ID PRODUCTO\',\np.nombre AS \'PRODUCTO\',\np.precio_compra AS \'PRECIO COMPRA\',\ndv.precio AS \'PRECIO VENTA\',\ndv.monto AS \'MONTO\',\ndv.cantidad AS \'CANTIDAD\',\nv.fecha AS \'FECHA\',\nv.folio  AS \'FOLIO VENTA\',\nc.nombre AS RFC\nFROM ec_ventas v\nLEFT JOIN ec_detalle_venta dv\nON v.id_venta = dv.id_venta\nLEFT JOIN ec_productos p\nON p.id_productos = dv.id_producto\nLEFT JOIN ec_clientes c\nON c.id_cliente = v.id_cliente\nWHERE ( v.fecha BETWEEN \'$_FECHA_1\' AND \'$_FECHA_2\' )\nORDER BY p.id_productos, dv.precio', 'DETALLE DE MOVIMIENTOS', '', '$_FECHA_1||fecha||calendario(this);|fecha_1|Fecha inicio ventas:', '$_FECHA_2||fecha||calendario(this);|fecha_2|Fecha final ventas:', '', NULL, NULL, NULL, NULL, NULL, 'Consulta'),
(2, 'CONSULTA DE INVENTARIOS A UNA FECHA', 'SELECT\n  p.id_productos AS \'ID PRODUCTO\',\n  p.nombre AS \'PRODUCTO\',\n  p.inventarioInicial AS \'INVENTARIO INICIAL\',\n  SUM(\n  IF( dv.id_detalle_venta IS NOT NULL AND ( v.fecha BETWEEN \'$_FECHA_INICIAL\' AND \'$_FECHA_FINAL\' ), \n      dv.cantidad, \n      0\n    )\n  ) AS \'VENTAS\',\n  p.Movimientos AS \'MOVIMIENTOS\',\n  p.InvFin AS \'INVENTARIO FINAL\'\nFROM\n(\nSELECT\np.orden_lista,\np.id_productos,\np.nombre,\nSUM(\n  IF(m.fecha <= \'$_INV_INICIAL\',\n    IF(md.cantidad IS NULL, 0, tm.afecta*md.cantidad),\n    0\n  )\n) AS inventarioInicial,\nSUM(\n  IF(m.id_venta <> -1 AND m.fecha >= \'$_FECHA_INICIAL\' AND m.fecha <= \'$_FECHA_FINAL\',\n    IF(md.cantidad IS NULL, 0, tm.afecta*md.cantidad),\n    0\n  )\n) AS Movimientos,\nSUM(\n  IF(m.fecha <= \'$_INV_FINAL\',\n    IF(md.cantidad IS NULL, 0, md.cantidad*tm.afecta),\n    0\n  )\n) AS InvFin\nFROM ec_productos p\nLEFT JOIN ec_detalle_movimiento md ON p.id_productos = md.id_producto\nLEFT JOIN ec_movimiento_inventario m ON md.id_movimiento_inventario = m.id_movimiento_inventario\nLEFT JOIN ec_tipos_movimiento tm ON m.id_tipo_movimiento = tm.id_movimiento\nLEFT JOIN ec_ventas pdo ON m.id_venta = pdo.id_venta\nWHERE 1\nGROUP BY p.id_productos\n) p\nLEFT JOIN ec_detalle_venta dv\nON dv.id_producto = id_productos\nLEFT JOIN ec_ventas v\nON dv.id_venta = v.id_venta\nAND ( v.fecha BETWEEN \'$_FECHA_INICIAL\' AND \'$_FECHA_FINAL\' )\nWHERE 1\nGROUP BY p.id_productos\nORDER BY orden_lista', 'CONSULTA DE INVENTARIOS A UNA FECHA', NULL, '$_INV_INICIAL||fecha||calendario(this);|fecha_1|Fecha inicial de inventario:', '$_INV_FINAL||fecha||calendario(this);|fecha_2|Fecha final de inventario:', '$_FECHA_INICIAL||fecha||calendario(this);|fecha_3|Fecha de :', '$_FECHA_FINAL||fecha||calendario(this);|fecha_4|Fecha a :', NULL, NULL, NULL, NULL, 'Consulta'),
(3, 'VENTAS EN UN PERIODO', 'SELECT\n    v.id_venta AS \'ID VENTA\',\n    v.folio AS \'FOLIO\',\n    v.total AS \'TOTAL\',\n    SUM( IF( dv.id_detalle_venta IS NULL, 0, dv.monto ) ) AS \'TOTAL DETALLE\',\n    v.fecha AS \'FECHA\',\n    IF( v.facturado = 0, \'0\', \'Timbrada\' )\nFROM ec_ventas v\nLEFT JOIN ec_detalle_venta dv\nON v.id_venta = dv.id_venta\nWHERE ( v.fecha BETWEEN \'$_FECHA_1\' AND \'$_FECHA_2\' )\nGROUP BY v.id_venta', 'VENTAS EN UN PERIODO', NULL, '$_FECHA_1||fecha||calendario(this);|fecha_1|Fecha inicio :', '$_FECHA_2||fecha||calendario(this);|fecha_2|Fecha final :', NULL, NULL, NULL, NULL, NULL, NULL, 'Consulta'),
(4, 'ELIMNAR DETALLE DE MOVIMIENTOS DE ALMACEN DE VENTAS', 'DELETE dm FROM ec_detalle_movimiento dm\nLEFT JOIN ec_movimiento_inventario mi\nON mi.id_movimiento_inventario = dm.id_movimiento_inventario\nLEFT JOIN ec_ventas v \nON mi.id_venta = v.id_venta\nWHERE v.facturado = 0\nAND ( v.fecha BETWEEN \'$_FECHA_1\' AND \'$_FECHA_2\' )', 'ELIMNAR DETALLE DE MOVIMIENTOS DE ALMACEN DE VENTAS', NULL, '$_FECHA_1||fecha||calendario(this);|fcha_1|Fecha inicio : ', '$_FECHA_2||fecha||calendario(this);|fcha_2|Fecha final : ', NULL, NULL, NULL, NULL, NULL, NULL, 'Herramienta'),
(5, 'ELIMINAR DETALLE DE VENTAS', 'DELETE FROM ec_detalle_venta\n    WHERE id_venta IN(\n     SELECT \n         id_venta\n      FROM ec_ventas\n        WHERE facturado = 0\n        AND ( fecha BETWEEN \'$_FECHA_1\' AND \'$_FECHA_2\' )\n    )', 'ELIMINAR DETALLE DE VENTAS', NULL, '$_FECHA_1||fecha||calendario(this);|fcha_1|Fecha inicio : ', '$_FECHA_2||fecha||calendario(this);|fcha_2|Fecha final : ', NULL, NULL, NULL, NULL, NULL, NULL, 'Herramienta'),
(6, 'REASIGNACION DE PRODUCTOS DE NOTAS DE VENTA', 'SELECT NOW()', 'REASIGNACION DE PRODUCTOS DE NOTAS DE VENTA', NULL, '$_FECHA_1||fecha||calendario(this);|fecha_1|Fecha inicio :', '$_FECHA_2||fecha||calendario(this);|fecha_2|Fecha final :', NULL, NULL, NULL, NULL, NULL, NULL, 'Herramienta'),
(7, 'CONSULTA DE INVENTARIO DE PRODUCTOS A UNA FECHA', 'SELECT\r\n	p.id_productos AS \'ID PRODUCTO\',\r\n	p.nombre AS \'PRODUCTO\',\r\n 	SUM( IF( dm.id_detalle_movimiento IS NULL OR mi.fecha > \'$_INV_LIMITE\', \r\n                    0, \r\n                    ( tm.afecta * dm.cantidad ) \r\n                 ) \r\n        ) AS \'INVENTARIO\',\r\n    IF( p.id_tipo_facturacion = 1, \r\n       \'NINGUNO\', \r\n       IF( p.id_tipo_facturacion = 3,\r\n         \'NO CONTROLADO\',\r\n         \'ES CONTROLADO\' \r\n        ) \r\n    ) AS \'PRODUCTO CONTROLADO\',\r\n    p.precio_compra\r\nFROM ec_productos p\r\nLEFT JOIN ec_detalle_movimiento dm\r\nON p.id_productos = dm.id_producto\r\nLEFT JOIN ec_movimiento_inventario mi\r\nON mi.id_movimiento_inventario = dm.id_movimiento_inventario\r\nLEFT JOIN ec_tipos_movimiento tm \r\nON tm.id_movimiento = mi.id_tipo_movimiento\r\nWHERE id_productos > 0\r\nGROUP BY p.id_productos', 'CONSULTA DE INVENTARIO DE PRODUCTOS A UNA FECHA', NULL, '$_INV_LIMITE||fecha||calendario(this);|fecha_1|Fecha limite de inventario:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Consulta');

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

--
-- Estructura de tabla para la tabla `sys_listados`
--

CREATE TABLE `sys_listados` (
  `id_listado` int(11) UNSIGNED NOT NULL,
  `titulo` varchar(45) NOT NULL,
  `tabla` varchar(120) NOT NULL,
  `no_tabla` int(2) NOT NULL DEFAULT '0',
  `consulta` text NOT NULL,
  `anchos` varchar(120) DEFAULT NULL,
  `alineacion` varchar(200) DEFAULT NULL,
  `campos` text NOT NULL,
  `ver` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `modificar` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `eliminar` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `condicion` text,
  `nuevo` tinyint(1) NOT NULL,
  `buscador` bit(1) NOT NULL DEFAULT b'0',
  `consulta_buscador` text NOT NULL,
  `condiciones_buscador` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_listados` (`id_listado`, `titulo`, `tabla`, `no_tabla`, `consulta`, `anchos`, `alineacion`, `campos`, `ver`, `modificar`, `eliminar`, `condicion`, `nuevo`, `buscador`, `consulta_buscador`, `condiciones_buscador`) VALUES
(1, ' Usuarios', 'sys_users', 0, 'SELECT\r\nid_usuario AS ID,\r\nCONCAT(nombre, \' \', apellido_paterno) AS Nombre,\r\nlogin AS Login\r\nFROM sys_users', '0|250|150', 'center|left|left', 'id_usuario|CONCAT(nombre, \' \', apellido_paterno)|login', 1, 1, 1, NULL, 1, b'0', '', ''),
(2, ' Sucursales', 'sys_sucursales', 0, 'SELECT id_sucursal AS ID, nombre AS Nombre FROM sys_sucursales', '0|350', 'center|left', 'id_sucursal|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(3, 'Configuración de pantalla', 'sys_conf_pantalla', 0, 'SELECT\r\nid_configuracion_pantalla AS ID,\r\nnombre AS Plantilla\r\nFROM sys_conf_pantalla\r\nJOIN sys_plantilla ON sys_conf_pantalla.id_plantilla = sys_plantilla.id_plantilla', '0|350', 'center|left', 'id_configuracion_pantalla|nombre', 1, 1, 0, NULL, 0, b'0', '', ''),
(4, 'Países', 'sys_paises', 0, 'SELECT id_pais AS ID, nombre AS Nombre FROM sys_paises', '0|350', 'center|left', 'id_pais|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(5, 'Estados', 'sys_estados', 0, 'SELECT\r\nid_estado AS ID,\r\nsys_estados.nombre AS Nombre,\r\nsys_paises.nombre AS \'País\'\r\nFROM sys_estados\r\nJOIN sys_paises ON sys_estados.id_pais = sys_paises.id_pais', '0|250|250', 'center|left|left', 'id_estado|sys_estados.nombre|sys_paises.nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(6, 'Configuración de pedidos', 'ec_conf_pedidos', 0, 'SELECT\r\nid_conf_pedidos AS ID,\r\n\'Configuración de pedidos\' AS Nombre\r\nFROM ec_conf_pedidos', '0|350', 'center|left', 'id_conf_pedidos|\'Configuración de pedidos\'', 1, 1, 0, NULL, 0, b'0', '', ''),
(7, 'Configuración de OC', 'ec_conf_oc', 0, 'SELECT\r\nid_conf_oc AS ID,\r\n\'Configuración de OC\' AS Nombre\r\nFROM ec_conf_oc', '0|350', 'center|left', 'id_conf_oc|\'Configuración de OC\'', 1, 1, 0, NULL, 0, b'0', '', ''),
(8, 'Configuración general', 'ec_conf_gral', 0, 'SELECT\r\nid_configuracion AS ID,\r\n\'Configuración general\' AS nombre\r\nFROM ec_conf_gral', '0|350', 'center|left', 'id_configuracion|\'Configuración general\'', 1, 1, 0, NULL, 0, b'0', '', ''),
(9, 'Proveedores', 'ec_proveedor', 0, 'SELECT\r\nid_proveedor AS ID,\r\nnombre_comercial AS Nombre,\r\nrfc AS RFC\r\nFROM ec_proveedor', '0|400|250', 'center|left|left', 'id_proveedor|nombre_comercial|rfc', 1, 1, 1, 'AND id_sucursal=$SUCURSAL AND id_proveedor > 0', 1, b'0', '', ''),
(10, 'Familias', 'ec_categoria', 0, 'SELECT id_categoria AS ID, nombre AS Nombre FROM ec_categoria', '0|600', 'center|left', 'id_categoria|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(11, 'Tipos', 'ec_subcategoria', 0, 'SELECT\r\ns.id_subcategoria AS ID,\r\ns.nombre AS Nombre,\r\nc.nombre AS \'Categoría\'\r\nFROM ec_subcategoria s\r\nJOIN ec_categoria c ON s.id_categoria = c.id_categoria', '0|350|350', 'center|left|left', 's.id_subcategoria|s.nombre|c.nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(12, ' Productos', 'ec_productos', 0, 'SELECT\r\nec_productos.id_productos AS ID, \r\nec_productos.orden_lista AS \'Orden de lista\',\r\nec_productos.nombre AS Nombre FROM ec_productos', '0|120|350', 'center|center|left', 'id_productos|orden_lista|nombre', 1, 1, 1, 'AND ec_productos.id_productos > 0', 1, b'1', 'ec_productos.nombre', ''),
(14, 'Movimientos de almacén', 'ec_movimiento_almacen', 0, 'SELECT\r\nm.id_movimiento_almacen AS ID,\r\ntm.nombre AS Tipo,\r\nfecha AS Fecha,\r\n(\r\n	SELECT\r\n	GROUP_CONCAT(p.nombre SEPARATOR \', \')\r\n	FROM ec_movimiento_detalle md\r\n	JOIN ec_productos p ON md.id_producto = p.id_productos\r\n	WHERE md.id_movimiento = m.id_movimiento_almacen\r\n) AS Productos\r\nFROM ec_movimiento_almacen m\r\nJOIN ec_tipos_movimiento tm ON m.id_tipo_movimiento = tm.id_tipo_movimiento', '0|250|120|350', 'center|left|center|left', 'm.id_movimiento_almacen,tm.nombre|m.fecha|(SELECT GROUP_CONCAT(p.nombre SEPARATOR \', \') FROM ec_movimiento_detalle md JOIN ec_productos p ON md.id_producto = p.id_productos WHERE md.id_movimiento = m.id_movimiento_almacen)', 1, 1, 1, 'AND id_sucursal=$SUCURSAL AND m.id_movimiento_almacen > 0', 1, b'0', '', ''),
(15, 'Guías', 'ec_guias', 0, 'SELECT id_guia AS ID, numero AS \'Número\', tg.empresa AS \'Tipo de guia\' FROM ec_guias g JOIN ec_tipos_guia tg ON g.id_tipo_guia = tg.id_tipo_guia', '0|180|350', 'center|left|left', 'id_guia|numero|tg.empresa', 1, 1, 1, NULL, 1, b'0', '', ''),
(16, 'Tipos de guía', 'ec_tipos_guia', 0, 'SELECT id_tipo_guia AS ID, empresa AS Empresa, kilometros AS Kilometros, kilogramos AS Kilogramos FROM ec_tipos_guia', '0|250|100|100', 'center|left|center|center', 'id_tipo_guia|empresa|kilometros|kilogramos', 1, 1, 1, NULL, 1, b'0', '', ''),
(17, 'Mensajería', 'ec_rutas', 0, 'SELECT\r\nid_ruta AS ID,\r\nfecha_partida AS Fecha,\r\nhora_partida AS Hora,\r\nCONCAT(r.nombre, \' \', r.apellido_paterno) AS Repartidor,\r\nIF(entregado = 0, \'NO\', \'SI\') AS Terminado\r\nFROM ec_rutas rt\r\nLEFT JOIN ec_repartidores r ON rt.id_repartidor = r.id_repartidor ', '0|120|120|350|120', 'center|center|center|left|center', 'id_ruta|fecha_partida|hora_partida AS Hora|CONCAT(r.nombre, \' \', r.apellido_paterno)|IF(entregado = 0, \'NO\', \'SI\')', 1, 1, 1, NULL, 1, b'0', '', ''),
(18, 'Tipos de movimiento', 'ec_tipos_movimiento', 0, 'SELECT id_tipo_movimiento AS ID, nombre AS Nombre FROM ec_tipos_movimiento', '0|600', 'center|left', 'id_tipo_movimiento|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(19, 'Notas de crédito', 'ec_notas_credito', 0, 'SELECT\r\nn.id_nota_credito AS ID,\r\nn.fecha AS Fecha,\r\nCONCAT(\'$\',FORMAT(n.total, 2)) AS Monto,\r\np.nombre_comercial AS Proveedor\r\nFROM ec_notas_credito n\r\nJOIN ec_proveedor p ON n.id_proveedor = p.id_proveedor', '0|120|120|350', 'center|center|right|left', 'n.id_nota_credito|n.fecha|n.total|Monto|IF(c.nombre IS NULL, p.nombre_comercial, c.nombre)', 1, 1, 1, 'AND n.id_sucursal=$SUCURSAL AND n.tipo_nc=1 AND n.id_nota_credito > 0', 1, b'0', '', ''),
(20, 'Repartidores', 'ec_repartidores', 0, 'SELECT id_repartidor AS ID, CONCAT(nombre, \' \', apellido_paterno) AS Nombre FROM ec_repartidores', '0|600', 'center|left', 'id_repartidor|CONCAT(nombre, \' \', apellido_paterno)', 1, 1, 1, 'AND id_repartidor > 0', 1, b'0', '', ''),
(21, 'Notas de cargo', 'ec_nota_cargo', 0, 'SELECT\r\nn.id_nota_cargo AS ID,\r\nn.fecha AS Fecha,\r\nCONCAT(\'$\', FORMAT(n.total, 2)) AS Monto,\r\np.nombre_comercial AS Proveedor\r\nFROM ec_nota_cargo n\r\nJOIN ec_proveedor p ON n.id_proveedor = p.id_proveedor', '0|120|120|350', 'center|center|right|left', 'n.id_nota_cargo|n.fecha|n.total|p.nombre_comercial', 1, 1, 1, 'AND n.id_sucursal=$SUCURSAL AND tipo_nc=1 AND id_nota_cargo > 0', 1, b'0', '', ''),
(22, 'Tipos de envio', 'ec_tipos_envio', 0, 'SELECT id_tipo_envio AS ID, nombre AS Nombre FROM ec_tipos_envio', '0|600', 'center|left', 'id_tipo_envio|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(23, 'Transportes', 'ec_transportes', 0, 'SELECT id_transporte AS ID, nombre AS Nombre, placas AS Placas FROM ec_transportes', '0|350|200', 'center|left|left', 'id_transporte|nombre|placas', 1, 1, 1, 'AND id_transporte > 1', 1, b'0', '', ''),
(24, ' Órdenes de compras', 'ec_oc', 0, 'SELECT\nid_orden_compra AS ID,\nfolio AS Folio,\np.nombre_comercial AS Proveedor,\nfecha AS Fecha\nFROM ec_oc oc\nJOIN ec_proveedor p ON oc.id_proveedor = p.id_proveedor\n', '0|90|250|80', 'center|center|left|center', 'id_orden_compra|folio|p.nombre,fecha\r\n\r\n', 1, 1, 1, 'AND oc.id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(25, 'Clientes', 'ec_clientes', 0, 'SELECT id_cliente AS ID, nombre AS Nombre, telefono AS \'Teléfono\', email AS \'E-mail\' FROM ec_clientes', '0|300|150|300', 'center|left|left|left', 'id_cliente|nombre|telefono|email', 1, 0, 0, 'AND id_sucursal = $SUCURSAL AND id_cliente >= 10000', 0, b'0', '', ''),
(26, 'Pedidos', 'ec_pedidos', 0, 'SELECT\r\np.id_pedido AS ID,\r\np.folio_pedido AS Folio,\r\nc.nombre AS Cliente,\r\ne.nombre AS Estado\r\nFROM ec_pedidos p\r\nJOIN ec_clientes c ON p.id_cliente = c.id_cliente\r\nJOIN ec_estatus_pedido e ON p.id_estatus = e.id_estatus', '0|120|350|160', 'center|center|left|left', 'p.id_pedido|p.folio_pedido|c.nombre|e.nombre', 1, 0, 1, 'AND p.id_sucursal=$SUCURSAL AND p.id_pedido NOT IN(-1) AND p.id_estatus NOT IN(8) AND folio_pedido IS NOT NULL', 0, b'0', '', ''),
(27, 'Notas de venta', 'ec_pedidos', 1, 'SELECT\r\np.id_pedido AS ID,\r\np.folio_nv AS Folio,\r\nc.nombre AS Cliente,\r\np.total AS Monto\r\nFROM ec_pedidos p\r\nJOIN ec_clientes c ON p.id_cliente = c.id_cliente', '0|120|350|160', 'center|center|left|right', 'p.id_pedido|p.folio_nv|c.nombre|p.total', 1, 0, 1, 'AND p.id_sucursal=$SUCURSAL AND p.id_pedido NOT IN(-1) AND p.id_estatus NOT IN(1,3)', 0, b'0', '', ''),
(28, 'Cotizaciones', 'ec_pedidos', 2, 'SELECT p.id_pedido AS ID, p.folio_cotizacion AS Folio, c.nombre AS Cliente, p.total AS Monto FROM ec_pedidos p JOIN ec_clientes c ON p.id_cliente = c.id_cliente', '0|120|250|120', 'center|center|left|right', 'p.id_pedido|p.folio_cotizacion|c.nombre|p.total', 1, 1, 1, 'AND p.id_sucursal=$SUCURSAL AND p.id_pedido NOT IN(-1) AND p.id_estatus NOT IN(1,3) AND (p.id_estatus IN(8) OR fue_cot = 1)', 1, b'0', '', ''),
(29, 'Prospectos', 'ec_clientes', 1, 'SELECT id_cliente AS ID, nombre AS Nombre, telefono AS \'Teléfono\', email AS \'E-mail\' FROM ec_clientes', '0|200|120|250', 'center|left|left|left', 'id_cliente|nombre|telefono|email', 1, 1, 1, 'AND id_sucursal = $SUCURSAL AND id_cliente NOT IN(-1) AND es_cliente = 0', 1, b'0', '', ''),
(30, 'Notas de crédito', 'ec_notas_credito', 1, 'SELECT\nn.id_nota_credito AS ID,\nn.fecha AS Fecha,\nn.total AS Monto,\nc.nombre AS Cliente\nFROM ec_notas_credito n\nJOIN ec_clientes c ON n.id_cliente = c.id_cliente', '0|120|150|350', 'center|center|right|left', 'n.id_nota_credito|n.fecha|n.total|Monto|c.nombre', 1, 1, 1, 'AND n.id_sucursal=$SUCURSAL AND n.tipo_nc=2', 1, b'0', '', ''),
(31, 'Notas de cargo', 'ec_nota_cargo', 1, 'SELECT\r\nn.id_nota_cargo AS ID,\r\nn.fecha AS Fecha,\r\nn.total AS Monto,\r\nc.nombre AS Cliente\r\nFROM ec_nota_cargo n\r\nJOIN ec_clientes c ON n.id_cliente = c.id_cliente', '0|120|120|350', 'center|center|right|left', 'n.id_nota_cargo|n.fecha|n.total|c.nombre', 1, 1, 1, 'AND n.id_sucursal=$SUCURSAL AND tipo_nc=2', 1, b'0', '', ''),
(32, 'Precios de venta', 'ec_precios', 0, 'SELECT\r\nlp.id_precio AS ID,\r\nlp.nombre AS Nombre,\r\nlp.fecha AS Fecha\r\nFROM ec_precios lp', '0|400|200', 'center|left|center', 'lp.id_precio|lp.nombre|lp.fecha', 1, 1, 1, '', 1, b'0', '', ''),
(33, 'Vendedores', 'ec_vendedores', 0, 'SELECT\r\nv.id_vendedor AS ID,\r\nCONCAT(u.nombre, \' \', u.apellido_paterno) AS Nombre\r\nFROM ec_vendedores v\r\nJOIN sys_users u ON v.id_usuario = u.id_usuario', '0|400', 'center|left', 'v.id_vendedor|CONCAT(u.nombre, \' \', u.apellido_paterno)', 1, 1, 1, 'AND v.id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(34, 'Cuentas por pagar', 'ec_cuentas_por_pagar', 0, 'SELECT\r\nc.id_cxp AS ID,\r\np.nombre_comercial AS Proveedor,\r\nCONCAT(\'$\',FORMAT(c.monto,2)) AS Monto,\r\nCONCAT(\'$\',FORMAT(c.abonado,2)) AS Abonado,\r\nCONCAT(\'$\',FORMAT(c.monto-c.abonado,2)) AS Resta\r\nFROM ec_cuentas_por_pagar c\r\nJOIN ec_proveedor p ON c.id_proveedor = p.id_proveedor\r\n', '0|400|120|120|120', 'center|left|right|right|right', 'c.id_cxp|p.nombre_comercial|c.monto|c.abonado|c.monto-c.abonado', 1, 1, 0, 'AND c.id_sucursal=$SUCURSAL', 0, b'0', '', ''),
(35, 'Cuentas por cobrar', 'ec_cuentas_por_cobrar', 0, 'SELECT\r\nc.id_cxc AS ID,\r\ncl.nombre AS Cliente,\r\nCONCAT(\'$\', FORMAT(c.monto, 2)) AS Monto,\r\nCONCAT(\'$\', FORMAT(c.abonado, 2)) AS Abonado,\r\nCONCAT(\'$\', FORMAT(c.monto-c.abonado, 2)) AS Resta\r\nFROM ec_cuentas_por_cobrar c\r\nJOIN ec_clientes cl ON c.id_cliente = cl.id_cliente', '0|400|120|120|120', 'center|left|right|right|right', 'c.id_cxc|cl.nombre|c.monto|c.abonado|c.monto-c.abonado', 1, 1, 0, 'AND c.id_sucursal=$SUCURSAL', 0, b'0', '', ''),
(36, 'Cuentas', 'ec_cuentas', 0, 'SELECT\r\nc.id_cuenta AS ID,\r\nb.nombre AS Banco,\r\nc.nombre AS Nombre\r\nFROM ec_cuentas c\r\nJOIN ec_bancos b ON c.id_banco = b.id_banco', '0|300|350', 'center|left|left', 'c.id_cuenta|b.nombre|c.nombre', 1, 1, 1, 'AND id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(37, 'Razones sociales', 'sys_razones_sociales', 0, 'SELECT\r\nid_razon_social AS ID,\r\nrfc AS RFC,\r\nrazon_social AS \'Razón social\'\r\nFROM sys_razones_sociales', '0|200|350', 'center|left|left', 'id_razon_social|rfc|razon_social', 1, 1, 1, 'AND id_razon_social > 0', 1, b'0', '', ''),
(38, 'Tipos de pago', 'ec_tipos_pago', 0, 'SELECT\r\nid_tipo_pago AS ID,\r\nnombre AS Nombre\r\nFROM ec_tipos_pago', '0|350', 'center|left', 'id_tipo_pago|nombre', 1, 1, 1, 'AND id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(39, 'Bancos', 'ec_bancos', 0, 'SELECT id_banco AS ID, nombre AS Nombre FROM ec_bancos', '0|350', 'center|left', 'id_banco|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(40, 'Monedas', 'ec_monedas', 0, 'SELECT id_moneda AS ID, nombre AS Nombre, cambio AS Cambio FROM ec_monedas', '0|300|100', 'center|left|right', 'id_moneda|nombre|cambio', 1, 1, 1, NULL, 1, b'0', '', ''),
(41, 'Facturas', 'ec_pedidos', 3, 'SELECT\r\np.id_pedido AS ID,\r\np.folio_factura AS Folio,\r\nc.nombre AS Cliente,\r\np.total AS Monto\r\nFROM ec_pedidos p\r\nJOIN ec_clientes c ON p.id_cliente = c.id_cliente', '0|120|350|150', 'center|center|left|right', 'p.id_pedido|p.folio_nv|c.nombre|p.total', 1, 0, 0, 'AND p.id_sucursal=$SUCURSAL AND p.id_pedido NOT IN(-1) AND facturado=1', 0, b'0', '', ''),
(42, 'Pendientes', 'ec_pendientes', 0, 'SELECT\r\nid_pendiente AS ID,\r\ndescripcion AS \'Descripción\',\r\nfecha AS Fecha\r\nFROM ec_pendientes', '0|300|100', 'center|left|center', 'id_pendiente|descripcion|fecha', 1, 1, 1, 'AND id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(43, 'Prioridades', 'ec_prioridades', 0, 'SELECT id_prioridad AS ID, descripcion AS Nombre FROM ec_prioridades', '0|300', 'center|left', 'id_prioridad|descripcion', 1, 1, 1, NULL, 1, b'0', '', ''),
(44, 'Corte de caja', 'ec_corte_caja', 0, 'SELECT\r\nid_corte_caja AS ID,\r\nfecha AS Fecha,\r\nhora AS Hora,\r\nmonto_inicial AS \'Monto inicial\',\r\nmonto_final As \'Monto final\'\r\nFROM ec_corte_caja', '0|120|120|120|120', 'center|center|center|right|right', 'id_corte_caja|fecha|hora|monto_inicial|monto_final ', 1, 1, 1, 'AND id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(45, 'Maquila', 'ec_maquila', 0, 'SELECT\r\nm.id_maquila AS ID,\r\nm.folio AS Folio,\r\nm.fecha AS Fecha,\r\np.nombre AS Producto,\r\nm.cantidad AS Cantidad\r\nFROM ec_maquila m\r\nJOIN ec_productos p ON m.id_producto = p.id_productos', '0|140|140|300|140', 'center|center|center|left|right', 'm.id_maquila|m.folio|m.fecha|p.nombre|m.cantidad', 1, 0, 1, 'AND m.id_sucursal=$SUCURSAL AND m.id_maquila > 0', 1, b'0', '', ''),
(46, 'Surtir pedidos', 'ec_pedidos', 4, 'SELECT\r\np.id_pedido AS ID,\r\nIF(p.folio_pedido IS NULL,p.folio_nv, p.folio_pedido) AS Folio,\r\np.fecha_alta AS Fecha,\r\nc.nombre AS Cliente,\r\ne.nombre AS Estado\r\nFROM ec_pedidos p\r\nJOIN ec_clientes c ON p.id_cliente = c.id_cliente\r\nJOIN ec_estatus_pedido e ON p.id_estatus = e.id_estatus', '0|120|180|300|150', 'center|center|center|left|left', 'p.id_pedido|IF(p.folio_pedido IS NULL,p.folio_nv, p.folio_pedido)|p.fecha_alta|c.nombre|e.nombre', 0, 1, 0, 'AND p.id_sucursal=$SUCURSAL AND p.id_pedido NOT IN(-1) AND p.id_estatus IN(2,6) AND folio_nv IS NULL', 0, b'0', '', ''),
(48, 'Acreedores', 'ec_acreedor', 0, 'SELECT\r\na.id_acreedor AS ID,\r\na.nombre AS Nombre,\r\ne.nombre AS Estado,\r\np.nombre AS \'País\'\r\nFROM ec_acreedor a\r\nJOIN sys_estados e ON a.id_estado = e.id_estado\r\nJOIN sys_paises p ON a.id_pais = p.id_pais', '0|400|200|200', 'center|left|left|left', 'a.id_acreedor|a.nombre|e.nombre|p.nombre', 1, 1, 1, 'AND id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(49, 'Gastos inherentes de importación', 'ec_gastos_impuestos', 0, 'SELECT\r\nid_gasto_impuesto AS ID,\r\nnombre AS Nombre\r\nFROM ec_gastos_impuestos', '0|600', 'center|left', 'id_gasto_impuesto|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(50, 'Transferencias', 'ec_transferencias', 0, 'SELECT\nt.id_transferencia AS ID,\ns.nombre AS \'Suc. origen\',\ns2.nombre AS \'Suc. destino\',\nCONCAT(t.fecha, \' \', t.hora) AS \'Fecha\',\ne.nombre AS \'Estatus\'\nFROM ec_transferencias t\nJOIN sys_sucursales s ON t.id_sucursal_origen = s.id_sucursal\nJOIN sys_sucursales s2 ON t.id_sucursal_destino = s2.id_sucursal\nJOIN ec_estatus_transferencia e ON t.id_estado = e.id_estatus', '0|250|250|100|200', 'center|left|left|center|left', 't.id_transferencia|s.nombre|s2.nombre|CONCAT(t.fecha, \' \', t.hora)|e.nombre', 1, 0, 1, 'AND t.id_transferencia > 0', 1, b'0', '', ''),
(51, 'Comparación de inventario', 'ec_comparacion_inv', 0, 'SELECT\r\nc.id_comparacion_inv AS ID,\r\nu.nombre AS \'Usuario\',\r\nCONCAT(c.fecha, \' \', c.hora) AS \'Fecha y Hora\'\r\nFROM ec_comparacion_inv c\r\nJOIN sys_users u ON c.id_usuario = u.id_usuario\r\n', '0|300|300', 'center|left|left', 'c.id_comparacion_inv|u.nombre|CONCAT(c.fecha, \' \', c.hora)', 1, 0, 1, NULL, 1, b'0', '', ''),
(52, 'Devolución', 'ec_devolucion', 0, 'SELECT c.id_devolucion AS ID, c.folio AS Folio, u.nombre AS \'Vendedor\', CONCAT(c.fecha, \' \', c.hora) AS \'Fecha\', p.folio_nv AS \'Nota de venta\' FROM ec_devolucion c JOIN sys_users u ON c.id_usuario = u.id_usuario JOIN ec_pedidos p ON c.id_pedido = p.id_pedido', '0|100|250|200|100', 'center|center|left|center|center', 'c.id_devolucion|c.folio|u.nombre|CONCAT(c.fecha, \' \', c.hora)|p.folio_nv', 1, 0, 1, 'AND c.id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(53, 'Gastos', 'ec_gastos', 0, 'SELECT\nc.id_gastos,\ncg.nombre AS \'Concepto\',\nCONCAT(c.fecha, \' \', c.hora) AS \'Fecha y hora\',\nu.nombre AS \'Usuario\',\nc.monto AS Monto\nFROM ec_gastos c\nJOIN sys_users u ON c.id_usuario = u.id_usuario\nJOIN ec_conceptos_gastos cg ON c.id_concepto = cg.id_concepto\n', '0|300|300|200|100', 'center|left|left|left|left', 'c.id_gastos|cg.nombre|CONCAT(c.fecha, \' \', c.hora)|u.nombre|c.monto', 1, 0, 1, NULL, 1, b'0', '', ''),
(54, 'Conceptos gastos', 'ec_conceptos_gastos', 0, 'SELECT id_concepto AS id,nombre AS nombre FROM ec_conceptos_gastos', '0|500', 'center|center', 'id_concepto|nombre', 1, 1, 1, 'AND id_concepto > 1', 1, b'0', '', ''),
(55, 'Subtipos', 'ec_subtipos', 0, 'SELECT\r\nt.id_subtipos AS \'ID\',\r\nt.nombre AS \'Subtipo\',\r\nc.nombre AS \'Tipo\'\r\nFROM ec_subtipos t\r\nJOIN ec_subcategoria c ON t.id_tipo = c.id_subcategoria\r\n', '0|300|300', 'left|left|left', 'id_subtipos|nombre|id_tipo|', 1, 1, 1, NULL, 1, b'0', '', ''),
(56, 'Numero de luces', 'ec_numero_luces', 0, 'SELECT\nt.id_numero_luces AS \'ID\',\nt.nombre AS \'nombre\',\nc.nombre AS \'Categoria\'\nFROM ec_numero_luces t\nJOIN ec_categoria c ON t.id_categoria = c.id_categoria\n', '0|300|300', 'left|left|left', 'id_numero_luces|nombre|id_categoria|', 1, 1, 1, NULL, 1, b'0', '', ''),
(57, 'Colores', 'ec_colores', 0, 'SELECT\nt.id_colores AS \'ID\',\nt.nombre AS \'Color\',\nc.nombre AS \'categoria\'\nFROM ec_colores t\nJOIN ec_categoria c ON t.id_categoria = c.id_categoria', '0|300|300', 'left|center|center', 't.id_colores|t.nombre|c.id_categoria|', 1, 1, 1, NULL, 1, b'0', '', ''),
(58, 'Tamaños', 'ec_tamanos', 0, 'SELECT t.id_tamanos AS \'ID\',\nt.nombre AS \'Nombre\',\nc.nombre AS \'Categoria\'\nFROM ec_tamanos t\nJOIN ec_categoria c ON t.id_categoria = c.id_categoria', '0|300|300', 'left|center|center', 't.id_tamanos|t.nombre|c.id_categoria', 1, 1, 1, NULL, 1, b'0', '', ''),
(59, 'Tipos de precios', 'ec_tipo_precio', 0, 'SELECT\nid_tipo_precio AS \'ID\',\nnombre AS \'Tipo de precio\'\nFROM ec_tipo_precio', '0|300', 'left|left', 'id_tipo_precio|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(60, 'Almacén', 'ec_almacen', 0, 'SELECT\r\nid_almacen AS \'ID\',\r\nnombre AS \'Almacén\',\r\nprioridad AS \'Prioridad\'\r\nFROM ec_almacen', '0|200|100', 'left|left|center', 'id_almacen|nombre|prioridad', 1, 1, 1, 'AND id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(61, 'Devolución transferencia', 'ec_devolucion_transferencia', 0, 'SELECT\nid_devolucion_transferencia AS \'ID\',\nfolio AS \'Folio\',\nCONCAT(fecha,\' \',hora) AS \'Fecha y hora\'\nFROM ec_devolucion_transferencia\n', '0|200|300', 'left|center|center', 'id_devolucion_transferencia|folio|CONCAT(fecha,\' \',hora)', 1, 1, 1, NULL, 1, b'0', '', ''),
(62, 'Periodos', 'ec_periodos', 0, 'SELECT\nid_periodos AS \'ID\',\nnombre AS \'Pedido\'\nFROM ec_periodos', '0|300', 'center|center', 'id_periodos|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(63, 'Estacionalidad', 'ec_estacionalidad', 0, 'SELECT \ne.id_estacionalidad AS \'ID\', \ne.nombre AS \'Estacionalidad\', \np.nombre AS \'Periodo\'\nFROM ec_estacionalidad e\nJOIN ec_periodos p ON e.id_periodo = p.id_periodos', '0|300|300', 'left|left|left', 'e.id_estacionalidad|e.nombre|p.nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(64, 'Empleados', 'ec_empleado', 0, 'SELECT\r\nid_empleado AS \'ID\',\r\nCONCAT(nombre,\' \',apellido_paterno,\' \',apellido_materno) AS \'Empleado\',\r\ntelefono AS \'Teléfono\'\r\nFROM ec_empleado\r\n\r\n', '0|300|200', 'center|left|center', 'id_empleado|CONCAT(nombre,\' \',apellido_paterno,\' \',apellido_materno)|telefono', 1, 1, 1, NULL, 1, b'0', '', ''),
(65, 'Lista de registro de nómina', 'ec_registro_nomina', 0, 'SELECT\nid_registro_nomina AS \'ID\',\nfecha AS \'Fecha\',\nhora_entrada AS \'Entrada\',\nhora_salida AS \'Saliada\'\nFROM ec_registro_nomina', '0|100|200|200', 'center|center|center|center', 'id_registro_nomina|fecha|hora_entrada|hora_salida', 1, 1, 1, NULL, 1, b'0', '', ''),
(66, 'Configuración de nóminas', 'ec_nomina_configuracion', 0, 'SELECT\r\nid_configuracion AS ID,\r\ntolerancia AS \'Min. de tolerancia\',\r\n(\r\n   CASE dia_corte\r\n      WHEN 1 THEN \'Lunes\'\r\n      WHEN 2 THEN \'Martes\'\r\n      WHEN 3 THEN \'Miércoles\'\r\n      WHEN 4 THEN \'Jueves\'\r\n      WHEN 5 THEN \'Viernes\'\r\n      WHEN 6 THEN \'Sábado\'\r\n      WHEN 7 THEN \'Domingo\'\r\n   END\r\n) AS \'Día de corte\'\r\nFROM ec_nomina_configuracion', '0|300|300', 'center|center|left', 'id_configuracion|tolerancia|(CASE dia_corte WHEN 1 THEN \'Lunes\'       WHEN 2 THEN \'Martes\'       WHEN 3 THEN \'Miércoles\'       WHEN 4 THEN \'Jueves\'       WHEN 5 THEN \'Viernes\'       WHEN 6 THEN \'Sábado\'       WHEN 7 THEN \'Domingo\'    END)', 1, 1, 0, 'AND id_sucursal=$SUCURSAL', 1, b'0', '', ''),
(67, 'Autorizaciones regalos', 'ec_autorizacion', 0, 'SELECT\r\nid_autorizacion AS ID,\r\nfecha AS Fecha,\r\nhora AS Hora,\r\nIF(autorizado=1, \'SI\', \'NO\') AS Autorizado\r\nFROM ec_autorizacion', '0|150|150|150', 'center|center|center|center', 'id_autorizacion|fecha|hora|IF(autorizado=1, \'SI\', \'NO\')', 1, 1, 0, NULL, 0, b'0', '', ''),
(68, 'Conceptos de ordenes de compra', 'ec_conceptos_oc', 0, 'SELECT id_concepto_oc,nombre AS Nombre FROM ec_conceptos_oc ', '0|300', 'center|center', 'id_concepto_oc|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(69, 'Salida de transferencias', 'ec_transferencias', 1, 'SELECT\r\nt.id_transferencia AS ID,\r\nt.folio AS Folio,\r\nCONCAT(t.fecha, \' \', t.hora) AS Fecha,\r\ns.nombre AS \'Sucursal origen\',\r\na.nombre AS \'Almacén origen\',\r\ns2.nombre AS \'Sucursal destino\',\r\na2.nombre AS \'Almacén destino\'\r\nFROM ec_transferencias t\r\nJOIN sys_sucursales s ON t.id_sucursal_origen = s.id_sucursal\r\nJOIN sys_sucursales s2 ON t.id_sucursal_destino = s2.id_sucursal\r\nJOIN ec_almacen a ON t.id_almacen_origen = a.id_almacen\r\nJOIN ec_almacen a2 ON t.id_almacen_destino = a2.id_almacen', '0|100|100|150|150|150|150', 'center|center|center|left|left|left|left', 't.id_transferencia|t.folio|CONCAT(t.fecha, \' \', t.hora)|s.nombre|a.nombre|s2.nombre|a2.nombre', 0, 0, 0, 'AND t.id_transferencia > 0\r\nAND t.id_sucursal_origen=$SUCURSAL\r\nAND t.id_estado=2', 0, b'0', '', ''),
(70, 'Recepción de transferencias', 'ec_transferencias', 2, 'SELECT\r\nt.id_transferencia AS ID,\r\nt.folio AS Folio,\r\nCONCAT(t.fecha, \' \', t.hora) AS Fecha,\r\ns.nombre AS \'Sucursal origen\',\r\na.nombre AS \'Almacén origen\',\r\ns2.nombre AS \'Sucursal destino\',\r\na2.nombre AS \'Almacén destino\'\r\nFROM ec_transferencias t\r\nJOIN sys_sucursales s ON t.id_sucursal_origen = s.id_sucursal\r\nJOIN sys_sucursales s2 ON t.id_sucursal_destino = s2.id_sucursal\r\nJOIN ec_almacen a ON t.id_almacen_origen = a.id_almacen\r\nJOIN ec_almacen a2 ON t.id_almacen_destino = a2.id_almacen', '0|100|100|150|150|150|150', 'center|center|center|left|left|left|left', 't.id_transferencia|t.folio|CONCAT(t.fecha, \' \', t.hora)|s.nombre|a.nombre|s2.nombre|a2.nombre', 0, 0, 0, 'AND t.id_transferencia > 0\r\nAND t.id_sucursal_destino=$SUCURSAL\r\nAND t.id_estado=3', 0, b'0', '', ''),
(71, 'Verificación de transferencias', 'ec_transferencias', 3, 'SELECT\r\nt.id_transferencia AS ID,\r\nt.folio AS Folio,\r\nCONCAT(t.fecha, \' \', t.hora) AS Fecha,\r\ns.nombre AS \'Sucursal origen\',\r\na.nombre AS \'Almacén origen\',\r\ns2.nombre AS \'Sucursal destino\',\r\na2.nombre AS \'Almacén destino\'\r\nFROM ec_transferencias t\r\nJOIN sys_sucursales s ON t.id_sucursal_origen = s.id_sucursal\r\nJOIN sys_sucursales s2 ON t.id_sucursal_destino = s2.id_sucursal\r\nJOIN ec_almacen a ON t.id_almacen_origen = a.id_almacen\r\nJOIN ec_almacen a2 ON t.id_almacen_destino = a2.id_almacen', '0|100|100|150|150|150|150', 'center|center|center|left|left|left|left', 't.id_transferencia|t.folio|CONCAT(t.fecha, \' \', t.hora)|s.nombre|a.nombre|s2.nombre|a2.nombre', 0, 0, 0, 'AND t.id_transferencia > 0\r\nAND t.id_sucursal_destino=$SUCURSAL\r\nAND t.id_estado=3', 0, b'0', '', ''),
(72, 'Resolución de transferencias', 'ec_transferencias', 4, 'SELECT\r\nt.id_transferencia AS ID,\r\nt.folio AS Folio,\r\nCONCAT(t.fecha, \' \', t.hora) AS Fecha,\r\ns.nombre AS \'Sucursal origen\',\r\na.nombre AS \'Almacén origen\',\r\ns2.nombre AS \'Sucursal destino\',\r\na2.nombre AS \'Almacén destino\'\r\nFROM ec_transferencias t\r\nJOIN sys_sucursales s ON t.id_sucursal_origen = s.id_sucursal\r\nJOIN sys_sucursales s2 ON t.id_sucursal_destino = s2.id_sucursal\r\nJOIN ec_almacen a ON t.id_almacen_origen = a.id_almacen\r\nJOIN ec_almacen a2 ON t.id_almacen_destino = a2.id_almacen', '0|100|100|150|150|150|150', 'center|center|center|left|left|left|left', 't.id_transferencia|t.folio|CONCAT(t.fecha, \' \', t.hora)|s.nombre|a.nombre|s2.nombre|a2.nombre', 0, 0, 0, 'AND t.id_transferencia > 0\r\nAND t.id_sucursal_destino=$SUCURSAL\r\nAND t.id_estado=4', 0, b'0', '', ''),
(73, 'Razón social', 'ec_conf_rs', 0, 'SELECT id_rs,rfc AS RFC,razon_social AS \'Razón Social\' FROM ec_conf_rs', '0|120|350', 'center|center|left', 'id_rs|rfc|razon_social', 1, 1, 1, NULL, 1, b'0', '', ''),
(74, 'Configuración de IVA', 'ec_conf_iva', 0, 'SELECT\r\nid_conf_iva,\r\nCONCAT(porcentaje,\'%\') AS Porcentaje\r\nFROM ec_conf_iva', '0|350', 'center|center', 'id_conf_iva|porcentaje', 1, 1, 0, NULL, 0, b'0', '', ''),
(75, 'Control de inventario', 'ec_movimiento_inventario', 0, 'SELECT\r\nmi.id_movimiento_inventario AS ID,\r\ntm.nombre AS Tipo,\r\nmi.folio AS Folio,\r\nmi.fecha AS Fecha,\r\nmi.hora AS Hora\r\nFROM ec_movimiento_inventario mi\r\nJOIN ec_tipos_movimiento tm ON mi.id_tipo_movimiento = tm.id_movimiento', '0|150|150|150|150', 'center|center|center|center|center', 'mi.id_movimiento_inventario|tm.nombre|mi.folio|mi.fecha|mi.hora', 1, 1, 1, NULL, 1, b'0', '', ''),
(76, ' Notas de ventas', 'ec_ventas', 0, 'SELECT \r\nid_venta AS ID,\r\nfolio AS Folio,\r\nc.nombre AS Nombre,\r\nCONCAT(\'$\',FORMAT(total,2)) AS Total,\r\nfecha AS Fecha,\r\nhora AS Hora,\r\nfolio_fiscal AS \'Folio fiscal\',\r\nIF(v.cancelado=1,\'SI\',\'NO\') AS Cancelado\r\nFROM ec_ventas v\r\nJOIN ec_clientes c ON v.id_cliente =c.id_cliente ', '0|80|200|100|80|80|200|100', 'center|center|center|center|center|center|center|center', 'id_venta|folio|c.nombre|total|fecha|hora|folio_fiscal|IF(v.cancelado=1,\'SI\',\'NO\')', 1, 1, 1, NULL, 0, b'0', '', ''),
(77, 'Emisor fiscal', 'ec_emisor', 0, 'SELECT\r\nid_emisor AS ID,\r\nrazon_social AS \'Razón social\',\r\nrfc AS RFC\r\nFROM ec_emisor', '0|300|200', 'center|left|left', 'id_emisor|razon_social|rfc', 1, 1, 0, NULL, 0, b'0', '', ''),
(78, 'Métodos de pago', 'ec_forma_pago', 0, 'SELECT\r\nid_forma_pago,\r\nnombre\r\nFROM ec_forma_pago', '0|350', 'center|left', 'id_forma_pago|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(79, 'Formas de pago', 'ec_metodos_pago', 0, 'SELECT\r\nid_metodo_pago,\r\nnombre\r\nFROM ec_metodos_pago', '0|350', 'center|left', 'id_metodo_pago|nombre', 1, 1, 1, NULL, 1, b'0', '', ''),
(80, 'Configuracion de CFDI', 'ec_cfdi', 0, 'SELECT \r\nid as Id,\r\nclave,\r\nnombre,\r\norden \r\nFROM ec_cfdi', '100|100|150|50', 'center|center|left|center', 'id|clave|nombre|orden', 1, 1, 1, '', 1, b'0', '', ''),
(81, 'Listado de Afiliaciones', 'ec_razon_afiliaciones', 0, 'SELECT \r\nid_afiliacion,\r\nno_afiliacion,\r\nfecha_alta,\r\nIF(activo=0,\'desactivado\',\'activado\') as Status\r\nFROM ec_razon_afiliaciones\r\n', '0|120|150|100', 'center|center|center|center', 'id_afiliacion|no_afiliacion|fecha_alta|IF(activo=0,\'desactivado\',\'activado\')', 1, 1, 1, NULL, 1, b'0', '', ''),
(82, 'Correos de notificaciones', 'sys_correos_avisos', 0, 'SELECT\r\nid_correo_aviso as Id,\r\nnombre as Nombre,\r\ndireccion as Direccion,\r\nIF(activo=1,\'Activado\',\'Desactivado\') as Estado,\r\nobservaciones as Osbervaciones\r\nFROM sys_correos_avisos', '0|200|200|70|100', 'center|left|left|center|left', 'id_correo_aviso|nombre|direccion|Direccion|\r\nIF(activo=1,\'Activado\',\'Desactivado\')', 1, 1, 1, NULL, 1, b'0', '', ''),
(83, '4.10 Configuración del sistema', 'ec_configuracion_razon', 0, 'SELECT \r\nid_config as Id,\r\nobservaciones as Nombre\r\nFROM ec_configuracion_razon', '0|500', 'center|center', 'id_config|observaciones', 1, 1, 0, NULL, 1, b'0', '', ''),
(84, '4.14 Catálogo de Tipos de Regimen Fiscal', 'ec_tipos_regimenes_fiscales', 0, 'SELECT\r\nid_tipo_regimen_fiscal AS ID,\r\nclave_numerica AS Clave,\r\nnombre_tipo_regimen_fiscal AS Descripción,\r\nIF( habilitado = \'1\', \'Habilitado\', \'Deshabilitado\') AS Status\r\nFROM ec_tipos_regimenes_fiscales', '0|100|200|100', 'center|center|left|center', 'id_tipo_regimen_fiscal|clave_numerica|nombre_tipo_regimen_fiscal|IF( habilitado = \'1\', \'Habilitado\', \'Deshabilitado\')', 1, 1, 1, NULL, 1, b'0', '', ''),
(85, '4.15 Catálogo de motivos de cancelación', 'ec_motivos_cancelacion_factura', 0, 'SELECT\r\nid_motivo,\r\nclave_motivo_sat,\r\ndescripcion\r\nFROM ec_motivos_cancelacion_factura', '0|100|300', 'center|center|left', 'id_motivo|clave_motivo_sat|descripcion', 1, 1, 1, NULL, 1, b'1', 'descripcion', ''),
(86, '4.16 Administración de sets de productos', 'ec_sets', 0, 'SELECT\r\nid_set AS ID,\r\nnombre AS NOMBRE,\r\ntipo_set AS TIPO,\r\nIF( habilitado = 1, \'HABILITADO\', \'DESHABILITADO\' ) AS STATUS,\r\nfecha_alta AS CREACION\r\nFROM ec_sets', '0|300|100|100|100', 'center|left|center|center|center', 'id_set|nombre|tipo_set|IF( habilitado = 1, \'HABILITADO\', \'DESHABILITADO\' )|fecha_alta', 1, 1, 1, 'AND id_set > 0', 1, b'1', 'nombre', '');

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

--
-- Estructura de tabla para la tabla `sys_log_errores_timbrado`
--

CREATE TABLE `sys_log_errores_timbrado` (
  `id_log` int(11) NOT NULL,
  `id_venta` int(11) NOT NULL,
  `contenido_log` text NOT NULL,
  `fecha_alta` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Estructura de tabla para la tabla `sys_menus`
--

CREATE TABLE `sys_menus` (
  `id_menu` int(11) NOT NULL,
  `nombre` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `es_listado` tinyint(1) UNSIGNED DEFAULT '1',
  `tabla_relacionada` varchar(120) CHARACTER SET latin1 DEFAULT NULL,
  `liga` varchar(200) CHARACTER SET latin1 DEFAULT NULL,
  `menu_padre` int(11) UNSIGNED NOT NULL,
  `en_permisos` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `icono` varchar(120) CHARACTER SET latin1 DEFAULT NULL,
  `orden` int(11) UNSIGNED NOT NULL,
  `no_tabla` int(2) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `sys_menus` (`id_menu`, `nombre`, `es_listado`, `tabla_relacionada`, `liga`, `menu_padre`, `en_permisos`, `icono`, `orden`, `no_tabla`) VALUES
(1, '4. Configuración', 0, '-', '-', 1, 1, 'img/configuracion.png', 10, 0),
(2, '2. Compras', 0, '-', '-', 2, 1, 'img/compras.png', 2, 0),
(3, '3. Almacén', 1, '-', '-', 3, 1, 'img/almacen.png', 2, 0),
(4, '1. Ventas', 1, '-', '-', 4, 1, 'img/ventas.png', 1, 0),
(5, 'Finanzas', 0, '-', '-', 5, 1, 'img/finanzas.png', 5, 0),
(11, '4.5 Usuarios', 1, 'sys_users', '-', 1, 1, NULL, 5, 0),
(12, '4.4 Sucursales', 1, 'sys_sucursales', '-', 1, 1, NULL, 4, 0),
(19, '2.2 Proveedores', 1, 'ec_proveedor', '-', 2, 1, NULL, 2, 0),
(23, '4.2 Productos', 1, 'ec_productos', '-', 1, 1, NULL, 2, 0),
(25, '2.1 Órdenes de compras ', 1, 'ec_oc', '-', 2, 1, NULL, 1, 0),
(41, '1.1 Clientes', 1, 'ec_clientes', '-', 4, 1, NULL, 1, 0),
(110, '4.1 Configuración de IVA', 1, 'ec_conf_iva', NULL, 1, 1, NULL, 1, 0),
(111, '3.1 Control de inventario', 1, 'ec_movimiento_inventario', NULL, 3, 1, NULL, 2, 0),
(112, '1.2 Notas de Ventas', 1, 'ec_ventas', NULL, 4, 1, NULL, 2, 0),
(113, '1.5 Importación Anterior', 0, NULL, 'code/especiales/Ventas/ventas.php?trash=', 4, 1, NULL, 5, 0),
(114, '4.3 Emisor fiscal', 1, 'ec_emisor', '-', 1, 1, NULL, 3, 0),
(115, '5. Reportes', 0, NULL, NULL, 115, 1, 'img/reportes.png', 60, 0),
(116, '5.1 Reporte de inventario', 0, NULL, 'code/reportes/reportes_mod.php?trash=&no_tabla=MA==&id_reporte=20', 115, 1, NULL, 1, 0),
(117, '4.6 Métodos de pago', 1, 'ec_forma_pago', '-', 1, 1, NULL, 6, 0),
(118, '4.7 Formas de pago', 1, 'ec_metodos_pago', '-', 1, 1, NULL, 7, 0),
(119, 'Configuracion de CFDI', 1, 'ec_cfdi', NULL, 1, 1, NULL, 8, 0),
(120, '1.3 Convertir archivo de Inbursa', 0, NULL, 'code/especiales/importa-exporta/prueba.php?', 4, 1, NULL, 3, 0),
(121, '5.2 Reporte de Notas de Venta', 0, NULL, 'code/reportes/reportes_mod.php?trash=&no_tabla=MA==&id_reporte=1', 115, 1, NULL, 2, 0),
(122, '4.8 Afiliaciones de Razon Social', 1, 'ec_razon_afiliaciones', NULL, 1, 1, NULL, 8, 0),
(123, '4.9 Configuración de Correos de Avisos', 1, 'sys_correos_avisos', NULL, 1, 1, NULL, 11, 0),
(124, '1.4 Captura de Ingresos', 0, NULL, 'code/especiales/capturaIngresos/inicio.php?', 4, 1, NULL, 4, 0),
(125, '5.3 Reporte de Inventario con Buscador', 0, NULL, 'code/especiales/inventario/inventario.php?', 115, 1, NULL, 3, 0),
(126, '4.10 configuración del Sistema', 1, 'ec_configuracion_razon', NULL, 1, 1, NULL, 12, 0),
(127, '3.2 Igualar Inventarios Negativos a Cero ', 0, NULL, 'code/especiales/inventario_a_ceros/inventario.php?', 3, 1, NULL, 2, 0),
(128, '4.13 Administración Productos', 0, NULL, 'gestionCL/facturacionProductos/index.php?a=a', 1, 1, NULL, 13, 0),
(129, '5.4 Reporte de inventario Facturación', 0, NULL, 'code/reportes/reportes_mod.php?trash=&no_tabla=MA==&id_reporte=30', 115, 1, NULL, 4, 0),
(130, '5.4 Reporte de Órdenes de Compra', 0, NULL, 'code/reportes/reportes_mod.php?trash=&no_tabla=MA==&id_reporte=21', 115, 1, NULL, 4, 0),
(131, '4.14 Catálogo de Tipos de Regimen Fiscal', 1, 'ec_tipos_regimenes_fiscales', NULL, 1, 1, NULL, 14, 0),
(132, '6. Herramientas', 0, NULL, NULL, 132, 1, NULL, 70, 0),
(133, '6.1 Consultas Prediseñadas', 0, NULL, 'code/especiales/herramientas/index.php?', 132, 1, NULL, 1, 0),
(134, '4.15 Catálogo de motivos de cancelación', 1, 'ec_motivos_cancelacion_factura', NULL, 1, 1, NULL, 15, 0),
(135, '4.16 Administración de sets de productos', 1, 'ec_sets', NULL, 1, 1, NULL, 16, 0);

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

--
-- Estructura de tabla para la tabla `sys_paises`
--

CREATE TABLE `sys_paises` (
  `id_pais` int(11) NOT NULL,
  `nombre` varchar(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_paises` (`id_pais`, `nombre`) VALUES
(1, 'México'),
(2, 'Alemania');

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

--
-- Estructura de tabla para la tabla `sys_permisos`
--

CREATE TABLE `sys_permisos` (
  `id_permiso` int(11) NOT NULL,
  `id_usuario` int(11) NOT NULL,
  `id_menu` int(11) NOT NULL,
  `ver` tinyint(1) DEFAULT '0',
  `modificar` tinyint(1) DEFAULT '0',
  `eliminar` tinyint(1) DEFAULT '0',
  `nuevo` tinyint(1) DEFAULT '0',
  `imprimir` tinyint(1) DEFAULT '0',
  `generar` tinyint(1) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_permisos` (`id_permiso`, `id_usuario`, `id_menu`, `ver`, `modificar`, `eliminar`, `nuevo`, `imprimir`, `generar`) VALUES
(1, 1, 11, 1, 1, 1, 1, 1, 1),
(2, 1, 12, 1, 1, 1, 1, 1, 1),
(9, 1, 19, 1, 1, 1, 1, 1, 1),
(13, 1, 23, 1, 1, 1, 1, 1, 1),
(31, 1, 41, 1, 1, 1, 1, 1, 1),
(56, 2, 11, 1, 1, 1, 1, 1, 1),
(57, 2, 12, 1, 1, 1, 1, 1, 1),
(58, 2, 13, 1, 1, 1, 1, 1, 1),
(59, 2, 14, 1, 1, 1, 1, 1, 1),
(60, 2, 15, 1, 1, 1, 1, 1, 1),
(397, 6, 11, 1, 1, 1, 1, 1, 1),
(398, 6, 12, 1, 1, 1, 1, 1, 1),
(399, 6, 13, 1, 1, 1, 1, 1, 1),
(400, 6, 14, 1, 1, 1, 1, 1, 1),
(401, 6, 15, 1, 1, 1, 1, 1, 1),
(481, 2, 16, 1, 1, 1, 1, 1, 1),
(482, 2, 17, 1, 1, 1, 1, 1, 1),
(483, 2, 18, 1, 1, 1, 1, 1, 1),
(484, 2, 19, 1, 1, 1, 1, 1, 1),
(485, 2, 20, 1, 1, 1, 1, 1, 1),
(486, 2, 21, 1, 1, 1, 1, 1, 1),
(487, 2, 22, 1, 1, 1, 1, 1, 1),
(488, 2, 23, 1, 1, 1, 1, 1, 1),
(489, 2, 24, 1, 1, 1, 1, 1, 1),
(490, 2, 25, 1, 1, 1, 1, 1, 1),
(491, 2, 26, 1, 1, 1, 1, 1, 1),
(492, 2, 27, 1, 1, 1, 1, 1, 1),
(493, 2, 28, 1, 1, 1, 1, 1, 1),
(494, 2, 29, 1, 1, 1, 1, 1, 1),
(495, 2, 30, 1, 1, 1, 1, 1, 1),
(496, 2, 31, 1, 1, 1, 1, 1, 1),
(497, 2, 32, 1, 1, 1, 1, 1, 1),
(498, 2, 33, 1, 1, 1, 1, 1, 1),
(499, 2, 34, 1, 1, 1, 1, 1, 1),
(500, 2, 35, 1, 1, 1, 1, 1, 1),
(501, 2, 36, 1, 1, 1, 1, 1, 1),
(502, 2, 37, 1, 1, 1, 1, 1, 1),
(503, 2, 38, 1, 1, 1, 1, 1, 1),
(504, 2, 39, 1, 1, 1, 1, 1, 1),
(505, 2, 40, 1, 1, 1, 1, 1, 1),
(506, 2, 41, 1, 1, 1, 1, 1, 1),
(507, 2, 42, 1, 1, 1, 1, 1, 1),
(508, 2, 43, 1, 1, 1, 1, 1, 1),
(509, 2, 46, 1, 1, 1, 1, 1, 1),
(510, 2, 47, 1, 1, 1, 1, 1, 1),
(511, 2, 48, 1, 1, 1, 1, 1, 1),
(512, 2, 49, 1, 1, 1, 1, 1, 1),
(513, 2, 50, 1, 1, 1, 1, 1, 1),
(514, 2, 52, 1, 1, 1, 1, 1, 1),
(515, 2, 53, 1, 1, 1, 1, 1, 1),
(516, 2, 54, 1, 1, 1, 1, 1, 1),
(517, 2, 55, 1, 1, 1, 1, 1, 1),
(518, 2, 56, 1, 1, 1, 1, 1, 1),
(519, 2, 57, 1, 1, 1, 1, 1, 1),
(520, 2, 60, 1, 1, 1, 1, 1, 1),
(521, 2, 61, 1, 1, 1, 1, 1, 1),
(522, 2, 66, 1, 1, 1, 1, 1, 1),
(523, 2, 67, 1, 1, 1, 1, 1, 1),
(524, 2, 68, 1, 1, 1, 1, 1, 1),
(525, 2, 69, 1, 1, 1, 1, 1, 1),
(526, 2, 70, 1, 1, 1, 1, 1, 1),
(527, 2, 71, 1, 1, 1, 1, 1, 1),
(528, 2, 72, 1, 1, 1, 1, 1, 1),
(529, 2, 73, 1, 1, 1, 1, 1, 1),
(530, 2, 74, 1, 1, 1, 1, 1, 1),
(531, 2, 75, 1, 1, 1, 1, 1, 1),
(532, 2, 76, 1, 1, 1, 1, 1, 1),
(533, 2, 77, 1, 1, 1, 1, 1, 1),
(534, 2, 78, 1, 1, 1, 1, 1, 1),
(535, 2, 79, 1, 1, 1, 1, 1, 1),
(536, 2, 80, 1, 1, 1, 1, 1, 1),
(537, 2, 81, 1, 1, 1, 1, 1, 1),
(538, 2, 83, 1, 1, 1, 1, 1, 1),
(539, 2, 84, 1, 1, 1, 1, 1, 1),
(540, 2, 85, 1, 1, 1, 1, 1, 1),
(541, 2, 86, 1, 1, 1, 1, 1, 1),
(542, 2, 87, 1, 1, 1, 1, 1, 1),
(543, 2, 88, 1, 1, 1, 1, 1, 1),
(544, 2, 89, 1, 1, 1, 1, 1, 1),
(545, 2, 90, 1, 1, 1, 1, 1, 1),
(546, 2, 91, 1, 1, 1, 1, 1, 1),
(547, 2, 93, 1, 1, 1, 1, 1, 1),
(548, 2, 94, 1, 1, 1, 1, 1, 1),
(549, 6, 16, 1, 1, 1, 1, 1, 1),
(550, 6, 17, 1, 1, 1, 1, 1, 1),
(551, 6, 18, 1, 1, 1, 1, 1, 1),
(552, 6, 19, 1, 1, 1, 1, 1, 1),
(553, 6, 20, 1, 1, 1, 1, 1, 1),
(554, 6, 21, 1, 1, 1, 1, 1, 1),
(555, 6, 22, 1, 1, 1, 1, 1, 1),
(556, 6, 23, 1, 1, 1, 1, 1, 1),
(557, 6, 24, 1, 1, 1, 1, 1, 1),
(558, 6, 25, 1, 1, 1, 1, 1, 1),
(559, 6, 26, 1, 1, 1, 1, 1, 1),
(560, 6, 27, 1, 1, 1, 1, 1, 1),
(561, 6, 28, 1, 1, 1, 1, 1, 1),
(562, 6, 29, 1, 1, 1, 1, 1, 1),
(563, 6, 30, 1, 1, 1, 1, 1, 1),
(564, 6, 31, 1, 1, 1, 1, 1, 1),
(565, 6, 32, 1, 1, 1, 1, 1, 1),
(566, 6, 33, 1, 1, 1, 1, 1, 1),
(567, 6, 34, 1, 1, 1, 1, 1, 1),
(568, 6, 35, 1, 1, 1, 1, 1, 1),
(569, 6, 36, 1, 1, 1, 1, 1, 1),
(570, 6, 37, 1, 1, 1, 1, 1, 1),
(571, 6, 38, 1, 1, 1, 1, 1, 1),
(572, 6, 39, 1, 1, 1, 1, 1, 1),
(573, 6, 40, 1, 1, 1, 1, 1, 1),
(574, 6, 41, 1, 1, 1, 1, 1, 1),
(575, 6, 42, 1, 1, 1, 1, 1, 1),
(576, 6, 43, 1, 1, 1, 1, 1, 1),
(577, 6, 46, 1, 1, 1, 1, 1, 1),
(578, 6, 47, 1, 1, 1, 1, 1, 1),
(579, 6, 48, 1, 1, 1, 1, 1, 1),
(580, 6, 49, 1, 1, 1, 1, 1, 1),
(581, 6, 50, 1, 1, 1, 1, 1, 1),
(582, 6, 52, 1, 1, 1, 1, 1, 1),
(583, 6, 53, 1, 1, 1, 1, 1, 1),
(584, 6, 54, 1, 1, 1, 1, 1, 1),
(585, 6, 55, 1, 1, 1, 1, 1, 1),
(586, 6, 56, 1, 1, 1, 1, 1, 1),
(587, 6, 57, 1, 1, 1, 1, 1, 1),
(588, 6, 60, 1, 1, 1, 1, 1, 1),
(589, 6, 61, 1, 1, 1, 1, 1, 1),
(590, 6, 66, 1, 1, 1, 1, 1, 1),
(591, 6, 67, 1, 1, 1, 1, 1, 1),
(592, 6, 68, 1, 1, 1, 1, 1, 1),
(593, 6, 69, 1, 1, 1, 1, 1, 1),
(594, 6, 70, 1, 1, 1, 1, 1, 1),
(595, 6, 71, 1, 1, 1, 1, 1, 1),
(596, 6, 72, 1, 1, 1, 1, 1, 1),
(597, 6, 73, 1, 1, 1, 1, 1, 1),
(598, 6, 74, 1, 1, 1, 1, 1, 1),
(599, 6, 75, 1, 1, 1, 1, 1, 1),
(600, 6, 76, 1, 1, 1, 1, 1, 1),
(601, 6, 77, 1, 1, 1, 1, 1, 1),
(602, 6, 78, 1, 1, 1, 1, 1, 1),
(603, 6, 79, 1, 1, 1, 1, 1, 1),
(604, 6, 80, 1, 1, 1, 1, 1, 1),
(605, 6, 81, 1, 1, 1, 1, 1, 1),
(606, 6, 83, 1, 1, 1, 1, 1, 1),
(607, 6, 84, 1, 1, 1, 1, 1, 1),
(608, 6, 85, 1, 1, 1, 1, 1, 1),
(609, 6, 86, 1, 1, 1, 1, 1, 1),
(610, 6, 87, 1, 1, 1, 1, 1, 1),
(611, 6, 88, 1, 1, 1, 1, 1, 1),
(612, 6, 89, 1, 1, 1, 1, 1, 1),
(613, 6, 90, 1, 1, 1, 1, 1, 1),
(614, 6, 91, 1, 1, 1, 1, 1, 1),
(615, 6, 93, 1, 1, 1, 1, 1, 1),
(616, 6, 94, 1, 1, 1, 1, 1, 1),
(620, 2, 95, 1, 1, 1, 1, 1, 1),
(621, 2, 96, 1, 1, 1, 1, 1, 1),
(622, 2, 97, 1, 1, 1, 1, 1, 1),
(623, 2, 98, 1, 1, 1, 1, 1, 1),
(624, 6, 95, 1, 1, 1, 1, 1, 1),
(625, 6, 96, 1, 1, 1, 1, 1, 1),
(626, 6, 97, 1, 1, 1, 1, 1, 1),
(627, 6, 98, 1, 1, 1, 1, 1, 1),
(631, 7, 11, 0, 0, 0, 0, 0, 0),
(632, 7, 12, 0, 0, 0, 0, 0, 0),
(635, 7, 19, 1, 1, 1, 1, 1, 1),
(639, 7, 23, 1, 1, 1, 1, 1, 1),
(641, 7, 25, 1, 1, 1, 1, 1, 1),
(648, 7, 41, 1, 1, 1, 1, 1, 1),
(682, 8, 11, 1, 1, 1, 1, 1, 1),
(683, 8, 12, 1, 1, 1, 1, 1, 1),
(686, 8, 19, 1, 1, 1, 1, 1, 1),
(732, 9, 11, 1, 1, 1, 1, 1, 1),
(733, 9, 12, 1, 1, 1, 1, 1, 1),
(734, 9, 14, 1, 1, 1, 1, 1, 1),
(735, 9, 15, 1, 1, 1, 1, 1, 1),
(736, 9, 19, 1, 1, 1, 1, 1, 1),
(737, 9, 20, 1, 1, 1, 1, 1, 1),
(738, 9, 21, 1, 1, 1, 1, 1, 1),
(739, 9, 22, 1, 1, 1, 1, 1, 1),
(740, 9, 23, 1, 1, 1, 1, 1, 1),
(741, 9, 24, 1, 1, 1, 1, 1, 1),
(742, 9, 25, 1, 1, 1, 1, 1, 1),
(743, 9, 26, 1, 1, 1, 1, 1, 1),
(744, 9, 27, 1, 1, 1, 1, 1, 1),
(745, 9, 28, 1, 1, 1, 1, 1, 1),
(746, 9, 29, 0, 0, 0, 0, 0, 0),
(747, 9, 32, 0, 0, 0, 0, 0, 0),
(748, 9, 36, 0, 0, 0, 0, 0, 0),
(749, 9, 41, 0, 0, 0, 0, 0, 0),
(750, 9, 42, 0, 0, 0, 0, 0, 0),
(751, 9, 43, 1, 1, 1, 1, 1, 1),
(752, 9, 50, 1, 1, 1, 1, 1, 1),
(753, 9, 57, 0, 0, 0, 0, 0, 0),
(754, 9, 65, 0, 0, 0, 0, 0, 0),
(755, 9, 66, 0, 0, 0, 0, 0, 0),
(756, 9, 67, 0, 0, 0, 0, 0, 0),
(757, 9, 68, 0, 0, 0, 0, 0, 0),
(758, 9, 69, 0, 0, 0, 0, 0, 0),
(759, 9, 70, 0, 0, 0, 0, 0, 0),
(760, 9, 71, 0, 0, 0, 0, 0, 0),
(761, 9, 72, 0, 0, 0, 0, 0, 0),
(762, 9, 73, 0, 0, 0, 0, 0, 0),
(763, 9, 74, 0, 0, 0, 0, 0, 0),
(764, 9, 77, 0, 0, 0, 0, 0, 0),
(765, 9, 81, 0, 0, 0, 0, 0, 0),
(766, 9, 83, 0, 0, 0, 0, 0, 0),
(767, 9, 84, 0, 0, 0, 0, 0, 0),
(768, 9, 85, 0, 0, 0, 0, 0, 0),
(769, 9, 86, 0, 0, 0, 0, 0, 0),
(770, 9, 87, 0, 0, 0, 0, 0, 0),
(771, 9, 88, 0, 0, 0, 0, 0, 0),
(772, 9, 89, 0, 0, 0, 0, 0, 0),
(773, 9, 90, 0, 0, 0, 0, 0, 0),
(774, 9, 91, 0, 0, 0, 0, 0, 0),
(775, 9, 93, 0, 0, 0, 0, 0, 0),
(776, 9, 94, 0, 0, 0, 0, 0, 0),
(777, 9, 95, 0, 0, 0, 0, 0, 0),
(778, 9, 96, 0, 0, 0, 0, 0, 0),
(779, 9, 97, 0, 0, 0, 0, 0, 0),
(780, 9, 98, 0, 0, 0, 0, 0, 0),
(781, 9, 99, 1, 1, 1, 1, 1, 1),
(787, 8, 23, 1, 1, 1, 1, 1, 1),
(789, 8, 25, 1, 1, 1, 1, 1, 1),
(796, 8, 41, 1, 1, 1, 1, 1, 1),
(839, 1, 25, 1, 1, 1, 1, 1, 1),
(840, 10, 11, 1, 1, 1, 1, 1, 1),
(841, 10, 12, 1, 1, 1, 1, 1, 1),
(842, 10, 19, 1, 1, 1, 1, 1, 1),
(843, 10, 23, 1, 1, 1, 1, 1, 1),
(844, 10, 25, 1, 1, 1, 1, 1, 1),
(845, 10, 41, 1, 1, 1, 1, 1, 1),
(846, 10, 66, 1, 1, 1, 1, 1, 1),
(847, 10, 67, 1, 1, 1, 1, 1, 1),
(848, 10, 68, 1, 1, 1, 1, 1, 1),
(849, 10, 69, 1, 1, 1, 1, 1, 1),
(850, 10, 70, 1, 1, 1, 1, 1, 1),
(851, 10, 71, 1, 1, 1, 1, 1, 1),
(852, 10, 72, 1, 1, 1, 1, 1, 1),
(853, 10, 73, 1, 1, 1, 1, 1, 1),
(854, 10, 74, 1, 1, 1, 1, 1, 1),
(855, 10, 95, 1, 1, 1, 1, 1, 1),
(856, 10, 96, 1, 1, 1, 1, 1, 1),
(857, 10, 97, 1, 1, 1, 1, 1, 1),
(858, 10, 98, 1, 1, 1, 1, 1, 1),
(859, 10, 101, 1, 1, 1, 1, 1, 1),
(860, 10, 107, 1, 1, 1, 1, 1, 1),
(861, 10, 109, 1, 1, 1, 1, 1, 1),
(862, 1, 110, 1, 1, 1, 1, 1, 1),
(866, 1, 111, 1, 1, 1, 1, 1, 1),
(867, 1, 112, 1, 1, 1, 1, 1, 1),
(868, 1, 113, 1, 1, 1, 1, 1, 1),
(869, 1, 114, 1, 1, 1, 1, 1, 1),
(870, 1, 116, 1, 1, 1, 1, 1, 1),
(871, 1, 117, 1, 1, 1, 1, 1, 1),
(872, 1, 118, 1, 1, 1, 1, 1, 1),
(873, 11, 11, 1, 1, 1, 1, 1, 1),
(874, 11, 12, 1, 1, 1, 1, 1, 1),
(875, 11, 19, 1, 1, 1, 1, 1, 1),
(876, 11, 23, 1, 1, 1, 1, 1, 1),
(877, 11, 25, 1, 1, 1, 1, 1, 1),
(878, 11, 41, 1, 1, 1, 1, 1, 1),
(879, 11, 110, 1, 1, 1, 1, 1, 1),
(880, 11, 111, 1, 1, 1, 1, 1, 1),
(881, 11, 112, 1, 1, 1, 1, 1, 1),
(882, 11, 113, 1, 1, 1, 1, 1, 1),
(883, 11, 114, 1, 1, 1, 1, 1, 1),
(884, 11, 116, 1, 1, 1, 1, 1, 1),
(885, 11, 117, 1, 1, 1, 1, 1, 1),
(886, 11, 118, 1, 1, 1, 1, 1, 1),
(887, 7, 110, 0, 0, 0, 0, 0, 0),
(888, 7, 111, 1, 1, 1, 1, 1, 1),
(889, 7, 112, 1, 1, 1, 1, 1, 1),
(890, 7, 113, 1, 1, 1, 1, 1, 1),
(891, 7, 114, 0, 0, 0, 0, 0, 0),
(892, 7, 116, 1, 1, 1, 1, 1, 1),
(893, 7, 117, 0, 0, 0, 0, 0, 0),
(894, 7, 118, 0, 0, 0, 0, 0, 0),
(895, 7, 119, 0, 0, 0, 0, 0, 0),
(896, 8, 110, 1, 1, 1, 1, 1, 1),
(897, 8, 111, 1, 1, 1, 1, 1, 1),
(898, 8, 112, 1, 1, 1, 1, 1, 1),
(899, 8, 113, 1, 1, 1, 1, 1, 1),
(900, 8, 114, 1, 1, 1, 1, 1, 1),
(901, 8, 116, 1, 1, 1, 1, 1, 1),
(902, 8, 117, 1, 1, 1, 1, 1, 1),
(903, 8, 118, 1, 1, 1, 1, 1, 1),
(904, 8, 119, 1, 1, 1, 1, 1, 1),
(905, 8, 120, 1, 1, 1, 1, 1, 1),
(906, 1, 119, 1, 1, 1, 1, 1, 1),
(907, 1, 120, 1, 1, 1, 1, 1, 1),
(908, 7, 120, 1, 1, 1, 1, 1, 1),
(909, 7, 121, 1, 1, 1, 1, 1, 1),
(910, 1, 121, 1, 1, 1, 1, 1, 1),
(911, 1, 122, 1, 1, 1, 1, 1, 1),
(912, 1, 126, 1, 1, 1, 1, 1, 1),
(913, 1, 125, 1, 1, 1, 1, 1, 1),
(914, 1, 123, 1, 1, 1, 1, 1, 1),
(915, 1, 124, 1, 1, 1, 1, 1, 1),
(916, 8, 121, 1, 1, 1, 1, 1, 1),
(917, 8, 122, 1, 1, 1, 1, 1, 1),
(918, 8, 123, 1, 1, 1, 1, 1, 1),
(919, 8, 124, 1, 1, 1, 1, 1, 1),
(920, 8, 125, 1, 1, 1, 1, 1, 1),
(921, 8, 126, 1, 1, 1, 1, 1, 1),
(922, 7, 122, 0, 0, 0, 0, 0, 0),
(923, 7, 123, 0, 0, 0, 0, 0, 0),
(924, 7, 124, 1, 1, 1, 1, 1, 1),
(925, 7, 125, 1, 1, 1, 1, 1, 1),
(926, 7, 126, 0, 0, 0, 0, 0, 0),
(927, 1, 127, 1, 1, 1, 1, 1, 1),
(928, 7, 127, 0, 0, 0, 0, 0, 0),
(929, 1, 128, 1, 1, 1, 1, 1, 1),
(930, 7, 128, 0, 0, 0, 0, 0, 0),
(932, 1, 129, 1, 1, 1, 1, 1, 1),
(933, 7, 129, 0, 0, 0, 0, 0, 0),
(934, 7, 130, 1, 1, 1, 1, 1, 1),
(935, 7, 131, 0, 0, 0, 0, 0, 0),
(936, 1, 130, 1, 1, 1, 1, 1, 1),
(937, 1, 131, 1, 1, 1, 1, 1, 1),
(938, 1, 133, 1, 1, 1, 1, 1, 1),
(939, 12, 11, 1, 1, 1, 1, 1, 1),
(940, 12, 12, 1, 1, 1, 1, 1, 1),
(941, 12, 19, 1, 1, 1, 1, 1, 1),
(942, 12, 23, 1, 1, 1, 1, 1, 1),
(943, 12, 25, 1, 1, 1, 1, 1, 1),
(944, 12, 41, 1, 1, 1, 1, 1, 1),
(945, 12, 110, 1, 1, 1, 1, 1, 1),
(946, 12, 111, 1, 1, 1, 1, 1, 1),
(947, 12, 112, 1, 1, 1, 1, 1, 1),
(948, 12, 113, 1, 1, 1, 1, 1, 1),
(949, 12, 114, 1, 1, 1, 1, 1, 1),
(950, 12, 116, 1, 1, 1, 1, 1, 1),
(951, 12, 117, 1, 1, 1, 1, 1, 1),
(952, 12, 118, 1, 1, 1, 1, 1, 1),
(953, 12, 119, 1, 1, 1, 1, 1, 1),
(954, 12, 120, 1, 1, 1, 1, 1, 1),
(955, 12, 121, 1, 1, 1, 1, 1, 1),
(956, 12, 122, 1, 1, 1, 1, 1, 1),
(957, 12, 123, 1, 1, 1, 1, 1, 1),
(958, 12, 124, 1, 1, 1, 1, 1, 1),
(959, 12, 125, 1, 1, 1, 1, 1, 1),
(960, 12, 126, 1, 1, 1, 1, 1, 1),
(961, 12, 127, 1, 1, 1, 1, 1, 1),
(962, 12, 128, 1, 1, 1, 1, 1, 1),
(963, 12, 129, 1, 1, 1, 1, 1, 1),
(964, 12, 130, 1, 1, 1, 1, 1, 1),
(965, 12, 131, 1, 1, 1, 1, 1, 1),
(966, 12, 133, 1, 1, 1, 1, 1, 1),
(967, 12, 134, 1, 1, 1, 1, 1, 1);

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

--
-- Estructura de tabla para la tabla `sys_permisos_funciones`
--

CREATE TABLE `sys_permisos_funciones` (
  `id_permiso_funcion` int(11) NOT NULL,
  `alias` varchar(80) NOT NULL,
  `nombre` varchar(80) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_permisos_funciones` (`id_permiso_funcion`, `alias`, `nombre`) VALUES
(1, 'Autorizar Requisiciones', 'aut_requisiones'),
(2, 'Autorizar Pedidos', 'aut_pedidos'),
(3, 'Modificar Ordenes de compra en surtimiento', 'mod_oc_surtimiento'),
(4, 'Modificar Pedidos en surtimiento', 'mod_ped_surtimiento'),
(5, 'Finalizar pedidos', 'fin_pedidos'),
(6, 'Finalizar Ordenes de compra', 'fin_ordenes');

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

--
-- Estructura de tabla para la tabla `sys_permisos_funcusers`
--

CREATE TABLE `sys_permisos_funcusers` (
  `id_permiso_funcuser` int(11) NOT NULL,
  `id_usuario` int(11) NOT NULL,
  `id_permiso_funcion` int(11) NOT NULL,
  `permiso` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_permisos_funcusers` (`id_permiso_funcuser`, `id_usuario`, `id_permiso_funcion`, `permiso`) VALUES
(1, 1, 1, 0),
(2, 1, 1, 0),
(3, 1, 1, 0),
(4, 1, 1, 0),
(5, 1, 1, 0),
(6, 1, 1, 0),
(7, 10, 4, 1),
(8, 10, 3, 1),
(9, 10, 5, 1),
(10, 10, 6, 1),
(11, 10, 1, 1),
(12, 10, 2, 1),
(13, 0, 1, 0),
(14, 0, 1, 0),
(15, 0, 1, 0),
(16, 0, 1, 0),
(17, 0, 1, 0);

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

--
-- Estructura de tabla para la tabla `sys_plantilla`
--

CREATE TABLE `sys_plantilla` (
  `id_plantilla` int(11) NOT NULL,
  `nombre` varchar(60) NOT NULL,
  `ruta_css` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_plantilla` (`id_plantilla`, `nombre`, `ruta_css`) VALUES
(1, 'Clásica', 'css/estilo_final1.css'),
(2, 'Billarmex', 'css/billarmex.css'),
(3, 'Casa de las luces', 'css/luces.css'),
(4, 'Capslim', 'css/capslim.css');

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

--
-- Estructura de tabla para la tabla `sys_razones_sociales`
--

CREATE TABLE `sys_razones_sociales` (
  `id_razon_social` int(11) NOT NULL,
  `rfc` varchar(20) NOT NULL,
  `razon_social` varchar(80) NOT NULL,
  `calle` varchar(80) NOT NULL,
  `no_int` varchar(20) NOT NULL,
  `no_ext` varchar(20) NOT NULL,
  `colonia` varchar(80) NOT NULL,
  `del_municipio` varchar(80) NOT NULL,
  `cp` varchar(10) NOT NULL,
  `id_pais` int(11) NOT NULL,
  `id_estado` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `sys_razones_sociales` (`id_razon_social`, `rfc`, `razon_social`, `calle`, `no_int`, `no_ext`, `colonia`, `del_municipio`, `cp`, `id_pais`, `id_estado`) VALUES
(-1, 'No aplica', '-No aplica-', 'No aplica', 'No aplica', 'No aplica', 'No aplica', 'No aplica', 'No aplica', 1, 16),
(1, 'FOCJ8503264C6', 'Jesús Iván Flores Cruz', 'Camelina', '', 'Mz 10A Lt 12', 'Buenavista', 'Iztapalapa', '09700', 1, 16),
(2, 'LFTG3490235T3', 'Razon social de prueba', 'calle de pruena', '', '10', 'Prueba', 'Prueba', '0900', 1, 2);

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

--
-- Estructura de tabla para la tabla `sys_reportes`
--

CREATE TABLE `sys_reportes` (
  `id_reporte` int(11) NOT NULL,
  `titulo` varchar(120) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
  `consulta` text COLLATE utf8_bin NOT NULL,
  `campo_fecha` varchar(120) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
  `ver_sumatorias` tinyint(1) NOT NULL,
  `consulta_sum` text COLLATE utf8_bin NOT NULL,
  `consulta_vacia` text COLLATE utf8_bin NOT NULL,
  `campoSucursal` varchar(120) COLLATE utf8_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

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

INSERT INTO `sys_reportes` (`id_reporte`, `titulo`, `consulta`, `campo_fecha`, `ver_sumatorias`, `consulta_sum`, `consulta_vacia`, `campoSucursal`) VALUES
(1, 'Reporte de ventas', 'SELECT\r\nv.folio,\r\nv.folio_fiscal,\r\nc.nombre,\r\nCONCAT(v.fecha,\'<br> \',v.hora),\r\nv.subtotal,\r\nv.iva,\r\nv.total,\r\nIF(v.facturado=1,\'facturado\',\'sin facturar\'),\r\nmp.nombre,\r\nfp.nombre,\r\nIF(v.cancelado=1,\'CANCELADO\',\'\')\r\nFROM ec_ventas v\r\nJOIN ec_clientes c on v.id_cliente=c.id_cliente\r\nJOIN ec_metodos_pago mp ON v.id_metodo_pago=mp.id_metodo_pago\r\nJOIN ec_forma_pago fp ON v.id_forma_pago=fp.id_forma_pago\r\nWHERE 1 AND (v.fecha BETWEEN \'$fecIni\' AND \'$fecFin\')\r\nXXX\r\nORDER BY v.fecha,v.hora ASC', 'NO', 0, '', 'SELECT\r\n_CAMPOS_\r\nFROM ec_ventas v\r\nJOIN ec_clientes c on v.id_cliente=c.id_cliente\r\nJOIN ec_metodos_pago mp ON v.id_metodo_pago=mp.id_metodo_pago\r\nJOIN ec_forma_pago fp ON v.id_forma_pago=fp.id_forma_pago\r\nWHERE 1 AND (v.fecha BETWEEN \'$fecIni\' AND \'$fecFin\')\r\nXXX\r\nORDER BY v.fecha,v.hora ASC', 'v.id_sucursal'),
(20, ' Reporte de inventario', 'SELECT\r\norden_lista,\r\nnombre,\r\nCompras,\r\nVentas,\r\nInvFin,\r\nUltPreCom,\r\nprecio_venta,\r\nUltPreCom*InvFin\r\nFROM\r\n(\r\nSELECT\r\np.orden_lista,\r\np.nombre,\r\nSUM(\r\n	IF(m.id_compra <> -1 AND m.fecha >= \'$fecIni\' AND m.fecha <= \'$fecFin\',\r\n		IF(md.cantidad IS NULL, 0, md.cantidad),\r\n		0\r\n	)\r\n) AS Compras,\r\nSUM(\r\n	IF(m.id_venta <> -1 AND m.fecha >= \'$fecIni\' AND m.fecha <= \'$fecFin\',\r\n		IF(md.cantidad IS NULL, 0, md.cantidad),\r\n		0\r\n	)\r\n) AS Ventas,\r\nSUM(\r\n	IF(m.fecha <= \'$fecFin\',\r\n		IF(md.cantidad IS NULL, 0, md.cantidad*tm.afecta),\r\n		0\r\n	)\r\n) AS InvFin,\r\n(\r\n	SELECT\r\n	ROUND(ec_detalle_compra.precio,2)\r\n	FROM ec_detalle_compra\r\n	JOIN ec_oc ON ec_detalle_compra.id_orden_compra = ec_oc.id_orden_compra\r\n	WHERE ec_oc.fecha <= \'$fecFin\'\r\n        AND ec_detalle_compra.id_producto = p.id_productos\r\n        ORDER BY ec_oc.id_orden_compra DESC\r\n        LIMIT 1\r\n) AS UltPreCom,\r\np.precio_venta\r\nFROM ec_productos p\r\nLEFT JOIN ec_detalle_movimiento md ON p.id_productos = md.id_producto\r\nLEFT JOIN ec_movimiento_inventario m ON md.id_movimiento_inventario = m.id_movimiento_inventario\r\nLEFT JOIN ec_tipos_movimiento tm ON m.id_tipo_movimiento = tm.id_movimiento\r\nLEFT JOIN ec_ventas pdo ON m.id_venta = pdo.id_venta\r\nLEFT JOIN ec_oc o ON m.id_compra = o.id_orden_compra\r\nWHERE m.fecha <= \'$fecFin\'\r\nXXX\r\nGROUP BY p.id_productos\r\n) p\r\nWHERE 1\r\nORDER BY orden_lista', 'NO', 1, 'SELECT\r\n\'Total\',\r\n\'\',\r\nSUM(Compras),\r\nSUM(Ventas),\r\nSUM(InvFin),\r\n\'\',\r\n\'\',\r\nSUM(UltPreCom*InvFin)\r\nFROM\r\n(\r\nSELECT\r\np.orden_lista,\r\np.nombre,\r\nSUM(\r\n	IF(m.id_compra <> -1 AND m.fecha >= \'$fecIni\' AND m.fecha <= \'$fecFin\',\r\n		IF(md.cantidad IS NULL, 0, md.cantidad),\r\n		0\r\n	)\r\n) AS Compras,\r\nSUM(\r\n	IF(m.id_venta <> -1 AND m.fecha >= \'$fecIni\' AND m.fecha <= \'$fecFin\',\r\n		IF(md.cantidad IS NULL, 0, md.cantidad),\r\n		0\r\n	)\r\n) AS Ventas,\r\nSUM(\r\n	IF(m.fecha <= \'$fecFin\',\r\n		IF(md.cantidad IS NULL, 0, md.cantidad*tm.afecta),\r\n		0\r\n	)\r\n) AS InvFin,\r\n\'\' AS UltPreCom,\r\n\'\' AS PreVen\r\nFROM ec_productos p\r\nLEFT JOIN ec_detalle_movimiento md ON p.id_productos = md.id_producto\r\nLEFT JOIN ec_movimiento_inventario m ON md.id_movimiento_inventario = m.id_movimiento_inventario\r\nLEFT JOIN ec_tipos_movimiento tm ON m.id_tipo_movimiento = tm.id_movimiento\r\nLEFT JOIN ec_ventas pdo ON m.id_venta = pdo.id_venta\r\nLEFT JOIN ec_oc o ON m.id_compra = o.id_orden_compra\r\nWHERE m.fecha <= \'$fecFin\'\r\nXXX\r\nGROUP BY p.id_productos\r\n) p\r\nWHERE 1\r\nORDER BY Compras DESC, Ventas DESC, nombre', 'SELECT\r\n_CAMPOS_\r\nFROM ec_productos p\r\nLEFT JOIN ec_detalle_movimiento md ON p.id_productos = md.id_producto\r\nLEFT JOIN ec_movimiento_inventario m ON md.id_movimiento_inventario = m.id_movimiento_inventario\r\nLEFT JOIN ec_tipos_movimiento tm ON m.id_tipo_movimiento = tm.id_movimiento\r\nLEFT JOIN ec_ventas pdo ON m.id_venta = pdo.id_venta\r\nLEFT JOIN ec_oc o ON m.id_compra = o.id_orden_compra\r\nWHERE m.fecha <= \'$fecFin\'\r\nXXX\r\nGROUP BY p.id_productos\r\nORDER BY Compras DESC, Ventas DESC, nombre', 'm.id_sucursal'),
(21, 'Reporte de Ordenes de Compra', 'SELECT\r\noc.id_orden_compra,\r\noc.folio,\r\np.nombre_comercial,\r\noc.subtotal,\r\noc.total,\r\noc.fecha\r\nFROM ec_oc oc\r\nJOIN ec_proveedor p ON oc.id_proveedor = p.id_proveedor\r\nWHERE 1\r\nXXX', 'oc.fecha', 0, '', 'SELECT\r\n_CAMPOS_\r\nFROM ec_oc oc\r\nJOIN ec_proveedor p ON oc.id_proveedor = p.id_proveedor\r\nWHERE 1', NULL),
(30, '', 'SELECT\n	p.id_productos,\n    p.orden_lista AS clave_sat,\n 	p.nombre,\n	p.nombre_etiqueta,\n	SUM(\n		IF(\n    		m.id_movimiento_inventario IS NOT NULL AND m.fecha <= \'$fecIni\',\n        	md.cantidad * tm.afecta,\n        	0\n        )\n    ) as inventarioInicial,\n	SUM(\n		IF(\n	    	m.id_movimiento_inventario IS NOT NULL AND m.id_tipo_movimiento = 1\n	    	AND (m.fecha BETWEEN \'$fecIni\' AND \'$fecFin\'),\n	        md.cantidad,\n	        0\n	    )\n    ) as entradas,\n	SUM(\n    	IF(\n	    	m.id_movimiento_inventario IS NOT NULL AND m.id_tipo_movimiento = 2 \n	    	AND (m.fecha BETWEEN \'$fecIni\' AND \'$fecFin\'),\n	        md.cantidad,\n	        0\n    	) \n    )as salidas,\n    SUM(\n		IF(\n	    	m.id_movimiento_inventario IS NOT NULL AND m.fecha <= \'$fecFin\',\n	        md.cantidad * tm.afecta,\n	        0\n	    )\n    ) as inventarioFinal\nFROM ec_productos p\nLEFT JOIN ec_detalle_movimiento md ON p.id_productos = md.id_producto\nLEFT JOIN ec_movimiento_inventario m ON md.id_movimiento_inventario = m.id_movimiento_inventario\nLEFT JOIN ec_tipos_movimiento tm ON m.id_tipo_movimiento = tm.id_movimiento\nWHERE 1\nGROUP BY p.id_productos', 'NO', 0, '', 'SELECT\r\n_CAMPOS_\r\nFROM ec_productos p\r\nLEFT JOIN ec_detalle_movimiento md ON p.id_productos = md.id_producto\r\nLEFT JOIN ec_movimiento_inventario m ON md.id_movimiento_inventario = m.id_movimiento_inventario\r\nLEFT JOIN ec_tipos_movimiento tm ON m.id_tipo_movimiento = tm.id_movimiento\r\nWHERE 1\r\nGROUP BY p.id_productos', NULL);

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

--
-- Estructura de tabla para la tabla `sys_reportes_columnas`
--

CREATE TABLE `sys_reportes_columnas` (
  `id_reporte_columna` int(11) NOT NULL,
  `id_reporte` int(11) NOT NULL,
  `campo` varchar(120) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
  `display` varchar(120) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
  `sumatoria` tinyint(1) NOT NULL,
  `orden` int(3) NOT NULL,
  `tipo` varchar(120) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

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

INSERT INTO `sys_reportes_columnas` (`id_reporte_columna`, `id_reporte`, `campo`, `display`, `sumatoria`, `orden`, `tipo`) VALUES
(1, 1, 'v.folio', 'FOLIO', 0, 1, 'label'),
(2, 1, 'v.folio_fiscal', 'FOLIO FISCAL', 0, 2, 'label'),
(3, 1, 'c.nombre', 'CLIENTE', 0, 3, 'label'),
(4, 1, 'CONCAT(v.fecha,\'<br> \',v.hora)', 'FECHA', 0, 4, 'label'),
(5, 1, 'v.subtotal', 'SUBTOTAL', 0, 5, 'values'),
(6, 1, 'v.iva', 'IVA', 0, 6, 'values'),
(7, 1, 'v.total', 'TOTAL', 0, 7, 'values'),
(8, 1, 'IF(v.facturado=1,\'facturado\',\'sin facturar\')', 'ESTATUS', 0, 8, 'label'),
(9, 1, 'mp.nombre', 'METODO DE PAGO', 0, 9, 'label'),
(10, 1, 'mp.nombre', 'METODO DE PAGO', 0, 10, 'label'),
(11, 1, 'v.cancelado', 'CANCELADO', 0, 11, 'label'),
(50, 20, 'p.orden_lista', 'Orden de lista', 0, 1, 'label'),
(51, 20, 'p.nombre', 'Producto', 0, 2, 'label'),
(53, 20, 'p.nombre', 'Compras', 1, 3, 'values'),
(54, 20, 'p.nombre', 'Ventas', 1, 4, 'values'),
(55, 20, 'p.nombre', 'Inventario', 1, 5, 'values'),
(56, 20, 'p.nombre', 'Ultimo precio compra', 1, 6, 'values'),
(59, 20, 'p.precio_venta', 'Precio Venta', 1, 7, 'values'),
(60, 20, 'p.nombre', 'Total', 1, 8, 'values'),
(61, 3, 'SUM(monto)', 'Monto', 1, 2, 'values'),
(62, 3, 'SUM(abonado)', 'Abonado', 1, 3, 'values'),
(63, 3, 'MAX(fecha_ultimo_pago)', 'Ultimo pago', 0, 4, 'label'),
(64, 4, 't.folio', 'Folio', 0, 1, 'label'),
(65, 4, 's1.nombre', 'Sucursal origen', 0, 2, 'label'),
(66, 4, 'a1.nombre', 'Almacén origen', 0, 3, 'label'),
(67, 4, 's2.nombre', 'Sucursal destino', 0, 4, 'label'),
(68, 5, 'CONCAT(u.nombre, \' \', u.apellido_paterno, \' \', u.apellido_materno)', 'Creada por', 0, 1, 'label'),
(69, 5, 'o.fecha', 'Fecha', 0, 2, 'label'),
(70, 5, 'c.nombre', 'Concepto', 0, 3, 'label'),
(71, 6, 'p.orden_lista', 'Orden de lista', 0, 1, 'label'),
(72, 6, 'p.nombre', 'Producto', 0, 2, 'label'),
(73, 6, 'p.ubicacion_almacen', 'Ubicación de almacén', 0, 3, 'label'),
(74, 6, '(\n	CASE t.id_tipo\n		WHEN 1 THEN \'Urgente\'\n		WHEN 2 THEN \'Libre\'\n		WHEN 3 THEN \'Medio\'\n		WHEN 4 THEN \'Alto\'\n	END\n)', 'Prioridad', 0, 4, 'label'),
(75, 7, 'p.orden_lista', 'Orden de lista', 0, 1, 'CHAR'),
(76, 7, 'p.nombre', 'Producto', 0, 2, 'CHAR'),
(77, 7, 'SUM(\n	IF(\n		md.id_movimiento IS NULL,\n		0,\n		md.cantidad*tm.afecta\n	)\n)', 'Stock actual', 0, 3, 'CHAR'),
(80, 8, 'p.orden_lista', 'Orden de lista', 0, 1, 'label'),
(81, 8, 'p.nombre', 'Nombre', 0, 2, 'label'),
(82, 9, 'p.nombre', 'Nombre', 0, 1, 'label'),
(84, 9, 'p.ubicacion_almacen', 'Ubicación de almacén', 0, 2, 'CHAR'),
(85, 10, 'p.nombre', 'Producto', 0, 1, 'CHAR'),
(86, 10, 'SUM(tp.cantidad_entrada) ', 'Cantidad', 0, 2, 'CHAR'),
(88, 11, 'p.nombre', 'Nombre', 0, 0, 'CHAR'),
(89, 11, 'p.ubicacion_almacen', 'Ubicación de almacén', 0, 2, 'CHAR'),
(90, 11, 'SUM(\n	IF(\n		md.id_movimiento IS NULL,\n		0,\n		md.cantidad*tm.afecta\n	)\n)', 'Stock en almacén', 0, 3, 'CHAR'),
(93, 12, 'nombre', 'Proveedor', 0, 1, 'CHAR'),
(94, 12, 'telefono ', 'Teléfono', 0, 2, 'CHAR'),
(95, 13, 'cliente', 'Cliente', 0, 1, 'CHAR'),
(97, 13, 'fechaPromesa', 'Fecha de promesa de pago', 0, 2, 'CHAR'),
(98, 13, 'monto', 'Monto', 0, 4, 'CHAR'),
(99, 13, 'diasTranscurridos', 'Días transcurridos', 0, 3, 'diasTranscurridos'),
(100, 14, 'cliente', 'Cliente', 0, 1, 'CHAR'),
(101, 14, 'concepto', 'Concepto', 0, 2, 'CHAR'),
(102, 14, 'fechaPromesa', 'Fecha de promesa de pago', 0, 3, 'CHAR'),
(103, 14, 'monto', 'Monto', 0, 4, 'CHAR'),
(104, 15, 'p.clave', 'Clave', 0, 1, 'CHAR'),
(105, 15, 'p.nombre', 'Producto', 0, 2, 'CHAR'),
(106, 15, 'SUM(IF(mi.id_movimiento_inventario IS NULL, 0, tm.afecta*dm.cantidad))', 'Cantidad', 0, 3, 'CHAR'),
(107, 16, 'CONCAT( nombre,  \' \', apellido_paterno,  \' \', apellido_materno )', 'Nombre', 0, 1, 'CHAR'),
(108, 16, 'clave', 'Clave', 0, 2, 'CHAR'),
(109, 16, 'email', 'Correo', 0, 3, 'CHAR'),
(110, 17, 'Nombre', 'Cliente', 0, 1, 'CHAR'),
(111, 17, 'evento', 'Evento', 0, 2, 'CHAR'),
(112, 17, 'fecha', 'Fecha', 0, 3, 'CHAR'),
(113, 17, 'CONCAT(\'$\',FORMAT(monto,2))', 'Monto', 0, 4, 'CHAR'),
(114, 3, 'SUM(monto)-SUM(abonado)', 'Restante', 1, 5, 'values'),
(115, 4, 'a2.nombre', 'Almacén destino', 0, 5, 'label'),
(116, 4, 'pp.nombre', 'Presentación', 0, 6, 'label'),
(117, 4, 'tp.cantidad_presentacion', 'Cantidad pedida', 0, 7, 'values'),
(118, 4, 'tp.cantidad_salida_pres', 'Cantidad salida', 0, 8, 'values'),
(119, 4, 'tp.cantidad_entrada_pres', 'Cantidad entrada', 0, 9, 'values'),
(120, 4, '( 	CASE tp.resolucion 		WHEN 0	THEN \'Sin resolver\' 		WHEN 1	THEN \'Devolver\' 		WHEN 2	THEN \'Mantener\' 		WHEN 3	THEN \'Elim', 'Resolución', 0, 10, 'label'),
(121, 8, 'p.precio_venta', 'Precio de venta', 0, 3, 'label'),
(122, 8, 'p.precio_compra', 'Precio de compra', 0, 4, 'label'),
(123, 9, 'p.precio_venta', 'Precio de venta', 0, 3, 'label'),
(124, 9, 'p.precio_compra', 'Precio de compra', 0, 4, 'label'),
(126, 18, 'c.nombre', 'Familia', 0, 1, 'label'),
(127, 18, 'SUM(pr.precio_venta)', 'Monto', 0, 3, 'label'),
(128, 18, 'COUNT(id_producto)', 'Cantidad', 0, 2, 'label'),
(129, 19, 'c.nombre', 'Tipo', 0, 1, 'label'),
(130, 19, 'COUNT(pd.id_producto)', 'Cantidad', 0, 2, 'label'),
(131, 19, 'CONCAT(\'$\',FORMAT(SUM(pr.precio_venta),2))', 'Monto', 0, 3, 'label'),
(135, 10, 'pr.nombre', 'Producto', 0, 1, 'label'),
(136, 10, 'COUNT(pd.id_producto)', 'Cantidad', 0, 2, 'label'),
(137, 10, 'CONCAT(\'$\',FORMAT(SUM(pr.precio_venta),2))', 'Monto', 0, 3, 'label'),
(138, 22, 'c.nombre', 'Color', 0, 1, 'label'),
(139, 22, 'COUNT(pd.id_producto)', 'Cantidad', 0, 2, 'label'),
(140, 22, 'CONCAT(\'$\',FORMAT(SUM(pr.precio_venta),2))', 'Monto', 0, 3, 'label'),
(141, 23, 'CONCAT(u.nombre,\' \',apellido_paterno,\' \',apellido_materno)', 'Vendedor', 0, 1, 'label'),
(142, 23, 'COUNT(pd.id_producto)', 'Cantidad', 0, 2, 'label'),
(143, 23, 'CONCAT(\'$\',FORMAT(SUM(pr.precio_venta),2))', 'Monto', 0, 3, 'label'),
(144, 24, 'c.nombre', 'Familia', 0, 1, 'label'),
(145, 24, 'SUM(pr.precio_venta)', 'Monto', 0, 3, 'label'),
(146, 24, 'COUNT(id_producto)', 'Cantidad', 0, 2, 'label'),
(147, 25, 'c.nombre', 'Tipo', 0, 1, 'label'),
(148, 25, 'COUNT(pd.id_producto)', 'Cantidad', 0, 2, 'label'),
(149, 25, 'CONCAT(\'$\',FORMAT(SUM(pr.precio_venta),2))', 'Monto', 0, 3, 'label'),
(150, 26, 'c.nombre', 'Subtipo', 0, 1, 'label'),
(151, 26, 'COUNT(pd.id_producto)', 'Cantidad', 0, 2, 'label'),
(152, 26, 'CONCAT(\'$\',FORMAT(SUM(pr.precio_venta),2))', 'Monto', 0, 3, 'label'),
(153, 27, 'pr.nombre', 'Producto', 0, 1, 'label'),
(154, 27, 'COUNT(pd.id_producto)', 'Cantidad', 0, 2, 'label'),
(155, 27, 'CONCAT(\'$\',FORMAT(SUM(pr.precio_venta),2))', 'Monto', 0, 3, 'label'),
(156, 28, 'c.nombre', 'Color', 0, 1, 'label'),
(157, 28, 'COUNT(pd.id_producto)', 'Cantidad', 0, 2, 'label'),
(158, 28, 'CONCAT(\'$\',FORMAT(SUM(pr.precio_venta),2))', 'Monto', 0, 3, 'label'),
(159, 29, 'pro.nombre_comercial', 'Proveedor', 0, 1, 'label'),
(160, 29, 'COUNT(p.id_proveedor)', 'Cantidad', 1, 2, 'label'),
(161, 29, 'CONCAT(\'$\',FORMAT(SUM(p.total),2))', 'Monto', 0, 3, 'label'),
(162, 30, 'p.id_productos', 'Id de producto', 0, 1, 'label'),
(163, 30, 'p.orden_lista', 'Clave SAT', 0, 2, 'label'),
(164, 30, 'p.nombre', 'Producto', 0, 3, 'label'),
(165, 30, 'p.nombre_etiqueta', 'Nombre de etiqueta', 0, 4, 'label'),
(166, 30, 'IF(\r\n    	m.id_movimiento_inventario IS NOT NULL AND m.fecha <= \'$fecIni\',\r\n        SUM( md.cantidad * tm.afecta ),\r\n   ', 'Inventario Inicial', 0, 5, 'values'),
(167, 30, 'IF(\r\n    	m.id_movimiento_inventario IS NOT NULL AND m.id_tipo_movimiento = 1 \r\n    	AND (m.fecha BETWEEN \'$fecIni\' AND ', 'Entradas', 0, 6, 'values'),
(168, 30, 'IF(\r\n    	m.id_movimiento_inventario IS NOT NULL AND m.id_tipo_movimiento = 2 \r\n    	AND (m.fecha BETWEEN \'$fecIni\' AND ', 'Salidas', 0, 7, 'values'),
(169, 30, 'IF(\r\n    	m.id_movimiento_inventario IS NOT NULL AND m.fecha <= \'$fecFin\',\r\n        0,\r\n        SUM( md.cantidad * tm.af', 'Inventario Final', 0, 8, 'values'),
(175, 21, 'oc.id_orden_compra', 'ID', 0, 1, 'values'),
(176, 21, 'oc.folio', 'FOLIO', 0, 2, 'label'),
(177, 21, 'p.nombre_comercial', 'PROVEEDOR', 0, 3, 'label'),
(178, 21, 'oc.subtotal', 'SUBTOTAL', 0, 4, 'values'),
(179, 21, 'oc.total', 'TOTAL', 0, 5, 'values'),
(180, 21, 'oc.fecha', 'FECHA', 0, 6, 'label');

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

--
-- Estructura de tabla para la tabla `sys_sucursales`
--

CREATE TABLE `sys_sucursales` (
  `id_sucursal` int(11) NOT NULL,
  `nombre` varchar(45) NOT NULL,
  `telefono` varchar(30) DEFAULT '1',
  `direccion` text,
  `descripcion` text,
  `id_razon_social` int(11) UNSIGNED DEFAULT NULL,
  `id_encargado` int(11) DEFAULT NULL,
  `activo` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  `logueo` bit(1) NOT NULL DEFAULT b'0',
  `logo` text NOT NULL,
  `multifacturacion` tinyint(1) NOT NULL DEFAULT '0',
  `id_precio` int(11) DEFAULT NULL,
  `descuento` float DEFAULT NULL,
  `prefijo` char(15) DEFAULT NULL,
  `usa_oferta` tinyint(1) NOT NULL,
  `alertas_resurtimiento` tinyint(1) NOT NULL,
  `acceso` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `sys_sucursales` (`id_sucursal`, `nombre`, `telefono`, `direccion`, `descripcion`, `id_razon_social`, `id_encargado`, `activo`, `logueo`, `logo`, `multifacturacion`, `id_precio`, `descuento`, `prefijo`, `usa_oferta`, `alertas_resurtimiento`, `acceso`) VALUES
(1, 'PEDRO ESTRADA ASCEVEDO', '5555 5555', 'ESTADO DE MEXICO', 'Descripcion de prueba', 1, 8, 1, b'1', 'https://easycount.com.mx/billarmex2//files/sys_sucursales_logo_5114_1.jpg', 0, 1, 0.1, 'SUA', 0, 1, 1),
(2, 'Sucursal ejemplo', '5567898765', '', '', 0, 1, 1, b'0', '', 0, 1, 0, 'PBA', 0, 0, 0),
(3, 'prueba sucursal producto 2', '12345678', '', '', 0, -1, 1, b'0', '', 0, 1, 0, '', 0, 0, 0);

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

--
-- Estructura de tabla para la tabla `sys_users`
--

CREATE TABLE `sys_users` (
  `id_usuario` int(11) NOT NULL,
  `nombre` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `apellido_paterno` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `apellido_materno` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `login` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `telefono` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `correo` varchar(120) COLLATE utf8_unicode_ci NOT NULL,
  `contrasena` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `edad` int(2) UNSIGNED DEFAULT NULL,
  `fecha_nacimiento` date DEFAULT NULL,
  `puesto` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `administrador` tinyint(1) NOT NULL,
  `id_sucursal` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `sys_users` (`id_usuario`, `nombre`, `apellido_paterno`, `apellido_materno`, `login`, `telefono`, `correo`, `contrasena`, `edad`, `fecha_nacimiento`, `puesto`, `administrador`, `id_sucursal`) VALUES
(-1, 'API Facturación', NULL, NULL, 'API', NULL, '', '', NULL, NULL, NULL, 0, 0),
(1, 'Oscar ', 'Mendoza', '', 'admin', '', 'desarrollo@terminus.mx', 'db6e2ee5f5981250dd8db42842233ddd', 26, '1985-03-26', '--', 1, -1),
(2, 'Dise', 'Diseño', '', 'diseno', '', 'diseno@terminus.mx', '60919e7f09bd1c55bc57ead1d7936256', NULL, NULL, 'Diseño', 0, -1),
(6, 'Desarrollo', 'Dev', '', 'desarrollo', '', 'iflores@terminus.mx', 'c82c2ccf8189f56cd2edc074316e0821', NULL, NULL, 'Desarrollador', 1, -1),
(7, 'FACTURACION', 'F', '', 'VERONICA ESTRADA ASCEVEDO', '', 'veroes_7934@hotmail.com', '88a406fb9531fdd094b0e8097587aa29', NULL, NULL, 'FACTURACION', 1, 1),
(8, 'PEDRO', 'ESTRADA', '', 'pedroestrada', '', 'estrada_pedro78@hotmail.com', '0ea8f6bf1d571345fceb0e7d226cff0b', NULL, NULL, 'director', 1, -1),
(9, 'VEA', 'E', 'A', '2767848', '', 'veroes_7934@hotmail.com', 'a84f9eec9b688baed4e0245a7c234638', NULL, NULL, 'a', 1, -1),
(10, 'Osvaldo', 'Hernandez', 'Hernandez', 'OsvaldoH91', '5549253316', 'ohernandez@terminus1o.com', 'd50f40094fff3caec164f8e64e584027', NULL, NULL, 'Tester', 1, -1),
(11, 'MONICA', 'MONICA', '', 'MONICA', '', 'MONICA', 'a96d7124c206b86f0522f5a76dad9e70', NULL, NULL, 'MONICA', 1, 1),
(12, 'Pedro', 'Estrada', '', 'PEDRO ESTRADA ASCEVEDO', '', 'fer.mb131197@gmail.com', '0ea8f6bf1d571345fceb0e7d226cff0b', NULL, NULL, 'FACTURACION', 0, 1);

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

--
-- Estructura de tabla para la tabla `sys_users_sucursales`
--

CREATE TABLE `sys_users_sucursales` (
  `id_user_sucursal` int(11) UNSIGNED NOT NULL,
  `id_usuario` int(11) UNSIGNED NOT NULL,
  `id_sucursal` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Estructura de tabla para la tabla `sys_user_groups`
--

CREATE TABLE `sys_user_groups` (
  `id_user_group` int(11) UNSIGNED NOT NULL,
  `id_usuario` int(11) UNSIGNED NOT NULL,
  `id_grupo` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Índices para tablas volcadas
--

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

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

--
-- Indices de la tabla `api_token`
--
ALTER TABLE `api_token`
  ADD PRIMARY KEY (`token`);

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

--
-- Indices de la tabla `cat_Tipo_Persona`
--
ALTER TABLE `cat_Tipo_Persona`
  ADD PRIMARY KEY (`idTipoPersona`);

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

--
-- Indices de la tabla `ec_clientes`
--
ALTER TABLE `ec_clientes`
  ADD PRIMARY KEY (`id_cliente`),
  ADD KEY `id_sucursal` (`id_sucursal`);

--
-- Indices de la tabla `ec_clientes_contacto`
--
ALTER TABLE `ec_clientes_contacto`
  ADD PRIMARY KEY (`id_cliente_contacto`);

--
-- Indices de la tabla `ec_clientes_razones_sociales`
--
ALTER TABLE `ec_clientes_razones_sociales`
  ADD PRIMARY KEY (`id_cliente_rs`),
  ADD KEY `id_cliente` (`id_cliente`);

--
-- Indices de la tabla `ec_configuracion_razon`
--
ALTER TABLE `ec_configuracion_razon`
  ADD PRIMARY KEY (`id_config`);

--
-- Indices de la tabla `ec_conf_iva`
--
ALTER TABLE `ec_conf_iva`
  ADD PRIMARY KEY (`id_conf_iva`);

--
-- Indices de la tabla `ec_conf_rs`
--
ALTER TABLE `ec_conf_rs`
  ADD PRIMARY KEY (`id_rs`);

--
-- Indices de la tabla `ec_detalle_compra`
--
ALTER TABLE `ec_detalle_compra`
  ADD PRIMARY KEY (`id_compra_detalle`),
  ADD KEY `fk1_tf_dc_idx` (`id_orden_compra`),
  ADD KEY `fk2_tf_dc_idx` (`id_producto`);

--
-- Indices de la tabla `ec_detalle_movimiento`
--
ALTER TABLE `ec_detalle_movimiento`
  ADD PRIMARY KEY (`id_detalle_movimiento`),
  ADD KEY `dm_fk2_idx` (`id_producto`),
  ADD KEY `id_movimintoxxxx07_idx` (`id_movimiento_inventario`);

--
-- Indices de la tabla `ec_detalle_pagos`
--
ALTER TABLE `ec_detalle_pagos`
  ADD PRIMARY KEY (`id_detalle_pagos`);

--
-- Indices de la tabla `ec_detalle_venta`
--
ALTER TABLE `ec_detalle_venta`
  ADD PRIMARY KEY (`id_detalle_venta`),
  ADD KEY `id_venta_aa3_idx` (`id_venta`),
  ADD KEY `id_producto_aa4_idx` (`id_producto`);

--
-- Indices de la tabla `ec_detalle_venta_back`
--
ALTER TABLE `ec_detalle_venta_back`
  ADD PRIMARY KEY (`id_detalle_venta`),
  ADD KEY `id_venta` (`id_venta`);

--
-- Indices de la tabla `ec_emisor`
--
ALTER TABLE `ec_emisor`
  ADD PRIMARY KEY (`id_emisor`);

--
-- Indices de la tabla `ec_forma_pago`
--
ALTER TABLE `ec_forma_pago`
  ADD PRIMARY KEY (`id_forma_pago`);

--
-- Indices de la tabla `ec_limites_razon_social`
--
ALTER TABLE `ec_limites_razon_social`
  ADD PRIMARY KEY (`id_limite_razon_social`);

--
-- Indices de la tabla `ec_metodos_pago`
--
ALTER TABLE `ec_metodos_pago`
  ADD PRIMARY KEY (`id_metodo_pago`);

--
-- Indices de la tabla `ec_motivos_cancelacion_factura`
--
ALTER TABLE `ec_motivos_cancelacion_factura`
  ADD PRIMARY KEY (`id_motivo`);

--
-- Indices de la tabla `ec_movimiento_inventario`
--
ALTER TABLE `ec_movimiento_inventario`
  ADD PRIMARY KEY (`id_movimiento_inventario`),
  ADD KEY `id_venta` (`id_venta`),
  ADD KEY `id_tipo_movimiento` (`id_tipo_movimiento`),
  ADD KEY `id_usuario` (`id_usuario`),
  ADD KEY `id_sucursal` (`id_sucursal`),
  ADD KEY `ec_movimiento_inventario_ibfk_6` (`id_compra`);

--
-- Indices de la tabla `ec_oc`
--
ALTER TABLE `ec_oc`
  ADD PRIMARY KEY (`id_orden_compra`),
  ADD KEY `id_proveedor_ab1_idx` (`id_proveedor`),
  ADD KEY `id_sucursal_ab2_idx` (`id_sucursal`),
  ADD KEY `id_usuario_ab3_idx` (`id_usuario`);

--
-- Indices de la tabla `ec_oc_detalle`
--
ALTER TABLE `ec_oc_detalle`
  ADD PRIMARY KEY (`id_oc_detalle`),
  ADD KEY `id_orden_compra_ac1_idx` (`id_orden_compra`),
  ADD KEY `id_producto_ac2_idx` (`id_producto`);

--
-- Indices de la tabla `ec_previo_detalle_back`
--
ALTER TABLE `ec_previo_detalle_back`
  ADD PRIMARY KEY (`id_previo_detalle_back`);

--
-- Indices de la tabla `ec_productos`
--
ALTER TABLE `ec_productos`
  ADD PRIMARY KEY (`id_productos`);

--
-- Indices de la tabla `ec_proveedor`
--
ALTER TABLE `ec_proveedor`
  ADD PRIMARY KEY (`id_proveedor`),
  ADD KEY `id_sucursal` (`id_sucursal`);

--
-- Indices de la tabla `ec_razon_afiliaciones`
--
ALTER TABLE `ec_razon_afiliaciones`
  ADD PRIMARY KEY (`id_afiliacion`);

--
-- Indices de la tabla `ec_sets`
--
ALTER TABLE `ec_sets`
  ADD PRIMARY KEY (`id_set`);

--
-- Indices de la tabla `ec_sets_detalles`
--
ALTER TABLE `ec_sets_detalles`
  ADD PRIMARY KEY (`id_set_detalle`),
  ADD KEY `id_set` (`id_set`),
  ADD KEY `id_producto` (`id_producto`);

--
-- Indices de la tabla `ec_status_facturacion`
--
ALTER TABLE `ec_status_facturacion`
  ADD PRIMARY KEY (`id_status_facturacion`);

--
-- Indices de la tabla `ec_sucursal_producto`
--
ALTER TABLE `ec_sucursal_producto`
  ADD PRIMARY KEY (`id_sucursal_producto`),
  ADD KEY `id_sucursal` (`id_sucursal`),
  ADD KEY `id_producto` (`id_producto`);

--
-- Indices de la tabla `ec_tipos_movimiento`
--
ALTER TABLE `ec_tipos_movimiento`
  ADD PRIMARY KEY (`id_movimiento`);

--
-- Indices de la tabla `ec_tipos_regimenes_fiscales`
--
ALTER TABLE `ec_tipos_regimenes_fiscales`
  ADD PRIMARY KEY (`id_tipo_regimen_fiscal`);

--
-- Indices de la tabla `ec_ventas`
--
ALTER TABLE `ec_ventas`
  ADD PRIMARY KEY (`id_venta`),
  ADD KEY `id_sucursal_aa1_idx` (`id_sucursal`),
  ADD KEY `id_cliente_aa2_idx` (`id_cliente`),
  ADD KEY `id_usuario_aa3_idx` (`id_usuario`);

--
-- Indices de la tabla `ec_ventas_back`
--
ALTER TABLE `ec_ventas_back`
  ADD PRIMARY KEY (`id_venta_back`),
  ADD KEY `id_venta` (`id_venta`);

--
-- Indices de la tabla `ec_venta_pagos`
--
ALTER TABLE `ec_venta_pagos`
  ADD PRIMARY KEY (`id_venta_pago`);

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

--
-- Indices de la tabla `sys_ambientes_facturacion`
--
ALTER TABLE `sys_ambientes_facturacion`
  ADD PRIMARY KEY (`id_ambiente`);

--
-- Indices de la tabla `sys_catalogos`
--
ALTER TABLE `sys_catalogos`
  ADD PRIMARY KEY (`id_catalogo`);

--
-- Indices de la tabla `sys_conf_pantalla`
--
ALTER TABLE `sys_conf_pantalla`
  ADD PRIMARY KEY (`id_configuracion_pantalla`),
  ADD KEY `id_plantilla` (`id_plantilla`);

--
-- Indices de la tabla `sys_correos_avisos`
--
ALTER TABLE `sys_correos_avisos`
  ADD PRIMARY KEY (`id_correo_aviso`);

--
-- Indices de la tabla `sys_estados`
--
ALTER TABLE `sys_estados`
  ADD PRIMARY KEY (`id_estado`),
  ADD KEY `id_pais` (`id_pais`);

--
-- Indices de la tabla `sys_grid`
--
ALTER TABLE `sys_grid`
  ADD PRIMARY KEY (`id_grid`);

--
-- Indices de la tabla `sys_grid_detalle`
--
ALTER TABLE `sys_grid_detalle`
  ADD PRIMARY KEY (`id_grid_detalle`);

--
-- Indices de la tabla `sys_groups`
--
ALTER TABLE `sys_groups`
  ADD PRIMARY KEY (`id_grupo`);

--
-- Indices de la tabla `sys_herramientas`
--
ALTER TABLE `sys_herramientas`
  ADD PRIMARY KEY (`id_herramienta`);

--
-- Indices de la tabla `sys_listados`
--
ALTER TABLE `sys_listados`
  ADD PRIMARY KEY (`id_listado`);

--
-- Indices de la tabla `sys_log_errores_timbrado`
--
ALTER TABLE `sys_log_errores_timbrado`
  ADD PRIMARY KEY (`id_log`);

--
-- Indices de la tabla `sys_menus`
--
ALTER TABLE `sys_menus`
  ADD PRIMARY KEY (`id_menu`);

--
-- Indices de la tabla `sys_paises`
--
ALTER TABLE `sys_paises`
  ADD PRIMARY KEY (`id_pais`);

--
-- Indices de la tabla `sys_permisos`
--
ALTER TABLE `sys_permisos`
  ADD PRIMARY KEY (`id_permiso`),
  ADD KEY `id_usuario` (`id_usuario`),
  ADD KEY `id_menu` (`id_menu`);

--
-- Indices de la tabla `sys_permisos_funciones`
--
ALTER TABLE `sys_permisos_funciones`
  ADD PRIMARY KEY (`id_permiso_funcion`);

--
-- Indices de la tabla `sys_permisos_funcusers`
--
ALTER TABLE `sys_permisos_funcusers`
  ADD PRIMARY KEY (`id_permiso_funcuser`),
  ADD KEY `id_usuario` (`id_usuario`),
  ADD KEY `id_permiso_funcion` (`id_permiso_funcion`);

--
-- Indices de la tabla `sys_plantilla`
--
ALTER TABLE `sys_plantilla`
  ADD PRIMARY KEY (`id_plantilla`);

--
-- Indices de la tabla `sys_razones_sociales`
--
ALTER TABLE `sys_razones_sociales`
  ADD PRIMARY KEY (`id_razon_social`),
  ADD KEY `id_pais` (`id_pais`),
  ADD KEY `id_estado` (`id_estado`);

--
-- Indices de la tabla `sys_reportes`
--
ALTER TABLE `sys_reportes`
  ADD PRIMARY KEY (`id_reporte`);

--
-- Indices de la tabla `sys_reportes_columnas`
--
ALTER TABLE `sys_reportes_columnas`
  ADD PRIMARY KEY (`id_reporte_columna`);

--
-- Indices de la tabla `sys_sucursales`
--
ALTER TABLE `sys_sucursales`
  ADD PRIMARY KEY (`id_sucursal`),
  ADD KEY `id_precio` (`id_precio`);

--
-- Indices de la tabla `sys_users`
--
ALTER TABLE `sys_users`
  ADD PRIMARY KEY (`id_usuario`),
  ADD KEY `id_escuela` (`id_sucursal`);

--
-- Indices de la tabla `sys_users_sucursales`
--
ALTER TABLE `sys_users_sucursales`
  ADD PRIMARY KEY (`id_user_sucursal`);

--
-- Indices de la tabla `sys_user_groups`
--
ALTER TABLE `sys_user_groups`
  ADD PRIMARY KEY (`id_user_group`);

--
-- AUTO_INCREMENT de las tablas volcadas
--

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

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

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

--
-- AUTO_INCREMENT de la tabla `cat_Tipo_Persona`
--
ALTER TABLE `cat_Tipo_Persona`
  MODIFY `idTipoPersona` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

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

--
-- AUTO_INCREMENT de la tabla `ec_clientes`
--
ALTER TABLE `ec_clientes`
  MODIFY `id_cliente` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11901;

--
-- AUTO_INCREMENT de la tabla `ec_clientes_contacto`
--
ALTER TABLE `ec_clientes_contacto`
  MODIFY `id_cliente_contacto` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12607;

--
-- AUTO_INCREMENT de la tabla `ec_clientes_razones_sociales`
--
ALTER TABLE `ec_clientes_razones_sociales`
  MODIFY `id_cliente_rs` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11901;

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

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

--
-- AUTO_INCREMENT de la tabla `ec_conf_rs`
--
ALTER TABLE `ec_conf_rs`
  MODIFY `id_rs` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT de la tabla `ec_detalle_compra`
--
ALTER TABLE `ec_detalle_compra`
  MODIFY `id_compra_detalle` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=107;

--
-- AUTO_INCREMENT de la tabla `ec_detalle_movimiento`
--
ALTER TABLE `ec_detalle_movimiento`
  MODIFY `id_detalle_movimiento` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=87911;

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

--
-- AUTO_INCREMENT de la tabla `ec_detalle_venta`
--
ALTER TABLE `ec_detalle_venta`
  MODIFY `id_detalle_venta` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=137;

--
-- AUTO_INCREMENT de la tabla `ec_detalle_venta_back`
--
ALTER TABLE `ec_detalle_venta_back`
  MODIFY `id_detalle_venta` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=177;

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

--
-- AUTO_INCREMENT de la tabla `ec_forma_pago`
--
ALTER TABLE `ec_forma_pago`
  MODIFY `id_forma_pago` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT de la tabla `ec_limites_razon_social`
--
ALTER TABLE `ec_limites_razon_social`
  MODIFY `id_limite_razon_social` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

--
-- AUTO_INCREMENT de la tabla `ec_motivos_cancelacion_factura`
--
ALTER TABLE `ec_motivos_cancelacion_factura`
  MODIFY `id_motivo` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT de la tabla `ec_movimiento_inventario`
--
ALTER TABLE `ec_movimiento_inventario`
  MODIFY `id_movimiento_inventario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7855;

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

--
-- AUTO_INCREMENT de la tabla `ec_oc_detalle`
--
ALTER TABLE `ec_oc_detalle`
  MODIFY `id_oc_detalle` bigint(21) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `ec_previo_detalle_back`
--
ALTER TABLE `ec_previo_detalle_back`
  MODIFY `id_previo_detalle_back` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=166;

--
-- AUTO_INCREMENT de la tabla `ec_proveedor`
--
ALTER TABLE `ec_proveedor`
  MODIFY `id_proveedor` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

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

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

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

--
-- AUTO_INCREMENT de la tabla `ec_status_facturacion`
--
ALTER TABLE `ec_status_facturacion`
  MODIFY `id_status_facturacion` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT de la tabla `ec_sucursal_producto`
--
ALTER TABLE `ec_sucursal_producto`
  MODIFY `id_sucursal_producto` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26767;

--
-- AUTO_INCREMENT de la tabla `ec_tipos_movimiento`
--
ALTER TABLE `ec_tipos_movimiento`
  MODIFY `id_movimiento` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `ec_tipos_regimenes_fiscales`
--
ALTER TABLE `ec_tipos_regimenes_fiscales`
  MODIFY `id_tipo_regimen_fiscal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT de la tabla `ec_ventas`
--
ALTER TABLE `ec_ventas`
  MODIFY `id_venta` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `ec_ventas_back`
--
ALTER TABLE `ec_ventas_back`
  MODIFY `id_venta_back` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8289;

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

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

--
-- AUTO_INCREMENT de la tabla `sys_ambientes_facturacion`
--
ALTER TABLE `sys_ambientes_facturacion`
  MODIFY `id_ambiente` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `sys_catalogos`
--
ALTER TABLE `sys_catalogos`
  MODIFY `id_catalogo` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=730;

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

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

--
-- AUTO_INCREMENT de la tabla `sys_estados`
--
ALTER TABLE `sys_estados`
  MODIFY `id_estado` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT de la tabla `sys_grid`
--
ALTER TABLE `sys_grid`
  MODIFY `id_grid` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;

--
-- AUTO_INCREMENT de la tabla `sys_grid_detalle`
--
ALTER TABLE `sys_grid_detalle`
  MODIFY `id_grid_detalle` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=402;

--
-- AUTO_INCREMENT de la tabla `sys_groups`
--
ALTER TABLE `sys_groups`
  MODIFY `id_grupo` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `sys_herramientas`
--
ALTER TABLE `sys_herramientas`
  MODIFY `id_herramienta` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT de la tabla `sys_listados`
--
ALTER TABLE `sys_listados`
  MODIFY `id_listado` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=87;

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

--
-- AUTO_INCREMENT de la tabla `sys_menus`
--
ALTER TABLE `sys_menus`
  MODIFY `id_menu` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=136;

--
-- AUTO_INCREMENT de la tabla `sys_paises`
--
ALTER TABLE `sys_paises`
  MODIFY `id_pais` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `sys_permisos`
--
ALTER TABLE `sys_permisos`
  MODIFY `id_permiso` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=968;

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

--
-- AUTO_INCREMENT de la tabla `sys_permisos_funcusers`
--
ALTER TABLE `sys_permisos_funcusers`
  MODIFY `id_permiso_funcuser` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT de la tabla `sys_plantilla`
--
ALTER TABLE `sys_plantilla`
  MODIFY `id_plantilla` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT de la tabla `sys_razones_sociales`
--
ALTER TABLE `sys_razones_sociales`
  MODIFY `id_razon_social` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `sys_reportes`
--
ALTER TABLE `sys_reportes`
  MODIFY `id_reporte` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT de la tabla `sys_reportes_columnas`
--
ALTER TABLE `sys_reportes_columnas`
  MODIFY `id_reporte_columna` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=181;

--
-- AUTO_INCREMENT de la tabla `sys_sucursales`
--
ALTER TABLE `sys_sucursales`
  MODIFY `id_sucursal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `sys_users`
--
ALTER TABLE `sys_users`
  MODIFY `id_usuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT de la tabla `sys_users_sucursales`
--
ALTER TABLE `sys_users_sucursales`
  MODIFY `id_user_sucursal` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `sys_user_groups`
--
ALTER TABLE `sys_user_groups`
  MODIFY `id_user_group` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Restricciones para tablas volcadas
--

--
-- Filtros para la tabla `ec_clientes`
--
ALTER TABLE `ec_clientes`
  ADD CONSTRAINT `ec_clientes_ibfk_1` FOREIGN KEY (`id_sucursal`) REFERENCES `sys_sucursales` (`id_sucursal`) ON UPDATE CASCADE;

--
-- Filtros para la tabla `ec_clientes_razones_sociales`
--
ALTER TABLE `ec_clientes_razones_sociales`
  ADD CONSTRAINT `ec_clientes_razones_sociales_ibfk_1` FOREIGN KEY (`id_cliente`) REFERENCES `ec_clientes` (`id_cliente`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Filtros para la tabla `ec_detalle_movimiento`
--
ALTER TABLE `ec_detalle_movimiento`
  ADD CONSTRAINT `dm_fk2` FOREIGN KEY (`id_producto`) REFERENCES `ec_productos` (`id_productos`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `id_movimintoxxxx07` FOREIGN KEY (`id_movimiento_inventario`) REFERENCES `ec_movimiento_inventario` (`id_movimiento_inventario`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Filtros para la tabla `ec_detalle_venta`
--
ALTER TABLE `ec_detalle_venta`
  ADD CONSTRAINT `id_producto_aa4` FOREIGN KEY (`id_producto`) REFERENCES `ec_productos` (`id_productos`) ON UPDATE CASCADE,
  ADD CONSTRAINT `id_venta_zzz09` FOREIGN KEY (`id_venta`) REFERENCES `ec_ventas` (`id_venta`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Filtros para la tabla `ec_movimiento_inventario`
--
ALTER TABLE `ec_movimiento_inventario`
  ADD CONSTRAINT `ec_movimiento_inventario_ibfk_2` FOREIGN KEY (`id_venta`) REFERENCES `ec_ventas` (`id_venta`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ec_movimiento_inventario_ibfk_3` FOREIGN KEY (`id_tipo_movimiento`) REFERENCES `ec_tipos_movimiento` (`id_movimiento`),
  ADD CONSTRAINT `ec_movimiento_inventario_ibfk_4` FOREIGN KEY (`id_usuario`) REFERENCES `sys_users` (`id_usuario`),
  ADD CONSTRAINT `ec_movimiento_inventario_ibfk_5` FOREIGN KEY (`id_sucursal`) REFERENCES `sys_sucursales` (`id_sucursal`),
  ADD CONSTRAINT `ec_movimiento_inventario_ibfk_6` FOREIGN KEY (`id_compra`) REFERENCES `ec_oc` (`id_orden_compra`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Filtros para la tabla `ec_oc`
--
ALTER TABLE `ec_oc`
  ADD CONSTRAINT `id_proveedor_ab1` FOREIGN KEY (`id_proveedor`) REFERENCES `ec_proveedor` (`id_proveedor`) ON UPDATE CASCADE,
  ADD CONSTRAINT `id_sucursal_ab2` FOREIGN KEY (`id_sucursal`) REFERENCES `sys_sucursales` (`id_sucursal`) ON UPDATE CASCADE,
  ADD CONSTRAINT `id_usuario_ab3` FOREIGN KEY (`id_usuario`) REFERENCES `sys_users` (`id_usuario`) ON UPDATE CASCADE;

--
-- Filtros para la tabla `ec_oc_detalle`
--
ALTER TABLE `ec_oc_detalle`
  ADD CONSTRAINT `id_orden_compra_ac1` FOREIGN KEY (`id_orden_compra`) REFERENCES `ec_oc` (`id_orden_compra`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `id_producto_ac2` FOREIGN KEY (`id_producto`) REFERENCES `ec_productos` (`id_productos`) ON UPDATE CASCADE;

--
-- Filtros para la tabla `ec_proveedor`
--
ALTER TABLE `ec_proveedor`
  ADD CONSTRAINT `ec_proveedor_ibfk_3` FOREIGN KEY (`id_sucursal`) REFERENCES `sys_sucursales` (`id_sucursal`) ON UPDATE CASCADE;

--
-- Filtros para la tabla `ec_sets_detalles`
--
ALTER TABLE `ec_sets_detalles`
  ADD CONSTRAINT `ec_sets_detalles_ibfk_1` FOREIGN KEY (`id_set`) REFERENCES `ec_sets` (`id_set`),
  ADD CONSTRAINT `ec_sets_detalles_ibfk_2` FOREIGN KEY (`id_producto`) REFERENCES `ec_productos` (`id_productos`);

--
-- Filtros para la tabla `ec_sucursal_producto`
--
ALTER TABLE `ec_sucursal_producto`
  ADD CONSTRAINT `ec_sucursal_producto_ibfk_1` FOREIGN KEY (`id_sucursal`) REFERENCES `sys_sucursales` (`id_sucursal`),
  ADD CONSTRAINT `ec_sucursal_producto_ibfk_2` FOREIGN KEY (`id_producto`) REFERENCES `ec_productos` (`id_productos`);

--
-- Filtros para la tabla `ec_ventas`
--
ALTER TABLE `ec_ventas`
  ADD CONSTRAINT `id_cliente_aa2` FOREIGN KEY (`id_cliente`) REFERENCES `ec_clientes` (`id_cliente`) ON UPDATE CASCADE,
  ADD CONSTRAINT `id_sucursal_aa1` FOREIGN KEY (`id_sucursal`) REFERENCES `sys_sucursales` (`id_sucursal`) ON UPDATE CASCADE,
  ADD CONSTRAINT `id_usuario_aa3` FOREIGN KEY (`id_usuario`) REFERENCES `sys_users` (`id_usuario`) ON UPDATE CASCADE;
COMMIT;

