diff --git a/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2024/001 VERIFICAR CONVENIO.sql b/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2024/001 VERIFICAR CONVENIO.sql index abfc058..b40fce6 100644 --- a/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2024/001 VERIFICAR CONVENIO.sql +++ b/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2024/001 VERIFICAR CONVENIO.sql @@ -7,9 +7,9 @@ if OBJECT_ID('tempdb.dbo.#convenios_revisar') is not null select id into #convenios_revisar -from db_olympo_web.dbo.convenios_cabecera where code in('002458'); +from db_olympo_web.dbo.convenios_cabecera where code in('003367'); -declare +declare @cuotas_pagadas int, @total_lotes int, @clave_verificar VARCHAR(max) = '', @@ -17,7 +17,7 @@ declare set @lote_id = (select lote_id from telus_procesos.dbo.agcm_datos_claves_avaluos where ClaveCatastral = @clave_verificar); - + set @cuotas_pagadas = (select count(*) from db_olympo_web.dbo.convenios_detalle de where agreement_id in(select id from #convenios_revisar) and all_paid = 1); print 'Cuotas pagadas: ' + CAST(@cuotas_pagadas as VARCHAR(MAX)); @@ -116,16 +116,18 @@ order by x.recaudacion_id_mg; goto salir /*verificar si hay pagos no procesados*/ -select * from db_olympo_web.dbo.agcm_2023_recaudacion_cuotas where lote_id = 7910 and recaudacion_id_mg = 0 -select * from db_olympo_web.dbo.agcm_2023_recaudacion_cuotas_detalle where lote_id = 7910 and recaudacion_id_mg = 0 +select * from db_olympo_web.dbo.agcm_2023_recaudacion_cuotas where lote_id = 28929 and recaudacion_id_mg = -2 +select * from db_olympo_web.dbo.agcm_2023_recaudacion_cuotas_detalle where lote_id = 28929 and recaudacion_id_mg = -2 -select * from agcm_2023_recaudacion_id_convenio where lote_id = 7910 +select * from agcm_2023_recaudacion_id_convenio where lote_id = 50177 ---delete db_olympo_web.dbo.agcm_2023_recaudacion_cuotas where lote_id = 2338 and recaudacion_id_mg = 0 +--delete db_olympo_web.dbo.agcm_2023_recaudacion_cuotas where lote_id = 28929 and recaudacion_id_mg = 0 +--delete db_olympo_web.dbo.agcm_2023_recaudacion_cuotas_detalle where lote_id = 28929 and recaudacion_id_mg = 0 /*Ver recaudaciones de usuario portal ciudadano, con el que se procesan las recaudaciones de convenios*/ -select sum(valor_pago) from recaudacion_registro_pago where lote_id = 49132 +select * from recaudacion_registro_pago where lote_id = 79914 and usuario_id = 430 +select top 10 * from usuario_permisos_xavier --where id = 430 --order by recaudacion_id desc