From d60600efb29349644792dad93c3311f98861c104 Mon Sep 17 00:00:00 2001 From: venkat102 Date: Thu, 10 Oct 2024 12:07:20 +0530 Subject: [PATCH] fix: check for empty row to get total amount --- erpnext/accounts/report/balance_sheet/balance_sheet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py index d59934f1d9d..05ab7629841 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.py +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py @@ -125,9 +125,9 @@ def get_provisional_profit_loss( total_assets = flt(asset[-2].get(key)) effective_liability = 0.00 - if liability: + if liability and liability[-1] == {}: effective_liability += flt(liability[-2].get(key)) - if equity: + if equity and equity[-1] == {}: effective_liability += flt(equity[-2].get(key)) provisional_profit_loss[key] = total_assets - effective_liability @@ -195,9 +195,9 @@ def get_report_summary( key = period if consolidated else period.key if asset: net_asset += asset[-2].get(key) - if liability: + if liability and liability[-1] == {}: net_liability += liability[-2].get(key) - if equity: + if equity and equity[-1] == {}: net_equity += equity[-2].get(key) if provisional_profit_loss: net_provisional_profit_loss += provisional_profit_loss.get(key)