fix: multi-currency issue
This commit is contained in:
parent
470c7e773f
commit
4acbeecbbe
@ -713,7 +713,8 @@ def get_bom_item_rate(args, bom_doc):
|
||||
"conversion_rate": 1, # Passed conversion rate as 1 purposefully, as conversion rate is applied at the end of the function
|
||||
"conversion_factor": args.get("conversion_factor") or 1,
|
||||
"plc_conversion_rate": 1,
|
||||
"ignore_party": True
|
||||
"ignore_party": True,
|
||||
"ignore_conversion_rate": True
|
||||
})
|
||||
item_doc = frappe.get_cached_doc("Item", args.get("item_code"))
|
||||
out = frappe._dict()
|
||||
|
@ -441,7 +441,7 @@ def get_item_tax_info(company, tax_category, item_codes, item_rates=None, item_t
|
||||
|
||||
if item_tax_templates is None:
|
||||
item_tax_templates = {}
|
||||
|
||||
|
||||
if item_rates is None:
|
||||
item_rates = {}
|
||||
|
||||
@ -807,10 +807,14 @@ def check_packing_list(price_list_rate_name, desired_qty, item_code):
|
||||
def validate_conversion_rate(args, meta):
|
||||
from erpnext.controllers.accounts_controller import validate_conversion_rate
|
||||
|
||||
if (not args.conversion_rate
|
||||
and args.currency==frappe.get_cached_value('Company', args.company, "default_currency")):
|
||||
company_currency = frappe.get_cached_value('Company', args.company, "default_currency")
|
||||
if (not args.conversion_rate and args.currency==company_currency):
|
||||
args.conversion_rate = 1.0
|
||||
|
||||
if (not args.ignore_conversion_rate and args.conversion_rate == 1 and args.currency!=company_currency):
|
||||
args.conversion_rate = get_exchange_rate(args.currency,
|
||||
company_currency, args.transaction_date, "for_buying") or 1.0
|
||||
|
||||
# validate currency conversion rate
|
||||
validate_conversion_rate(args.currency, args.conversion_rate,
|
||||
meta.get_label("conversion_rate"), args.company)
|
||||
|
Loading…
x
Reference in New Issue
Block a user