Cambio en proceso de intereses para que congele los intereses a la fecha de solicitud del convenio.

This commit is contained in:
Anthony Laz Arteaga 2024-11-25 16:56:25 -05:00
parent 198a0fd064
commit e06afdcac9
3 changed files with 50 additions and 26 deletions

View File

@ -7,7 +7,7 @@ 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('002658'); from db_olympo_web.dbo.convenios_cabecera where code in('001219');
declare declare
@cuotas_pagadas int, @cuotas_pagadas int,
@ -116,17 +116,28 @@ 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 = 32946 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_detalle where lote_id = 32946 and recaudacion_id_mg = 0
select * from agcm_2023_recaudacion_id_convenio where lote_id = 7910 select * from agcm_2023_recaudacion_id_convenio where lote_id = 32946
--delete db_olympo_web.dbo.agcm_2023_recaudacion_cuotas where lote_id = 2338 and recaudacion_id_mg = 0 --delete from agcm_2023_recaudacion_id_convenio where lote_id = 32946 and recaudacion_id <= 0
--delete db_olympo_web.dbo.agcm_2023_recaudacion_cuotas where lote_id = 32946 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 = 36888 select * from recaudacion_registro_pago
and usuario_id = 430 where lote_id = 32946 and usuario_id = 430
order by recaudacion_id desc --order by recaudacion_id desc
select * from recaudacion_registro_pago rp
inner join recaudacion_registro_pago_lote rpl on rp.recaudacion_id = rpl.recaudacion_id
where rp.lote_id = 32946 and rp.usuario_id = 430 and rp.recaudacion_id > 738018
select * from recaudacion_registro_pago_lote_rubro x where x.recaudacion_lote_id = 1045358
SALIR: SALIR:

View File

@ -7,16 +7,24 @@ if OBJECT_ID('tempdb.dbo.#reintegrar') is not null
/*OBTENEMOS LOS RECAUDACION IDS A REINTEGRAR DE ACUERDO AL ANÁLISIS DEL SCRIPT 001 VERIFICAR CONVENIO*/ /*OBTENEMOS LOS RECAUDACION IDS A REINTEGRAR DE ACUERDO AL ANÁLISIS DEL SCRIPT 001 VERIFICAR CONVENIO*/
select * into #reintegrar from recaudacion_registro_pago where usuario_id = 430 select * into #reintegrar from recaudacion_registro_pago where usuario_id = 430
and recaudacion_id in ( and recaudacion_id in (
728498, 746985,
728499, 746986,
728500, 746987,
728501, 746988,
728502, 746989,
728503, 746990,
728504, 746991,
728505, 746992,
734004, 746993,
734005 746994,
746995,
746996,
746997,
746998,
746999,
747000,
747001,
747002
) )
order by recaudacion_id desc order by recaudacion_id desc
@ -27,7 +35,7 @@ select pg.recaudacion_id
where pg.usuario_id = 430 where pg.usuario_id = 430
order by pg.recaudacion_id desc order by pg.recaudacion_id desc
--GOTO SALIR GOTO SALIR
/*OJO: VERIFICAR SI NO HAY PAGOS ENTRE EL PAGO INICIAL Y LOS PAGOS DUPLICADOS*/ /*OJO: VERIFICAR SI NO HAY PAGOS ENTRE EL PAGO INICIAL Y LOS PAGOS DUPLICADOS*/

View File

@ -1,7 +1,8 @@
USE [db_olympo_web] USE [db_olympo_web]
BEGIN BEGIN
declare @par_id_convenio int = 0; declare @par_id_convenio int = 0,
@fecha_convenio date;
-- SET NOCOUNT ON added to prevent extra result sets from -- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements. -- interfering with SELECT statements.
SET NOCOUNT ON; SET NOCOUNT ON;
@ -9,8 +10,9 @@ BEGIN
-- VERIFICAR CONVENIO ESTADO -- VERIFICAR CONVENIO ESTADO
SET @par_id_convenio = (select id from db_olympo_web.dbo.convenios_cabecera where code in('002303')); SET @par_id_convenio = (select id from db_olympo_web.dbo.convenios_cabecera where code in('001219'));
SET @fecha_convenio = (select x.create_date from db_olympo_web.dbo.convenios_cabecera x where id = @par_id_convenio);
--select * from telus.dbo.agcm_2022_tram_liquidaciones_convenio where id_convenio in(@par_id_convenio) --select * from telus.dbo.agcm_2022_tram_liquidaciones_convenio where id_convenio in(@par_id_convenio)
@ -34,11 +36,12 @@ BEGIN
and a.id_convenio in(@par_id_convenio) and a.id_convenio in(@par_id_convenio)
group by a.id_convenio group by a.id_convenio
order by a.id_convenio order by a.id_convenio
print @@ROWCOUNT print @@ROWCOUNT
create index IX_LO_FI_con on #conmain(fila,id_convenio) create index IX_LO_FI_con on #conmain(fila,id_convenio)
/* /*
select * from #conmain select @fecha_convenio
GOTO SALIR GOTO SALIR
*/ */
@ -80,12 +83,11 @@ BEGIN
DECLARE @contador INT = 0; DECLARE @contador INT = 0;
UPDATE #con SET fila = @contador, @contador = @contador + 1; UPDATE #con SET fila = @contador, @contador = @contador + 1;
--delete from #con where fila <> 1
/*
select * from #con select * from #con
GOTO SALIR GOTO SALIR
*/
@ -288,10 +290,13 @@ BEGIN
Rollback; Rollback;
goto SALIR goto SALIR
*/ */
--select @idusuariorec,4,@par_valor_pagado,@par_valor_pagado,0,@par_lote_id,-2,null,null,null,@card ,@id,@fecha
--Rollback;
--goto SALIR
-- Ejecutar Pago -- Ejecutar Pago
print '========PROCESANDO PAGO===================' print '========PROCESANDO PAGO==================='
exec telus.dbo.agcm_2023_telus_recaudacion_registro_pago_convenios @idusuariorec,4,@par_valor_pagado,@par_valor_pagado,0,@par_lote_id,-2,null,null,null,@card ,@id,@fecha exec telus.dbo.akla_2024_telus_recaudacion_registro_pago_convenios @idusuariorec,4,@par_valor_pagado,@par_valor_pagado,0,@par_lote_id,-2,null,null,null,@card ,@id,@fecha, 1, @fecha_convenio
print '========FIN PROCESANDO PAGO===================' print '========FIN PROCESANDO PAGO==================='
/* /*
select @idusuariorec,4,@par_valor_pagado,@par_valor_pagado,0,@par_lote_id,-2,null,null,null,@card ,@id,@fecha select @idusuariorec,4,@par_valor_pagado,@par_valor_pagado,0,@par_lote_id,-2,null,null,null,@card ,@id,@fecha