ALTER TABLE VS4TAPInvoiceADJ ADD
	TIPJWTAXBase money NULL,
	TIPJVATType smallint NULL,
	TIPJTotal money NULL,
	TIPJTotalInRate money NULL,
	TIPJNetTotal money NULL,
	TIPJDepositText nvarchar(30) NULL,
	TIPJDiscountText nvarchar(30) NULL
GO

UPDATE VS4TAPInvoiceADJ Set TIPJWTAXBase=TIPJTaxBase ,TIPJVATType=TIPJDepositVAT,TIPJTotal=TIPJGrandTotalVAT, TIPJTotalInRate=TIPJFirstPayment, TIPJNetTotal=TIPJWTAXRate
GO
UPDATE VS4TAPInvoiceADJ Set TIPJFlag2=TIPJIncoType
GO
ALTER TABLE VS4TAPInvoiceADJ
	DROP COLUMN TIPJIncoType
GO
DROP INDEX VS4TAPInvoiceADJ.TFliCreateCode
GO
DROP INDEX VS4TAPInvoiceADJ.TFliEditBy
GO
DROP INDEX VS4TAPInvoiceADJ.TFliEditCode
GO
ALTER TABLE VS4TAPInvoiceADJ
	DROP COLUMN TIPJCreateCode,TIPJCreateBy,TIPJCreateDate,TIPJEditCode,TIPJEditBy,TIPJEditDate,TIPJConfirmBy,TIPJConfirmDate,TIPJApproveBy,TIPJApproveDate,TIPJApproveNote,TIPJCancelNo,TIPJCancelBy,TIPJCancelDate,TIPJCancelNote
GO
ALTER TABLE VS4TAPInvoiceADJ ADD
	TIPJIncoType nvarchar(3) NULL
GO
UPDATE VS4TAPInvoiceADJ Set TIPJIncoType='FOB' WHERE TIPJFlag2=0
GO
UPDATE VS4TAPInvoiceADJ Set TIPJIncoType='CIF' WHERE TIPJFlag2=1
GO
UPDATE VS4TAPInvoiceADJ Set TIPJIncoType='CFR' WHERE TIPJFlag2=2
GO
UPDATE VS4TAPInvoiceADJ Set TIPJIncoType='EXW' WHERE TIPJFlag2=3
GO
