where
(([Sales Margin Local Currency]/[Sales Without Tax Local Currency])>=0.9 or ([Sales Margin Local Currency]/[Sales Without Tax Local Currency])<0.1)
and [Sales Without Tax Local Currency]!=0
and ri.BillingRule not in ('5','6') -- 2013.01.02 EN / req by solman 8888811700
and right(p.productID,9) not in ('900002181','900002182')