Importacion II

SELECT `2.0:Balance por Movimientos` as Movimientos,
Val((SELECT sum(PreciototalAdd) FROM Ventadia Where familia not like `Forma_de_pago` and ticket<>`` and (forma_de_pago is null or forma_de_pago not like `EFECTIVO`) and codplu not like `ADD*` and tipo_invitado=0 )&``)
+
Val((SELECT sum(PrecioTotal) FROM Ventadia where familia = `FUNCION` and (artnombre=`DESCUADRE`)) & ``)
-
Val( ( SELECT sum(pagado) FROM Ventadia Where ticket<>`` and (Forma_De_Pago like `PENDIENTECOBRO`)) &``)
as Importe,
first (Camarero) as Agente
From Ventadia
UNION
SELECT `2.1:Ventas realizadas:` as Movimientos,
Val((SELECT sum(PrecioTotalAdd) FROM Ventadia Where ticket <>`` and preciototal > 0 and familia not like `PENDIENTE` and familia not like `FORMA DE PAGO` ) &``)
AS Importe,
first (Camarero) as Agente
From Ventadia
UNION
SELECT `2.2:Ventas anulados:` as Movimientos,
Val((SELECT sum(PrecioTotalAdd) FROM Ventadia Where ticket <>`` and preciototal < 0 and familia not like `PENDIENTE` and familia not like `FORMA DE PAGO` ) &``)
AS Importe,
first (Camarero) as Agente
From Ventadia
UNION
SELECT `2.3:Ventas invitadas:` as Movimientos,
-(
Val((SELECT sum(PrecioTotalAdd) FROM Ventadia Where ticket <>`` and familia not like `forma de pago` and tipo_invitado=-1) &``)
-
Val((SELECT sum(PreciototalAdd) FROM Ventadia Where codplu like `PEND*` and tipo_invitado=-1 )) & ``)
AS Importe,
first (Camarero) as Agente
From Ventadia
UNION
SELECT `2.4:Tickets cobrados que estaban pendientes: ` as Movimientos,
Val( (SELECT sum(PreciototalAdd) FROM Ventadia Where codplu like `PEND*` and preciototaladd>0 ) &``)
AS Importe,
first (Camarero) as Agente
From Ventadia
UNION
SELECT `2.5:Tickets anulados que estaban pendientes: ` as Movimientos,
Val( (SELECT sum(PreciototalAdd) FROM Ventadia Where codplu like `PEND*` and preciototaladd<0 ) &``)
AS Importe,
first (Camarero) as Agente
From Ventadia
UNION
SELECT `2.5:Tickets invitados que estaban pendientes: ` as Movimientos,
Val( (SELECT -sum(PreciototalAdd) FROM Ventadia Where codplu like `PEND*` and tipo_invitado<>0) & ``)
AS Importe,
first (Camarero) as Agente
From Ventadia
UNION
SELECT `2.6:Tickets dejados pendientes de cobro :` as Movimientos,
Val( (SELECT sum(-Pagado) FROM Ventadia Where ticket <>`` and forma_de_pago like `PENDIENTECOBRO`) & ``)
AS Importe,
first (Camarero) as Agente
From Ventadia
UNION SELECT `2.7:Descuadre de Efectivo: ` as Movimientos,
Val((SELECT sum(PrecioTotal) FROM Ventadia where familia = `FUNCION` and (artnombre=`DESCUADRE`)) & ``)
AS Importe,
first (Camarero) as Agente
From Ventadia;

MovimientosImporteAgente2.0:Balance por Movimientos11.7Camarero_22.1:Ventas realizadas:41.6Camarero_22.2:Ventas anulados:-8.4Camarero_22.3:Ventas invitadas:-1.8Camarero_22.4:Tickets cobrados que estaban pendientes: 20.1Camarero_22.5:Tickets anulados que estaban pendientes: -7.2Camarero_22.5:Tickets invitados que estaban pendientes: -6.7Camarero_22.6:Tickets dejados pendientes de cobro :-25.9Camarero_22.7:Descuadre de Efectivo: 0Camarero_2
SELECT `1.0:Facturacion: Balance de Efectivo` as Movimientos,
(
(SELECT sum(PreciototalAdd) FROM Ventadia Where familia not like `Forma_de_pago` and ticket<>`` and (forma_de_pago is null or forma_de_pago not like `EFECTIVO`) and codplu not like `ADD*` and tipo_invitado=0)
-
val((SELECT sum(pagado) FROM Ventadia Where ticket<>`` and (Forma_De_Pago like `PENDIENTECOBRO`)) & ``)
-
VAl((SELECT sum(pagado) FROM Ventadia Where ticket <>`` and (Forma_De_Pago not like `PENDIENTECOBRO`) and (Forma_De_Pago not like `EFECTIVO`)) & ``)
+
VAl((SELECT Sum(PrecioTotal) FROM Ventadia where familia = `FUNCION` and (artnombre=`DESCUADRE`) ) &``)
+
VAL((Select Sum(PrecioTotal) FROM Ventadia where familia like `Ingreso*`) & ``)
+
val((Select Sum(-PrecioTotal) FROM Ventadia where familia like `Pagos*`) &``)
+
val((Select Sum([PrecioTotal]) FROM Ventadia where familia like `Cambios*`) & ``)
+
Val((Select Sum(-PrecioTotal) FROM Ventadia where familia like `Retirado*`) &``)
)


