Fixed the computing of payment_rate and payment_rate_currency_id…

To replace #1915