FIX Discount->getSavingsForOrder sql to be postgres compatible