/*==============================================================*/
/* DBMS name:      ORACLE Version 9i                            */
/* Created on:     12/12/2007 01:48:28 p.m.                     */
/*==============================================================*/


/*==============================================================*/
/* View: CXP_DET_MOV_PAGO                                       */
/*==============================================================*/
CREATE OR REPLACE VIEW CXP_DET_MOV_PAGO AS
SELECT A."COD_CIA", B."COD_PROVEEDOR", A."SUCURSAL", A."TIP_DOC", A."NUM_DOC", A."SUCURSAL_REF", 
       B."FEC_DOC", A."TIP_DOC_REF", A."NUM_DOC_REF", A."MON_PAGO", B."NUM_ASIENTO", 
       A."MON_DESCUENTO", A."INTERES", A."INT_MORA", B."COD_MONEDA", B."DOC_REF"
FROM CXP_DET_PAGO_NOTA A, CXP_ENC_PAGO_NOTA B
WHERE A."COD_CIA" = B."COD_CIA"
  AND A."SUCURSAL_REF" = B."SUCURSAL" 
  AND A."TIP_DOC_REF" = B."TIP_DOC"
  AND A."NUM_DOC_REF" = B."NUM_DOC"
  AND B."ESTADO" = 'A';

/*==============================================================*/
/* View: CXP_LIQUIDACION                                        */
/*==============================================================*/
CREATE OR REPLACE VIEW CXP_LIQUIDACION AS
SELECT A."COD_CIA", B."COD_PROVEEDOR", A."SUCURSAL", A."TIP_DOC", A."NUM_DOC", A."SUCURSAL_REF", A."TIP_DOC_REF", A."NUM_DOC_REF", A."MON_PAGO", B."FEC_DOC", B."NUM_ASIENTO", A."MON_DESCUENTO", A."INTERES", A."INT_MORA", B."COD_MONEDA", B."DOC_REF"
FROM CXP_DET_PAGO_NOTA A, CXP_ENC_PAGO_NOTA B
WHERE A."COD_CIA" = B."COD_CIA" AND A."SUCURSAL" = B."SUCURSAL" AND A."TIP_DOC" = B."TIP_DOC" AND A."NUM_DOC" = B."NUM_DOC" AND B."ESTADO" = 'A' AND B."TIP_DOC_REF" IS NOT NULL;

/*==============================================================*/
/* View: CXP_OBLIG_VIEW                                         */
/*==============================================================*/
CREATE OR REPLACE VIEW CXP_OBLIG_VIEW AS
SELECT O."COD_CIA", O."SUCURSAL", O."TIP_DOC", O."NUM_DOC", O."NUM_PARTE", M."COD_PROVEEDOR", O."FEC_VENCE", O."MON_PAGO", O."MON_SALDO", M."COD_MONEDA"
FROM CXP_OBLIGACION O, CXP_ENC_MOVIMIENTO M
WHERE O."COD_CIA" = M."COD_CIA" AND O."SUCURSAL" = M."SUCURSAL" AND O."TIP_DOC" = M."TIP_DOC" AND O."NUM_DOC" = M."NUM_DOC" AND M."ESTADO" = 'A';

