Hi Kennedy,
I have tried your query and it doesn't work. Furthermore, our inv1.docentry does not equal to oinv.docnum. If I changed oinv.docnum to oinv.docentry, the total of VatSumSy will accumulate all the documents that has tax code of 'SR', 'DS' & 'AJS'.
Thanks & BR,
Leng