fix: Incorrect provisional profit and loss in balance sheet
This commit is contained in:
parent
528c71382f
commit
ed2c6b6637
@ -120,11 +120,11 @@ def check_opening_balance(asset, liability, equity):
|
|||||||
opening_balance = 0
|
opening_balance = 0
|
||||||
float_precision = cint(frappe.db.get_default("float_precision")) or 2
|
float_precision = cint(frappe.db.get_default("float_precision")) or 2
|
||||||
if asset:
|
if asset:
|
||||||
opening_balance = flt(asset[0].get("opening_balance", 0), float_precision)
|
opening_balance = flt(asset[-1].get("opening_balance", 0), float_precision)
|
||||||
if liability:
|
if liability:
|
||||||
opening_balance -= flt(liability[0].get("opening_balance", 0), float_precision)
|
opening_balance -= flt(liability[-1].get("opening_balance", 0), float_precision)
|
||||||
if equity:
|
if equity:
|
||||||
opening_balance -= flt(equity[0].get("opening_balance", 0), float_precision)
|
opening_balance -= flt(equity[-1].get("opening_balance", 0), float_precision)
|
||||||
|
|
||||||
opening_balance = flt(opening_balance, float_precision)
|
opening_balance = flt(opening_balance, float_precision)
|
||||||
if opening_balance:
|
if opening_balance:
|
||||||
|
@ -282,7 +282,8 @@ def add_total_row(out, root_type, balance_must_be, period_list, company_currency
|
|||||||
total_row = {
|
total_row = {
|
||||||
"account_name": _("Total {0} ({1})").format(_(root_type), _(balance_must_be)),
|
"account_name": _("Total {0} ({1})").format(_(root_type), _(balance_must_be)),
|
||||||
"account": _("Total {0} ({1})").format(_(root_type), _(balance_must_be)),
|
"account": _("Total {0} ({1})").format(_(root_type), _(balance_must_be)),
|
||||||
"currency": company_currency
|
"currency": company_currency,
|
||||||
|
"opening_balance": 0.0
|
||||||
}
|
}
|
||||||
|
|
||||||
for row in out:
|
for row in out:
|
||||||
@ -294,6 +295,7 @@ def add_total_row(out, root_type, balance_must_be, period_list, company_currency
|
|||||||
|
|
||||||
total_row.setdefault("total", 0.0)
|
total_row.setdefault("total", 0.0)
|
||||||
total_row["total"] += flt(row["total"])
|
total_row["total"] += flt(row["total"])
|
||||||
|
total_row["opening_balance"] += row["opening_balance"]
|
||||||
row["total"] = ""
|
row["total"] = ""
|
||||||
|
|
||||||
if "total" in total_row:
|
if "total" in total_row:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user