update vs4tteasuryTransMB set tttmmode=0 where tttmmode is null
update vs4tteasuryTransMB set tttmmode=1 where tttmmode =2 and tttmcutmode=0
update VS4VTeasuryTrans set tttmmode=1 where tttmmode =2 and ttetsavefrom='DE' and tttmcutmode=1
update vs4tteasuryTransMB set tttmchequeStatus=(select tchrchqstatus from vs4tchequerec where tchrno=tttmchequeno) where tttmchequeno is not null and tttmmode=1

update vs4treceivevoucher set trvhttetno=(select top 1 ttetno from vs4tteasurytrans where ttetsavefrom='RV' AND ttetcancelstatus<>1 and ttetrefno=trvhno)

update vs4tteasuryTransMB set tttmchequeno=(select top 1 TCHRNo from VS4VChequeRec where TTTMTTeTNo=TRVHTTeTNo and TTTMLn=TRVRLn and trvhcancelstatus<>1)
where TTTMMode=1
