Tul xxx Tul
User / IP
:
216.73.216.217
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
aircan.me
/
public_html
/
vendefacilmayy
/
Base de datos
/
Viewing: vacio.sql
-- phpMyAdmin SQL Dump -- version 5.2.1 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 23-05-2026 a las 05:59:01 -- Versión del servidor: 10.4.32-MariaDB -- Versión de PHP: 8.2.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `tiendaonline` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `abonos` -- CREATE TABLE `abonos` ( `id` int(11) NOT NULL, `abono` decimal(10,2) NOT NULL, `fecha` datetime DEFAULT NULL ON UPDATE current_timestamp(), `id_caja` int(11) NOT NULL, `id_credito` int(11) NOT NULL, `id_usuario` int(11) NOT NULL, `id_formapago` int(11) DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `abonosporpagar` -- CREATE TABLE `abonosporpagar` ( `id` int(11) NOT NULL, `abono` decimal(10,2) NOT NULL, `fecha` datetime DEFAULT NULL ON UPDATE current_timestamp(), `id_credito` int(11) NOT NULL, `id_usuario` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `abono_reparacion` -- CREATE TABLE `abono_reparacion` ( `id` int(11) NOT NULL, `monto` decimal(10,2) DEFAULT NULL, `descripcion` text DEFAULT NULL, `fecha` date DEFAULT NULL, `id_caja` int(11) NOT NULL, `id_reparacion` int(11) NOT NULL, `id_formapago` int(11) DEFAULT NULL, `id_usuario` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `acceso` -- CREATE TABLE `acceso` ( `id` int(11) NOT NULL, `evento` varchar(30) NOT NULL, `ip` varchar(50) NOT NULL, `detalle` text NOT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `activos_fijos` -- CREATE TABLE `activos_fijos` ( `id` int(11) NOT NULL, `codigo` varchar(50) NOT NULL, `nombre` varchar(255) NOT NULL, `categoria` varchar(100) DEFAULT NULL, `descripcion` text DEFAULT NULL, `fecha_compra` date NOT NULL, `costo` decimal(10,2) NOT NULL, `vida_util_meses` int(11) NOT NULL, `valor_residual` decimal(10,2) NOT NULL DEFAULT 0.00, `metodo` varchar(20) NOT NULL DEFAULT 'LINEAL', `estado` int(11) NOT NULL DEFAULT 1, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `apartados` -- CREATE TABLE `apartados` ( `id` int(11) NOT NULL, `productos` longtext NOT NULL, `fecha_create` date DEFAULT NULL, `fecha_apartado` datetime NOT NULL, `fecha_retiro` datetime NOT NULL, `abono` decimal(10,2) NOT NULL, `total` decimal(10,2) NOT NULL, `color` varchar(15) NOT NULL, `estado` int(11) NOT NULL DEFAULT 1, `moneda` char(50) NOT NULL, `id_cliente` int(11) NOT NULL, `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cajas` -- CREATE TABLE `cajas` ( `id` int(11) NOT NULL, `monto_inicial` decimal(10,2) NOT NULL, `fecha_apertura` date NOT NULL, `fecha_cierre` date DEFAULT NULL, `monto_final` decimal(10,2) DEFAULT NULL, `total_ventas` int(11) DEFAULT NULL, `egresos` decimal(10,2) DEFAULT NULL, `gastos` decimal(10,2) DEFAULT NULL, `estado` int(11) NOT NULL DEFAULT 1, `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `categorias` -- CREATE TABLE `categorias` ( `id` int(11) NOT NULL, `categoria` varchar(100) NOT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `estado` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `categorias_gastos` -- CREATE TABLE `categorias_gastos` ( `id` int(11) NOT NULL, `nombre` varchar(100) NOT NULL, `codigo_cuenta` varchar(50) NOT NULL, `estado` tinyint(4) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cierre_caja_metodos` -- CREATE TABLE `cierre_caja_metodos` ( `id` int(11) NOT NULL, `id_caja` int(11) NOT NULL, `metodo` varchar(100) NOT NULL, `monto` decimal(15,2) DEFAULT 0.00, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `clientes` -- CREATE TABLE `clientes` ( `id` int(11) NOT NULL, `identidad` varchar(50) NOT NULL, `num_identidad` varchar(15) NOT NULL, `nombre` varchar(255) NOT NULL, `telefono` varchar(50) NOT NULL, `correo` varchar(100) DEFAULT NULL, `direccion` varchar(255) DEFAULT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `estado` int(11) NOT NULL DEFAULT 1, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `compras` -- CREATE TABLE `compras` ( `id` int(11) NOT NULL, `productos` longtext NOT NULL, `total` decimal(10,2) NOT NULL, `aplica_iva` tinyint(4) NOT NULL DEFAULT 0, `iva_monto` decimal(10,2) NOT NULL DEFAULT 0.00, `retencion_monto` decimal(10,2) NOT NULL DEFAULT 0.00, `total_pagar` decimal(10,2) NOT NULL DEFAULT 0.00, `fecha` date NOT NULL, `hora` time NOT NULL, `serie` varchar(20) NOT NULL, `estado` int(11) NOT NULL DEFAULT 1, `moneda` char(10) NOT NULL, `metodo` varchar(20) NOT NULL DEFAULT '', `id_caja` int(11) DEFAULT 1, `id_proveedor` int(11) NOT NULL, `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cotizaciones` -- CREATE TABLE `cotizaciones` ( `id` int(11) NOT NULL, `productos` longtext NOT NULL, `total` decimal(10,2) NOT NULL, `totalConImpuesto` decimal(10,2) NOT NULL DEFAULT 0.00, `fecha` date NOT NULL, `hora` time NOT NULL, `metodo` varchar(20) NOT NULL, `validez` varchar(30) NOT NULL, `descuento` decimal(10,2) NOT NULL DEFAULT 0.00, `impuesto` int(11) NOT NULL DEFAULT 0, `moneda` char(10) NOT NULL, `id_cliente` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `creditos` -- CREATE TABLE `creditos` ( `id` int(11) NOT NULL, `monto` decimal(10,2) NOT NULL, `fecha` date NOT NULL, `hora` time NOT NULL, `estado` int(11) NOT NULL DEFAULT 1, `id_venta` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_apartado` -- CREATE TABLE `detalle_apartado` ( `id` int(11) NOT NULL, `monto` decimal(10,2) NOT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `id_caja` int(11) NOT NULL DEFAULT 1, `id_apartado` int(11) NOT NULL, `id_usuario` int(11) NOT NULL, `id_formapago` int(11) DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_reparacion` -- CREATE TABLE `detalle_reparacion` ( `id` int(11) NOT NULL, `producto` text DEFAULT NULL, `precio` decimal(10,2) NOT NULL, `cantidad` int(11) NOT NULL, `id_reparacion` int(11) NOT NULL, `id_producto` int(10) UNSIGNED DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_traslados` -- CREATE TABLE `detalle_traslados` ( `id` bigint(20) UNSIGNED NOT NULL, `traslado_id` bigint(20) UNSIGNED NOT NULL, `producto_id` bigint(20) UNSIGNED NOT NULL, `nombre_producto` varchar(255) NOT NULL, `cantidad` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_ventas` -- CREATE TABLE `detalle_ventas` ( `id` int(11) NOT NULL, `producto` varchar(255) NOT NULL, `id_producto` int(11) NOT NULL, `precio` decimal(10,2) NOT NULL, `cantidad` int(11) NOT NULL, `fecha` date NOT NULL, `fecha_vencimiento` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `efectivo_abonos` -- CREATE TABLE `efectivo_abonos` ( `id` int(11) NOT NULL, `monto` decimal(10,2) NOT NULL, `cobrado` decimal(10,2) NOT NULL, `devuelta` decimal(10,2) NOT NULL, `referencia` text DEFAULT NULL, `abono_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `efectivo_ventas` -- CREATE TABLE `efectivo_ventas` ( `id` int(11) NOT NULL, `monto` decimal(10,2) NOT NULL, `cobrado` decimal(10,2) NOT NULL, `devuelta` decimal(10,2) NOT NULL, `fecha` date NOT NULL, `referencia` text DEFAULT NULL, `venta_id` int(11) NOT NULL, `formapago_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `empresa` -- CREATE TABLE `empresa` ( `id` int(11) NOT NULL, `limite_sucursal` int(11) NOT NULL DEFAULT 5, `mensaje1` text DEFAULT NULL, `mensaje2` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -- Volcado de datos para la tabla `empresa` -- INSERT INTO `empresa` (`id`, `limite_sucursal`, `mensaje1`, `mensaje2`) VALUES (1, 10, 'Estado Activo', ''); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `entradas_salidas` -- CREATE TABLE `entradas_salidas` ( `id` int(11) NOT NULL, `id_producto` int(11) NOT NULL, `tipo` varchar(50) NOT NULL COMMENT 'Entrada, Salida', `cantidad` int(11) NOT NULL, `motivo` text DEFAULT NULL, `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `formapagos` -- CREATE TABLE `formapagos` ( `id` int(11) NOT NULL, `formapago` varchar(100) NOT NULL, `estado` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; -- -- Volcado de datos para la tabla `formapagos` -- INSERT INTO `formapagos` (`id`, `formapago`, `estado`) VALUES (1, 'EFECTIVO', 1), (2, 'TARJETA', 1), (3, 'TRANSFERENCIA', 1), (4, 'PAYPAL', 1), (5, 'CHEQUE', 1), (6, 'BITCOIN', 1), (7, 'USDT', 1), (8, 'BINANCE', 1), (10, 'OTROS', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `gastos` -- CREATE TABLE `gastos` ( `id` int(11) NOT NULL, `monto` decimal(10,2) NOT NULL, `subtotal` decimal(10,2) NOT NULL DEFAULT 0.00, `aplica_iva` tinyint(4) NOT NULL DEFAULT 0, `iva_monto` decimal(10,2) NOT NULL DEFAULT 0.00, `retencion_monto` decimal(10,2) NOT NULL DEFAULT 0.00, `codigo_cuenta` varchar(50) DEFAULT NULL, `categoria` varchar(100) DEFAULT NULL, `subcategoria` varchar(100) DEFAULT NULL, `descripcion` varchar(255) NOT NULL, `foto` varchar(150) DEFAULT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `id_caja` int(11) NOT NULL DEFAULT 1, `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `identidades` -- CREATE TABLE `identidades` ( `id` int(11) NOT NULL, `nombre` varchar(100) NOT NULL, `estado` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; -- -- Volcado de datos para la tabla `identidades` -- INSERT INTO `identidades` (`id`, `nombre`, `estado`) VALUES (1, 'DNI', 1), (2, 'RUC', 1), (3, 'PASAPORTE', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `inventario` -- CREATE TABLE `inventario` ( `id` int(11) NOT NULL, `movimiento` varchar(100) NOT NULL, `accion` varchar(20) NOT NULL, `cantidad` int(11) NOT NULL, `stock_actual` int(11) NOT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `id_producto` int(11) NOT NULL, `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `marcas` -- CREATE TABLE `marcas` ( `id` int(11) NOT NULL, `marca` varchar(100) NOT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `estado` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `medidas` -- CREATE TABLE `medidas` ( `id` int(11) NOT NULL, `medida` varchar(100) NOT NULL, `nombre_corto` varchar(10) DEFAULT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `estado` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `permisos` -- CREATE TABLE `permisos` ( `id` int(11) NOT NULL, `nombre` varchar(100) NOT NULL, `acciones` longtext DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -- Volcado de datos para la tabla `permisos` -- INSERT INTO `permisos` (`id`, `nombre`, `acciones`) VALUES (1, 'usuarios', '[\"ver_usuarios\",\"crear_usuarios\",\"editar_usuarios\",\"eliminar_usuarios\"]'), (2, 'roles', '[\"ver_roles\",\"crear_roles\",\"editar_roles\",\"eliminar_roles\"]'), (3, 'marcas', '[\"ver_marcas\",\"crear_marcas\",\"editar_marcas\",\"eliminar_marcas\"]'), (4, 'log_de_acceso', '[\"ver_log_acceso\",\"eliminar_log_acceso\"]'), (5, 'medidas', '[\"ver_medidas\",\"crear_medidas\",\"editar_medidas\",\"eliminar_medidas\"]'), (6, 'categorias', '[\"ver_categorias\",\"crear_categorias\",\"editar_categorias\",\"eliminar_categorias\"]'), (7, 'productos', '[\"ver_productos\",\"crear_productos\",\"editar_productos\",\"eliminar_productos\",\"ver_galeria_productos\",\"agregar_galeria_productos\",\"eliminar_galeria_productos\"]'), (8, 'clientes', '[\"ver_clientes\",\"crear_clientes\",\"editar_clientes\",\"eliminar_clientes\"]'), (9, 'proveedores', '[\"ver_proveedores\",\"crear_proveedores\",\"editar_proveedores\",\"eliminar_proveedores\"]'), (10, 'cajas', '[\"ver_cajas\",\"abrir_cajas\",\"cerrar_cajas\",\"ver_movimientos_cajas\",\"ver_reportes_cajas\"]'), (11, 'compras', '[\"ver_compras\",\"crear_compras\",\"cuentas_por_pagar\",\"anular_compras\",\"reporte_compras\"]'), (12, 'ventas', '[\"ver_ventas\",\"crear_ventas\",\"editar_ventas\",\"cuentas_por_cobrar\",\"anular_ventas\",\"reporte_ventas\"]'), (14, 'cotizaciones', '[\"ver_cotizaciones\",\"crear_cotizaciones\",\"eliminar_cotizaciones\",\"reporte_cotizaciones\"]'), (15, 'apartados', '[\"ver_apartados\",\"crear_apartados\",\"entregar_apartados\",\"reporte_apartados\"]'), (16, 'inventario', '[\"ver_inventario\"]'), (17, 'sucursales', '[\"ver_sucursales\",\"crear_sucursales\",\"editar_sucursales\",\"eliminar_sucursales\"]'), (20, 'modificar_logo', '[\"modificar_logo\"]'), (22, 'backup', '[\"generar_backup\"]'), (24, 'forma_pagos', '[\"ver_forma_pago\",\"crear_forma_pago\",\"editar_forma_pago\",\"eliminar_forma_pago\"]'), (25, 'traslados', '[\"nuevo_traslado\",\"ver_tralados\",\"recepcionar_traslados\",\"cancelar_traslado\"]'), (26, 'taller', '[\"ver_orden\",\"crear_orden\",\"editar_orden\",\"refaccion_orden\",\"orden_estados\",\"abonos_orden\"]'), (27, 'gastos', '[\"ver_gastos\",\"crear_gastos\",\"eliminar_gastos\"]'), (28, 'activos_fijos', '[\"ver_activos\",\"crear_activos\",\"editar_activos\",\"eliminar_activos\"]'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `porpagar` -- CREATE TABLE `porpagar` ( `id` int(11) NOT NULL, `monto` decimal(10,2) NOT NULL, `fecha` date NOT NULL, `hora` time NOT NULL, `estado` int(11) NOT NULL DEFAULT 1, `id_compra` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `productos` -- CREATE TABLE `productos` ( `id` int(11) NOT NULL, `codigo` varchar(50) NOT NULL, `descripcion` text NOT NULL, `precio_compra` decimal(10,2) NOT NULL, `precio_venta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`precio_venta`)), `cantidad` int(11) NOT NULL DEFAULT 0, `peso` varchar(50) DEFAULT NULL, `modelo` varchar(100) DEFAULT NULL, `garantia_valor` varchar(50) DEFAULT NULL, `garantia_tipo` enum('ninguna','dias','meses','anios') NOT NULL DEFAULT 'ninguna', `fecha_vencimiento` date DEFAULT NULL, `imei` varchar(100) DEFAULT NULL, `sku` varchar(100) DEFAULT NULL, `foto` varchar(100) DEFAULT NULL, `estado` int(11) NOT NULL DEFAULT 1, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `ventas` int(11) NOT NULL DEFAULT 0, `servicio` int(11) NOT NULL DEFAULT 0, `id_medida` int(11) NOT NULL, `id_categoria` int(11) NOT NULL, `id_marca` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `producto_lotes_vencimiento` -- CREATE TABLE `producto_lotes_vencimiento` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_producto` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL, `fecha_vencimiento` date NOT NULL, `cantidad` decimal(10,2) NOT NULL DEFAULT 0.00, `estado` int(11) NOT NULL DEFAULT 1, `fecha` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `uq_producto_sucursal_vencimiento` (`id_producto`,`id_sucursal`,`fecha_vencimiento`), KEY `idx_producto_lotes_producto` (`id_producto`), KEY `idx_producto_lotes_sucursal` (`id_sucursal`), KEY `idx_producto_lotes_fecha` (`fecha_vencimiento`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `proveedor` -- CREATE TABLE `proveedor` ( `id` int(11) NOT NULL, `ruc` varchar(15) NOT NULL, `nombre` varchar(255) NOT NULL, `telefono` varchar(50) NOT NULL, `correo` varchar(100) NOT NULL, `direccion` varchar(255) NOT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `estado` int(11) NOT NULL DEFAULT 1, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `reparaciones` -- CREATE TABLE `reparaciones` ( `id` int(11) NOT NULL, `correlativo` int(11) NOT NULL DEFAULT 0, `modelo` varchar(100) DEFAULT NULL, `aparato` varchar(255) DEFAULT NULL, `imei` varchar(100) NOT NULL DEFAULT '0', `color` varchar(100) NOT NULL DEFAULT '0', `estetica` varchar(100) NOT NULL DEFAULT '0', `fecha_ingreso` date NOT NULL, `hora_ingreso` time NOT NULL, `fecha_prometida` date NOT NULL, `problema` text DEFAULT NULL, `mano_obra` decimal(10,2) NOT NULL DEFAULT 0.00, `anticipo` decimal(10,2) NOT NULL DEFAULT 0.00, `clave` varchar(200) DEFAULT '0', `pin` varchar(100) DEFAULT '0', `solucion` text DEFAULT NULL, `observaciones` text DEFAULT NULL, `estado` enum('pendiente','en_proceso','en_espera','reparado','entregado','cancelado','no_reparable') NOT NULL DEFAULT 'pendiente', `id_cliente` int(11) NOT NULL, `id_marca` int(11) NOT NULL, `id_caja` int(11) NOT NULL, `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `roles` -- CREATE TABLE `roles` ( `id` int(11) NOT NULL, `nombre` varchar(100) NOT NULL, `permisos` text DEFAULT NULL, `estado` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -- Volcado de datos para la tabla `roles` -- INSERT INTO `roles` (`id`, `nombre`, `permisos`, `estado`) VALUES (1, 'Cajero', '[\"ver_clientes\",\"crear_clientes\",\"ver_cajas\",\"abrir_cajas\",\"cerrar_cajas\",\"ver_movimientos_cajas\",\"ver_reportes_cajas\",\"ver_ventas\",\"crear_ventas\",\"editar_ventas\",\"cuentas_por_cobrar\",\"ver_apartados\",\"crear_apartados\",\"ver_gastos\",\"crear_gastos\"]', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `subcategorias_gastos` -- CREATE TABLE `subcategorias_gastos` ( `id` int(11) NOT NULL, `id_categoria` int(11) NOT NULL, `nombre` varchar(100) NOT NULL, `codigo_cuenta` varchar(50) NOT NULL, `estado` tinyint(4) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `sucursales` -- CREATE TABLE `sucursales` ( `id` int(11) NOT NULL, `ruc` varchar(15) NOT NULL, `nombre` varchar(255) NOT NULL, `telefono` varchar(50) NOT NULL, `correo` varchar(100) NOT NULL, `direccion` text NOT NULL, `mensaje` text NOT NULL, `impuesto` int(11) NOT NULL DEFAULT 0, `estado` int(11) NOT NULL DEFAULT 1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -- Volcado de datos base para la tabla `sucursales` -- INSERT INTO `sucursales` (`id`, `ruc`, `nombre`, `telefono`, `correo`, `direccion`, `mensaje`, `impuesto`, `estado`) VALUES (9, '093281031', 'VendeFácil', '+50558668096', 'vende@gmail.com', 'Nicaragua', 'Bienvenidos a VendeFácil', 0, 1), (10, '75765769', 'Tienda Online', '343298428', 'tienda@gmail.com', 'Bogotá, Colombia', 'Tienda Online Bienvenidos', 0, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `traslados` -- CREATE TABLE `traslados` ( `id` bigint(20) UNSIGNED NOT NULL, `usuario_envia_id` bigint(20) UNSIGNED NOT NULL, `usuario_recibe_id` bigint(20) UNSIGNED DEFAULT NULL, `sucursal_origen_id` bigint(20) UNSIGNED NOT NULL, `sucursal_destino_id` bigint(20) UNSIGNED NOT NULL, `fecha_envio` datetime NOT NULL, `fecha_recepcion` datetime DEFAULT NULL, `estado` varchar(20) NOT NULL DEFAULT 'enviado', `nota_envio` text DEFAULT NULL, `nota_recepcion` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuarios` -- CREATE TABLE `usuarios` ( `id` int(11) NOT NULL, `nombre` varchar(100) NOT NULL, `apellido` varchar(100) NOT NULL, `correo` varchar(100) NOT NULL, `telefono` varchar(15) NOT NULL, `direccion` varchar(255) NOT NULL, `perfil` varchar(100) DEFAULT NULL, `clave` varchar(200) NOT NULL, `token` varchar(100) DEFAULT NULL, `fecha` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `estado` int(11) NOT NULL DEFAULT 1, `rol` int(11) DEFAULT NULL, `id_sucursal` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -- Volcado de datos para la tabla `usuarios` -- INSERT INTO `usuarios` (`id`, `nombre`, `apellido`, `correo`, `telefono`, `direccion`, `perfil`, `clave`, `token`, `fecha`, `estado`, `rol`, `id_sucursal`) VALUES (1, 'Administrador', 'Administrador', 'admin@gmail.com', '+50558668096', 'Managua, Nicaragua', 'assets/images/perfil/202601290848261.jpg', '$2y$10$HLq7pNdA5WMVYRn7aNMZJuBKtUuiNMkc5TdObpyB.8sLypKN4NchO', NULL, '2026-05-20 18:05:40', 1, NULL, 9), (8, 'Cajero', '1', 'cajero@gmail.com', '5073912837', 'Medellin, Bogotá', NULL, '$2y$10$8yfCDWiEg3vQvzYpcIBlvu1ilkp7gDgL.3WcS3.pxrL/HKxMAoM.W', NULL, '2026-03-21 21:16:19', 1, 1, 9), (9, 'Caja 2', 'Rosas', 'cajasecuandario@gmail.com', '384710', 'Cartagena, Colombia', NULL, '$2y$10$ckYtsUAMvcoD7aWB8zxdOe/mQMWqh8Vx3.qN0GrAEgzulMtJrtyLu', NULL, '2026-03-21 21:42:14', 1, 1, 9), (10, 'TestCaja', 'Prueba', 'testcaja@test.com', '5551234567', 'Test Address', NULL, '$2y$10$h82g9KxC9rHO7S8bmVfWE.ts9421fS./xEi7iuAnkXUQ6smzBskNS', NULL, '2026-03-23 13:06:52', 1, 1, 10), (11, 'Axel', 'Guerrero', 'toby@gmail.com', '3502937193', 'Cartagena, Colombia', NULL, '$2y$10$Acim4lOqYEuHJSpzACNoa.EI/ODJlFXe5z1CEmNnOG6gUlDt.Enr.', NULL, '2026-03-24 19:55:08', 1, 1, 9); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `ventas` -- CREATE TABLE `ventas` ( `id` int(11) NOT NULL, `productos` longtext NOT NULL, `total` decimal(10,2) NOT NULL, `totalConImpuesto` decimal(10,2) NOT NULL DEFAULT 0.00, `fecha` date NOT NULL, `hora` time NOT NULL, `metodo` varchar(15) NOT NULL, `descuento` decimal(10,2) NOT NULL DEFAULT 0.00, `iva_monto` decimal(10,2) NOT NULL DEFAULT 0.00, `retencion_monto` decimal(10,2) NOT NULL DEFAULT 0.00, `total_final` decimal(10,2) NOT NULL DEFAULT 0.00, `serie` varchar(20) NOT NULL, `pago` decimal(10,2) NOT NULL, `estado` int(11) NOT NULL DEFAULT 1, `impuesto` tinyint(4) NOT NULL DEFAULT 0, `moneda` char(10) NOT NULL DEFAULT '$', `nota` text DEFAULT NULL, `id_caja` int(11) NOT NULL DEFAULT 1, `id_cliente` int(11) DEFAULT NULL, `id_usuario` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL, `id_formapago` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `ventas_pendientes` -- CREATE TABLE `ventas_pendientes` ( `id` int(11) NOT NULL, `productos` longtext NOT NULL, `total` decimal(10,2) NOT NULL, `totalConImpuesto` decimal(10,2) NOT NULL DEFAULT 0.00, `fecha` date NOT NULL, `hora` time NOT NULL, `metodo` varchar(15) NOT NULL DEFAULT 'WEB', `descuento` decimal(10,2) NOT NULL DEFAULT 0.00, `serie` varchar(20) NOT NULL DEFAULT '', `estado` tinyint(4) NOT NULL DEFAULT 0, `impuesto` tinyint(4) NOT NULL DEFAULT 0, `moneda` char(10) NOT NULL DEFAULT '$', `nota` text DEFAULT NULL, `motivo` text DEFAULT NULL, `cliente_identidad` varchar(50) NOT NULL, `cliente_num_identidad` varchar(15) NOT NULL, `cliente_nombre` varchar(255) NOT NULL, `cliente_telefono` varchar(50) NOT NULL, `cliente_correo` varchar(100) DEFAULT NULL, `cliente_direccion` varchar(255) DEFAULT NULL, `fecha_procesado` datetime DEFAULT NULL, `id_usuario_procesa` int(11) DEFAULT NULL, `id_sucursal` int(11) NOT NULL, `venta_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `abonos` -- ALTER TABLE `abonos` ADD PRIMARY KEY (`id`), ADD KEY `id_credito` (`id_credito`), ADD KEY `FK_abonos_usuarios` (`id_usuario`), ADD KEY `FK_abonos_cajas` (`id_caja`); -- -- Indices de la tabla `abonosporpagar` -- ALTER TABLE `abonosporpagar` ADD PRIMARY KEY (`id`) USING BTREE; -- -- Indices de la tabla `abono_reparacion` -- ALTER TABLE `abono_reparacion` ADD PRIMARY KEY (`id`), ADD KEY `FK__aperturacierre` (`id_caja`), ADD KEY `FK__reparaciones` (`id_reparacion`), ADD KEY `FK__usuarios` (`id_usuario`), ADD KEY `FK_abono_reparacion_formapagos` (`id_formapago`); -- -- Indices de la tabla `acceso` -- ALTER TABLE `acceso` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `activos_fijos` -- ALTER TABLE `activos_fijos` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uniq_codigo_sucursal` (`codigo`,`id_sucursal`), ADD KEY `FK_activos_usuarios` (`id_usuario`), ADD KEY `FK_activos_sucursales` (`id_sucursal`); -- -- Indices de la tabla `apartados` -- ALTER TABLE `apartados` ADD PRIMARY KEY (`id`), ADD KEY `id_cliente` (`id_cliente`), ADD KEY `FK_apartados_usuarios` (`id_usuario`), ADD KEY `FK_apartados_sucursales` (`id_sucursal`); -- -- Indices de la tabla `cajas` -- ALTER TABLE `cajas` ADD PRIMARY KEY (`id`), ADD KEY `id_usuario` (`id_usuario`), ADD KEY `FK_cajas_sucursales` (`id_sucursal`); -- -- Indices de la tabla `categorias` -- ALTER TABLE `categorias` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `categorias_gastos` -- ALTER TABLE `categorias_gastos` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `cierre_caja_metodos` -- ALTER TABLE `cierre_caja_metodos` ADD PRIMARY KEY (`id`), ADD KEY `idx_id_caja` (`id_caja`); -- -- Indices de la tabla `clientes` -- ALTER TABLE `clientes` ADD PRIMARY KEY (`id`), ADD KEY `FK_clientes_sucursales` (`id_sucursal`); -- -- Indices de la tabla `compras` -- ALTER TABLE `compras` ADD PRIMARY KEY (`id`), ADD KEY `id_proveedor` (`id_proveedor`), ADD KEY `id_usuario` (`id_usuario`), ADD KEY `FK_compras_sucursales` (`id_sucursal`), ADD KEY `FK_compras_cajas` (`id_caja`); -- -- Indices de la tabla `cotizaciones` -- ALTER TABLE `cotizaciones` ADD PRIMARY KEY (`id`), ADD KEY `id_cliente` (`id_cliente`), ADD KEY `FK_cotizaciones_sucursales` (`id_sucursal`); -- -- Indices de la tabla `creditos` -- ALTER TABLE `creditos` ADD PRIMARY KEY (`id`), ADD KEY `id_venta` (`id_venta`); -- -- Indices de la tabla `detalle_apartado` -- ALTER TABLE `detalle_apartado` ADD PRIMARY KEY (`id`), ADD KEY `FK_detalle_apartado_cajas` (`id_caja`), ADD KEY `FK_detalle_apartado_apartados` (`id_apartado`), ADD KEY `FK_detalle_apartado_usuarios` (`id_usuario`); -- -- Indices de la tabla `detalle_reparacion` -- ALTER TABLE `detalle_reparacion` ADD PRIMARY KEY (`id`) USING BTREE, ADD KEY `id_producto` (`id_producto`) USING BTREE, ADD KEY `id_cotizacion` (`id_reparacion`) USING BTREE; -- -- Indices de la tabla `detalle_traslados` -- ALTER TABLE `detalle_traslados` ADD PRIMARY KEY (`id`), ADD KEY `detalle_traslados_traslado_id_foreign` (`traslado_id`); -- -- Indices de la tabla `detalle_ventas` -- ALTER TABLE `detalle_ventas` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `efectivo_abonos` -- ALTER TABLE `efectivo_abonos` ADD PRIMARY KEY (`id`) USING BTREE; -- -- Indices de la tabla `efectivo_ventas` -- ALTER TABLE `efectivo_ventas` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `empresa` -- ALTER TABLE `empresa` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `entradas_salidas` -- ALTER TABLE `entradas_salidas` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `formapagos` -- ALTER TABLE `formapagos` ADD PRIMARY KEY (`id`) USING BTREE; -- -- Indices de la tabla `gastos` -- ALTER TABLE `gastos` ADD PRIMARY KEY (`id`), ADD KEY `id_usuario` (`id_usuario`), ADD KEY `FK_gastos_cajas` (`id_caja`), ADD KEY `FK_gastos_sucursales` (`id_sucursal`); -- -- Indices de la tabla `identidades` -- ALTER TABLE `identidades` ADD PRIMARY KEY (`id`) USING BTREE; -- -- Indices de la tabla `inventario` -- ALTER TABLE `inventario` ADD PRIMARY KEY (`id`), ADD KEY `id_producto` (`id_producto`), ADD KEY `id_usuario` (`id_usuario`), ADD KEY `FK_inventario_sucursales` (`id_sucursal`); -- -- Indices de la tabla `marcas` -- ALTER TABLE `marcas` ADD PRIMARY KEY (`id`) USING BTREE; -- -- Indices de la tabla `medidas` -- ALTER TABLE `medidas` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `permisos` -- ALTER TABLE `permisos` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `porpagar` -- ALTER TABLE `porpagar` ADD PRIMARY KEY (`id`) USING BTREE; -- -- Indices de la tabla `productos` -- ALTER TABLE `productos` ADD PRIMARY KEY (`id`), ADD KEY `id_categoria` (`id_categoria`), ADD KEY `id_medida` (`id_medida`), ADD KEY `FK_productos_marcas` (`id_marca`), ADD KEY `FK_productos_sucursales` (`id_sucursal`); -- -- Indices de la tabla `proveedor` -- ALTER TABLE `proveedor` ADD PRIMARY KEY (`id`), ADD KEY `FK_proveedor_sucursales` (`id_sucursal`); -- -- Indices de la tabla `reparaciones` -- ALTER TABLE `reparaciones` ADD PRIMARY KEY (`id`) USING BTREE, ADD KEY `FK_reparaciones_marcas` (`id_marca`), ADD KEY `FK_reparaciones_clientes` (`id_cliente`), ADD KEY `FK_reparaciones_aperturacierre` (`id_caja`), ADD KEY `FK_reparaciones_usuarios` (`id_usuario`), ADD KEY `FK_reparaciones_sucursales` (`id_sucursal`); -- -- Indices de la tabla `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `subcategorias_gastos` -- ALTER TABLE `subcategorias_gastos` ADD PRIMARY KEY (`id`), ADD KEY `FK_subcat_categoria` (`id_categoria`); -- -- Indices de la tabla `sucursales` -- ALTER TABLE `sucursales` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `traslados` -- ALTER TABLE `traslados` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`id`), ADD KEY `rol` (`rol`), ADD KEY `FK_usuarios_sucursales` (`id_sucursal`); -- -- Indices de la tabla `ventas` -- ALTER TABLE `ventas` ADD PRIMARY KEY (`id`), ADD KEY `id_cliente` (`id_cliente`), ADD KEY `id_usuario` (`id_usuario`), ADD KEY `FK_ventas_cajas` (`id_caja`), ADD KEY `FK_ventas_sucursales` (`id_sucursal`); -- -- Indices de la tabla `ventas_pendientes` -- ALTER TABLE `ventas_pendientes` ADD PRIMARY KEY (`id`), ADD KEY `FK_ventas_pendientes_sucursales` (`id_sucursal`), ADD KEY `FK_ventas_pendientes_usuarios` (`id_usuario_procesa`), ADD KEY `FK_ventas_pendientes_ventas` (`venta_id`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `abonos` -- ALTER TABLE `abonos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `abonosporpagar` -- ALTER TABLE `abonosporpagar` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `abono_reparacion` -- ALTER TABLE `abono_reparacion` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `acceso` -- ALTER TABLE `acceso` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `activos_fijos` -- ALTER TABLE `activos_fijos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `apartados` -- ALTER TABLE `apartados` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `cajas` -- ALTER TABLE `cajas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `categorias` -- ALTER TABLE `categorias` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `categorias_gastos` -- ALTER TABLE `categorias_gastos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `cierre_caja_metodos` -- ALTER TABLE `cierre_caja_metodos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `clientes` -- ALTER TABLE `clientes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `compras` -- ALTER TABLE `compras` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `cotizaciones` -- ALTER TABLE `cotizaciones` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `creditos` -- ALTER TABLE `creditos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `detalle_apartado` -- ALTER TABLE `detalle_apartado` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `detalle_reparacion` -- ALTER TABLE `detalle_reparacion` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `detalle_traslados` -- ALTER TABLE `detalle_traslados` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `detalle_ventas` -- ALTER TABLE `detalle_ventas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `efectivo_abonos` -- ALTER TABLE `efectivo_abonos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `efectivo_ventas` -- ALTER TABLE `efectivo_ventas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `empresa` -- ALTER TABLE `empresa` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `entradas_salidas` -- ALTER TABLE `entradas_salidas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `formapagos` -- ALTER TABLE `formapagos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT de la tabla `gastos` -- ALTER TABLE `gastos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `identidades` -- ALTER TABLE `identidades` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT de la tabla `inventario` -- ALTER TABLE `inventario` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `marcas` -- ALTER TABLE `marcas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `medidas` -- ALTER TABLE `medidas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `permisos` -- ALTER TABLE `permisos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29; -- -- AUTO_INCREMENT de la tabla `porpagar` -- ALTER TABLE `porpagar` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `productos` -- ALTER TABLE `productos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `proveedor` -- ALTER TABLE `proveedor` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `reparaciones` -- ALTER TABLE `reparaciones` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `roles` -- ALTER TABLE `roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `subcategorias_gastos` -- ALTER TABLE `subcategorias_gastos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `sucursales` -- ALTER TABLE `sucursales` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `traslados` -- ALTER TABLE `traslados` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `usuarios` -- ALTER TABLE `usuarios` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT de la tabla `ventas` -- ALTER TABLE `ventas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `ventas_pendientes` -- ALTER TABLE `ventas_pendientes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `usuarios` -- ALTER TABLE `usuarios` ADD CONSTRAINT `FK_usuarios_sucursales` FOREIGN KEY (`id_sucursal`) REFERENCES `sucursales` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `usuarios_ibfk_1` FOREIGN KEY (`rol`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- Prefacturación - Nuevas tablas, columnas, permisos y roles CREATE TABLE IF NOT EXISTS `prefacturas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `productos` longtext NOT NULL, `total` decimal(10,2) NOT NULL, `totalConImpuesto` decimal(10,2) NOT NULL DEFAULT 0.00, `fecha` date NOT NULL, `hora` time NOT NULL, `descuento` decimal(10,2) NOT NULL DEFAULT 0.00, `iva_monto` decimal(10,2) NOT NULL DEFAULT 0.00, `retencion_monto` decimal(10,2) NOT NULL DEFAULT 0.00, `total_final` decimal(10,2) NOT NULL DEFAULT 0.00, `estado` int(11) NOT NULL DEFAULT 1 COMMENT '1: Borrador, 2: Facturado, 0: Anulado', `impuesto` tinyint(4) NOT NULL DEFAULT 0, `moneda` char(10) NOT NULL DEFAULT '$', `nota` text DEFAULT NULL, `id_cliente` int(11) DEFAULT NULL, `id_vendedor` int(11) NOT NULL, `id_sucursal` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; ALTER TABLE `ventas` ADD COLUMN `id_vendedor` int(11) DEFAULT NULL; INSERT INTO `permisos` (`id`, `nombre`, `acciones`) VALUES (29, 'prefacturas', '["ver_prefacturas","crear_prefacturas","editar_prefacturas","eliminar_prefacturas"]'); INSERT INTO `roles` (`id`, `nombre`, `permisos`, `estado`) VALUES (2, 'Vendedor', '["ver_prefacturas","crear_prefacturas"]', 1); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Coded With 💗 by
0x6ick