Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow: Calculate field action won't manage properly formulas with decimal fields #9460

Open
SinergiaCRM opened this issue Jan 26, 2022 · 0 comments · May be fixed by #9461
Open

Workflow: Calculate field action won't manage properly formulas with decimal fields #9460

SinergiaCRM opened this issue Jan 26, 2022 · 0 comments · May be fixed by #9461
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

Comments

@SinergiaCRM
Copy link
Contributor

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:
WFDecimalFinal

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

  1. Change the default user decimal separator to something else than "."
  2. Add two decimal field to any module
  3. Create a workflow that saves one decimal field to another decimal field
  4. Run the workflow and check that the result is not correct.

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

SinergiaCRM added a commit to SinergiaTIC/SuiteCRM that referenced this issue Jan 26, 2022
@SinergiaCRM SinergiaCRM changed the title Calculate field action won't manage properly formulas with decimal fields Workflow: Calculate field action won't manage properly formulas with decimal fields Jan 26, 2022
@johnM2401 johnM2401 added Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type:Bug Bugs within the core SuiteCRM codebase Area: Workflow Issues & PRs related to all things regarding workflow Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution labels Feb 8, 2022
SinergiaCRM added a commit to SinergiaTIC/SuiteCRM that referenced this issue Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
2 participants