How is the «Apply Discount On Prices» («Excluding Tax» / «Including Tax») option handled?

How to setup the «Apply Customer Tax» option in accordance with the Russian tax law?