Update 003 PAGAR NUEVAS CUOTAS.sql

This commit is contained in:
Darwin Quiroz 2024-12-04 15:12:41 -05:00
parent 304bda5266
commit 65c9326083

View File

@ -74,7 +74,7 @@ BEGIN
and a.id not in(
select xxyz.idpago from agcm_2023_recaudacion_cuotas xxyz
)
and a.id not in(select id_pago_olympo from telus.dbo.agcm_2023_tram_id_pagos_olympo_omitir) -- Se agregó
and a.id not in(select id_pago_olympo from telus.dbo.agcm_2023_tram_id_pagos_olympo_omitir) -- Se agrego
order by a.id
@ -103,7 +103,7 @@ BEGIN
and a.id not in(
select xx.idpago from db_olympo_web.dbo.agcm_2023_recaudacion_cuotas xx
)
and a.id not in(select id_pago_olympo from telus.dbo.agcm_2023_tram_id_pagos_olympo_omitir) -- Se agregó
and a.id not in(select id_pago_olympo from telus.dbo.agcm_2023_tram_id_pagos_olympo_omitir) -- Se agreg<EFBFBD>
order by a.id
*/
@ -152,7 +152,7 @@ BEGIN
select @id,@fecha,a.lote_id,0,a.valor,0,@valorpagado,0,a.id,a.id_convenio,0,a.desde,a.hasta
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'
-- Actualizar valor de deuda según la clave que tenga prioridad
-- Actualizar valor de deuda seg<EFBFBD>n la clave que tenga prioridad
/*
select * from @tbredis
Rollback;
@ -256,12 +256,12 @@ BEGIN
-- ===================================================
-- Procesar Pago
select @par_valor_pagado=a.valor_pagar_unitario,@par_lote_id=a.lote_id,
@card ='Recaudación Facilidad de Pago. Control #'+cast(a.id_convenio_olympo as varchar(30)) ,
@card ='Recaudaci<EFBFBD>n Facilidad de Pago. Control #'+cast(a.id_convenio_olympo as varchar(30)) ,
@NumeroTransaccion = cast(a.idpago as varchar(30)),
@aniodesde=a.aniodesde,@aniohasta=a.aniohasta,@id_tranliqui=a.id_tranliqui
from @tbredis a
where a.fila=@idfila
-- Verificación si existe Pago
-- Verificaci<EFBFBD>n si existe Pago
declare @noproxy int = isnull((select x.fila from agcm_2023_recaudacion_cuotas_detalle x where x.lote_id=@par_lote_id and x.idpago=@id and x.fecha_pago=@fecha and x.recaudacion_id_mg<>'0'),0)
print '@noproxy'
print @noproxy