From a0c412a0dd23aeb8181ec49cced5da4e1c908d81 Mon Sep 17 00:00:00 2001 From: Mitchy25 <42224026+Mitchy25@users.noreply.github.com> Date: Tue, 31 May 2022 15:25:09 +1200 Subject: [PATCH] Ignore Cancelled GL Entries Profitability Analysis includes 'is_cancelled' GL Entries which means that the profit numbers are incorrect. This change will ensure that the profit figures ignore cancelled GL Entries. --- .../report/profitability_analysis/profitability_analysis.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py index 3e7aa1e368..183e279fe5 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py @@ -211,6 +211,7 @@ def set_gl_entries_by_account( {additional_conditions} and posting_date <= %(to_date)s and {based_on} is not null + and is_cancelled = 0 order by {based_on}, posting_date""".format( additional_conditions="\n".join(additional_conditions), based_on=based_on ),