SUM(Case when type is invoice then {amount} else 0...
# suitescript
a
SUM(Case when type is invoice then {amount} else 0 end)