Skip to content

Commit

Permalink
fix: calculation of P/L in balance sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Dec 31, 2023
1 parent a9a84cc commit 71cda2a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions erpnext/accounts/report/balance_sheet/balance_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 71cda2a

Please sign in to comment.