CREATE TABLE [dbo].[APQVoucherARTaxDetails]
(
[QVoucherID] [int] NOT NULL,
[DetailID] [int] NOT NULL,
[InvoiceTaxDetailID] [int] NOT NULL,
[ApplicationReceivablePayableDistID] [int] NOT NULL,
[VoucheredAmount] [money] NOT NULL CONSTRAINT [DF_APQVoucherARTaxDetails_VoucheredAmount] DEFAULT ((0)),
[VoucheredDistApplicationAmount] [money] NOT NULL CONSTRAINT [DF_APQVoucherARTaxDetails_VoucheredDistApplicationAmount] DEFAULT ((0)),
[DistApplicationAmount] [money] NOT NULL CONSTRAINT [DF_APQVoucherARTaxDetails_DistApplicationAmount] DEFAULT ((0)),
[Amount] [money] NOT NULL CONSTRAINT [DF_APQVoucherARTaxDetails_Amount] DEFAULT ((0)),
[DistTaxedAmount] [money] NOT NULL CONSTRAINT [DF_APQVoucherARTaxDetails_DistTaxedAmount] DEFAULT ((0)),
[DistNonTaxedAmount] [money] NOT NULL CONSTRAINT [DF_APQVoucherARTaxDetails_DistNonTaxedAmount] DEFAULT ((0)),
[TaxExemptCodeID] [int] NULL,
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UpdatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_APQVoucherARTaxDetails_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_APQVoucherARTaxDetails_LastUpdate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[APQVoucherARTaxDetails] ADD CONSTRAINT [PK_APQVoucherARTaxDetails] PRIMARY KEY CLUSTERED ([QVoucherID], [DetailID], [InvoiceTaxDetailID], [ApplicationReceivablePayableDistID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[APQVoucherARTaxDetails] ADD CONSTRAINT [FK_APQVoucherARTaxDetails_TaxExemptCodeID_SHTaxExemptCodes] FOREIGN KEY ([TaxExemptCodeID]) REFERENCES [dbo].[SHTaxExemptCodes] ([TaxExemptCodeID])
GO