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

Fix token boolean filter to work with money & use in templates #26254

Merged
merged 1 commit into from
May 18, 2023

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Fix token boolean filter to work with money & use in templates

Before

Templates need to use this construct

{if $isShowTax && '{contribution.tax_amount|raw}' !== '0.00'}

After

{if $isShowTax && {contribution.tax_amount|boolean}}

Technical Details

The |raw comparison is quite confusing because it compares to 0.00 & we need quotes. We are otherwise using the |boolean increasingly so there is some consistency there.

Comments

Note that a bunch of the changed templates are in tests & I feel pretty sure all the templates have test cover on this

I won't do any pro-active template updates here

@civibot
Copy link

civibot bot commented May 17, 2023

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

Ah - I used {tax_amount} when I meant {total_amount}

The |raw comparison is quite confusing because it compares to 0.00
& we are otherwise using the |boolean increasingly
@colemanw
Copy link
Member

Ok, test coverage appears to be extensive.

@colemanw colemanw merged commit 745b8d0 into civicrm:master May 18, 2023
@colemanw colemanw deleted the balance branch May 18, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants