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

CRM-18405 unformat amount to do math operation #8130

Closed
wants to merge 1 commit into from

Conversation

sunilpawar
Copy link
Contributor

@eileenmcnaughton
Copy link
Contributor

I'm not loving this.

It works - but I feel like it would be better to assign it to the tpl unformatted & then format it in the tpl. Making that change might be riskier though

@eileenmcnaughton
Copy link
Contributor

ah no I take it back - what I would prefer to see is a data attribute that has the raw value & use that rather than the fomatted value. I think we made that change to the price set stuff in calculate.tpl

Mixing formatted & unformatted values seems like hard work but data attributes rock

@sunilpawar
Copy link
Contributor Author

for new contribution, how we going to prepare raw value for total amount and fee amount, page not going to refresh and we can change amount at any time?

@eileenmcnaughton
Copy link
Contributor

Hmm - just reading through CRM/Price/Form/Calculate.tpl - it has a function calculateText that does something like what you are doing (and ideally would use the same code as what you are doing) and then it assigns that to the data val

cj('#pricevalue').data('raw-total', totalfee).trigger('change');

So I guess the question is whether you can figure out a way to share code with Calculate.tpl (which should be on all or most money pages) rather than duplicating it.

@monishdeb
Copy link
Member

Closing in favor of #8386

@monishdeb monishdeb closed this May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants