This commit is contained in:
Darwin Quiroz 2024-11-26 11:40:08 -05:00
parent e06afdcac9
commit ce9fc03a7c
6 changed files with 33 additions and 19 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('001219'); from db_olympo_web.dbo.convenios_cabecera where code in('002458');
declare declare
@cuotas_pagadas int, @cuotas_pagadas int,

View File

@ -10,7 +10,7 @@ BEGIN
-- VERIFICAR CONVENIO ESTADO -- VERIFICAR CONVENIO ESTADO
SET @par_id_convenio = (select id from db_olympo_web.dbo.convenios_cabecera where code in('001219')); SET @par_id_convenio = (select id from db_olympo_web.dbo.convenios_cabecera where code in('002458'));
SET @fecha_convenio = (select x.create_date from db_olympo_web.dbo.convenios_cabecera x where id = @par_id_convenio); SET @fecha_convenio = (select x.create_date from db_olympo_web.dbo.convenios_cabecera x where id = @par_id_convenio);

View File

@ -2,12 +2,14 @@ use telus;
/*verificar convenios antes del 2024*/ /*verificar convenios antes del 2024*/
--exec telus_avaluo_emision_consulta 32946
if OBJECT_ID('tempdb.dbo.#convenios_revisar') is not null if OBJECT_ID('tempdb.dbo.#convenios_revisar') is not null
drop table #convenios_revisar drop table #convenios_revisar
select id select id
into #convenios_revisar into #convenios_revisar
from db_olympo_web.dbo.convenios_cabecera where code in('002538'); from db_olympo_web.dbo.convenios_cabecera where code in('001219');
select b.ClaveCatastral, a.* from agcm_2022_tram_liquidaciones_convenio a select b.ClaveCatastral, a.* from agcm_2022_tram_liquidaciones_convenio a
inner join telus_procesos.dbo.agcm_datos_claves_avaluos b on a.lote_id = b.lote_id inner join telus_procesos.dbo.agcm_datos_claves_avaluos b on a.lote_id = b.lote_id
@ -34,7 +36,8 @@ select b.* from avaluo_emision_anual_cabecera b
--update rentas_estado set estado_registro = 'INACTIVO' where tipo_renta=0 and registro_lote_id = 56354 and estado_registro <> 'INACTIVO' --update rentas_estado set estado_registro = 'INACTIVO' where tipo_renta=0 and registro_lote_id = 56354 and estado_registro <> 'INACTIVO'
--update agcm_2022_tram_liquidaciones_convenio set estado = 'INACTIVO' where id = 5688 --update agcm_2022_tram_liquidaciones_convenio set estado = 'INACTIVO' where id = 967
GOTO SALIR GOTO SALIR

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('002458');
declare declare
@cuotas_pagadas int, @cuotas_pagadas int,
@ -124,7 +124,7 @@ select * from agcm_2023_recaudacion_id_convenio where lote_id = 7910
--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 = 2338 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 sum(valor_pago) from recaudacion_registro_pago where lote_id = 49132
and usuario_id = 430 and usuario_id = 430
--order by recaudacion_id desc --order by recaudacion_id desc

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,17 +10,22 @@ BEGIN
-- VERIFICAR CONVENIO ESTADO -- VERIFICAR CONVENIO ESTADO
SET @par_id_convenio = (select id from db_olympo_web.dbo.convenios_cabecera where code in('002658')); SET @par_id_convenio = (select id from db_olympo_web.dbo.convenios_cabecera where code in('002458'));
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 liquidaciones_main x where x.id = 726643 --SELECT * FROM liquidaciones_main x where x.id = 726643
--update telus.dbo.agcm_2022_tram_liquidaciones_convenio set estado = 'ACTIVO' where id_liquidacion = 726643; --update telus.dbo.agcm_2022_tram_liquidaciones_convenio set estado = 'ACTIVO' where id_liquidacion = 726643;
--update telus.dbo.agcm_2022_tram_liquidaciones_convenio set estado = 'ACTIVO' where id_convenio in(@par_id_convenio)
--update telus.dbo.agcm_2022_tram_liquidaciones_convenio set estado = 'INACTIVO' where id_convenio in(@par_id_convenio) --update telus.dbo.agcm_2022_tram_liquidaciones_convenio set estado = 'INACTIVO' where id_convenio in(@par_id_convenio)
--update telus.dbo.agcm_2022_tram_liquidaciones_convenio set estado = 'INACTIVO' where id_convenio in(@par_id_convenio) --update telus.dbo.agcm_2022_tram_liquidaciones_convenio set estado = 'INACTIVO' where id_convenio in(@par_id_convenio)
--select * from telus.dbo.agcm_2022_tram_liquidaciones_convenio where id_convenio in(@par_id_convenio)
--GOTO SALIR --GOTO SALIR
@ -34,11 +40,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,7 +87,7 @@ 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
@ -108,7 +115,7 @@ BEGIN
print @@ROWCOUNT print @@ROWCOUNT
-- select * from #con order by create_date -- select * from #con order by create_date
declare @fila int =1,@total int=0 declare @fila int =1,@total int=0
declare @fecha date,@fecha_convenio date, @id int, @idliqui int declare @fecha date, @id int, @idliqui int
-- --
declare @valorpagado numeric(18,2)=0 declare @valorpagado numeric(18,2)=0
declare @tbredis table(fila int identity(1,1),idpago int,fecha_pago date,lote_id int,valorconveniototal numeric(18,3), declare @tbredis table(fila int identity(1,1),idpago int,fecha_pago date,lote_id int,valorconveniototal numeric(18,3),
@ -139,7 +146,7 @@ BEGIN
,@NumeroTransaccion varchar(max)='' ,@NumeroTransaccion varchar(max)=''
,@id_tranliqui int =0 ,@id_tranliqui int =0
select @fecha = a.date, @id=a.id from #con a where a.fila=@fila select @fecha = a.date, @id=a.id from #con a where a.fila=@fila
select @valorpagado = a.to_paid, @idliqui = a.collection_id from convenios_pagos_detalle a where a.id = @id and a.tax_id=3 select @valorpagado = a.value_paid, @idliqui = a.collection_id from convenios_pagos_detalle a where a.id = @id and a.tax_id=3
print '@valorpagado' print '@valorpagado'
print @valorpagado print @valorpagado
print '@idliqui' print '@idliqui'
@ -151,11 +158,11 @@ BEGIN
from telus.dbo.agcm_2022_tram_liquidaciones_convenio a where a.id_convenio=@convenio_id and from telus.dbo.agcm_2022_tram_liquidaciones_convenio a where a.id_convenio=@convenio_id and
a.id_liquidacion=@idliqui and (a.estado='ACTIVO' ) --or a.estado='PROCESARPAGO' a.id_liquidacion=@idliqui and (a.estado='ACTIVO' ) --or a.estado='PROCESARPAGO'
-- Actualizar valor de deuda seg<65>n la clave que tenga prioridad -- Actualizar valor de deuda seg<65>n la clave que tenga prioridad
/*
select * from @tbredis select * from @tbredis
Rollback; Rollback;
goto SALIR goto SALIR
*/
print @@ROWCOUNT print @@ROWCOUNT
set @idfila = (select count(*) from @tbredis a where a.idpago=@id) set @idfila = (select count(*) from @tbredis a where a.idpago=@id)
if @idfila = 0 if @idfila = 0
@ -288,11 +295,14 @@ 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
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

View File

@ -2,6 +2,7 @@ use telus;
/*verificar convenios antes del 2024*/ /*verificar convenios antes del 2024*/
--exec agcm_telus_avaluo_emision_consulta 49132, '2024-02-19'
if OBJECT_ID('tempdb.dbo.#convenios_revisar') is not null if OBJECT_ID('tempdb.dbo.#convenios_revisar') is not null
drop table #convenios_revisar drop table #convenios_revisar