From 5b1c0a73dfd6321b5359af3dc60aae3f4e3cb351 Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Thu, 7 Mar 2024 19:06:08 +0100 Subject: [PATCH] explicitly recalculate delta when applying a calculated value --- core/src/main/resources/fieldCalculation.js | 2 +- web/src/main/webapp/resources/js/fieldCalculation.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/resources/fieldCalculation.js b/core/src/main/resources/fieldCalculation.js index a589a9f6b3d2..a32a10d6af2a 100644 --- a/core/src/main/resources/fieldCalculation.js +++ b/core/src/main/resources/fieldCalculation.js @@ -1957,7 +1957,7 @@ var FieldCalculation = FieldCalculation || {}; var inputFieldVariable = _getSeriesInputFieldVariable(variableName, index, false); if (inputFieldVariable) { inputFieldVariable.enteredValue = _cloneJSON( inputFieldVariable.value); - inputFieldVariable.delta = false; + inputFieldVariable.delta = !_equalInputFieldVariable(inputFieldVariable); if (FIELD_CALCULATION_DEBUG_LEVEL >= 1) { console.log("apply calculated value " + _debugVarName(inputFieldVariable)); } diff --git a/web/src/main/webapp/resources/js/fieldCalculation.js b/web/src/main/webapp/resources/js/fieldCalculation.js index a589a9f6b3d2..8053a03109e4 100644 --- a/web/src/main/webapp/resources/js/fieldCalculation.js +++ b/web/src/main/webapp/resources/js/fieldCalculation.js @@ -1956,8 +1956,8 @@ var FieldCalculation = FieldCalculation || {}; function _inputFieldApplyCalculatedValue(variableName, index) { var inputFieldVariable = _getSeriesInputFieldVariable(variableName, index, false); if (inputFieldVariable) { - inputFieldVariable.enteredValue = _cloneJSON( inputFieldVariable.value); - inputFieldVariable.delta = false; + inputFieldVariable.enteredValue = _cloneJSON(inputFieldVariable.value); + inputFieldVariable.delta = !_equalInputFieldVariable(inputFieldVariable); if (FIELD_CALCULATION_DEBUG_LEVEL >= 1) { console.log("apply calculated value " + _debugVarName(inputFieldVariable)); }