- botón pagar
- se duplican los pedidos. Al pedir la cuenta
- agregar platos disponibles
- cuando todos los pedidos estén entregados cambiar botón a "entregar mesa"
- agregar consumo adicional a pedido. Mientras no haya pagado
- agregar nombre de persona que pide para llevar
- agregar 100 pesos por envase al plato para llevat
- agregar tabla bebidas y postres
- agregar plato adicional con precio modificable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CANTIDAD MIGRANTES | |
select nac.NOMBRE, count(*) as 'Cantidad Migrantes' | |
from USP_USUARIO_APS as usp | |
inner join NAC_NACIONALIDAD as nac on nac.id = usp.NAC_ID | |
where NAC_ID > 1 and usp.NOD_ID in (225, 226, 227, 2957) and year(usp.FECHA_INSCRIPCION) = 2018 | |
group by nac.nombre | |
order by count(*) desc; | |
-- CANTIDAD ATENCIONES A MIGRANTES | |
select nac.nombre, count(*) as 'Cantidad Atenciones' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert into rrhh_licencia2 | |
select id, licencia, fecha_emision, ingreso_at, inicio_at, termino_at, tipo_licencia, | |
COALESCE(tipo_reposo, 1) AS tipo_reposo, 1 AS reposo_lugar, | |
(CASE WHEN jornada = 0 THEN 1 WHEN jornada = 1 THEN 1 WHEN jornada = 2 THEN 2 WHEN jornada is null THEN 1 END) as jornada, | |
COALESCE(id_ocupacion, 19) AS id_ocupacion, | |
COALESCE(id_actividad, 9) AS id_actividad, | |
(CASE WHEN subsidio = 'A' THEN 1 WHEN subsidio = 'E' THEN 1 WHEN subsidio = 'B' THEN 2 WHEN subsidio = 'C' THEN 3 | |
WHEN subsidio = 'D' THEN 4 WHEN subsidio = 'H' THEN 4 WHEN subsidio = 'F' THEN 5 WHEN subsidio = 'G' THEN 6 ELSE '7' END) AS subsidio, | |
usuario_id, usuario_ingresa, | |
(CASE WHEN estado = 1 THEN 1 ELSE 2 END) AS estado, medico, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO rrhh_accidente_trabajo | |
select id, tipo, (CASE WHEN estado = 0 THEN 2 WHEN estado = 1 THEN 1 END) AS estado, usuario, '17432116', | |
num_resolucion, fecha_ingreso, fecha_accidente, fecha_inicio_reposo, fecha_fin_reposo, '.', null, null | |
from rrhh_licencia_accidente WHERE usuario != 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PRIMERO, ELIMINAR POSIBLES DUPLICADOS | |
select * | |
into dbo.temporal_filtro | |
from USP_USUARIO_APS | |
where FECHA_INSCRIPCION in ( SELECT MAX(FECHA_INSCRIPCION) from USP_USUARIO_APS group by RUT); | |
-- EXTRAER DATOS NECESARIOS DESDE PERCAPITA. CAMBIAR CÓDIGO CENTRO FONASA POR RAYEN | |
select concat(run, dv) as run, | |
case cod_centro when 102300 then 225 when 102301 then 227 when 102302 then 226 | |
when 102306 then 2957 when 102412 then 226 when 102413 then 226 when 102701 then 3003 end as cod_centro, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT l.rut, l.dv, l.nombres, l.tipo_calculo AS calidad, l.centro_costo, l.cargo, l.docente, l.lugar_desempenio | |
FROM rrhh_licencia AS rl | |
INNER JOIN liquidaciones AS l ON l.rut = rl.usuario_id | |
WHERE rl.estado != 'ELIMINADO' AND DATE_FORMAT(rl.inicio_at, '%Y-%m') = '2017-09' AND l.area = 'EDUCACION' AND l.aniomes = 201709 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select a.FECHA_DE_NACIMIENTO, c.FECHA_HORA_INICIO, datediff(yy, a.FECHA_DE_NACIMIENTO, c.FECHA_HORA_INICIO) | |
from CIT_CITA as c | |
inner join USP_USUARIO_APS as a on a.ID = c.USP_ID | |
where TDA_ID in | |
(select ID from TDA_TIPO_DE_ATENCION where nombre = 'MORBILIDAD') | |
and datediff(yy, a.FECHA_DE_NACIMIENTO, c.FECHA_HORA_INICIO) > 9 | |
and datediff(yy, a.FECHA_DE_NACIMIENTO, c.FECHA_HORA_INICIO) < 20 | |
and year(c.FECHA_HORA_INICIO) = 2016 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT MONTH(fo.orden_at) AS mes, fdo_fp.nombre, SUM(fdo_fp.cantidad) AS cantidad | |
FROM finanzas_ordencompra AS fo | |
INNER JOIN | |
(SELECT fdo.ordencompra_id, fdo.cantidad, fp.nombre | |
FROM finanzas_detalle_ordencompra AS fdo | |
INNER JOIN | |
(SELECT id, nombre | |
FROM finanzas_producto | |
WHERE nombre REGEXP 'oficio|carta' AND (nombre NOT REGEXP 'formulario|opalina|libro|arch|adhesivo|talonario|prehospitalaria|laminas|triptico|volantes|lomo|separador') AND (nombre NOT REGEXP 'saco|funda|volante|block|sobre|tallimetro|balanza|flayer|balamza|carne|revista|carpeta|diptico|cuad|tabla') AND departamento = 'SALUD') AS fp ON fp.id = fdo.producto_id) AS fdo_fp ON fdo_fp.ordencompra_id = fo.id | |
WHERE YEAR(fo.orden_at) = 2016 AND fo.estado_id NOT IN (1,4) AND bodega_central != 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
(char(34)+u.RUT+char(34)) AS RUT, | |
(char(34)+u.NOMBRES+char(34)) AS NOMBRES, | |
(char(34)+u.APELLIDO_PATERNO+char(34)) AS APELLIDO_PATERNO, | |
(char(34)+u.APELLIDO_MATERNO+char(34)) AS APELLIDO_MATERNO, | |
char(34)+CONVERT(VARCHAR(10),u.FECHA_DE_NACIMIENTO,20)+char(34) AS FECHA_NACIMIENTO, | |
SEXO = CASE u.HL7_0001_U_ID | |
WHEN 3 THEN 1 | |
WHEN 2 THEN 2 | |
ELSE 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1) IDENTIFICAR LAS FILAS QUE ESTÁN EN LA TABLA BAK, PERO NO EN LA ORIGINAL | |
select fp2.* | |
from finanzas_proveedor as fp1 | |
right join finanzas_proveedor_bak as fp2 on fp1.id = fp2.id | |
where fp1.id is null; | |
-- 2) INSERTAR EN LA TABLA ORIGINAL LAS FILAS QUE FUERON BORRADAS | |
insert into finanzas_proveedor | |
(select fp2.* | |
from finanzas_proveedor as fp1 |