From 90ac065930ea0b4d432be53e6fef4798314ae96c Mon Sep 17 00:00:00 2001 From: Ahmed Reda Abukhatwa Date: Thu, 30 Apr 2026 20:16:21 +0300 Subject: [PATCH] fix(profit-loss-report): handle zero base values and prevent null% display (cherry picked from commit 73350118144dfd38c2646620d13658f78f7ddcf1) --- erpnext/accounts/report/financial_statements.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 7a8cadc128e..a628febd2c1 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -790,14 +790,14 @@ def compute_margin_view_data(data, columns, accumulated_values): curr_value = row.get(curr_period) if base_value is None or curr_value is None: - data[row_idx][curr_period] = "N/A" + data[row_idx][curr_period] = None continue if base_value == 0: if curr_value == 0: data[row_idx][curr_period] = 0 else: - data[row_idx][curr_period] = "N/A" + data[row_idx][curr_period] = None continue margin_percent = round((curr_value / base_value) * 100, 2)