From 327b19cba68e610be7f0ae47ef5a1e1bd452bcdc Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 16 Jul 2024 14:33:52 +0530 Subject: [PATCH] fix: show total rows credit row in balance sheet --- .../report/balance_sheet/balance_sheet.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py index ccadaac3ca20..504fec76ef06 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.py +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py @@ -123,19 +123,15 @@ def get_provisional_profit_loss( for period in period_list: key = period if consolidated else period.key total_assets = flt(asset[0].get(key)) + effective_liability = 0.00 - if liability or equity: - effective_liability = 0.0 - if liability: - effective_liability += flt(liability[0].get(key)) - if equity: - effective_liability += flt(equity[0].get(key)) + if liability: + effective_liability += flt(liability[0].get(key)) + if equity: + effective_liability += flt(equity[0].get(key)) - provisional_profit_loss[key] = total_assets - effective_liability - else: - provisional_profit_loss[key] = total_assets - - total_row[key] = provisional_profit_loss[key] + provisional_profit_loss[key] = total_assets - effective_liability + total_row[key] = provisional_profit_loss[key] + effective_liability if provisional_profit_loss[key]: has_value = True