2

My setup: CiviCRM 5.20.0 on Drupal 7.

I entered contributions in different currencies. In Find Contributions, check some entries. At Actions select Thank-you letter print or email.

I put tokens Contributions:

{contribution.currency} {contribution.total_amount} {contribution.fee_amount} {contribution.net_amount}

and it gives me lines like these:

CNY HK$ 1,299.90 HK$ 0.00 HK$ 1,299.90

GBP HK$ 500.00 HK$ 0.00 HK$ 500.00

where CNY and GBP are the currencies of those contributions and HK$ is the symbol of the default currency.

It seems the amounts variables just took the system default.

Would you suggest some work-around? e.g. how to strip the wrong currency symbol.

Thank you.

2
  • I tried qualifiers like |replace:'HK$':'' but it breaks the smarty tag. Commented Dec 10, 2019 at 3:01
  • I did this: At CRM/Utils/Token.php line 1814 add a format parameter '%a' as a quick an dirty fix. Obviously future updates will overwrite my code. How can I make my code update-safe? Commented Dec 17, 2019 at 9:22

1 Answer 1

3

Well - there's a bug worth reporting here, but I understand your priority is getting these letters out. This should do the trick:

  • Go to Administer menu » Localizations » Languages, Currency, Locations.
  • Change Monetary Amount Display to %a.
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.