Hi,
Try this :
select (t1.LineTotal + (SELECT sum(TAXSUM) from INV4 where DocEntry = t1.DocEntry and LineNum = t1.LineNum and staType in ('8','9','10','11') group by DocEntry,LineNum )) as assvalue from INV1 t1 inner join OINV t0 on t0.DocEntry = $[INV1.DocEntry] where t0.DocNum = '100320'
Thanks & Regards,
Nagarajan