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

Multiplier default value #6

Closed
coni2k opened this issue May 22, 2015 · 1 comment
Closed

Multiplier default value #6

coni2k opened this issue May 22, 2015 · 1 comment

Comments

@coni2k
Copy link
Contributor

coni2k commented May 22, 2015

Multiplier default value is 1 at the moment.
When it's 0, index income with a sub element calculation fails. Probably it's mixing MainElement's multiplier with its own element multiplier.

@coni2k coni2k changed the title Naming Naming - UnitOfWork May 22, 2015
@coni2k coni2k changed the title Naming - UnitOfWork Multiplier default value May 25, 2015
@coni2k
Copy link
Contributor Author

coni2k commented Jun 1, 2015

In elementItem.js, multiplier function, it was mixing no multiplier field and the user has no multiplier value cases.

In case if there is no multiplier field on the element, it should have returned 1 as a default value, in order to make a correct calculation (or it could of course return null and the caller could make a null check and don't try to multiply the value since there is none).

However, if there is a multiplier field on the element but the user didn't set any value to it, then the default value should have been 0.

Since these cases were checked like the same, it was either returning 0 (and resulting in a calculation error) or returning 1, which had no calculation issue but of course wasn't correct since every CMRP was starting with value 1 for 'Number of Sales'.

It's fixed accordingly.

@coni2k coni2k closed this as completed Jun 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant