Se analisa si sube todo el lote en las 4 bases
LISTA DE REGISTRO POR FECHA EN EL LOTE Muestra si hay movimientos que sean Viejos. Que la entidad envie archivos con fecha anterior al lote mes actual.
select cast(ctafemis as DATE) ,sum(ctaimpgrab) from ctacte where IDCTACTE in ( select idctacte from boxicwa.dbo.hctacte where nrolot = '4005') group by cast(ctafemis as DATE) order by 1
TOTAL LOTE BOXI
select 'lOTE' as lote , sum(ctaimpgrab) as BOXI from ctacte where IDCTACTE in ( select idctacte from boxicwa.dbo.hctacte where nrolot = '4005')
TOTAL LOTE INTERFAZ
select nrolot as lote, sum(ctaimpgrab) AS Interfaz from boxicwa.dbo.hctacte where nrolot = '4005' group by nrolot
TOTAL LOTE CWA-INTERMEDIO
select usr_icrmvi_nrolot as Lote,sum(usr_icrmvi_impnac) as CWA_Inter from GIGA_S_15_INT.GIGARED.DBO.usr_icrmvi inner join GIGA_S_15_INT.GIGARED.DBO.cjrmvi on cjrmvi_modfor=usr_icrmvi_modgen and cjrmvi_codfor=usr_icrmvi_codgen and cjrmvi_nrofor=usr_icrmvi_nrogen and cjrmvi_nroitm=USR_ICRMVI_itmgen and cjrmvi_debhab=USR_ICRMVI_dehgen where usr_icrmvi_nrolot = '4005' group by usr_icrmvi_nrolot
TOTAL LOTE CWA-REAL
select USR_DATOSINTERFAZ_lote as Lote,sum(usr_icrmvi_impnac) as CWA_REAL from GIGA_S_15_INT.gigared.dbo.USR_DATOSINTERFAZ where USR_DATOSINTERFAZ_lote = '4005' GROUP BY USR_DATOSINTERFAZ_lote