[fix] Get exchange rate as 1 if same currency
This commit is contained in:
parent
e1f8b1d695
commit
0f5d97a156
@ -63,6 +63,9 @@ def before_tests():
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_exchange_rate(from_currency, to_currency):
|
||||
if from_currency == to_currency:
|
||||
return 1
|
||||
|
||||
exchange = "%s-%s" % (from_currency, to_currency)
|
||||
value = flt(frappe.db.get_value("Currency Exchange", exchange, "exchange_rate"))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user