Skip to content

Commit

Permalink
refactor: primitive summary for p&l and balance sheet
Browse files Browse the repository at this point in the history
(cherry picked from commit eb4c476)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Mar 22, 2024
1 parent da17496 commit 9e15ecf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions erpnext/accounts/report/balance_sheet/balance_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ def execute(filters=None):

chart = get_chart_data(filters, columns, asset, liability, equity)

report_summary = get_report_summary(
report_summary, primitive_summary = get_report_summary(
period_list, asset, liability, equity, provisional_profit_loss, currency, filters
)

return columns, data, message, chart, report_summary
return columns, data, message, chart, report_summary, primitive_summary


def get_provisional_profit_loss(
Expand Down Expand Up @@ -217,7 +217,7 @@ def get_report_summary(
"datatype": "Currency",
"currency": currency,
},
]
], (net_asset - net_liability + net_equity)


def get_chart_data(filters, columns, asset, liability, equity):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def execute(filters=None):
currency = filters.presentation_currency or frappe.get_cached_value(
"Company", filters.company, "default_currency"
)
report_summary = get_report_summary(
report_summary, primitive_summary = get_report_summary(
period_list, filters.periodicity, income, expense, net_profit_loss, currency, filters
)

return columns, data, None, chart, report_summary
return columns, data, None, chart, report_summary, primitive_summary


def get_report_summary(
Expand Down Expand Up @@ -112,7 +112,7 @@ def get_report_summary(
"datatype": "Currency",
"currency": currency,
},
]
], net_profit


def get_net_profit_loss(income, expense, period_list, company, currency=None, consolidated=False):
Expand Down

0 comments on commit 9e15ecf

Please sign in to comment.