UPDATE VS4TTaxTrans Set TTxtBaseAmount=TTxTBaseAmount*-1,TTxtVATAmount=TTxTVATAmount*-1,TTxTFlag2=9898 WHERE TTxTType=0 AND (TTxTFlag2<>9898 or TTxTFlag2 is null)
GO
UPDATE VS4TTaxTrans Set TTxtCalcType=1 WHERE TTxTType=0 AND TTxTBaseAmount > 0
GO
UPDATE VS4TTaxTrans Set TTxtCalcType=-1 WHERE TTxTType=0 AND TTxTBaseAmount < 0
GO
UPDATE VS4TTaxTrans Set TTxtSubtotal=abs(TTxtSubtotal)*TTxtCalcType,TTxtGrandTotal=abs(TTxtGrandTotal)*TTxtCalcType,TTxtSignTaxAmount=abs(TTxtSignTaxAmount)*TTxtCalcType WHERE TTxTType=0 
GO