CREATE TABLE VS4TARInvoiceP(
	TIvoNo nvarchar(30) NOT NULL,
	TIvoBalanceFlag tinyint NULL,
	TIvoType smallint NULL,
	TIvoTRBKCode nvarchar(30) NULL,
	TIvoTRCACode nvarchar(30) NULL,
	TIvoMode smallint NULL,
	TIvoDate datetime NULL,
	TIvoLoadingDate datetime NULL,
	TIvoStartAgingDate datetime NULL,
	TIvoDueDate datetime NULL,
	TIvoGLMethod smallint NULL,
	TIvoTGLTNo nvarchar(30) NULL,
	TIvoClientTaxNo nvarchar(30) NULL,
	TIvoBranchCode nvarchar(30) NULL,
	TIvoBranchName nvarchar(150) NULL,
	TIvoTaxNo nvarchar(30) NULL,
	TIvoRefNo nvarchar(30) NULL,
	TIvoRefDate datetime NULL,
	TIvoRefNo2 nvarchar(30) NULL,
	TIvoRefDate2 datetime NULL,
	TIvoRefNo3 nvarchar(30) NULL,
	TIvoRefNo4 nvarchar(60) NULL,
	TIvoPONo nvarchar(30) NULL,
	TIvoSOCode nvarchar(30) NULL,
	TIvoJobCode nvarchar(30) NULL,
	TIvoTJobNo nvarchar(30) NULL,
	TIvoTJbMLn int NULL,
	TIvoTARWCode nvarchar(30) NULL,
	TIvoTPrjCode nvarchar(30) NULL,
	TIvoTBraCode nvarchar(30) NULL,
	TIvoTEmpCode nvarchar(30) NULL,
	TIvoSaleName nvarchar(140) NULL,
	TIvoDeliveryDate datetime NULL,
	TIvoDeliveryTo nvarchar(255) NULL,
	TIvoTOTNLn int NULL,
	TIvoTARNCode nvarchar(30) NULL,
	TIvoTARDCode nvarchar(30) NULL,
	TIvoContactNote nvarchar(100) NULL,
	TIvoContactName nvarchar(160) NULL,
	TIvoCustomerName nvarchar(200) NULL,
	TIvoCusAddress nvarchar(255) NULL,
	TIvoCustomerName2 nvarchar(200) NULL,
	TIvoCusAddress2 nvarchar(255) NULL,
	TIvoConsignee nvarchar(255) NULL,
	TIvoNotifyParty nvarchar(255) NULL,
	TIvoCostTotal money NULL,
	TIvoPMCostTotal money NULL,
	TIvoPriceChannel smallint NULL,
	TIvoDiscountList money NULL,
	TIvoSubTotal money NULL,
	TIvoDiscountText nvarchar(30) NULL,
	TIvoDiscountTotal money NULL,
	TIvoNetTotal money NULL,
	TIvoDepositText nvarchar(30) NULL,
	TIvoDeposit money NULL,
	TIvoTotal money NULL,
	TIvoTotalFOB money NULL,
	TIvoTCurCode nvarchar(5) NULL,
	TIvoExchangeRate float NULL,
	TIvoExchangeRate2 float NULL,
	TIvoTotalInRate money NULL,
	TIvoVATType smallint NULL,
	TIvoVATRate real NULL,
	TIvoTaxBase money NULL,
	TIvoVATTotal money NULL,
	TIvoGrandTotal money NULL,
	TIvoNOTAXTotal money NULL,
	TIvoWTaxBase money NULL,
	TIvoWTaxRate real NULL,
	TIvoWTaxTotal money NULL,
	TIvoLastPayDate datetime NULL,
	TIvoNetPayment money NULL,
	TIvoManualArrear tinyint NULL,
	TIvoBaseArrears money NULL,
	TIvoArrears money NULL,
	TIvoIgnoreArrears smallint NULL,
	TIvoAdjustTotal money NULL,
	TIvoBaseAvailable money NULL,
	TIvoAvailable money NULL,
	TIvoRewardTotal money NULL,
	TIvoPremiumTotal money NULL,
	TIvoCommissionBase money NULL,
	TIvoCommissionRate nvarchar(30) NULL,
	TIvoCommission money NULL,
	TIvoBaseIncoType nvarchar(3) NULL,
	TIvoIncoType nvarchar(3) NULL,
	TIvoIncoTerms nvarchar(50) NULL,
	TIvoOtherFee money NULL,
	TIvoTransportFee money NULL,
	TIvoHandlingFee money NULL,
	TIvoFreightFee money NULL,
	TIvoInsurance money NULL,
	TIvoTransportDesc money NULL,
	TIvoDuty money NULL,
	TIvoShipBy nvarchar(255) NULL,
	TIvoCountryOrigin nvarchar(50) NULL,
	TIvoDestination nvarchar(255) NULL,
	TIvoCondition nvarchar(100) NULL,
	TIvoConditionDay smallint NULL,
	TIvoCondition1 real NULL,
	TIvoConditionDay1 smallint NULL,
	TIvoTShpCode nvarchar(30) NULL,
	TIvoTRouCode nvarchar(30) NULL,
	TIvoDeliveryCond smallint NULL,
	TIvoCustom1 nvarchar(30) NULL,
	TIvoCustom2 nvarchar(30) NULL,
	TIvoCustom3 nvarchar(30) NULL,
	TIvoCustom4 nvarchar(255) NULL,
	TIvoCustom5 nvarchar(255) NULL,
	TIvoCustom6 nvarchar(30) NULL,
	TIvoCustomNo nvarchar(30) NULL,
	TIvoCustomDate datetime NULL,
	TIvoCartonName nvarchar(30) NULL,
	TIvoTotalQuantity float NULL,
	TIvoTotalCarton float NULL,
	TIvoTotalNW float NULL,
	TIvoTotalGW float NULL,
	TIvoTotalVolumeM float NULL,
	TIvoDayAvailable smallint NULL,
	TIvoPaymentNote nvarchar(200) NULL,
	TIvoStatementNote nvarchar(200) NULL,
	TIvoPackingNote nvarchar(200) NULL,
	TIvoDeliveryNote nvarchar(200) NULL,
	TIvoNote nvarchar(255) NULL,
	TIvoDescription nvarchar(4000) NULL,
	TIvoTPOSCode nvarchar(50) NULL,
	TIvoTSOTCode nvarchar(50) NULL,
	TIvoDeliveryStatus smallint NULL,
	TIvoBillStatus smallint NULL,
	TIvoCardStatus smallint NULL,
	TIvoCardFlag smallint NULL,
	TIvoTaxFlag smallint NULL,
	TIvoReceiptStatus smallint NULL,
	TIvoInvoiceStatus smallint NULL,
	TIvoCNStatus smallint NULL,
	TIvoBoxList nvarchar(60) NULL,
	TIvoCreateBy nvarchar(140) NULL,
	TIvoCreateDate datetime NULL,
	TIvoEditCode nvarchar(30) NULL,
	TIvoEditBy nvarchar(140) NULL,
	TIvoEditDate datetime NULL,
	TIvoConfirmStatus smallint NULL,
	TIvoConfirmBy nvarchar(140) NULL,
	TIvoConfirmDate datetime NULL,
	TIvoApproveStatus smallint NULL,
	TIvoApproveBy nvarchar(140) NULL,
	TIvoApproveDate datetime NULL,
	TIvoApproveNote nvarchar(80) NULL,
	TIvoRevision smallint NULL,
	TIvoCancelStatus smallint NULL,
	TIvoCancelBy nvarchar(140) NULL,
	TIvoCancelDate datetime NULL,
	TIvoCancelNote nvarchar(80) NULL,
	TIvoFlag1 smallint NULL,
	TIvoFlag2 smallint NULL,
	TIvoFlag3 datetime NULL
	)  ON [PRIMARY]
GO
ALTER TABLE VS4TARInvoiceP ADD CONSTRAINT
	PK_VS4TARInvoiceP PRIMARY KEY CLUSTERED 
	(
	TIvoNo
	) ON [PRIMARY]

GO


