mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
unconditionally fetch exchange rate
This commit is contained in:
@@ -10,6 +10,7 @@ from erpnext.accounts.doctype.pricing_rule.pricing_rule import get_pricing_rule_
|
|||||||
from erpnext.setup.utils import get_exchange_rate
|
from erpnext.setup.utils import get_exchange_rate
|
||||||
from frappe.model.meta import get_field_precision
|
from frappe.model.meta import get_field_precision
|
||||||
from erpnext.stock.doctype.batch.batch import get_batch_no
|
from erpnext.stock.doctype.batch.batch import get_batch_no
|
||||||
|
from erpnext import get_company_currency
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@@ -589,13 +590,11 @@ def get_price_list_currency_and_exchange_rate(args):
|
|||||||
|
|
||||||
price_list_currency = get_price_list_currency(args.price_list)
|
price_list_currency = get_price_list_currency(args.price_list)
|
||||||
price_list_uom_dependant = get_price_list_uom_dependant(args.price_list)
|
price_list_uom_dependant = get_price_list_uom_dependant(args.price_list)
|
||||||
plc_conversion_rate = args.plc_conversion_rate
|
plc_conversion_rate = 1
|
||||||
|
company_currency = get_company_currency(args.company)
|
||||||
|
|
||||||
if (not plc_conversion_rate) or (price_list_currency and args.price_list_currency \
|
if company_currency:
|
||||||
and price_list_currency != args.price_list_currency):
|
plc_conversion_rate = get_exchange_rate(price_list_currency, company_currency, args.transaction_date)
|
||||||
# cksgb 19/09/2016: added args.transaction_date as posting_date argument for get_exchange_rate
|
|
||||||
plc_conversion_rate = get_exchange_rate(price_list_currency, args.currency,
|
|
||||||
args.transaction_date) or plc_conversion_rate
|
|
||||||
|
|
||||||
return frappe._dict({
|
return frappe._dict({
|
||||||
"price_list_currency": price_list_currency,
|
"price_list_currency": price_list_currency,
|
||||||
|
|||||||
Reference in New Issue
Block a user