fix: include grand_total in journal entry and handle taxes correctly in invoice total calculation

This commit is contained in:
ljain112
2025-10-09 13:44:32 +05:30
parent 2112f36577
commit 88f6d783b4
2 changed files with 2 additions and 1 deletions

View File

@@ -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,
}
)

View File

@@ -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