ALTER TABLE VS4TPOSTrans ADD
	TPTADiscountText nvarchar(30) NULL,
	TPTADepositText nvarchar(30) NULL,
	TPTAWTAXBase money NULL,
	TPTAVATType smallint NULL,
	TPTAVATRate float(53) NULL,
	TPTATotal money NULL,
	TPTATotalInRate money NULL,
	TPTANetTotal money NULL
GO
UPDATE VS4TPOSTrans Set TPTAVATRate=TPTAVATPercent,TPTAWTAXBase=TPTATaxBase ,TPTAVATType=2,TPTATotal=TPTAGrandTotalVAT, TPTATotalInRate=TPTAFirstPayment, TPTANetTotal=TPTAWTAXRate
GO

UPDATE VS4TPOSTrans SET TPTADepositText=replace(''+convert(char(20),round(TPTADepositRate,2)),' ','') where TPTADepositRate > 0
GO
UPDATE VS4TPOSTrans SET TPTADepositText=TPTADepositText+'%' WHERE TPTADepositText<>''
GO

UPDATE VS4TPOSTrans SET TPTADiscountText=replace(''+convert(char(20),round(TPTADiscountPC,2)),' ','') where TPTADiscountPC > 0
GO
UPDATE VS4TPOSTrans SET TPTADiscountText=TPTADiscountText+'%' WHERE TPTADiscountText<>''
GO
UPDATE VS4TPOSTrans SET TPTADiscountText=TPTADiscountText+'+'+replace(''+convert(char(20),round(TPTADiscountFix,2)),' ','') where TPTADiscountFix > 0
GO

ALTER TABLE VS4TPOSTrans
	DROP COLUMN TPTAIncoType, TPTAInsurance, TPTAFreightFee, TPTAOtherFee, TPTATransportFee, TPTACountryOrigin
GO
