From ef3a4c3869e3c57f9e2d7c59b3f7d805d28e69c6 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Tue, 15 Aug 2023 11:36:58 +0200 Subject: [PATCH] fix: use correct aggregation type if numberType undefined DHIS2-15698 numberType can be missing in AO that use the default value for it. The default value is VALUE and should not cause the total aggregation type to be overridden. --- src/modules/pivotTable/PivotTableEngine.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/pivotTable/PivotTableEngine.js b/src/modules/pivotTable/PivotTableEngine.js index 46f8cc0fa..631557a6e 100644 --- a/src/modules/pivotTable/PivotTableEngine.js +++ b/src/modules/pivotTable/PivotTableEngine.js @@ -833,7 +833,10 @@ export class PivotTableEngine { if (totalCell && totalCell.count) { totalCell.value = applyTotalAggregationType( totalCell, - this.visualization.numberType !== NUMBER_TYPE_VALUE && + // DHIS2-15698: do not override total aggregation type when numberType option is not present + // (numberType option default is VALUE) + this.visualization.numberType && + this.visualization.numberType !== NUMBER_TYPE_VALUE && AGGREGATE_TYPE_SUM ) this.adaptiveClippingController.add(