Create or replace Package DistCon is

   Function Tabla(pcia in varchar2, psis in varchar2) return varchar2;
   Function TablaDet(pTabla in varchar2) return varchar2;
   Function Vista(pTabla in varchar2) return varchar2;
   Function Consecutivo(pcia in varchar2, psis in varchar2) return number;
   Procedure Encabezado(pcia in varchar2, psis in varchar2, fecha in date,
                        descr in varchar2, porigen in varchar2, pmoneda in varchar2,
                        ptipcambio in number, pcambiobase in number,
                        pclase in varchar2, numdist in out number);
   Procedure Detalle(pcta in varchar2, pcco in varchar2, descr in varchar2,
                     pref in varchar2, pdeb in number, pcre in number);
   Procedure ChequearConsistencia(pSuc in Varchar2,pProv in Varchar2,pDoc in Varchar2,
     				  pOri in Varchar2,pClase in Varchar2,pAcreedor in Varchar2,
      				  pDocRef in Varchar2, pFecha in Date, pDistr in Number, 
   				  pObsrv in Varchar2,pEstado in Char);
   Function  EstadoTrans(pCia in Char, pSis in Varchar2, pDis in Number, 
			 pOri in Varchar2,pClase in Varchar2) Return Char;
   Function  TransAplicada(pCia in Char, pSis in Varchar2, pDis in Number, 
			 pOri in Varchar2,pClase in Varchar2) Return Boolean;
   Procedure PaqTransInco(pCia in Char, pSis in Varchar2, pFecIni in Date, 
			pFecFin in Date,pOri in Varchar2,pClase in Varchar2);
   Procedure Totales(plins in out number, pdebs in out number, pcres in out number);
   Procedure Datos(pcia in varchar2, psis in varchar2, pdis in number, pest out varchar2,
                   pmon out varchar2, pasi out varchar2, pdeb out number, pcre out number, 
                   pdebbas out number, pcrebas out number);
   Function Estado(pcia in varchar2, psis in varchar2, pdis in number) return varchar2;
   Procedure Resumen(pPiv in varchar2 default 'U');
   Procedure AsientoTemporal(pcia in varchar2, psis in varchar2, pmoneda in varchar2,
                     poriini in varchar2, porifin in varchar2,
                     pclaini in varchar2, pclafin in varchar2,
                     pfecini in date, pfecfin in date, pdisini in number,
                     pdisfin in number,pivote in varchar2,
                     pivasi in varchar2,
                     pcolfec in varchar2 default 'm.fecha');
   Procedure Anular(pcia in varchar2, psis in varchar2, poriini in varchar2,
                    porifin in varchar2, pclaini in varchar2, pclafin in varchar2,
                    pfecini in date, pfecfin in date,
                    pdisini in number, pdisfin in number);
   Procedure Activar(pcia in varchar2, psis in varchar2, poriini in varchar2,
                    porifin in varchar2, pclaini in varchar2, pclafin in varchar2,
                    pfecini in date, pfecfin in date,
                    pdisini in number, pdisfin in number);
   Procedure Reversar(pcia in varchar2, psis in varchar2,
                      poriini in varchar2, porifin in varchar2,
                      pasiini in varchar2, pasifin in varchar2);                          
   Procedure AsientoFinal(pcia in varchar2, psis in varchar2,
                          pasitmp in varchar2, pasifin in varchar2,
                          pperiodo in number);
   Procedure IniMonBase(pMonBase in Varchar2);

   Procedure PaqDatosTrans(pCia in Char, pSis in Varchar2, pSucursal in Varchar2, pDoc in Varchar2, 
                           pLlave1 in Varchar2, pLlave2 in Varchar2, pDocRef in Varchar2, 
                           pOrigen in Varchar2, pClase in Varchar2, pDocSal out Varchar2, 
                           pMoneda out Varchar2, pTipCambio out Number, pCambioBase out Number);

   Procedure PaqActDistrTrans(pCia in Char, pSis in Varchar2, pSucursal in Varchar2, pDoc in Varchar2, 
                              pLlave1 in Varchar2, pLlave2 in Varchar2, pDocRef in Varchar2, 
                              pOrigen in Varchar2, pClase in Varchar2, pDist in Number);

   Procedure AsientoReversar(pCia in Char, pSis in Varchar2, pDist in Number);

End DistCon;
/
