Fixes and patch for Currency Exchange based on date
This commit is contained in:
@@ -128,9 +128,9 @@ class AccountsController(TransactionBase):
|
||||
|
||||
def set_price_list_currency(self, buying_or_selling):
|
||||
if self.meta.get_field("posting_date"):
|
||||
translation_date = self.posting_date
|
||||
transaction_date = self.posting_date
|
||||
else:
|
||||
translation_date = self.transaction_date
|
||||
transaction_date = self.transaction_date
|
||||
|
||||
if self.meta.get_field("currency"):
|
||||
# price list part
|
||||
@@ -144,7 +144,7 @@ class AccountsController(TransactionBase):
|
||||
self.plc_conversion_rate = 1.0
|
||||
|
||||
elif not self.plc_conversion_rate:
|
||||
self.plc_conversion_rate = get_exchange_rate(translation_date,
|
||||
self.plc_conversion_rate = get_exchange_rate(transaction_date,
|
||||
self.price_list_currency, self.company_currency)
|
||||
|
||||
# currency
|
||||
@@ -154,7 +154,7 @@ class AccountsController(TransactionBase):
|
||||
elif self.currency == self.company_currency:
|
||||
self.conversion_rate = 1.0
|
||||
elif not self.conversion_rate:
|
||||
self.conversion_rate = get_exchange_rate(translation_date, self.currency,
|
||||
self.conversion_rate = get_exchange_rate(transaction_date, self.currency,
|
||||
self.company_currency)
|
||||
|
||||
def set_missing_item_details(self, for_validate=False):
|
||||
|
||||
Reference in New Issue
Block a user