Merge pull request #39366 from frappe/revert-38914-multi_currency_ledger_jv_pe
Revert "fix: GL values in transaction currency via JV"
This commit is contained in:
commit
5fc29ac913
@ -1031,10 +1031,6 @@ class JournalEntry(AccountsController):
|
|||||||
|
|
||||||
def build_gl_map(self):
|
def build_gl_map(self):
|
||||||
gl_map = []
|
gl_map = []
|
||||||
conversion_rate_map = self.get_conversion_rate_map()
|
|
||||||
transaction_currency_map = self.get_transaction_currency_map()
|
|
||||||
company_currency = erpnext.get_company_currency(self.company)
|
|
||||||
|
|
||||||
self.get_against_accounts()
|
self.get_against_accounts()
|
||||||
for d in self.get("accounts"):
|
for d in self.get("accounts"):
|
||||||
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
|
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
|
||||||
@ -1064,12 +1060,6 @@ class JournalEntry(AccountsController):
|
|||||||
"cost_center": d.cost_center,
|
"cost_center": d.cost_center,
|
||||||
"project": d.project,
|
"project": d.project,
|
||||||
"finance_book": self.finance_book,
|
"finance_book": self.finance_book,
|
||||||
"conversion_rate": conversion_rate_map.get(d.against_account_link, 1)
|
|
||||||
if d.account_currency == company_currency
|
|
||||||
else 1,
|
|
||||||
"currency": transaction_currency_map.get(d.against_account_link, d.account_currency)
|
|
||||||
if d.account_currency == company_currency
|
|
||||||
else d.account_currency,
|
|
||||||
},
|
},
|
||||||
item=d,
|
item=d,
|
||||||
)
|
)
|
||||||
@ -1119,20 +1109,6 @@ class JournalEntry(AccountsController):
|
|||||||
|
|
||||||
return gl_map
|
return gl_map
|
||||||
|
|
||||||
def get_transaction_currency_map(self):
|
|
||||||
transaction_currency_map = {}
|
|
||||||
for account in self.get("accounts"):
|
|
||||||
transaction_currency_map.setdefault(account.party or account.account, account.account_currency)
|
|
||||||
|
|
||||||
return transaction_currency_map
|
|
||||||
|
|
||||||
def get_conversion_rate_map(self):
|
|
||||||
conversion_rate_map = {}
|
|
||||||
for account in self.get("accounts"):
|
|
||||||
conversion_rate_map.setdefault(account.party or account.account, account.exchange_rate)
|
|
||||||
|
|
||||||
return conversion_rate_map
|
|
||||||
|
|
||||||
def make_gl_entries(self, cancel=0, adv_adj=0):
|
def make_gl_entries(self, cancel=0, adv_adj=0):
|
||||||
from erpnext.accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
|
|
||||||
|
@ -930,7 +930,7 @@ class AccountsController(TransactionBase):
|
|||||||
# Update details in transaction currency
|
# Update details in transaction currency
|
||||||
gl_dict.update(
|
gl_dict.update(
|
||||||
{
|
{
|
||||||
"transaction_currency": args.get("currency") or self.get("currency") or self.company_currency,
|
"transaction_currency": self.get("currency") or self.company_currency,
|
||||||
"transaction_exchange_rate": self.get("conversion_rate", 1),
|
"transaction_exchange_rate": self.get("conversion_rate", 1),
|
||||||
"debit_in_transaction_currency": self.get_value_in_transaction_currency(
|
"debit_in_transaction_currency": self.get_value_in_transaction_currency(
|
||||||
account_currency, args, "debit"
|
account_currency, args, "debit"
|
||||||
@ -969,10 +969,10 @@ class AccountsController(TransactionBase):
|
|||||||
return self.doctype
|
return self.doctype
|
||||||
|
|
||||||
def get_value_in_transaction_currency(self, account_currency, args, field):
|
def get_value_in_transaction_currency(self, account_currency, args, field):
|
||||||
if account_currency == args.get("currency") or self.get("currency"):
|
if account_currency == self.get("currency"):
|
||||||
return args.get(field + "_in_account_currency")
|
return args.get(field + "_in_account_currency")
|
||||||
else:
|
else:
|
||||||
return flt(args.get(field, 0) / (args.get("conversion_rate") or self.get("conversion_rate", 1)))
|
return flt(args.get(field, 0) / self.get("conversion_rate", 1))
|
||||||
|
|
||||||
def validate_qty_is_not_zero(self):
|
def validate_qty_is_not_zero(self):
|
||||||
for item in self.items:
|
for item in self.items:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user