Use tokens in offline receipt
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 18 Jan 2022 04:46:36 +0000 (17:46 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 18 Jan 2022 05:01:05 +0000 (18:01 +1300)
commit6b892bd2c6a8889f31d2bcd594dc3e8b3d8218f3
treea0baeeba389307b06875e1141b16379b60c5103b
parentb4baebc4e302a21236051291a8c02474feeae3c5
Use tokens in offline receipt

This gets us away from the empty checks & the isset that causes a crash with smarty modifiers.
There is no change at the moment as to what is assigned so we don't need to make any changes to existing sites.

The goal is to specify the mappings on the workflow template class later. That will allow
us to remove significant amounts of code (& leakage points) from the form layer.
However we still need to resolve https://github.com/civicrm/civicrm-core/pull/22547
because at the moment values in this template expect raw values - which is
not the case with mapped params at the moment.

Note the biggest thing to contemplate in this PR is the addition of an
-always-there-in-contribution-smarty-templates smarty value isShowTax.
The way it is currently checking is that there should pretty much
be 'something' assigned if invoicing is enabled & it makes sense
that tax would show even if zero if enabled - which is what I *think*
is already happening (with maybe some random variation).

I added 'taxTerm' as a domain token and I do kinda prefer that but
it is available more places (unless we change the audience).
invoice_notes is another contribution setting that effects display.
CRM/Contribute/Form/AdditionalInfo.php
CRM/Contribute/WorkflowMessage/ContributionOfflineReceipt.php
CRM/Contribute/WorkflowMessage/ContributionTrait.php
sql/civicrm_generated.mysql
tests/phpunit/CRM/Contribute/Form/ContributionTest.php
xml/templates/message_templates/contribution_offline_receipt_html.tpl
xml/templates/message_templates/contribution_offline_receipt_text.tpl