as Importe,
first (Camarero) as Agente
From Ventadia
Union
SELECT `1.1:Efectivo en Caja` as Movimientos,
(
(SELECT sum(PreciototalAdd) FROM Ventadia Where familia not like `Forma_de_pago` and ticket<>`` and (forma_de_pago is null or forma_de_pago not like `EFECTIVO`) and codplu not like `ADD*` and tipo_invitado=0)
-
val((SELECT sum(pagado) FROM Ventadia Where ticket<>`` and (Forma_De_Pago like `PENDIENTECOBRO`)) & ``)
-
VAl((SELECT sum(pagado) FROM Ventadia Where ticket <>`` and (Forma_De_Pago not like `PENDIENTECOBRO`) and (Forma_De_Pago not like `EFECTIVO`)) & ``)
+
VAl((SELECT Sum(PrecioTotal) FROM Ventadia where familia = `FUNCION` and (artnombre=`DESCUADRE`) ) &``)
)
AS VALOR,
first (Camarero) as Agente
From Ventadia
Union
SELECT `1.2:Ingresos ` as Movimientos,
Val((Select Sum(PrecioTotal) FROM Ventadia where familia like `Ingreso*`) & ``)
AS VALOR,
first (Camarero) as Agente
From Ventadia
Union
SELECT `1.3:Pagos desde caja` as Movimientos,
VAL((Select Sum(-PrecioTotal) FROM Ventadia where familia like `Pagos*`) &``)
AS VALOR,
first (Camarero) as Agente
FROM Ventadia
Union
SELECT `1.4:Cambios introducidos en caja ` as Movimientos,
Val((Select Sum([PrecioTotal]) FROM Ventadia where familia like `Cambios*`) & ``)
AS VALOR,
first (Camarero) as Agente
From Ventadia
UNION SELECT `1.5:Efectivo retirado de caja ` as Movimientos,
Val((Select Sum(-PrecioTotal) FROM Ventadia where familia like `Retirado*`) &``)
AS VALOR,
first (Camarero) as Agente
From Ventadia;




MovimientosImporteAgente1.0:Facturacion: Balance por Forma de Pago10.7Camarero_21.1:Efectivo en Caja10.7Camarero_21.2:Ingresos 100Camarero_21.3:Pagos desde caja-100Camarero_21.4:Cambios introducidos en caja 0Camarero_21.5:Efectivo retirado de caja 0Camarero_2

SELECT `1.0:Facturacion: Balance por Forma de Pago` as Movimientos,

Val( (SELECT sum(PreciototalAdd) FROM Ventadia Where familia not like `Forma_de_pago` and ticket<>`` and (forma_de_pago is null or forma_de_pago not like `EFECTIVO`) and codplu not like `ADD*` and tipo_invitado=0 ) &``)
+
Val((SELECT sum(PrecioTotal) FROM Ventadia where familia = `FUNCION` and (artnombre=`DESCUADRE`)) & ``)
-
Val(( SELECT sum(pagado) FROM Ventadia Where ticket<>`` and (Forma_De_Pago like `PENDIENTECOBRO`)) &``)
as Importe,
first (Camarero) as Agente
From Ventadia
Union
SELECT `1.1:Importe en: Efectivo` as Movimientos,
(
Val((SELECT sum(PreciototalAdd) FROM Ventadia Where familia not like `Forma_de_pago` and ticket<>`` and (forma_de_pago is null or forma_de_pago not like `EFECTIVO`) and codplu not like `ADD*` and tipo_invitado=0) & ``)
-
VAl((SELECT sum(pagado) FROM Ventadia Where ticket<>`` and (Forma_De_Pago like `PENDIENTECOBRO`)) &``)
-
Val((SELECT sum(pagado) FROM Ventadia Where ticket <>`` and (Forma_De_Pago not like `PENDIENTECOBRO`) and (Forma_De_Pago not like `EFECTIVO`)) & ``)
+
Val((SELECT Sum(PrecioTotal) FROM Ventadia where familia = `FUNCION` and (artnombre=`DESCUADRE`) ) & ``)
)
AS VALOR,
first (Camarero) as Agente
From Ventadia
UNION SELECT `1.2:Importe en FDP : ` & Forma_De_pago as Movimientos,
Val(sum(pagado) & ``) as VALOR,
first (Camarero) as Agente
FROM Ventadia Where ticket <>`` and (Forma_De_Pago not like `PENDIENTECOBRO`) and (Forma_De_Pago not like `EFECTIVO`)
GROUP BY Forma_De_pago;



MovimientosImporteAgente1.0:Facturacion: Balance por Forma de Pago11.7Camarero_21.1:Importe en: Efectivo10.7Camarero_21.2:Importe en FDP : ESPECIAL11Camarero_21.2:Importe en FDP : ESPECIAL30Camarero_2
Registros relacionados