makes set_exchange_rate retrieve the latest exchange rate not average for "pay" and "internal transfer" payment entries

This commit is contained in:
tunde 2017-06-08 20:54:01 +01:00
parent 6148fe0909
commit 9b827e5b95

View File

@ -149,8 +149,6 @@ class PaymentEntry(AccountsController):
if self.paid_from and not self.source_exchange_rate: if self.paid_from and not self.source_exchange_rate:
if self.paid_from_account_currency == self.company_currency: if self.paid_from_account_currency == self.company_currency:
self.source_exchange_rate = 1 self.source_exchange_rate = 1
elif self.payment_type in ("Pay", "Internal Transfer"):
self.source_exchange_rate = get_average_exchange_rate(self.paid_from)
else: else:
self.source_exchange_rate = get_exchange_rate(self.paid_from_account_currency, self.source_exchange_rate = get_exchange_rate(self.paid_from_account_currency,
self.company_currency, self.posting_date) self.company_currency, self.posting_date)