update vs4tarinvoice set tivomode=1 where tivovattype=0 and tivomode  is null
GO
update vs4tarinvoice set tivomode=0 where tivovattype<>0 and tivomode is null
GO
update vs4tarcreditnote set trcnmode=1 where trcnvattype=0 and trcnmode  is null
GO
update vs4tarcreditnote set trcnmode=0 where trcnvattype<>0 and trcnmode is null
GO
update vs4tardebitnote set TDBNmode=1 where TDBNvattype=0 and TDBNmode  is null
GO
update vs4tardebitnote set TDBNmode=0 where TDBNvattype<>0 and TDBNmode is null
GO
update vs4tapinvoice set tiapmode=1 where tiapvattype=0 and tiapmode  is null
GO
update vs4tapinvoice set tiapmode=0 where tiapvattype<>0 and tiapmode is null
GO
update vs4tapcreditnote set tpcnmode=1 where tpcnvattype=0 and tpcnmode  is null
GO
update vs4tapcreditnote set tpcnmode=0 where tpcnvattype<>0 and tpcnmode is null
GO
update vs4tapdebitnote set TDENMode=1 where TDENvattype=0 and TDENmode  is null
GO
update vs4tapdebitnote set TDENmode=0 where TDENvattype<>0 and TDENmode is null
GO