USE [master]
GO
/****** Object:  Database [colavirtual]    Script Date: 04/12/2023 11:55:12 ******/
CREATE DATABASE [colavirtual]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'colavirtual', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL15.SQLEXPRESS\MSSQL\DATA\colavirtual.mdf' , SIZE = 401408KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
 LOG ON 
( NAME = N'colavirtual_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL15.SQLEXPRESS\MSSQL\DATA\colavirtual_log.ldf' , SIZE = 73728KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [colavirtual].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [colavirtual] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [colavirtual] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [colavirtual] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [colavirtual] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [colavirtual] SET ARITHABORT OFF 
GO
ALTER DATABASE [colavirtual] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [colavirtual] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [colavirtual] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [colavirtual] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [colavirtual] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [colavirtual] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [colavirtual] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [colavirtual] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [colavirtual] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [colavirtual] SET  DISABLE_BROKER 
GO
ALTER DATABASE [colavirtual] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [colavirtual] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [colavirtual] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [colavirtual] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [colavirtual] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [colavirtual] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [colavirtual] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [colavirtual] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [colavirtual] SET  MULTI_USER 
GO
ALTER DATABASE [colavirtual] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [colavirtual] SET DB_CHAINING OFF 
GO
ALTER DATABASE [colavirtual] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [colavirtual] SET TARGET_RECOVERY_TIME = 60 SECONDS 
GO
ALTER DATABASE [colavirtual] SET DELAYED_DURABILITY = DISABLED 
GO
ALTER DATABASE [colavirtual] SET QUERY_STORE = OFF
GO
USE [colavirtual]
GO
/****** Object:  Table [dbo].[botones]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[botones](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [nvarchar](50) NULL,
	[prefijo] [nvarchar](50) NULL,
	[texto] [nvarchar](50) NULL,
	[color] [nvarchar](50) NULL,
	[fondo] [nvarchar](250) NULL,
	[idpadre] [int] NULL,
	[habilitado] [bit] NULL,
	[servicio] [nvarchar](50) NULL,
	[prioridad] [bit] NULL,
	[tarjeta] [bit] NULL,
	[orden] [smallint] NULL,
	[idpuesto] [int] NULL,
	[idpantalla] [int] NULL,
	[tipoticket] [nchar](20) NULL,
	[fondo2] [nvarchar](250) NULL,
 CONSTRAINT [PK_botones2] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  View [dbo].[vMenuBotones]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [dbo].[vMenuBotones]
AS
WITH CTE AS (SELECT  id, idpadre, texto, fondo2, habilitado, CONVERT(VARCHAR(MAX), orden) AS orden, LEN(CONVERT(VARCHAR(MAX), orden)) - LEN(REPLACE(CONVERT(VARCHAR(MAX), orden), '/', '')) AS profundidad
             FROM    dbo.botones
             WHERE   (idpadre = 0)
                 UNION ALL
             SELECT  t.id, t.idpadre, t.texto, t.fondo2, t.habilitado, c.orden + '/' + CONVERT(VARCHAR(MAX), t.orden) AS orden, LEN(c.orden + '/' + CONVERT(VARCHAR(MAX), t.orden)) 
                                                        - LEN(REPLACE(c.orden + '/' + CONVERT(VARCHAR(MAX), t.orden), '/', '')) AS profundidad
             FROM    dbo.botones AS t INNER JOIN  CTE AS c ON t.idpadre = c.id)
    SELECT TOP (100) PERCENT id, idpadre, texto, fondo2, habilitado, orden, profundidad, { fn CONCAT(REPLICATE('_', profundidad * 3), texto) } AS menu
    FROM CTE AS CTE_1
GO
/****** Object:  Table [dbo].[tickets]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tickets](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[idpuesto] [int] NULL,
	[textopuesto] [nvarchar](50) NULL,
	[idpersona] [int] NULL,
	[nroticket] [nchar](10) NULL,
	[servicio] [nvarchar](50) NULL,
	[tarjeta] [bit] NULL,
	[prioridad] [bit] NULL,
	[emitido] [datetime] NULL,
	[atendido] [datetime] NULL,
	[finalizado] [datetime] NULL,
	[derivado] [bit] NULL,
	[descartado] [datetime] NULL,
	[preferencial] [bit] NULL,
	[boton] [nvarchar](50) NULL,
	[operacion] [nvarchar](500) NULL,
	[textoticket] [nvarchar](50) NULL,
	[idcliente] [nvarchar](50) NULL,
	[idpantalla] [int] NULL,
	[datocliente] [nvarchar](250) NULL,
	[estado] [nvarchar](250) NULL,
	[totalespera] [time](7) NULL,
	[totalatencion] [time](7) NULL,
	[totaltiempo] [time](7) NULL,
	[nombreOperador] [nvarchar](250) NULL,
	[usuario] [nvarchar](50) NULL,
 CONSTRAINT [PK_tickets] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  View [dbo].[vTicketsHoyServicio]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[vTicketsHoyServicio]
AS
SELECT        servicio, CONVERT(char, emitido, 3) AS Periodo, COUNT(*) AS TicketsAtendidos, AVG(ISNULL(DATEDIFF(minute, atendido, finalizado), 0)) AS PromedioAtencion, MAX(ISNULL(DATEDIFF(minute, atendido, finalizado), 0)) 
                         AS MayorTiempo
FROM            dbo.tickets
WHERE        (CAST(emitido AS date) = CAST(GETDATE() AS date)) AND (atendido IS NOT NULL) AND (finalizado IS NOT NULL) OR
                         (CAST(emitido AS date) = CAST(GETDATE() AS date)) AND (estado = 'COMPLETADO')
GROUP BY servicio, CONVERT(char, emitido, 3)
GO
/****** Object:  Table [dbo].[personas]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[personas](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [nvarchar](50) NULL,
	[telefono] [nvarchar](50) NULL,
	[usuario] [nvarchar](50) NULL,
	[password] [nvarchar](50) NULL,
	[registro] [datetime] NULL,
	[habilitado] [bit] NULL,
	[libre] [bit] NULL,
	[conectado] [bit] NULL,
	[ultimocambio] [datetime] NULL,
	[idcentral] [int] NULL,
	[idagencia] [int] NULL,
 CONSTRAINT [PK_cajeros] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  View [dbo].[vTicketsHoyFuncionario]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[vTicketsHoyFuncionario]
AS
SELECT        dbo.personas.nombre AS Operador, CONVERT(char, dbo.tickets.emitido, 3) AS Periodo, COUNT(*) AS TicketsAtendidos, AVG(ISNULL(DATEDIFF(minute, dbo.tickets.atendido, dbo.tickets.finalizado), 0)) AS PromedioAtencion, 
                         MAX(ISNULL(DATEDIFF(minute, dbo.tickets.atendido, dbo.tickets.finalizado), 0)) AS MayorTiempo
FROM            dbo.tickets INNER JOIN
                         dbo.personas ON dbo.tickets.idpersona = dbo.personas.id
WHERE        (CAST(dbo.tickets.emitido AS date) = CAST(GETDATE() AS date)) AND (dbo.tickets.descartado IS NULL) AND (dbo.tickets.atendido IS NOT NULL) AND (dbo.tickets.finalizado IS NOT NULL) OR
                         (CAST(dbo.tickets.emitido AS date) = CAST(GETDATE() AS date)) AND (dbo.tickets.estado = 'COMPLETADO')
GROUP BY dbo.personas.nombre, CONVERT(char, dbo.tickets.emitido, 3)
GO
/****** Object:  View [dbo].[dashboard]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[dashboard]
AS
SELECT        id, nroticket, emitido, ISNULL(DATEDIFF(minute, emitido, DATEADD(minute, - 100, DATEADD(day, - 2, GETDATE()))), 0) AS espera, servicio
FROM            dbo.tickets
WHERE        (atendido IS NOT NULL) AND (descartado IS NULL) AND (emitido BETWEEN DATEADD(minute, - 140, DATEADD(day, - 2, GETDATE())) AND DATEADD(minute, - 100, DATEADD(day, - 2, GETDATE())))
GO
/****** Object:  View [dbo].[vTicketsEnEsperaxServicio]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[vTicketsEnEsperaxServicio]
AS
SELECT        servicio, COUNT(id) AS tickets
FROM            dbo.tickets
WHERE        (estado = 'ESPERANDO') AND (CAST(emitido AS date) = CAST(GETDATE() AS date)) OR
                         (atendido IS NULL) AND (descartado IS NULL) AND (CAST(emitido AS date) = CAST(GETDATE() AS date))
GROUP BY servicio
GO
/****** Object:  View [dbo].[vTicketsHoyxHora]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[vTicketsHoyxHora]
AS
SELECT        a.hora1, a.hora2, a.TicketsAtendidos, b.TicketsDescartados
FROM            (SELECT        CAST(atendido AS date) AS Fecha, DATEPART(HOUR, atendido) AS hora1, RTRIM(CONVERT(char, DATEPART(HOUR, atendido))) + ':00' AS hora2, COUNT(*) AS TicketsAtendidos
                          FROM            dbo.tickets
                          WHERE        (descartado IS NULL) AND (atendido IS NOT NULL) AND (finalizado IS NOT NULL) AND (CAST(emitido AS date) = CAST(GETDATE() AS date))
                          GROUP BY CAST(atendido AS date), DATEPART(HOUR, atendido)) AS a FULL OUTER JOIN
                             (SELECT        CAST(descartado AS date) AS Fecha, DATEPART(HOUR, descartado) AS hora1, RTRIM(CONVERT(char, DATEPART(HOUR, descartado))) + ':00' AS hora2, COUNT(*) AS TicketsDescartados
                               FROM            dbo.tickets AS tickets_1
                               WHERE        (descartado IS NOT NULL) AND (CAST(emitido AS date) = CAST(GETDATE() AS date))
                               GROUP BY CAST(descartado AS date), DATEPART(HOUR, descartado)) AS b ON a.hora1 = b.hora1
GO
/****** Object:  View [dbo].[vTicketsAyerxHora]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[vTicketsAyerxHora]
AS
SELECT        CAST(atendido AS date) AS Fecha, DATEPART(HOUR, atendido) AS atendido, RTRIM(CONVERT(char, DATEPART(HOUR, atendido))) + ':00' AS HORA, COUNT(*) AS TicketsAtendidos
FROM            dbo.tickets
WHERE        (descartado IS NULL) AND (atendido IS NOT NULL) AND (finalizado IS NOT NULL) AND (CAST(emitido AS date) = CAST(GETDATE() - 1 AS date))
GROUP BY CAST(atendido AS date), DATEPART(HOUR, atendido)
GO
/****** Object:  Table [dbo].[agenda]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[agenda](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[USERID] [nvarchar](50) NOT NULL,
	[BAGNUMBER] [nvarchar](50) NULL,
	[NAME] [nvarchar](50) NULL,
	[DEFAULTDEPTID] [nvarchar](50) NULL,
	[GENDER] [nvarchar](2) NULL,
	[TITLE] [nvarchar](20) NULL,
	[PRIVILEGE] [nvarchar](50) NULL,
	[PASSWORD] [nvarchar](50) NULL,
	[CARDNO] [nvarchar](50) NULL,
	[VERIFYPASS] [nvarchar](50) NULL,
	[VERIFICATIONMETHOD] [nvarchar](50) NULL,
 CONSTRAINT [PK_tarjetas_1] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  View [dbo].[tarjetas]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[tarjetas]
AS
SELECT        BAGNUMBER AS idusuario, NAME AS nombre, CARDNO AS tarjeta1, USERID AS tarjeta2, TITLE AS rol
FROM            dbo.agenda
GO
/****** Object:  Table [dbo].[puestos]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[puestos](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [nvarchar](50) NULL,
	[fecha] [datetime] NULL,
	[idpersona] [int] NULL,
	[habilitada] [bit] NULL,
	[libre] [bit] NULL,
	[servicio] [nvarchar](50) NULL,
	[atender_prioridad] [bit] NULL,
 CONSTRAINT [PK_cajas] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  View [dbo].[ticket_actual]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[ticket_actual]
AS
SELECT     TOP (2) dbo.tickets.id, dbo.tickets.nroticket, dbo.puestos.nombre
FROM         dbo.tickets INNER JOIN
                      dbo.puestos ON dbo.tickets.id = dbo.puestos.id
ORDER BY dbo.tickets.id DESC
GO
/****** Object:  View [dbo].[vTicketsEnEspera]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/* menos 400 minutos select id,nroticket, emitido, ISNULL(DATEDIFF(minute, dbo.tickets.emitido,dateadd(minute,-400,dateadd(day,1,getdate()))), 0) as espera,servicio
pruebas en horario where atendido is null and descartado is null and cast(emitido as date)=cast(getdate() as date)
definitivo where atendido is null and finalizado is null and descartado is null and cast(emitido as date)=cast(getdate() as date)*/
CREATE VIEW [dbo].[vTicketsEnEspera]
AS
SELECT        servicio, ISNULL(DATEDIFF(minute, emitido, GETDATE()), 0) AS espera, id, nroticket, emitido, idpantalla
FROM            dbo.tickets
WHERE        (estado = 'ESPERANDO') AND (CAST(emitido AS date) = CAST(GETDATE() AS date)) OR
                         (CAST(emitido AS date) = CAST(GETDATE() AS date)) AND (atendido IS NULL) AND (descartado IS NULL)
GO
/****** Object:  Table [dbo].[conf_rep_asfi]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[conf_rep_asfi](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[idservicio] [nvarchar](50) NULL,
 CONSTRAINT [PK_conf_rep_asfi] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[configuracion]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[configuracion](
	[id] [int] NOT NULL,
	[empresa] [varchar](250) NULL,
	[sucursal] [varchar](250) NULL,
	[licencia] [nvarchar](500) NULL,
	[urlAdmin] [nvarchar](250) NULL,
	[urlReportes] [nvarchar](250) NULL,
	[ipServidorLocal] [nvarchar](50) NULL,
	[ipServidorCentral] [nvarchar](50) NULL,
	[dbServidorCentral] [nvarchar](50) NULL,
	[usrServidorCentral] [nvarchar](50) NULL,
	[pswServidorCentral] [nvarchar](50) NULL,
 CONSTRAINT [PK_configuracion] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[csv]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[csv](
	[columna 0] [varchar](50) NULL,
	[columna 1] [varchar](50) NULL,
	[columna 2] [varchar](50) NULL,
	[columna 3] [varchar](50) NULL,
	[columna 4] [varchar](50) NULL,
	[columna 5] [varchar](50) NULL,
	[columna 6] [varchar](50) NULL,
	[columna 7] [varchar](50) NULL,
	[columna 8] [varchar](50) NULL,
	[columna 9] [varchar](50) NULL,
	[columna 10] [varchar](50) NULL,
	[columna 11] [varchar](50) NULL,
	[columna 12] [varchar](50) NULL,
	[columna 13] [varchar](50) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[equipos]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[equipos](
	[id] [int] NOT NULL,
	[nombre] [nvarchar](50) NULL,
	[estado] [bit] NULL,
 CONSTRAINT [PK_equipos] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[grupopantallas]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[grupopantallas](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [nvarchar](250) NULL,
	[habilitado] [bit] NULL,
 CONSTRAINT [PK_pantallas] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[historico]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[historico](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[servicio] [nvarchar](50) NULL,
	[idpuesto] [int] NULL,
	[idticket] [int] NULL,
	[evento] [nvarchar](250) NULL,
	[fechahora] [datetime] NULL,
	[idcajero] [int] NULL,
	[tipo] [nvarchar](50) NULL,
 CONSTRAINT [PK_historico] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[llamada]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[llamada](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[puestoid] [int] NULL,
	[nombre] [nvarchar](50) NULL,
	[ticket] [int] NULL,
	[estado] [bit] NULL,
	[servicio] [nvarchar](50) NULL,
 CONSTRAINT [PK_llamada] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[mensajes]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mensajes](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [nvarchar](50) NULL,
	[texto] [nvarchar](250) NULL,
	[color] [nvarchar](50) NULL,
	[estado] [bit] NULL,
	[orden] [int] NULL,
 CONSTRAINT [PK_mensajes] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[operaciones]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[operaciones](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[operacion] [nvarchar](50) NULL,
	[habilitado] [bit] NULL,
	[idservicio] [varchar](50) NULL,
 CONSTRAINT [PK_Operaciones] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[parametros]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[parametros](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[modulo] [nvarchar](50) NULL,
	[tabla] [nvarchar](250) NULL,
	[campo] [nvarchar](250) NULL,
	[descripcion] [nvarchar](250) NULL,
	[valor] [nvarchar](250) NULL,
	[tipodedato] [nvarchar](50) NULL,
 CONSTRAINT [PK_parametros] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[role_permissions]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[role_permissions](
	[permission_id] [int] IDENTITY(1,1) NOT NULL,
	[page_name] [nvarchar](50) NULL,
	[action_name] [nvarchar](50) NULL,
	[role_id] [int] NULL,
 CONSTRAINT [PK_role_permissions] PRIMARY KEY CLUSTERED 
(
	[permission_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[roles]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[roles](
	[role_id] [int] IDENTITY(1,1) NOT NULL,
	[role_name] [nvarchar](50) NULL,
 CONSTRAINT [PK_roles] PRIMARY KEY CLUSTERED 
(
	[role_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[servicios]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[servicios](
	[id] [nvarchar](50) NOT NULL,
	[descripcion] [nvarchar](50) NULL,
	[ticket] [int] NULL,
	[fecha] [datetime] NULL,
	[habilitado] [bit] NULL,
	[idpantalla] [smallint] NULL,
 CONSTRAINT [PK_servicios] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[servicios_puestos]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[servicios_puestos](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[idservicio] [nvarchar](50) NULL,
	[idpuesto] [int] NULL,
 CONSTRAINT [PK_servicios_puestos] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[temp_tickets_atendidos]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[temp_tickets_atendidos](
	[idticket] [int] NULL,
	[servicio] [nvarchar](50) NULL,
	[hora] [datetime] NULL,
	[nroticket] [nvarchar](50) NULL,
	[puesto] [nvarchar](50) NULL,
	[prioridad] [bit] NULL,
	[idpantalla] [int] NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[tickets_central]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tickets_central](
	[idpuesto] [int] NULL,
	[textopuesto] [nvarchar](50) NULL,
	[idpersona] [int] NULL,
	[nroticket] [nchar](10) NULL,
	[servicio] [nvarchar](50) NULL,
	[tarjeta] [bit] NULL,
	[prioridad] [bit] NULL,
	[emitido] [datetime] NULL,
	[atendido] [datetime] NULL,
	[finalizado] [datetime] NULL,
	[derivado] [bit] NULL,
	[descartado] [datetime] NULL,
	[preferencial] [bit] NULL,
	[boton] [nvarchar](50) NULL,
	[operacion] [nvarchar](500) NULL,
	[textoticket] [nvarchar](50) NULL,
	[idcliente] [nvarchar](50) NULL,
	[idpantalla] [int] NULL,
	[datocliente] [nvarchar](250) NULL,
	[estado] [nvarchar](250) NULL,
	[totalespera] [time](7) NULL,
	[totalatencion] [time](7) NULL,
	[totaltiempo] [time](7) NULL,
	[nombreOperador] [nvarchar](250) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ticketsDetalle]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ticketsDetalle](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[idticket] [int] NULL,
	[nroticket] [nchar](10) NULL,
	[idusuario] [int] NULL,
	[usuario] [nvarchar](250) NULL,
	[idpuesto] [int] NULL,
	[servicio] [nvarchar](250) NULL,
	[estado] [nvarchar](50) NULL,
	[iniciado] [datetime] NULL,
	[atendido] [datetime] NULL,
	[completado] [datetime] NULL,
	[totalespera] [nchar](10) NULL,
	[totalatencion] [nchar](10) NULL,
	[totaltiempo] [nchar](10) NULL,
 CONSTRAINT [PK_ticketDetalle] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[timbre]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[timbre](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[sonar] [bit] NULL,
	[nroticket] [nvarchar](50) NULL,
	[textoticket] [nvarchar](50) NULL,
	[textopuesto] [nvarchar](50) NULL,
	[idpantalla] [int] NULL,
	[fechahora] [datetime] NULL,
 CONSTRAINT [PK_timbre] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[UserLevelPermissions]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserLevelPermissions](
	[UserLevelID] [int] NOT NULL,
	[TableName] [nvarchar](255) NOT NULL,
	[Permission] [int] NOT NULL,
 CONSTRAINT [PKUserLevelPermissions] PRIMARY KEY CLUSTERED 
(
	[UserLevelID] ASC,
	[TableName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[UserLevels]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserLevels](
	[UserLevelID] [int] NOT NULL,
	[UserLevelName] [nvarchar](255) NOT NULL,
 CONSTRAINT [PKUserLevels] PRIMARY KEY CLUSTERED 
(
	[UserLevelID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Usuarios]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Usuarios](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [nvarchar](250) NULL,
	[usuario] [nvarchar](255) NULL,
	[password] [nvarchar](255) NULL,
	[userlevelid] [int] NULL,
	[habilitado] [bit] NULL,
	[email] [nvarchar](50) NULL,
	[foto] [nvarchar](250) NULL,
	[user_role_id] [int] NULL,
	[login_session_key] [varchar](255) NULL,
	[email_status] [varchar](255) NULL,
	[password_expire_date] [datetime] NULL,
	[password_reset_key] [varchar](255) NULL,
 CONSTRAINT [PK_usuarios] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[videos]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[videos](
	[id] [int] NOT NULL,
	[nombre] [nvarchar](50) NULL,
	[archivo] [nvarchar](250) NULL,
	[estado] [bit] NULL,
	[lunes] [bit] NULL,
	[martes] [bit] NULL,
	[miercoles] [bit] NULL,
	[jueves] [bit] NULL,
	[viernes] [bit] NULL,
	[sabado] [bit] NULL,
	[domingo] [bit] NULL,
 CONSTRAINT [PK_videos] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[web_imagenes]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[web_imagenes](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [nvarchar](50) NULL,
	[tipo] [nvarchar](50) NULL,
	[imagen] [nvarchar](250) NULL,
	[habilitado] [bit] NULL,
 CONSTRAINT [PK_web_imagenes] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[agenda] ON 

INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (1, N'50497A', N'58058', N'JUAN PEREZ UNO', N'2', N'M', N'Alumno', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (2, N'504989', N'58059', N'JUAN PEREZ SEGUNDO', N'2', N'M', N'Alumno', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (3, N'504997', N'58060', N'JUAN PEREZ TERCERO', N'2', N'M', N'Alumno', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (4, N'505004', N'58061', N'JUAN PEREZ CUARTO', N'2', N'M', N'Alumno', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (5, N'505012', N'58062', N'JUAN PEREZ QUINTO', N'2', N'M', N'Alumno', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (6, N'50502A', N'58063', N'JUAN PEREZ SEXTO', N'2', N'M', N'staff', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (7, N'505039', N'58065', N'JUAN PEREZ SEPTIMO', N'2', N'M', N'Alumno', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (8, N'505047', N'58066', N'JUAN PEREZ OCTAVO', N'2', N'M', N'Alumno', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (9, N'505055', N'58067', N'JUAN PEREZ NOVENO', N'2', N'M', N'staff', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[agenda] ([id], [USERID], [BAGNUMBER], [NAME], [DEFAULTDEPTID], [GENDER], [TITLE], [PRIVILEGE], [PASSWORD], [CARDNO], [VERIFYPASS], [VERIFICATIONMETHOD]) VALUES (10, N'505063', N'58068', N'JUAN PEREZ DECIMO', N'2', N'M', N'staff', NULL, NULL, NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[agenda] OFF
GO
SET IDENTITY_INSERT [dbo].[botones] ON 

INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (1, N'ATENCION PREFERENC', N'AP', N'', N'#804040', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton5.png', 0, 1, N'ATCLIENTE', 0, 0, 19, 0, 1, N'                    ', N'uploads/fondos/i5hotgs_wpyljz9.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (2, N'CAJA', N'CA', N'', N'#FF8000', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton1.png', 0, 1, N'CAJA', 0, 0, 11, 0, 1, N'                    ', N'uploads/fondos/i5hotgs_wpyljz9.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (3, N'SERVICIOS', N'SE', N'', N'yellow', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton2.png', 0, 1, N'ATCLIENTE', 0, 0, 12, 0, 1, N'                    ', N'uploads/fondos/lc6xjk7go50_ih3.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (4, N'FRACCIONAMIENTO', N'FR', N'', N'-1', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton3.png', 0, 1, N'ATCLIENTE', 1, 1, 13, 0, 1, N'                    ', N'uploads/fondos/lc6xjk7go50_ih3.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (5, N'CAPTACIONES', N'CA', N'', N'-1', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton4.png', 0, 1, N'CAJA', 1, 0, 14, 0, 1, N'                    ', N'uploads/fondos/lc6xjk7go50_ih3.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (8, N'ATENCION PREFERENCIAL', N'AP', N'', N'yellow', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton5.png', 4, 1, N'DOCUMENTOS', 0, 0, 43, 0, 1, N'                    ', N'uploads/fondos/i5hotgs_wpyljz9.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (9, N'RECLAMOS', N'RE', N'', N'-1', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton6.png', 4, 1, N'PLATAFORMA', 0, 0, 45, 0, 1, NULL, N'uploads/fondos/i5hotgs_wpyljz9.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (10, N'ASAMBLEA', N'AS', N'', N'-1', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton7.png', 0, 1, N'ATCLIENTE', 0, 0, 22, 0, 1, NULL, N'uploads/fondos/i5hotgs_wpyljz9.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (11, N'RECLAMOS', N'RE', N'', N'-1', N'D:\_.IBARAKISOFT\_Proyectos\2022\COOP INCAHUASI\REQUERIMIENTOS\botones-fondo-pantallatouch\boton6.png', 0, 1, N'DOCUMENTOS', 0, 0, 21, 0, 1, NULL, N'uploads/fondos/hcarzjv345qm2ei.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (12, N'Afiliaciones de socios', N'AF', N'AFILIACIONES', N'-1', N'C:\Program Files (x86)\IbarakiSoft\Fila Virtual - Tickets\Imagenes\botones\boton_rojo.png', 3, 1, N'ATCLIENTE', 1, 0, 34, 0, 1, NULL, N'uploads/fondos/i5hotgs_wpyljz9.png')
INSERT [dbo].[botones] ([id], [nombre], [prefijo], [texto], [color], [fondo], [idpadre], [habilitado], [servicio], [prioridad], [tarjeta], [orden], [idpuesto], [idpantalla], [tipoticket], [fondo2]) VALUES (13, N'desperfectos', N'DE', N'Desperfectos', N'white', N'C:\Program Files (x86)\IbarakiSoft\Fila Virtual - Tickets\Imagenes\botones\boton_verde.png', 4, 1, N'ATCLIENTE', 0, 0, 44, 0, 1, NULL, N'uploads/fondos/lc6xjk7go50_ih3.png')
SET IDENTITY_INSERT [dbo].[botones] OFF
GO
SET IDENTITY_INSERT [dbo].[conf_rep_asfi] ON 

INSERT [dbo].[conf_rep_asfi] ([id], [idservicio]) VALUES (1, N'ATCLIENTE')
INSERT [dbo].[conf_rep_asfi] ([id], [idservicio]) VALUES (2, N'PLATAFORMA')
SET IDENTITY_INSERT [dbo].[conf_rep_asfi] OFF
GO
INSERT [dbo].[configuracion] ([id], [empresa], [sucursal], [licencia], [urlAdmin], [urlReportes], [ipServidorLocal], [ipServidorCentral], [dbServidorCentral], [usrServidorCentral], [pswServidorCentral]) VALUES (1, N'COOP FATIMA', N'CENTRAL', N'---', N'http://localhost/filasadmin', N'http://localhost/filasreportes', N'127.0.0.1', N'192.168.1.111', N'colavirtualcentral', N'sa', N'sa')
GO
SET IDENTITY_INSERT [dbo].[grupopantallas] ON 

INSERT [dbo].[grupopantallas] ([id], [nombre], [habilitado]) VALUES (1, N'Pantalla predeterminada', 1)
INSERT [dbo].[grupopantallas] ([id], [nombre], [habilitado]) VALUES (2, N'Piso 2', 1)
SET IDENTITY_INSERT [dbo].[grupopantallas] OFF
GO
SET IDENTITY_INSERT [dbo].[llamada] ON 

INSERT [dbo].[llamada] ([id], [puestoid], [nombre], [ticket], [estado], [servicio]) VALUES (1, 1, NULL, NULL, 0, NULL)
SET IDENTITY_INSERT [dbo].[llamada] OFF
GO
SET IDENTITY_INSERT [dbo].[mensajes] ON 

INSERT [dbo].[mensajes] ([id], [nombre], [texto], [color], [estado], [orden]) VALUES (4, N'test1', N'EMPRESA SRL', N'-256', 1, 1)
INSERT [dbo].[mensajes] ([id], [nombre], [texto], [color], [estado], [orden]) VALUES (5, N'Gracias', N'Gracias por su preferencia', N'-8323328', 1, 2)
SET IDENTITY_INSERT [dbo].[mensajes] OFF
GO
SET IDENTITY_INSERT [dbo].[operaciones] ON 

INSERT [dbo].[operaciones] ([id], [operacion], [habilitado], [idservicio]) VALUES (1, N'Habilitacion para pàgo', 1, N'CAJA')
INSERT [dbo].[operaciones] ([id], [operacion], [habilitado], [idservicio]) VALUES (2, N'Reubicacion', 1, N'ATCLIENTE')
INSERT [dbo].[operaciones] ([id], [operacion], [habilitado], [idservicio]) VALUES (3, N'Liquidacion', 1, N'CAJA')
INSERT [dbo].[operaciones] ([id], [operacion], [habilitado], [idservicio]) VALUES (4, N'Reprocesamiento', 1, N'ATCLIENTE')
INSERT [dbo].[operaciones] ([id], [operacion], [habilitado], [idservicio]) VALUES (5, N'Cancelacion Total', 1, N'ATCLIENTE')
INSERT [dbo].[operaciones] ([id], [operacion], [habilitado], [idservicio]) VALUES (6, N'Reprogramacion', 1, N'ATCLIENTE')
INSERT [dbo].[operaciones] ([id], [operacion], [habilitado], [idservicio]) VALUES (7, N'Consulta', 1, N'PLATAFORMA')
SET IDENTITY_INSERT [dbo].[operaciones] OFF
GO
SET IDENTITY_INSERT [dbo].[parametros] ON 

INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (1, N'OPERADOR', N'MENSAJE', N'EMERGENTE', NULL, N'5', N'int')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (3, N'OPERADOR', N'CONFIGURACION', N'HABILITAR_PRIORIDAD', NULL, N'1', N'bit')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (4, N'OPERADOR', N'CONFIGURACION', N'RELACION_PRIORIDAD', NULL, N'2', N'int')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (5, N'OPERADOR', N'CONFIGURACION', N'DATOCLIENTE', NULL, N'False', N'bit')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (6, N'PANTALLA', N'CONFIGURACION', N'MOSTRAR_PENDIENTES', NULL, N'True', N'bit')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (7, N'OPERADOR', N'LOGIN', N'AUTENTICAR_WINDOWS', NULL, N'False', N'bit')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (8, N'OPERADOR', N'LOGIN', N'SOLICITAR_ROL', NULL, N'False', N'bit')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (9, N'OPERADOR', N'LOGIN', N'ROL', NULL, N'FILAS', N'nvarchar')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (10, N'REPORTES', N'ESPERA', N'RANGOS', NULL, N'30', N'int')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (11, N'OPERADOR', N'ESPERA', N'MOSTRAR_AMARILLO', N'a cuantos minutos mostrar advertencia tickets casi al limite de tiempo', N'25', N'int')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (12, N'OPERADOR', N'ESPERA', N'MOSTRAR_ROJO', N'a cuantos minutos el tickets al limite de tiempo', N'30', N'int')
INSERT [dbo].[parametros] ([id], [modulo], [tabla], [campo], [descripcion], [valor], [tipodedato]) VALUES (13, N'OPERADOR', N'CONFIGURACION', N'TIMER_TICKETSENLIMITE', N'cada cuantos minutos notificar tickets al limite de tiempo', N'5', NULL)
SET IDENTITY_INSERT [dbo].[parametros] OFF
GO
SET IDENTITY_INSERT [dbo].[personas] ON 

INSERT [dbo].[personas] ([id], [nombre], [telefono], [usuario], [password], [registro], [habilitado], [libre], [conectado], [ultimocambio], [idcentral], [idagencia]) VALUES (1, N'1bbbbba', N'1', N'caja1', N'123', CAST(N'2021-10-27T22:43:26.987' AS DateTime), 1, 0, 0, CAST(N'2023-03-24T18:08:46.680' AS DateTime), 7, NULL)
SET IDENTITY_INSERT [dbo].[personas] OFF
GO
SET IDENTITY_INSERT [dbo].[puestos] ON 

INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (1, N'CAJA 1', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 1, 1, 0, N'CAJA', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (3, N'CAJA 2', CAST(N'2010-08-27T17:35:55.720' AS DateTime), 2, 1, 1, N'CAJA', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (4, N'CAJA 4', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 6, 1, 1, N'CAJA', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (5, N'CAJA 3', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 3, 1, 1, N'CAJA', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (7, N'CAJA 5', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 5, 1, 1, N'PLATAFORMA', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (8, N'CAJA 6', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 7, 1, 1, N'PLATAFORMA', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (9, N'CAJA 7', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 4, 1, 1, N'PLATAFORMA', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (10, N'CAJA 9', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 9, 1, 1, N'PLATAFORMA', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (11, N'CAJA 8', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 8, 1, 1, N'ATCLIENTE', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (12, N'CAJA 12', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 1, 1, 1, N'ATCLIENTE', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (13, N'CAJA 10', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 10, 1, 1, N'ATCLIENTE', 1)
INSERT [dbo].[puestos] ([id], [nombre], [fecha], [idpersona], [habilitada], [libre], [servicio], [atender_prioridad]) VALUES (14, N'CAJA 11', CAST(N'2010-08-27T17:35:55.000' AS DateTime), 11, 1, 1, N'ATCLIENTE', 1)
SET IDENTITY_INSERT [dbo].[puestos] OFF
GO
SET IDENTITY_INSERT [dbo].[role_permissions] ON 

INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8256, N'historico', N'list', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8257, N'historico', N'view', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8258, N'tickets', N'list', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8259, N'tickets', N'view', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8260, N'usuarios', N'view', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8261, N'usuarios', N'accountedit', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8262, N'usuarios', N'accountview', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8263, N'servicios', N'menu', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8264, N'vmenubotones', N'list1', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8265, N'vticketsenesperaxservicio', N'list', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8266, N'vticketsenesperaxservicio', N'view', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8267, N'vticketsenesperaxservicio', N'list', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8268, N'vticketsenesperaxservicio', N'view', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8269, N'ticketsdetalle', N'list', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8270, N'ticketsdetalle', N'view', 2)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8611, N'botones', N'list', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8612, N'botones', N'view', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8613, N'operaciones', N'list', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8614, N'historico', N'list', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8615, N'historico', N'view', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8616, N'llamada', N'list', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8617, N'llamada', N'view', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8618, N'tickets', N'view', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8619, N'tickets', N'add', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8620, N'usuarios', N'accountedit', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8621, N'usuarios', N'accountview', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8622, N'vticketshoyservicio', N'list', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8623, N'vticketshoyservicio', N'view', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8624, N'vticketshoyfuncionario', N'list', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8625, N'vticketshoyfuncionario', N'view', 7)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8626, N'agenda', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8627, N'agenda', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8628, N'agenda', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8629, N'agenda', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8630, N'agenda', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8631, N'agenda', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8632, N'agenda', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8633, N'botones', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8634, N'botones', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8635, N'botones', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8636, N'botones', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8637, N'botones', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8638, N'botones', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8639, N'botones', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8640, N'configuracion', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8641, N'equipos', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8642, N'equipos', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8643, N'equipos', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8644, N'equipos', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8645, N'equipos', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8646, N'equipos', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8647, N'equipos', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8648, N'operaciones', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8649, N'operaciones', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8650, N'operaciones', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8651, N'operaciones', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8652, N'operaciones', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8653, N'operaciones', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8654, N'operaciones', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8655, N'historico', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8656, N'historico', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8657, N'historico', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8658, N'historico', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8659, N'historico', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8660, N'historico', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8661, N'historico', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8662, N'llamada', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8663, N'llamada', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8664, N'llamada', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8665, N'llamada', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8666, N'llamada', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8667, N'llamada', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8668, N'llamada', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8669, N'mensajes', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8670, N'mensajes', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8671, N'mensajes', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8672, N'mensajes', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8673, N'mensajes', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8674, N'mensajes', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8675, N'mensajes', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8676, N'personas', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8677, N'personas', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8678, N'personas', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8679, N'personas', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8680, N'personas', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8681, N'personas', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8682, N'personas', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8683, N'puestos', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8684, N'puestos', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8685, N'puestos', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8686, N'puestos', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8687, N'puestos', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8688, N'puestos', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8689, N'puestos', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8690, N'servicios', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8691, N'servicios', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8692, N'servicios', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8693, N'servicios', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8694, N'servicios', N'editfield', 1)
GO
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8695, N'servicios', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8696, N'servicios', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8697, N'servicios_puestos', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8698, N'servicios_puestos', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8699, N'servicios_puestos', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8700, N'servicios_puestos', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8701, N'servicios_puestos', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8702, N'servicios_puestos', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8703, N'servicios_puestos', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8704, N'temp_tickets_atendidos', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8705, N'temp_tickets_atendidos', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8706, N'temp_tickets_atendidos', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8707, N'temp_tickets_atendidos', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8708, N'temp_tickets_atendidos', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8709, N'temp_tickets_atendidos', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8710, N'temp_tickets_atendidos', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8711, N'timbre', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8712, N'timbre', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8713, N'timbre', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8714, N'timbre', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8715, N'timbre', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8716, N'timbre', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8717, N'timbre', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8718, N'videos', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8719, N'videos', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8720, N'videos', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8721, N'videos', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8722, N'videos', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8723, N'videos', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8724, N'videos', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8725, N'agencias', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8726, N'tarjetas', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8727, N'tarjetas', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8728, N'ticket_actual', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8729, N'ticket_actual', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8730, N'tickets', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8731, N'tickets', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8732, N'tickets', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8733, N'tickets', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8734, N'tickets', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8735, N'tickets', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8736, N'tickets', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8737, N'horariodetalle', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8738, N'adminusers', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8739, N'userlevels', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8740, N'userlevels', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8741, N'userlevels', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8742, N'userlevels', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8743, N'userlevels', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8744, N'userlevels', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8745, N'userlevels', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8746, N'userlevelpermissions', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8747, N'userlevelpermissions', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8748, N'userlevelpermissions', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8749, N'userlevelpermissions', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8750, N'userlevelpermissions', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8751, N'userlevelpermissions', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8752, N'userlevelpermissions', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8753, N'horarios', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8754, N'conf_rep_asfi', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8755, N'conf_rep_asfi', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8756, N'conf_rep_asfi', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8757, N'conf_rep_asfi', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8758, N'conf_rep_asfi', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8759, N'conf_rep_asfi', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8760, N'conf_rep_asfi', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8761, N'sysdiagrams', N'import_data', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8762, N'usuarios', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8763, N'usuarios', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8764, N'usuarios', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8765, N'usuarios', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8766, N'usuarios', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8767, N'usuarios', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8768, N'usuarios', N'accountedit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8769, N'usuarios', N'accountview', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8770, N'roles', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8771, N'roles', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8772, N'roles', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8773, N'roles', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8774, N'roles', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8775, N'roles', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8776, N'role_permissions', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8777, N'role_permissions', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8778, N'role_permissions', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8779, N'role_permissions', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8780, N'role_permissions', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8781, N'role_permissions', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8782, N'servicios', N'menu', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8783, N'vticketshoyservicio', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8784, N'vticketshoyservicio', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8785, N'vticketshoyfuncionario', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8786, N'vticketshoyfuncionario', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8787, N'vmenubotones', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8788, N'vmenubotones', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8789, N'web_imagenes', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8790, N'web_imagenes', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8791, N'web_imagenes', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8792, N'web_imagenes', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8793, N'web_imagenes', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8794, N'web_imagenes', N'delete', 1)
GO
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8795, N'vmenubotones', N'list1', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8796, N'vticketshoyxhora', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8797, N'vticketshoyxhora', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8798, N'vticketsayerxhora', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8799, N'vticketsayerxhora', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8800, N'parametros', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8801, N'parametros', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8802, N'parametros', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8803, N'parametros', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8804, N'parametros', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8805, N'parametros', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8806, N'configuracion', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8807, N'configuracion', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8808, N'configuracion', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8809, N'configuracion', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8810, N'configuracion', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8811, N'configuracion', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8812, N'vticketsenespera', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8813, N'vticketsenespera', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8814, N'dashboard', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8815, N'dashboard', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8816, N'vticketsenesperaxservicio', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8817, N'vticketsenesperaxservicio', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8818, N'vticketsenesperaxservicio', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8819, N'vticketsenesperaxservicio', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8820, N'ticketsdetalle', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8821, N'ticketsdetalle', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8822, N'ticketsdetalle', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8823, N'ticketsdetalle', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8824, N'ticketsdetalle', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8825, N'ticketsdetalle', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8826, N'grupopantallas', N'list', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8827, N'grupopantallas', N'view', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8828, N'grupopantallas', N'add', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8829, N'grupopantallas', N'edit', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8830, N'grupopantallas', N'editfield', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8831, N'grupopantallas', N'delete', 1)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8832, N'historico', N'list', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8833, N'historico', N'view', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8834, N'tickets', N'list', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8835, N'tickets', N'view', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8836, N'usuarios', N'view', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8837, N'usuarios', N'accountedit', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8838, N'usuarios', N'accountview', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8839, N'servicios', N'menu', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8840, N'vmenubotones', N'list1', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8841, N'vticketsenesperaxservicio', N'list', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8842, N'vticketsenesperaxservicio', N'view', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8843, N'vticketsenesperaxservicio', N'list', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8844, N'vticketsenesperaxservicio', N'view', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8845, N'ticketsdetalle', N'list', 8)
INSERT [dbo].[role_permissions] ([permission_id], [page_name], [action_name], [role_id]) VALUES (8846, N'ticketsdetalle', N'view', 8)
SET IDENTITY_INSERT [dbo].[role_permissions] OFF
GO
SET IDENTITY_INSERT [dbo].[roles] ON 

INSERT [dbo].[roles] ([role_id], [role_name]) VALUES (1, N'Administrator')
INSERT [dbo].[roles] ([role_id], [role_name]) VALUES (6, N'Supervisor')
INSERT [dbo].[roles] ([role_id], [role_name]) VALUES (7, N'Operadores')
INSERT [dbo].[roles] ([role_id], [role_name]) VALUES (8, N'User')
INSERT [dbo].[roles] ([role_id], [role_name]) VALUES (9, N'supervisor')
SET IDENTITY_INSERT [dbo].[roles] OFF
GO
INSERT [dbo].[servicios] ([id], [descripcion], [ticket], [fecha], [habilitado], [idpantalla]) VALUES (N'ATCLIENTE', N'Atención al cliente - Oficiales', 1, CAST(N'2023-03-07T16:36:03.027' AS DateTime), 1, 1)
INSERT [dbo].[servicios] ([id], [descripcion], [ticket], [fecha], [habilitado], [idpantalla]) VALUES (N'CAJA', N'Cajeros', 3, CAST(N'2023-07-17T17:40:03.267' AS DateTime), 1, 1)
INSERT [dbo].[servicios] ([id], [descripcion], [ticket], [fecha], [habilitado], [idpantalla]) VALUES (N'DOCUMENTOS', N'Firma de documentos', 1, CAST(N'2023-03-07T16:35:25.533' AS DateTime), 1, 2)
INSERT [dbo].[servicios] ([id], [descripcion], [ticket], [fecha], [habilitado], [idpantalla]) VALUES (N'PLATAFORMA', N'Plataforma de reclamos', 1, CAST(N'2021-11-03T09:14:30.977' AS DateTime), 1, 1)
GO
SET IDENTITY_INSERT [dbo].[servicios_puestos] ON 

INSERT [dbo].[servicios_puestos] ([id], [idservicio], [idpuesto]) VALUES (1, N'CAJA', 1)
INSERT [dbo].[servicios_puestos] ([id], [idservicio], [idpuesto]) VALUES (2, N'CAJA', 2)
INSERT [dbo].[servicios_puestos] ([id], [idservicio], [idpuesto]) VALUES (3, N'PLATAFORMA', 3)
INSERT [dbo].[servicios_puestos] ([id], [idservicio], [idpuesto]) VALUES (4, N'CAJA', 4)
INSERT [dbo].[servicios_puestos] ([id], [idservicio], [idpuesto]) VALUES (5, N'ATCLIENTE', 1)
SET IDENTITY_INSERT [dbo].[servicios_puestos] OFF
GO
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (1, N'CAJA', CAST(N'2023-01-09T18:05:56.243' AS DateTime), N'CA-1      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (8, N'CAJA', CAST(N'2023-01-19T19:41:26.647' AS DateTime), N'CA-1      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (9, N'CAJA', CAST(N'2023-01-19T19:42:23.360' AS DateTime), N'CA-2      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (16, N'ATCLIENTE', CAST(N'2023-03-07T16:45:44.360' AS DateTime), N'AF-1      ', N'CAJA 1', 1, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (17, N'CAJA', CAST(N'2023-03-24T14:15:50.813' AS DateTime), N'CA-1      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (18, N'CAJA', CAST(N'2023-03-24T14:16:01.013' AS DateTime), N'CA-2      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (19, N'CAJA', CAST(N'2023-03-24T15:59:19.063' AS DateTime), N'CA-3      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (20, N'CAJA', CAST(N'2023-03-24T16:15:32.717' AS DateTime), N'CA-4      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (21, N'CAJA', CAST(N'2023-03-24T16:24:10.970' AS DateTime), N'CA-5      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (27, N'CAJA', CAST(N'2023-03-24T17:17:54.857' AS DateTime), N'CA-11     ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (28, N'CAJA', CAST(N'2023-03-24T17:35:27.920' AS DateTime), N'CA-12     ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (29, N'CAJA', CAST(N'2023-03-24T17:48:22.530' AS DateTime), N'CA-13     ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (22, N'CAJA', CAST(N'2023-03-24T16:24:12.870' AS DateTime), N'CA-6      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (23, N'CAJA', CAST(N'2023-03-24T16:24:14.543' AS DateTime), N'CA-7      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (25, N'CAJA', CAST(N'2023-03-24T16:45:06.577' AS DateTime), N'CA-9      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (26, N'CAJA', CAST(N'2023-03-24T16:45:12.683' AS DateTime), N'CA-10     ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (30, N'CAJA', CAST(N'2023-03-24T17:54:24.960' AS DateTime), N'CA-14     ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (24, N'CAJA', CAST(N'2023-03-24T16:42:24.140' AS DateTime), N'CA-8      ', N'CAJA 1', 0, 1)
INSERT [dbo].[temp_tickets_atendidos] ([idticket], [servicio], [hora], [nroticket], [puesto], [prioridad], [idpantalla]) VALUES (31, N'CAJA', CAST(N'2023-03-24T18:08:46.680' AS DateTime), N'CA-15     ', N'CAJA 1', 0, 1)
GO
SET IDENTITY_INSERT [dbo].[tickets] ON 

INSERT [dbo].[tickets] ([id], [idpuesto], [textopuesto], [idpersona], [nroticket], [servicio], [tarjeta], [prioridad], [emitido], [atendido], [finalizado], [derivado], [descartado], [preferencial], [boton], [operacion], [textoticket], [idcliente], [idpantalla], [datocliente], [estado], [totalespera], [totalatencion], [totaltiempo], [nombreOperador], [usuario]) VALUES (1, 0, N'', NULL, N'CA-2      ', N'CAJA', 0, 0, CAST(N'2023-07-17T16:52:04.403' AS DateTime), NULL, NULL, NULL, NULL, 0, N'CAJA', NULL, N'CA-2', N'', 1, NULL, N'ESPERANDO', NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[tickets] ([id], [idpuesto], [textopuesto], [idpersona], [nroticket], [servicio], [tarjeta], [prioridad], [emitido], [atendido], [finalizado], [derivado], [descartado], [preferencial], [boton], [operacion], [textoticket], [idcliente], [idpantalla], [datocliente], [estado], [totalespera], [totalatencion], [totaltiempo], [nombreOperador], [usuario]) VALUES (2, 0, N'', NULL, N'CA-3      ', N'CAJA', 0, 0, CAST(N'2023-07-17T17:40:05.487' AS DateTime), NULL, NULL, NULL, NULL, 0, N'CAJA', NULL, N'CA-3', N'', 1, NULL, N'ESPERANDO', NULL, NULL, NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[tickets] OFF
GO
SET IDENTITY_INSERT [dbo].[ticketsDetalle] ON 

INSERT [dbo].[ticketsDetalle] ([id], [idticket], [nroticket], [idusuario], [usuario], [idpuesto], [servicio], [estado], [iniciado], [atendido], [completado], [totalespera], [totalatencion], [totaltiempo]) VALUES (1, 1, N'CA-2      ', NULL, NULL, NULL, N'CAJA', N'ESPERANDO', CAST(N'2023-07-17T16:52:04.403' AS DateTime), NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[ticketsDetalle] ([id], [idticket], [nroticket], [idusuario], [usuario], [idpuesto], [servicio], [estado], [iniciado], [atendido], [completado], [totalespera], [totalatencion], [totaltiempo]) VALUES (2, 2, N'CA-3      ', NULL, NULL, NULL, N'CAJA', N'ESPERANDO', CAST(N'2023-07-17T17:40:05.487' AS DateTime), NULL, NULL, NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[ticketsDetalle] OFF
GO
SET IDENTITY_INSERT [dbo].[timbre] ON 

INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (1, 0, N'CA-6      ', N'CA-6      ', N'CAJA 1', 0, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (2, 0, N'CA-15     ', N'CA-15', N'CAJA 1', 1, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (3, 0, N'HP-118    ', N'HP-118    ', N'AT 2', 2, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (4, 0, NULL, NULL, NULL, 3, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (5, 0, NULL, NULL, NULL, 4, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (6, 0, NULL, NULL, NULL, 5, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (7, 0, NULL, NULL, NULL, 6, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (8, 0, NULL, NULL, NULL, 7, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (9, 0, NULL, NULL, NULL, 8, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (10, 0, NULL, NULL, NULL, 9, NULL)
INSERT [dbo].[timbre] ([id], [sonar], [nroticket], [textoticket], [textopuesto], [idpantalla], [fechahora]) VALUES (11, 0, NULL, NULL, NULL, 10, NULL)
SET IDENTITY_INSERT [dbo].[timbre] OFF
GO
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}agencias', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}agenda', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}botones', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}configuracion', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}equipos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}historico', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}llamada', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}mensajes', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}operaciones', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}personas', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}puestos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}servicios', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}servicios_puestos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}tarjetas', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}temp_tickets_atendidos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}ticket_actual', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}tickets', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}UserLevelPermissions', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}UserLevels', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}Usuarios', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (-2, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}videos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}agencias', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}agenda', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}botones', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}configuracion', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}equipos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}historico', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}llamada', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}mensajes', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}operaciones', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}personas', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}puestos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}servicios', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}servicios_puestos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}tarjetas', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}temp_tickets_atendidos', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}ticket_actual', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}tickets', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}UserLevelPermissions', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}UserLevels', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}Usuarios', 0)
INSERT [dbo].[UserLevelPermissions] ([UserLevelID], [TableName], [Permission]) VALUES (0, N'{87B35B48-D328-45E3-B1DE-5519C484BB4A}videos', 0)
GO
INSERT [dbo].[UserLevels] ([UserLevelID], [UserLevelName]) VALUES (-2, N'Anonymous')
INSERT [dbo].[UserLevels] ([UserLevelID], [UserLevelName]) VALUES (-1, N'Administrator')
INSERT [dbo].[UserLevels] ([UserLevelID], [UserLevelName]) VALUES (0, N'Default')
GO
SET IDENTITY_INSERT [dbo].[Usuarios] ON 

INSERT [dbo].[Usuarios] ([id], [nombre], [usuario], [password], [userlevelid], [habilitado], [email], [foto], [user_role_id], [login_session_key], [email_status], [password_expire_date], [password_reset_key]) VALUES (1, N'admin', N'admin', N'$2y$10$HViIRz/4S3NysCTrC9YazO5nKnC.l1qQEhRRr076M9699ddoJSIOS', NULL, 1, N'filas@ibarakisoft.com', N'http://localhost/filasadmin/uploads/files/8vc9lx45136q0iu.png', 1, N'6edd7cfc83408d6b37b55ae5863f5214', NULL, CAST(N'1905-06-23T00:00:00.000' AS DateTime), NULL)
INSERT [dbo].[Usuarios] ([id], [nombre], [usuario], [password], [userlevelid], [habilitado], [email], [foto], [user_role_id], [login_session_key], [email_status], [password_expire_date], [password_reset_key]) VALUES (2, N'supervisor', N'supervisor', N'$2y$10$JWLDQD1pymxVNPvDrdCx4u0tBGEfpKaALvDjib0yIuu6bgY3gpuve', NULL, 1, N'filas@ibarakisoft.com', N'', 6, NULL, NULL, CAST(N'1905-06-23T00:00:00.000' AS DateTime), NULL)
SET IDENTITY_INSERT [dbo].[Usuarios] OFF
GO
SET IDENTITY_INSERT [dbo].[web_imagenes] ON 

INSERT [dbo].[web_imagenes] ([id], [nombre], [tipo], [imagen], [habilitado]) VALUES (1, N'rojo', N'boton', N'uploads/fondos/lc6xjk7go50_ih3.png', 1)
INSERT [dbo].[web_imagenes] ([id], [nombre], [tipo], [imagen], [habilitado]) VALUES (2, N'azul', N'boton', N'uploads/fondos/i5hotgs_wpyljz9.png', 1)
INSERT [dbo].[web_imagenes] ([id], [nombre], [tipo], [imagen], [habilitado]) VALUES (4, N'celeste', N'boton', N'uploads/fondos/hcarzjv345qm2ei.png', 1)
SET IDENTITY_INSERT [dbo].[web_imagenes] OFF
GO
ALTER TABLE [dbo].[botones] ADD  CONSTRAINT [DF_botones_color]  DEFAULT ((-1)) FOR [color]
GO
ALTER TABLE [dbo].[botones] ADD  CONSTRAINT [DF_botones_idpadre]  DEFAULT ((0)) FOR [idpadre]
GO
ALTER TABLE [dbo].[botones] ADD  CONSTRAINT [DF_botones_habilitado]  DEFAULT ((1)) FOR [habilitado]
GO
ALTER TABLE [dbo].[botones] ADD  CONSTRAINT [DF_botones_prioridad]  DEFAULT ((0)) FOR [prioridad]
GO
ALTER TABLE [dbo].[botones] ADD  CONSTRAINT [DF_botones_tarjeta]  DEFAULT ((0)) FOR [tarjeta]
GO
ALTER TABLE [dbo].[botones] ADD  CONSTRAINT [DF_botones_orden]  DEFAULT ((1)) FOR [orden]
GO
ALTER TABLE [dbo].[botones] ADD  CONSTRAINT [DF_botones_idpuesto]  DEFAULT ((0)) FOR [idpuesto]
GO
ALTER TABLE [dbo].[botones] ADD  CONSTRAINT [DF_botones_idpantalla]  DEFAULT ((1)) FOR [idpantalla]
GO
ALTER TABLE [dbo].[conf_rep_asfi] ADD  CONSTRAINT [DF_conf_rep_asfi_idservicio]  DEFAULT ((0)) FOR [idservicio]
GO
ALTER TABLE [dbo].[grupopantallas] ADD  CONSTRAINT [DF_pantallas_habilitado]  DEFAULT ((1)) FOR [habilitado]
GO
ALTER TABLE [dbo].[operaciones] ADD  CONSTRAINT [DF_Operaciones_habilitado]  DEFAULT ((1)) FOR [habilitado]
GO
ALTER TABLE [dbo].[personas] ADD  CONSTRAINT [DF_cajeros_registro]  DEFAULT (getdate()) FOR [registro]
GO
ALTER TABLE [dbo].[personas] ADD  CONSTRAINT [DF_cajeros_estado]  DEFAULT ((1)) FOR [habilitado]
GO
ALTER TABLE [dbo].[personas] ADD  CONSTRAINT [DF_cajeros_libre]  DEFAULT ((1)) FOR [libre]
GO
ALTER TABLE [dbo].[personas] ADD  CONSTRAINT [DF_personas_conectado]  DEFAULT ((0)) FOR [conectado]
GO
ALTER TABLE [dbo].[personas] ADD  CONSTRAINT [DF_personas_ultimocambio]  DEFAULT (getdate()) FOR [ultimocambio]
GO
ALTER TABLE [dbo].[puestos] ADD  CONSTRAINT [DF_cajas_fecha]  DEFAULT (getdate()) FOR [fecha]
GO
ALTER TABLE [dbo].[puestos] ADD  CONSTRAINT [DF_puestos_idpersona]  DEFAULT ((0)) FOR [idpersona]
GO
ALTER TABLE [dbo].[puestos] ADD  CONSTRAINT [DF_cajas_habilitada]  DEFAULT ((1)) FOR [habilitada]
GO
ALTER TABLE [dbo].[puestos] ADD  CONSTRAINT [DF_cajas_libre]  DEFAULT ((1)) FOR [libre]
GO
ALTER TABLE [dbo].[puestos] ADD  CONSTRAINT [DF_puestos_servicio]  DEFAULT (N'CAJA') FOR [servicio]
GO
ALTER TABLE [dbo].[puestos] ADD  CONSTRAINT [DF_puestos_atender_prioridad]  DEFAULT ((1)) FOR [atender_prioridad]
GO
ALTER TABLE [dbo].[servicios] ADD  CONSTRAINT [DF_servicios_ticket]  DEFAULT ((0)) FOR [ticket]
GO
ALTER TABLE [dbo].[servicios] ADD  CONSTRAINT [DF_servicios_fecha]  DEFAULT (getdate()) FOR [fecha]
GO
ALTER TABLE [dbo].[servicios] ADD  CONSTRAINT [DF_servicios_habilitado]  DEFAULT ((1)) FOR [habilitado]
GO
ALTER TABLE [dbo].[servicios] ADD  CONSTRAINT [DF_servicios_idpantalla]  DEFAULT ((0)) FOR [idpantalla]
GO
ALTER TABLE [dbo].[temp_tickets_atendidos] ADD  CONSTRAINT [DF_temp_tickets_atendidos_hora]  DEFAULT (getdate()) FOR [hora]
GO
ALTER TABLE [dbo].[temp_tickets_atendidos] ADD  CONSTRAINT [DF_temp_tickets_atendidos_prioridad]  DEFAULT ((0)) FOR [prioridad]
GO
ALTER TABLE [dbo].[temp_tickets_atendidos] ADD  CONSTRAINT [DF_temp_tickets_atendidos_idpantalla]  DEFAULT ((0)) FOR [idpantalla]
GO
ALTER TABLE [dbo].[tickets] ADD  CONSTRAINT [DF_tickets_nroticket]  DEFAULT (N'-') FOR [nroticket]
GO
ALTER TABLE [dbo].[tickets] ADD  CONSTRAINT [DF_tickets_servicio]  DEFAULT (N'-') FOR [servicio]
GO
ALTER TABLE [dbo].[tickets] ADD  CONSTRAINT [DF_tickets_tarjeta]  DEFAULT ((0)) FOR [tarjeta]
GO
ALTER TABLE [dbo].[tickets] ADD  CONSTRAINT [DF_tickets_prioridad]  DEFAULT ((0)) FOR [prioridad]
GO
ALTER TABLE [dbo].[tickets] ADD  CONSTRAINT [DF_tickets_emitido]  DEFAULT (getdate()) FOR [emitido]
GO
ALTER TABLE [dbo].[tickets] ADD  CONSTRAINT [DF_tickets_preferencial]  DEFAULT ((0)) FOR [preferencial]
GO
ALTER TABLE [dbo].[tickets] ADD  CONSTRAINT [DF_tickets_idpantalla]  DEFAULT ((0)) FOR [idpantalla]
GO
ALTER TABLE [dbo].[tickets] ADD  CONSTRAINT [DF_tickets_estado]  DEFAULT ('ESPERANDO') FOR [estado]
GO
ALTER TABLE [dbo].[timbre] ADD  CONSTRAINT [DF_timbre_sonar]  DEFAULT ((0)) FOR [sonar]
GO
ALTER TABLE [dbo].[timbre] ADD  CONSTRAINT [DF_timbre_idpantalla]  DEFAULT ((0)) FOR [idpantalla]
GO
ALTER TABLE [dbo].[timbre] ADD  CONSTRAINT [DF_timbre_fechahora]  DEFAULT (getdate()) FOR [fechahora]
GO
ALTER TABLE [dbo].[Usuarios] ADD  CONSTRAINT [DF_usuarios_habilitado]  DEFAULT ((1)) FOR [habilitado]
GO
ALTER TABLE [dbo].[Usuarios] ADD  CONSTRAINT [DF_Usuarios_password_expire_date]  DEFAULT (((2021)-(1))-(21)) FOR [password_expire_date]
GO
ALTER TABLE [dbo].[conf_rep_asfi]  WITH NOCHECK ADD  CONSTRAINT [FK_conf_rep_asfi_servicios] FOREIGN KEY([idservicio])
REFERENCES [dbo].[servicios] ([id])
GO
ALTER TABLE [dbo].[conf_rep_asfi] NOCHECK CONSTRAINT [FK_conf_rep_asfi_servicios]
GO
/****** Object:  StoredProcedure [dbo].[aceptarTicket]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[aceptarTicket] 
	-- Add the parameters for the stored procedure here
	@idpuesto int,
	@idpersona int,
	@idticket int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	declare @hora as datetime
	set @hora = getdate()

    -- Insert statements for procedure here
	UPDATE tickets 
	SET atendido= @hora, idpuesto=@idpuesto,idpersona=@idpersona, estado='ATENDIENDO' ,totalespera=CONVERT(char(8), @hora - emitido, 8)
	where id = @idticket

	update ticketsDetalle
	set idusuario= @idpersona,idpuesto=@idpuesto,atendido=@hora,totalespera=CONVERT(char(8), @hora - iniciado, 8),estado='ATENDIENDO'
	where ticketsDetalle.id=(select top 1 d.id from ticketsDetalle d where idticket=@idticket order by d.id desc);
	return;

END
GO
/****** Object:  StoredProcedure [dbo].[crear_ticket]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[crear_ticket] 
-- parametros
@servicio nvarchar(15),
@tarjeta bit,
@prioridad bit,
@prefijo nvarchar(10),
@boton nvarchar(50)
as 

begin 
-- variables
declare @nroticket int

select @nroticket = count(*)+1 from tickets where servicio = @servicio and convert(char,emitido,103) = convert(char,getdate(),103)

--select  count(*)+1 from tickets where servicio = @servicio and convert(char,emitido,103) = convert(char,getdate(),103)

--select @nroticket = ticket+1 from servicios where id = @servicio and convert(char,emitido,103) = convert(char,getdate(),103)

insert into tickets(nroticket,servicio,tarjeta,prioridad,boton)
values(@prefijo+'-'+cast(@nroticket as char),@servicio,@tarjeta,@prioridad,@boton)

select @prefijo+'-'+cast(@nroticket as char)
end
GO
/****** Object:  StoredProcedure [dbo].[crear_ticket2]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[crear_ticket2] 
-- parametros
@nroticket varchar(10),
@servicio nvarchar(15),
@tarjeta bit,
@prioridad bit,
@prefijo nvarchar(10),
@boton nvarchar(50),
@textoticket nvarchar(50),
@textopuesto nvarchar(50),
@idcliente nvarchar(50),
@idpuesto integer,
@idpantalla integer
as 

begin 
-- variables
insert into tickets(nroticket,servicio,tarjeta,prioridad,boton,textoticket,textopuesto,idcliente,idpuesto,idpantalla)
values(@nroticket,@servicio,@tarjeta,@prioridad,@boton,@textoticket,@textopuesto,@idcliente,@idpuesto,@idpantalla)

select @nroticket as nroticket
end
GO
/****** Object:  StoredProcedure [dbo].[crearLinkedServer]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[crearLinkedServer] 
	-- Add the parameters for the stored procedure here
 @nombrelinkedserver  nvarchar(50),
 @ip nvarchar(15),
 @db nvarchar(50),
 @usuario nvarchar(50),
 @password nvarchar(50)

AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	   

--DECLARE @nombrelinkedserver as nvarchar(50)
--DECLARE @ip as nvarchar(15)
--DECLARE @db as nvarchar(50)
--DECLARE @usuario as nvarchar(50)
--DECLARE @password as nvarchar(50)

--set @nombrelinkedserver = N'FILAS_AGENCIA2'
--set @ip = N'192.168.1.178'
--set @db = N'colavirtual_ag2'
--set @usuario = 'sa'
--set @password  = 'sa'

/****** Object:  LinkedServer [AGENCIA1]    Script Date: 25/03/2021 12:06:11 ******/
EXEC master.dbo.sp_addlinkedserver @server = @nombrelinkedserver, @srvproduct=N'', @provider=N'SQLNCLI', @datasrc=@ip , @catalog= @db
 /* For security reasons the linked server remote logins password is changed with ######## */
--EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=@nombrelinkedserver,@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
--EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=@nombrelinkedserver, @useself=N'False',@locallogin=N'sa',@rmtuser=@usuario , @rmtpassword=@password 

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=@nombrelinkedserver,@useself=N'False',@locallogin=NULL,@rmtuser=@usuario ,@rmtpassword=@password
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=@nombrelinkedserver,@useself=N'True',@locallogin=N'sa',@rmtuser=NULL,@rmtpassword=NULL

EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'collation compatible', @optvalue=N'false'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'data access', @optvalue=N'true'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'dist', @optvalue=N'false'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'pub', @optvalue=N'false'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'rpc', @optvalue=N'true'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'rpc out', @optvalue=N'true'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'sub', @optvalue=N'false'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'connect timeout', @optvalue=N'0'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'collation name', @optvalue=null


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'lazy schema validation', @optvalue=N'false'

EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'query timeout', @optvalue=N'0'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'use remote collation', @optvalue=N'true'


EXEC master.dbo.sp_serveroption @server=@nombrelinkedserver, @optname=N'remote proc transaction promotion', @optvalue=N'true'




END
GO
/****** Object:  StoredProcedure [dbo].[derivarTicket]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[derivarTicket] 
	-- Add the parameters for the stored procedure here
	@servicio nvarchar(50),
	@idpuesto int,
	@textopuesto nvarchar(250),
	@idpantalla int,
	@idticket int,
	@nroticket nvarchar(10)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	declare @hora as datetime
	set @hora = GETDATE();
    -- Insert statements for procedure here
	UPDATE       tickets
	SET                servicio = @servicio, idpuesto = @idpuesto, derivado = 1,atendido=Null,textopuesto=@textopuesto,idpantalla=@idpantalla,estado='ESPERANDO',totalatencion=CONVERT(char(8), @hora - atendido, 8)
	WHERE        (id = @idticket);

	update ticketsDetalle
	set ticketsDetalle.estado='DERIVADO',completado=@hora,totalatencion=CONVERT(char(8), @hora - atendido, 8)
	where ticketsDetalle.id=(select top 1 d.id from ticketsDetalle d where idticket=@idticket  order by d.id desc);

	insert into ticketsDetalle(idticket,nroticket,servicio,estado,iniciado)
	values (@idticket, rtrim(@nroticket), rtrim(@servicio), 'ESPERANDO', @hora);
END
GO
/****** Object:  StoredProcedure [dbo].[descartarTicket]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[descartarTicket]
	-- Add the parameters for the stored procedure here
	@idpuesto int,
	@idpersona int,
	@id int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	declare @hora datetime;
	set @hora = GETDATE();

    -- Insert statements for procedure here
	UPDATE tickets 
	SET descartado = @hora, idpuesto=@idpuesto,idpersona=@idpersona,estado='DESCARTADO',totalatencion=CONVERT(char(8), @hora - atendido, 8),totaltiempo=CONVERT(char(8), @hora - emitido, 8)
	where id = @id;

	update ticketsDetalle
	set ticketsDetalle.estado='DESCARTADO',completado=@hora,totalatencion=CONVERT(char(8), @hora - atendido, 8),totaltiempo=CONVERT(char(8), @hora - iniciado, 8)
	where ticketsDetalle.id=(select top 1 d.id from ticketsDetalle d where idticket=@id order by d.id desc);
END
GO
/****** Object:  StoredProcedure [dbo].[finalizarTicket]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[finalizarTicket]
	-- Add the parameters for the stored procedure here
	@idpuesto int, 
	@idpersona int,
	@operacion nchar(500),
	@datocliente nchar(250),
	@id int

AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	declare @hora datetime;
	set @hora = GETDATE();
    -- Insert statements for procedure here
	UPDATE tickets
	SET finalizado = @hora, idpuesto = @idpuesto, idpersona = @idpersona, operacion = @operacion,datocliente=@datocliente, estado='COMPLETADO',totalatencion=CONVERT(char(8), @hora - atendido, 8),totaltiempo=CONVERT(char(8), @hora - emitido, 8)
	WHERE (id = @id);

	update ticketsDetalle
	set ticketsDetalle.estado='COMPLETADO',completado=@hora,totalatencion=CONVERT(char(8), @hora - atendido, 8),totaltiempo=CONVERT(char(8), @hora - iniciado, 8)
	where ticketsDetalle.id=(select top 1 d.id from ticketsDetalle d where idticket=@id order by d.id desc);
END
GO
/****** Object:  StoredProcedure [dbo].[fixTicketsActualizarEstadosyTotales]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

create PROCEDURE [dbo].[fixTicketsActualizarEstadosyTotales]
	-- Add the parameters for the stored procedure here

AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
select COUNT(*) as totalespera_nulos from tickets where atendido is not null and descartado is null and totalespera is null
update tickets 
set  totalespera= CONVERT(char, tickets.atendido - tickets.emitido, 8)
where atendido is not null and descartado is null

select COUNT(*) as totalatencion_nulos from tickets where finalizado is not null and totalatencion is null
update tickets 
set  totalatencion = CONVERT(char, tickets.finalizado - tickets.atendido, 8) 
where finalizado is not null and descartado is null

select COUNT(*) as totaltiempo_nulos from tickets where finalizado is not null and descartado is null and totaltiempo is null
update tickets 
set  totaltiempo = CONVERT(char, tickets.finalizado - tickets.emitido, 8) 
where finalizado is not null and descartado is null

select COUNT(*) as estadoAtendiendo from tickets where atendido is not null and finalizado is null and descartado is null and derivado is null and estado!='ATENDIENDO'
update tickets 
set estado = 'ATENDIENDO' 
where atendido is not null and finalizado is null and descartado is null and derivado is null and estado!='ATENDIENDO'

select COUNT(*) as estadoDescartado from tickets where descartado is not null and estado!='DESCARTADO' 
update tickets 
set estado = 'DESCARTADO' 
where descartado is not null and estado!='DESCARTADO' 

select COUNT(*) as estadoCompletado  from tickets where finalizado is not null and descartado is null and estado!='COMPLETADO' 
update tickets 
set estado = 'COMPLETADO' 
where finalizado is not null and descartado is null and estado!='COMPLETADO' 

END
GO
/****** Object:  StoredProcedure [dbo].[fixTicketsActualizarNombres]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[fixTicketsActualizarNombres] 
	-- Add the parameters for the stored procedure here
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	update t 
	set textopuesto = pu.nombre, nombreoperador= pe.nombre 
	from tickets t left outer join  puestos pu on t.idpuesto=pu.id 
	left outer join personas pe on t.idpersona = pe.id 
	where t.nombreoperador is null or t.textopuesto is null
END
GO
/****** Object:  StoredProcedure [dbo].[operadorTraerConPrioridadSinAtender]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[operadorTraerConPrioridadSinAtender] 
	-- Add the parameters for the stored procedure here
	@idpuesto int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
select * 
from tickets as t 
where CAST(emitido as date)=CAST(getdate() as date)
and estado = 'ESPERANDO'
and prioridad = 1
and ( (servicio in (select idservicio from servicios_puestos where idpuesto=@idpuesto)) or (idpuesto=@idpuesto))
order by id
END
GO
/****** Object:  StoredProcedure [dbo].[operadorTraerTicketsSinAtender]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[operadorTraerTicketsSinAtender] 
	-- Add the parameters for the stored procedure here
	@idpuesto int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
select *,DATEDIFF(minute, emitido, getdate()) as espera
from tickets as t 
where CAST(emitido as date)=CAST(getdate() as date)
and estado = 'ESPERANDO'
and ( (servicio in (select idservicio from servicios_puestos where idpuesto=@idpuesto)) or (idpuesto=@idpuesto))
order by id
END
GO
/****** Object:  StoredProcedure [dbo].[sincronizar_operadores]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


/****** Object:  StoredProcedure [dbo].[sincronizar_operadores]    Script Date: 29/3/2022 01:41:43 ******/
--SET ANSI_NULLS ON
--GO

--SET QUOTED_IDENTIFIER ON
--GO


CREATE PROCEDURE [dbo].[sincronizar_operadores]
@totalregistros integer output
AS
BEGIN

DECLARE @SQLQuery AS NVARCHAR(MAX);


DECLARE @CATALOGO as nvarchar(50);
set @CATALOGO = '';
select @CATALOGO=dbServidorCentral from configuracion where id=1;
begin
SET @SQLQuery='
		MERGE  personas a
		USING SERVIDORCENTRAL.'+@CATALOGO +'.dbo.operadores c
		ON (a.usuario = c.usuario )
		WHEN NOT MATCHED BY SOURCE THEN DELETE
		WHEN MATCHED -- and (a.ultimocambio<>c.ultimocambio)
			THEN UPDATE SET 
			a.nombre=c.nombre,a.telefono=c.telefono, a.habilitado=c.habilitado, a.libre=c.libre,a.conectado=c.conectado, a.usuario=c.usuario, a.password=c.password, a.idagencia=c.idagencia, a.ultimocambio=c.ultimocambio
		WHEN NOT MATCHED BY TARGET 
		THEN INSERT (nombre,telefono,registro,habilitado,libre,usuario,password,idagencia, conectado, ultimocambio, idcentral)
			VALUES (c.nombre,c.telefono,c.registro,c.habilitado,c.libre,c.usuario, c.password,c.idagencia,c.conectado,getdate(), c.idcentral);
		';
		--EXEC sp_executesql @SQLQuery;
		BEGIN TRY
		begin
		  EXEC sp_executesql @SQLQuery;
			-- capturar cuantos registros se insertaron
			set @totalregistros = @@ROWCOUNT;

			-- actualizar sincronizacion
			PRINT 'SINC: sincronizado operadores completado: ' + cast(@totalregistros as char);
		end
		END TRY
		BEGIN CATCH
		begin
			PRINT 'SINC: sincronizado operadores error: ' + ERROR_MESSAGE() ;
		end
		END CATCH
	return
end
END
GO
/****** Object:  StoredProcedure [dbo].[spTraerNroTicket]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE procedure [dbo].[spTraerNroTicket]

	-- Add the parameters for the function here
	@servicio varchar(50)
	
AS
BEGIN
	-- Declare the return variable here
	--declare @nroticket int
	declare  @fecha date,@ticket integer

	-- Add the T-SQL statements to compute the return value here
	--select distinct @nroticket = count(idticket)+1 from historico where servicio = @servicio and convert(char,fechahora,103) = convert(char,getdate(),103)
select top 1 @fecha = fecha, @ticket = ticket from servicios where id=@servicio 

if convert(char,@fecha,103) = convert(char,getdate(),103)
 set @ticket = @ticket+1
else 
 set  @ticket = 1
update servicios set ticket = @ticket, fecha=getdate() where id=@servicio

	-- Return the result of the function
	--select  @nroticket as nroticket

	select  @ticket as nroticket

END
GO
/****** Object:  Trigger [dbo].[asignarFondo]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE TRIGGER [dbo].[asignarFondo]
   ON  [dbo].[botones] 
   after  INSERT,UPDATE
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	declare @fondo nvarchar(500)
	declare @id int

	select top 1 @fondo = fondo, @id = id from inserted;
	if len(@fondo) = 0 or @fondo is null
		select top 1 @fondo= fondo from (
		select top 1 fondo, 1 as orden from botones where len(fondo)>0 and id=(select idpadre from botones where id=@id)
		union 
		select TOP 1 fondo, 2 as orden from botones where len(fondo)>0
		) fondos order by orden;

   update botones 
   set fondo= @fondo
   from botones b
   inner join inserted i on b.id=i.id;
  END
GO
ALTER TABLE [dbo].[botones] ENABLE TRIGGER [asignarFondo]
GO
/****** Object:  Trigger [dbo].[actHoraUltimoCambio]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE TRIGGER [dbo].[actHoraUltimoCambio]
   ON  [dbo].[historico]
   AFTER INSERT,UPDATE
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for trigger here
	update personas set ultimocambio = getdate()
	from inserted
	where inserted.idcajero = personas.id 
END
GO
ALTER TABLE [dbo].[historico] ENABLE TRIGGER [actHoraUltimoCambio]
GO
/****** Object:  Trigger [dbo].[actualizarNombres]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE TRIGGER [dbo].[actualizarNombres]
   ON  [dbo].[tickets]
   AFTER  INSERT,UPDATE
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	declare @id int;
	select @id = id from inserted;

    ---- Insert statements for trigger here
	--update t 
	--set nombreoperador= pe.nombre, usuario = pe.usuario 
	--from tickets t left outer join personas pe on t.idpersona = pe.id 
	--where t.nombreoperador is null or t.usuario is null
	--and t.id=@id

	--update t 
	--set textopuesto = pu.nombre 
	--from tickets t left outer join  puestos pu on t.idpuesto=pu.id 
	--where t.textopuesto is null
	--and t.id=@id
END
GO
ALTER TABLE [dbo].[tickets] ENABLE TRIGGER [actualizarNombres]
GO
/****** Object:  Trigger [dbo].[insertarDetalleNuevoTicket]    Script Date: 04/12/2023 11:55:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE TRIGGER [dbo].[insertarDetalleNuevoTicket] 
   ON [dbo].[tickets] 
   AFTER  INSERT
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for trigger here
	insert into ticketsDetalle(idticket,nroticket,servicio,estado,iniciado)
	select id,nroticket,servicio,'ESPERANDO',emitido
	from INSERTED
	WHERE atendido is null and derivado is null
END
GO
ALTER TABLE [dbo].[tickets] ENABLE TRIGGER [insertarDetalleNuevoTicket]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Lista de Servicios que se mostrarán en los reportes para la ASFI' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'conf_rep_asfi'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tickets"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 246
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'dashboard'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'dashboard'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "CTE_1"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 246
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vMenuBotones'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vMenuBotones'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tickets"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 262
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsAyerxHora'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsAyerxHora'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tickets"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 246
            End
            DisplayFlags = 280
            TopColumn = 16
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsEnEspera'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsEnEspera'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tickets"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 262
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsEnEsperaxServicio'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsEnEsperaxServicio'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tickets"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 262
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "personas"
            Begin Extent = 
               Top = 138
               Left = 38
               Bottom = 268
               Right = 262
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsHoyFuncionario'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsHoyFuncionario'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tickets"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 262
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsHoyServicio'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsHoyServicio'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "a"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 246
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "b"
            Begin Extent = 
               Top = 6
               Left = 284
               Bottom = 136
               Right = 492
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsHoyxHora'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vTicketsHoyxHora'
GO
USE [master]
GO
ALTER DATABASE [colavirtual] SET  READ_WRITE 
GO
