From 450c2470e959f4d705afc3212546249ad406bee3 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Wed, 8 Nov 2023 14:08:57 +0530 Subject: [PATCH] refactor: set against account link for jv --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 3 ++- erpnext/accounts/utils.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 9f76d9df19..c70ad2fdaa 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -230,6 +230,7 @@ class JournalEntry(AccountsController): "account": tax_withholding_details.get("account_head"), rev_debit_or_credit: tax_withholding_details.get("tax_amount"), "against_account": parties[0], + "against_account_link": parties[0], }, ) @@ -723,7 +724,7 @@ class JournalEntry(AccountsController): elif flt(d.credit) > 0: self.accounts_credited.append(d) - if d.against_account: + if d.against_account_link: self.separate_against_account_entries = 0 break diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index e0adac412b..0edfc2ad5a 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -629,6 +629,7 @@ def update_reference_in_journal_entry(d, journal_entry, do_not_save=False): new_row.set("reference_name", d["against_voucher"]) new_row.against_account = cstr(jv_detail.against_account) + new_row.against_account_link = cstr(jv_detail.against_account) new_row.is_advance = cstr(jv_detail.is_advance) new_row.docstatus = 1