Update 001 VERIFICAR CONVENIO.sql

This commit is contained in:
darwin_quiroz 2025-07-23 11:16:51 -05:00
parent a10289a67a
commit fd039e65c4

View File

@ -7,9 +7,9 @@ if OBJECT_ID('tempdb.dbo.#convenios_revisar') is not null
select id select id
into #convenios_revisar 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, @cuotas_pagadas int,
@total_lotes int, @total_lotes int,
@clave_verificar VARCHAR(max) = '', @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 @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); 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)); print 'Cuotas pagadas: ' + CAST(@cuotas_pagadas as VARCHAR(MAX));
@ -116,16 +116,18 @@ order by x.recaudacion_id_mg;
goto salir goto salir
/*verificar si hay pagos no procesados*/ /*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 where lote_id = 28929 and recaudacion_id_mg = -2
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_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*/ /*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 and usuario_id = 430
select top 10 * from usuario_permisos_xavier --where id = 430
--order by recaudacion_id desc --order by recaudacion_id desc