Arthur Schopenhauer said this quote

Now this was possible only by a man determining himself entirely *rationally* according to concepts, not according to changing impressions and moods. But as only the maxims of our conduct, not the consequences or circumstances, are in our power, to be capable of always remaining consistent we must take as our object only the maxims, not the consequences and circumstances, and thus the doctrine of virtue is again introduced.”—from_The World as Will and Representation_. Translated from the German by E. F. J. Paye in two volumes: volume I, p. 89