From 71cda2aa6432aff0d006194d6acf01f95ef41c10 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Sun, 31 Dec 2023 14:13:59 +0100 Subject: [PATCH] fix: calculation of P/L in balance sheet --- .../accounts/report/balance_sheet/balance_sheet.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py index b225aac7b560..8446e458f950 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.py +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py @@ -124,11 +124,11 @@ def get_provisional_profit_loss( key = period if consolidated else period.key effective_liability = 0.0 if liability: - effective_liability += flt(liability[-2].get(key)) + effective_liability += flt(liability[0].get(key)) if equity: - effective_liability += flt(equity[-2].get(key)) + effective_liability += flt(equity[0].get(key)) - provisional_profit_loss[key] = flt(asset[-2].get(key)) - effective_liability + provisional_profit_loss[key] = flt(asset[0].get(key)) - effective_liability total_row[key] = effective_liability + provisional_profit_loss[key] if provisional_profit_loss[key]: @@ -193,11 +193,11 @@ def get_report_summary( for period in period_list: key = period if consolidated else period.key if asset: - net_asset += asset[-2].get(key) + net_asset += asset[0].get(key) if liability: - net_liability += liability[-2].get(key) + net_liability += liability[0].get(key) if equity: - net_equity += equity[-2].get(key) + net_equity += equity[0].get(key) if provisional_profit_loss: net_provisional_profit_loss += provisional_profit_loss.get(key)