From e06afdcac9bec8acfede727ad8e6feb35abd9494 Mon Sep 17 00:00:00 2001 From: Anthony Laz Arteaga Date: Mon, 25 Nov 2024 16:56:25 -0500 Subject: [PATCH] Cambio en proceso de intereses para que congele los intereses a la fecha de solicitud del convenio. --- .../PROCESO 2023/001 VERIFICAR CONVENIO.sql | 27 ++++++++++++----- .../002 REINTEGRAR DUPLICADOS.sql | 30 ++++++++++++------- .../PROCESO 2023/003 PAGAR NUEVAS CUOTAS.sql | 19 +++++++----- 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/001 VERIFICAR CONVENIO.sql b/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/001 VERIFICAR CONVENIO.sql index 1dc0768..01f10e2 100644 --- a/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/001 VERIFICAR CONVENIO.sql +++ b/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/001 VERIFICAR CONVENIO.sql @@ -7,7 +7,7 @@ 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('002658'); +from db_olympo_web.dbo.convenios_cabecera where code in('001219'); declare @cuotas_pagadas int, @@ -116,17 +116,28 @@ 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 = 32946 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*/ -select sum(valor_pago) from recaudacion_registro_pago where lote_id = 36888 -and usuario_id = 430 -order by recaudacion_id desc +select * from recaudacion_registro_pago +where lote_id = 32946 and usuario_id = 430 +--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: diff --git a/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/002 REINTEGRAR DUPLICADOS.sql b/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/002 REINTEGRAR DUPLICADOS.sql index 290caee..ecf023e 100644 --- a/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/002 REINTEGRAR DUPLICADOS.sql +++ b/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/002 REINTEGRAR DUPLICADOS.sql @@ -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*/ select * into #reintegrar from recaudacion_registro_pago where usuario_id = 430 and recaudacion_id in ( -728498, -728499, -728500, -728501, -728502, -728503, -728504, -728505, -734004, -734005 +746985, +746986, +746987, +746988, +746989, +746990, +746991, +746992, +746993, +746994, +746995, +746996, +746997, +746998, +746999, +747000, +747001, +747002 ) order by recaudacion_id desc @@ -27,7 +35,7 @@ select pg.recaudacion_id where pg.usuario_id = 430 order by pg.recaudacion_id desc ---GOTO SALIR +GOTO SALIR /*OJO: VERIFICAR SI NO HAY PAGOS ENTRE EL PAGO INICIAL Y LOS PAGOS DUPLICADOS*/ diff --git a/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/003 PAGAR NUEVAS CUOTAS.sql b/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/003 PAGAR NUEVAS CUOTAS.sql index d634dc1..c53db83 100644 --- a/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/003 PAGAR NUEVAS CUOTAS.sql +++ b/CONVENIOS FINALIZADOS APROBADOS/PROCESO 2023/003 PAGAR NUEVAS CUOTAS.sql @@ -1,7 +1,8 @@ USE [db_olympo_web] 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 -- interfering with SELECT statements. SET NOCOUNT ON; @@ -9,8 +10,9 @@ BEGIN -- 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) @@ -34,11 +36,12 @@ BEGIN and a.id_convenio in(@par_id_convenio) group by a.id_convenio order by a.id_convenio + print @@ROWCOUNT create index IX_LO_FI_con on #conmain(fila,id_convenio) /* - select * from #conmain + select @fecha_convenio GOTO SALIR */ @@ -79,13 +82,12 @@ BEGIN where y.idpago=x.idpagCab and x.to_paid=y.valor_pagar_unitario DECLARE @contador INT = 0; UPDATE #con SET fila = @contador, @contador = @contador + 1; - + --delete from #con where fila <> 1 - /* + select * from #con GOTO SALIR - */ @@ -288,10 +290,13 @@ BEGIN Rollback; 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 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===================' /* select @idusuariorec,4,@par_valor_pagado,@par_valor_pagado,0,@par_lote_id,-2,null,null,null,@card ,@id,@fecha