-
-
Notifications
You must be signed in to change notification settings - Fork 827
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 fee amount when contributions have multiple associated participants #24576
Open
MegaphoneJon
wants to merge
1
commit into
civicrm:master
Choose a base branch
from
MegaphoneJon:fix-event-fee-amounts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Standard links)
|
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 19, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 19, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 20, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 23, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 23, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 23, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 23, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 23, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 23, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 23, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 23, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 24, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 24, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
eileenmcnaughton
added a commit
to eileenmcnaughton/civicrm-core
that referenced
this pull request
Jun 24, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
mattwire
pushed a commit
to mattwire/civicrm-core
that referenced
this pull request
Jun 25, 2023
This updates the default online event template to use the variables assigned by the workflow template This works to standardise the variables previously in dataArray , lineItem, totalAmount, taxAmount to reflect the approach in other templates per https://docs.civicrm.org/user/en/latest/email/message-templates/#variables-and-tokens-in-workflow-message-templates However, for participants, per the helpful discussion at civicrm#24576 the expectation is that the primaryParticipant gets the values for all participants whereas the others only get line items, tax breakdowns, totals that relate to them. Hence I have assigned an array participants that holds detials for all participants and the template iterates through them showing all or just the one that relates to the assigned participant id depending on whether it is primary. This allows the template to display in the Message preview and should also mean that those values that I have addressed will always reflect the participantID being used. This also addresses some notices and incompatibility with secure smarty. However, there are still values I haven't made sense of, or otherwise left out of the scope of this PR in the template. Also note I updated the taxBreakdown in the contribution trait - I decided it was cloberring the amount as it iterated through the line items - rather than doing a running total.
test this please |
jenkins, test this please |
1 similar comment
jenkins, test this please |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
See https://lab.civicrm.org/dev/core/-/issues/3859 for replication steps and a description of the bug.
This PR handles the most immediate issue - when a contribution has a single line item, the existing code works. With multiple line items, it changes a value to be incorrect. This ensures the code only works on contributions with a single line item.
Before
Editing a contribution (through the UI) changes
civicrm_participant.fee_amount
to match the value of the entire contribution - even when there are multiple line items.After
The
fee_amount
is only changed when a single line item exists.Comments
This is just an
if
statement, with a tiny bit of strict type enforcement while there are only two placesisSingleLineItem()
is referenced.