mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
refactor: isolate to specific doctypes
(cherry picked from commit b348aa3b37)
This commit is contained in:
@@ -1119,20 +1119,19 @@ class AccountsController(TransactionBase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Update details in transaction currency
|
# Update details in transaction currency
|
||||||
gl_dict.update(
|
if self.doctype not in ["Purchase Invoice", "Sales Invoice", "Journal Entry", "Payment Entry"]:
|
||||||
{
|
gl_dict.update(
|
||||||
"transaction_currency": self.get("currency") or self.company_currency,
|
{
|
||||||
"transaction_exchange_rate": item.get("exchange_rate", 1)
|
"transaction_currency": self.get("currency") or self.company_currency,
|
||||||
if self.doctype == "Journal Entry" and item
|
"transaction_exchange_rate": self.get("conversion_rate", 1),
|
||||||
else 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, gl_dict, "debit"
|
||||||
account_currency, gl_dict, "debit"
|
),
|
||||||
),
|
"credit_in_transaction_currency": self.get_value_in_transaction_currency(
|
||||||
"credit_in_transaction_currency": self.get_value_in_transaction_currency(
|
account_currency, gl_dict, "credit"
|
||||||
account_currency, gl_dict, "credit"
|
),
|
||||||
),
|
}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
|
|
||||||
if not args.get("against_voucher_type") and self.get("against_voucher_type"):
|
if not args.get("against_voucher_type") and self.get("against_voucher_type"):
|
||||||
gl_dict.update({"against_voucher_type": self.get("against_voucher_type")})
|
gl_dict.update({"against_voucher_type": self.get("against_voucher_type")})
|
||||||
|
|||||||
Reference in New Issue
Block a user