You are on page 1of 4

REVISION CASOS...

CASO 1 : COD_CLIENTE 2948229 / SALDO_CARTERA : 3.999,36 / DIFERENCIA DETECTADA :


2.061,61

--tab LUNES 26 JULIO


select a.num_proceso, b.cod_ciclfact, a.cod_tipdocum, sum(a.mto_debe),
sum(a.mto_haber)
from fa_detbalance_to a, fa_procesos b
where a.cod_cliente = 2948229
and a.num_proceso = b.num_proceso (+)
group by a.num_proceso, b.cod_ciclfact, a.cod_tipdocum
order by 1 asc, 2

--tab LUNES02 26 JULIO


select b.cod_ciclfact, b.fec_historico, b.cod_item, sum(b.imp_documento), count(1)
from fah_balance b
where b.cod_cliente = 2948229
group by b.cod_ciclfact, b.fec_historico, b.cod_item
order by b.fec_historico asc

-- REVISANDO ITEM 2 (PAGOS)


select sum(imp_pago)
from co_pagos
where cod_cliente = 2948229
and cod_tipdocum = 8

257.242,14

-- REVISANDO ITEM 2 (PAGOS)


select sum(b.imp_documento)
from fah_balance b
where b.cod_cliente = 2948229
and cod_item = 2

-257.242,14

- PAGOS CO_PAGOS VS PAGOS FAH_BALANCE : OK

==========================================

--REVISANDO ITEM 6 (FACTURAS CICLO)


select sum(b.imp_documento)
from fah_balance b
where b.cod_cliente = 2948229
and cod_item = 6

234.342,94

--REVISANDO ITEM 6 (FACTURAS CICLO)


select sum(impORTE_DEBE), sum(impORTE_HABER)
from co_CARTERA
where cod_cliente = 2948229
and cod_tipdocum = 2
UNION ALL
select sum(impORTE_DEBE), sum(impORTE_HABER)
from co_CANCELADOS
where cod_cliente = 2948229
and cod_tipdocum = 2

SELECT 3874.98 + 230467.96 FROM DUAL

234.342,94

- FACTURAS CICLO CO_CARTERA + CO_CANCELADOS VS FACTURA CICLO FAH_BALANCE : OK

=============================================================================

-- REVISANDO ITEM 4 (NOTAS DE CREDITO)


select sum(imp_documento)
from fah_balance
where cod_cliente = 2948229
And cod_item = 4

-6516.89

-- REVISANDO ITEM 4 (NOTAS DE CREDITO)


select sum(impORTE_DEBE), sum(impORTE_HABER)
from co_CARTERA
where cod_cliente = 2948229
and cod_tipdocum = 25
UNION ALL
select sum(impORTE_DEBE), sum(impORTE_HABER)
from co_CANCELADOS
where cod_cliente = 2948229
and cod_tipdocum = 25

6516.89 6516.89

- NOTAS DE CREDITO CO_CARTERA + CO_CANCELADOS VS NOTAS DE CREDITO FAH_BALANCE : OK

==================================================================================

-- REVISANDO ITEM 3 (REVERSAS DE PAGO)


select sum(imp_documento)
from fah_balance
where cod_cliente = 2948229
And cod_item = 3

9857.57

-- REVISANDO ITEM 3 (REVERSAS DE PAGO)


select sum(impORTE_DEBE), sum(impORTE_HABER)
from co_CARTERA
where cod_cliente = 2948229
and cod_tipdocum = 60
UNION ALL
select sum(impORTE_DEBE), sum(impORTE_HABER)
from co_CANCELADOS
where cod_cliente = 2948229
and cod_tipdocum = 60
2396.18

-- REVISANDO ITEM 3 (REVERSAS DE PAGO)


select sum(imp_pago)
from co_pagos
where cod_cliente = 2948229
and cod_tipdocum IN (17, 84, 10, 60)

7461.39

SELECT 7461.39 + 2396.18 FROM DUAL

9857.57

- REVERSAS DE PAGO CO_PAGOS + CO_CARTERA + CO_CANCELADOS VS REVERSAS DE PAGO


FAH_BALANCE : OK
===================================================================================
==========

-- REVISANDO ITEM 5 (FACTURAS EN CUOTAS)


select sum(imp_documento)
from fah_balance
where cod_cliente = 2948229
And cod_item = 5

23429.62

-- REVISANDO ITEM 5 (FACTURAS EN CUOTAS)


select sum(IMPORTE_DEBE), sum(IMPORTE_HABER)
from co_CARTERA
where cod_cliente = 2948229
and cod_tipdocum IN (35,1,18,48,90,91)
UNION ALL
select sum(IMPORTE_DEBE), sum(IMPORTE_HABER)
from co_CANCELADOS
where cod_cliente = 2948229
and cod_tipdocum IN (35,1,18,48,90,91)

23429.62

- FACTURAS EN CUOTAS CO_CARTERA + CO_CANCELADOS VS FACTURAS EN CUOTA FAH_BALANCE :


OK
===================================================================================
==

RESUMEN:
ITEM 2 (PAGOS) OK
ITEM 3 (REVERSAS PAGO) OK
ITEM 4 (NOTAS DE CREDITO) OK
ITEM 5 (FACTURAS CUOTAS) OK
ITEM 6 (FACTURA CICLO) OK

===================================================================================
==
--REVISANDO CONSISTENCIA SUMATORIA DE ITEMS POR CICLO.

SELECT A.COD_CICLFACT, A.MONTO SUMA_ITEMS_1_A_6, B.MONTO ITEM_8 FROM (select


COD_CICLFACT, SUM(IMP_DOCUMENTO) MONTO
from fah_balance
where cod_cliente = 2948229
AND COD_ITEM BETWEEN 1 AND 6
GROUP BY COD_CICLFACT) A,
(select COD_CICLFACT, SUM(IMP_DOCUMENTO) MONTO
from fah_balance
where cod_cliente = 2948229
AND COD_ITEM = 8
GROUP BY COD_CICLFACT) B
WHERE A.COD_CICLFACT = B.COD_CICLFACT
AND A.MONTO != B.MONTO

COD_CICLFACT SUMA_ITEMS_1_A_6 ITEM_8


180521 6088.51 4026.9 --
Ajuste de $2061.61 (-)
180621 3999.36 6060.97 --
Ajuste de $2061.61 (+)
______________________________________________________________________
-- TOTAL DE AJUSTES = $0

select *
from fah_balance
where cod_cliente = 2948229
AND COD_CICLFACT = 180621
order by cod_item

Se detecta inconsistencia entre suma de items en los ciclo de MAYO y JUNIO,


producto de las correcciones implementadas por la operadora.
Pero si sumamos los ajustes implementados por la operadora, casualmente suman $0.

(Revision realizada el Lunes 26 de Julio en BD RSCLPAN)

You might also like