refactor: linkage between journal as payment and gain/loss journal

(cherry picked from commit f119a1e115)

# Conflicts:
#	erpnext/accounts/doctype/gl_entry/gl_entry.py
This commit is contained in:
ruthra kumar
2023-07-11 12:04:13 +05:30
committed by Mergify
parent 075a7dfe2e
commit 01953bc0e3
3 changed files with 20 additions and 8 deletions

View File

@@ -1033,9 +1033,9 @@ class AccountsController(TransactionBase):
"cost_center": erpnext.get_default_cost_center(self.company),
# TODO: figure out a way to pass reference
# throws 'Journal Entry doesn't have {account} or doesn't have matched account'
# "reference_type": self.doctype,
# "reference_name": self.name,
# "reference_detail_no": arg.idx,
"reference_type": self.doctype,
"reference_name": self.name,
"reference_detail_no": arg.idx,
reverse_dr_or_cr: abs(arg.get("difference_amount")),
reverse_dr_or_cr + "_in_account_currency": 0,
}