Repository: akvo/akvo-rsr

Issue:
Feature Request: Indicator comments on Program overview and Program overview results table
### What are you trying to do?

Partners want to see the indicator comment on Program overview results tablethe 

### Describe the solution you'd like

Add comments column on the report

### Have you consider alternatives?

_No response_

### Additional context

_No response_


Discussion:

Resolving patch:
diff --git a/akvo/rsr/dataclasses.py b/akvo/rsr/dataclasses.py
--- a/akvo/rsr/dataclasses.py
+++ b/akvo/rsr/dataclasses.py
@@ -403,6 +403,7 @@ class ContributorData(ReportingPeriodMixin):
     indicator_cumulative: bool = False
     target_value: Optional[Decimal] = None
     period_actual_value: Optional[Decimal] = None
+    period_actual_comment: str = ''
     period_narrative: str = ''
     indicator_baseline_value: Optional[Decimal] = None
     indicator_target_value: Optional[Decimal] = None
@@ -423,6 +424,7 @@ def make(cls, data, prefix=''):
             indicator_cumulative=data.get(f"{prefix}indicator__cumulative", False),
             target_value=maybe_decimal(data.get(f"{prefix}target_value", None)),
             period_actual_value=ensure_decimal(data.get(f"{prefix}actual_value", None)),
+            period_actual_comment=data.get(f"{prefix}actual_comment", ''),
             period_narrative=data.get(f"{prefix}narrative", ''),
             indicator_baseline_value=data.get(f"{prefix}indicator__baseline_value", None),
             indicator_target_value=data.get(f"{prefix}indicator__target_value", None),
diff --git a/akvo/rsr/views/py_reports/program_overview_excel_report.py b/akvo/rsr/views/py_reports/program_overview_excel_report.py
--- a/akvo/rsr/views/py_reports/program_overview_excel_report.py
+++ b/akvo/rsr/views/py_reports/program_overview_excel_report.py
@@ -62,7 +62,7 @@ def generate_workbok(program, start_date=None, end_date=None):
     aggregate_targets = is_aggregating_targets(program)
     use_indicator_target = utils.is_using_indicator_target(program)
     disaggregations = get_disaggregations(program)
-    disaggregations_column_start = 17 if aggregate_targets else 16
+    disaggregations_column_start = 18 if aggregate_targets else 17
     disaggregation_types_length = 0
     for types in disaggregations.values():
         disaggregation_types_length += len(types.keys())
@@ -106,6 +106,8 @@ def generate_workbok(program, start_date=None, end_date=None):
         ws.set_col_style(col, Style(size=25))
         col += 1
         ws.set_col_style(col, Style(size=25))
+        col += 1
+        ws.set_col_style(col, Style(size=25))
         # r1
         ws.set_row_style(1, Style(size=36))
         for i in range(1, disaggregations_column_start):
@@ -130,6 +132,8 @@ def generate_workbok(program, start_date=None, end_date=None):
         col += 1
         ws.set_cell_value(1, col, 'Actual value')
         col += 1
+        ws.set_cell_value(1, col, 'Actual comment')
+        col += 1
         ws.set_cell_value(1, col, '% of contribution')
         # col += 1
         if disaggregation_types_length:
@@ -236,6 +240,9 @@ def render_contributor(ws, row, result, indicator, period, contributor, aggregat
     col += 2
     ws.set_cell_value(row, col, contributor.actual_value)
     col += 1
+    ws.set_cell_style(row, col, long_text_style)
+    ws.set_cell_value(row, col, contributor.period_actual_comment)
+    col += 1
     if period.is_quantitative and not period.is_cumulative_future:
         contribution = calculate_percentage(contributor.actual_value, period.aggregated_value)
         ws.set_cell_style(row, col, Style(alignment=Alignment(horizontal='right')))
diff --git a/akvo/rsr/views/py_reports/program_utils.py b/akvo/rsr/views/py_reports/program_utils.py
--- a/akvo/rsr/views/py_reports/program_utils.py
+++ b/akvo/rsr/views/py_reports/program_utils.py
@@ -143,9 +143,9 @@ def fetch_contributors(root_period_ids):
         )\
         .filter(id__in=contributor_ids)\
         .values(
-            'id', 'period_start', 'parent_period', 'target_value', 'actual_value', 'narrative', 'indicator__id',
-            'indicator__type', 'indicator__measure', 'indicator__cumulative', 'indicator__target_value',
-            'indicator__baseline_value', 'indicator__result__project__id',
+            'id', 'period_start', 'parent_period', 'target_value', 'actual_value', 'actual_comment', 'narrative',
+            'indicator__id', 'indicator__type', 'indicator__measure', 'indicator__cumulative',
+            'indicator__target_value', 'indicator__baseline_value', 'indicator__result__project__id',
             'indicator__result__project__title', 'indicator__result__project__subtitle',
             'indicator__result__project__aggregate_children', 'indicator__result__project__aggregate_to_parent',
             'indicator__result__project__primary_location__latitude',


Test patch: