fix: GL values in transaction currency via JV (#38914)
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 729bb67..13df9d5 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -922,7 +922,7 @@
# Update details in transaction currency
gl_dict.update(
{
- "transaction_currency": self.get("currency") or self.company_currency,
+ "transaction_currency": args.get("currency") or self.get("currency") or self.company_currency,
"transaction_exchange_rate": self.get("conversion_rate", 1),
"debit_in_transaction_currency": self.get_value_in_transaction_currency(
account_currency, args, "debit"
@@ -955,10 +955,10 @@
return self.doctype
def get_value_in_transaction_currency(self, account_currency, args, field):
- if account_currency == self.get("currency"):
+ if account_currency == args.get("currency") or self.get("currency"):
return args.get(field + "_in_account_currency")
else:
- return flt(args.get(field, 0) / self.get("conversion_rate", 1))
+ return flt(args.get(field, 0) / (args.get("conversion_rate") or self.get("conversion_rate", 1)))
def validate_qty_is_not_zero(self):
if self.doctype == "Purchase Receipt":