refactor: set against account link for jv

This commit is contained in:
Gursheen Anand
2023-11-08 14:08:57 +05:30
parent 09439334ca
commit 450c2470e9
2 changed files with 3 additions and 1 deletions

View File

@@ -230,6 +230,7 @@ class JournalEntry(AccountsController):
"account": tax_withholding_details.get("account_head"), "account": tax_withholding_details.get("account_head"),
rev_debit_or_credit: tax_withholding_details.get("tax_amount"), rev_debit_or_credit: tax_withholding_details.get("tax_amount"),
"against_account": parties[0], "against_account": parties[0],
"against_account_link": parties[0],
}, },
) )
@@ -723,7 +724,7 @@ class JournalEntry(AccountsController):
elif flt(d.credit) > 0: elif flt(d.credit) > 0:
self.accounts_credited.append(d) self.accounts_credited.append(d)
if d.against_account: if d.against_account_link:
self.separate_against_account_entries = 0 self.separate_against_account_entries = 0
break break

View File

@@ -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.set("reference_name", d["against_voucher"])
new_row.against_account = cstr(jv_detail.against_account) 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.is_advance = cstr(jv_detail.is_advance)
new_row.docstatus = 1 new_row.docstatus = 1