Workflow: Calculate field action won't manage properly formulas with decimal fields #9460
Labels
Area: Workflow
Issues & PRs related to all things regarding workflow
Priority:Important
Issues & PRs that are important; broken functions, errors - there are workarounds
Status:Fix Proposed
A issue that has a PR related to it that provides a possible resolution
Type:Bug
Bugs within the core SuiteCRM codebase
The calculate field actions in Workflow aren't dealing properly with decimal fields and the user-defined decimal separator.
If a user is using "," as decimal separator and "." for the 1000s, having a calculate action that saves the values of a decimal field to another decimal field, it will always move the decimal separator two positions to the right, ignoring it. See image bellow:
Issue
The calculate field actions in Workflow aren't dealing properly with decimal fields and the user-defined decimal separator.
Expected Behavior
It should work properly with any kind of decimal separator.
Actual Behavior
The result is multiply by 100.
Possible Fix
Format the number after calculating formula in modules/AOW_Actions/actions/actionComputeField.php
Steps to Reproduce
Context
Your Environment
SuiteCRM Version used: Version 7.12.2
Browser name and version: Chrome Versión 97.0.4692.71 (Build oficial) (64 bits)
Environment name and version: MySQL, PHP 7
Operating System and version: Ubuntu 18.04
The text was updated successfully, but these errors were encountered: