======Control de Interfaz - SQL Y eXCEL====== Este control se creo para poder revisar las ODBC y ver las diferencias. Lo compone el siguiente Excel : {{analisis_interfaz_revisar_diariamente.zip}} y La siguiente SP:{{interfaz_cobranzas_querie_rapido.zip}} /*replica desactualizada -----TOTAL LOTE INTERFAZ consulta los ultimos lotes select nrolot as '@lotecobranzas', sum(ctaimpgrab) AS Interfaz from boxicwa.dbo.hctacte where nrolot > '4363' group by nrolot order by nrolot */ Declare @lotecobranzas int --luego del = podemos poner el numero del lote a consultar. por default traera el ultimo ejecutado set @lotecobranzas = 4504 --El if indicara cual es el ultimo lote proceso en interfaz y te dejara consultar = o menor a este para poder usar IF if @lotecobranzas <= (select max(nrolot) from boxicwa.dbo.hctacte) begin select @lotecobranzas as lote , sum(ctaimpgrab) as Importe_Boxi , (select sum(ctaimpgrab) AS Importe from boxicwa.dbo.hctacte where nrolot = @lotecobranzas group by nrolot) as Importe_Interfaz, ((select sum(b.TOTAL) from rcab as a, extracciones as b where a.IDRCAB = b.IDREC and ctanrocomp in (select ctanrocomp from boxicwa.dbo.hctacte where nrolot = @lotecobranzas))*-1) as Extracciones_Efectivo, (((sum(ctaimpgrab)+((select sum(b.TOTAL) from rcab as a, extracciones as b where a.IDRCAB = b.IDREC and ctanrocomp in (select ctanrocomp from boxicwa.dbo.hctacte where nrolot = @lotecobranzas))*-1) )-(select sum(ctaimpgrab) AS Importe from boxicwa.dbo.hctacte where nrolot = @lotecobranzas group by nrolot) )*-1) as Diferencias_boxiVsInterfaz from ctacte where IDCTACTE in ( select idctacte from boxicwa.dbo.hctacte where nrolot = @lotecobranzas) --------Validacion resgitro cargados en extracciones dentro del lote-------------------- select abonumero,ctanrocomp,total, (select sum(total) from rcab as a, extracciones as b where a.IDRCAB = b.IDREC and ctanrocomp in (select ctanrocomp from boxicwa.dbo.hctacte where nrolot = @lotecobranzas)) as Det_Extraccion from rcab as a, extracciones as b where a.IDRCAB = b.IDREC and ctanrocomp in (select ctanrocomp from boxicwa.dbo.hctacte where nrolot = @lotecobranzas) order by abonumero asc end Else Print 'Pusiste un Lote que no esta procesado por que es Mayor al ultimo Generado' =====Paso 1 - Correr el query===== Con el query corremos el nro lote y nos dara los totales. Los mismmo los copiaremos al excel en la hoja "Informacion Resumen" =====Paso 2 - Interfaz===== Entramos a CWA y ejecutamos "lotes interfaz", guardamos la rta en TXT. Esta informacion la importaremos en el Excel, dentro de la hoja "Detalle Interfaz", colocaremos uno bajo el otro lote "detalle". Luego actualizaremos la tabla dinamica "Tabla ingresos contables" De esta forma copletaremosl a informacion, actualizando las partes. Tener presente que la Extracciones en efectivo no se presentan en boxi, si en la interfaz y CWA.