ALTER TABLE Puc ADD ListarConc VARCHAR(4) DEFAULT('0'),ReqAutorizac BIT DEFAULT(0)
GO
ALTER TABLE Diarios ADD CodTransac VARCHAR(10)
GO
ALTER TABLE Trn_Comprobantes ADD CdSustento VARCHAR(4),Tipo_Pago VARCHAR(10)
GO
ALTER TABLE Trn_ComDetalle ADD CdConcTrib VARCHAR(4),CdTarifTrib VARCHAR(4)
,NumEstablec VARCHAR(20),PtoEmision VARCHAR(20),Num_Autoriza VARCHAR(50),FechAutoriza SMALLDATETIME
GO
ALTER TABLE tm_Comp ADD tmConcTrib VARCHAR(4),tmTarifTrib VARCHAR(4)
,tmEstablec VARCHAR(20),tmPtoEmision VARCHAR(20),tmAutoriza VARCHAR(50),tmFechAut SMALLDATETIME
GO
ALTER TABLE tm_Compau ADD tmConcTrib VARCHAR(4),tmTarifTrib VARCHAR(4)
,tmEstablec VARCHAR(20),tmPtoEmision VARCHAR(20),tmAutoriza VARCHAR(50),tmFechAut SMALLDATETIME
GO
CREATE TABLE ConceptosTrib ( 
IdConcepto VARCHAR(4) NOT NULL,
Concepto VARCHAR(250) NOT NULL,
CodigoConc VARCHAR(10) NOT NULL,
IdClase VARCHAR(4) NOT NULL,
CdTarifa VARCHAR(4),
Inactivo BIT DEFAULT ((0)) NOT NULL
 CONSTRAINT PK_ConceptosTrib PRIMARY KEY CLUSTERED (IdConcepto),
 CONSTRAINT CK_ConceptosTribCodigoConc CHECK ((len([CodigoConc])>(0))),
 CONSTRAINT CK_ConceptosTribConcepto CHECK ((len([Concepto])>(0))),
 CONSTRAINT CK_ConceptosTribIdClase CHECK ((len([IdClase])>(0))),
 CONSTRAINT CK_ConceptosTribIdConcepto CHECK ((len([IdConcepto])>(0))))
GO
CREATE TABLE TiposComFmt ( 
IdCom VARCHAR(3) NOT NULL,
IdForma CHAR(2) NOT NULL,
Descripcion VARCHAR(100) NOT NULL,
Formato VARCHAR(20) NOT NULL,
Predtmnado BIT DEFAULT ((0)) NOT NULL,
TipoPapel INT DEFAULT ((1)) NOT NULL,
Orientacion INT DEFAULT ((1)) NOT NULL,
VistaPrevia BIT DEFAULT ((0)) NOT NULL,
VerSetup BIT DEFAULT ((0)) NOT NULL,
NumCopias INT DEFAULT ((1)) NOT NULL,
sp_Nombre VARCHAR(50),
Ind_Location VARCHAR(50)
 CONSTRAINT PK_TiposComFmt PRIMARY KEY CLUSTERED (IdCom,IdForma),
 CONSTRAINT CK_TiposComFmtDescripcion CHECK ((len([Descripcion])>(0))),
 CONSTRAINT CK_TiposComFmtFormato CHECK ((len([Formato])>(0))),
 CONSTRAINT CK_TiposComFmtIdCom CHECK ((len([IdCom])>(0))),
 CONSTRAINT CK_TiposComFmtIdForma CHECK ((len([IdForma])>(0))))
GO
CREATE TABLE TiposSustento ( 
IdSustento VARCHAR(4) NOT NULL,
Sustento VARCHAR(150) NOT NULL,
Inactivo BIT DEFAULT ((0)) NOT NULL
 CONSTRAINT PK_TiposSustento PRIMARY KEY CLUSTERED (IdSustento),
 CONSTRAINT CK_TiposSustentoIdSustento CHECK ((len([IdSustento])>(0))),
 CONSTRAINT CK_TiposSustentoSustento CHECK ((len([Sustento])>(0))))
GO
ALTER TABLE ConceptosTrib ADD 
 CONSTRAINT FK_ConceptosTrib_ClaseTar FOREIGN KEY (IdClase) REFERENCES [dbo].[ClaseTar] (IdClase)
ALTER TABLE TiposComFmt ADD 
 CONSTRAINT FK_TiposComFmt_TiposCom FOREIGN KEY (IdCom) REFERENCES [dbo].[TiposCom] (IdCom)
