diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 294353eca16..71220186dc7 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -409,6 +409,7 @@ class JournalEntry(AccountsController): "posting_date": self.posting_date, "tax_withholding_net_total": net_total, "base_tax_withholding_net_total": net_total, + "grand_total": net_total, } ) diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py index 4c727a41015..b1c0f426d99 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -724,7 +724,7 @@ def get_advance_adjusted_in_invoice(inv): def get_invoice_total_without_tcs(inv, tax_details): - tcs_tax_row = [d for d in inv.taxes if d.account_head == tax_details.account_head] + tcs_tax_row = [d for d in inv.get("taxes") or [] if d.account_head == tax_details.account_head] tcs_tax_row_amount = tcs_tax_row[0].base_tax_amount if tcs_tax_row else 0 return inv.grand_total - tcs_tax_row_amount