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

dev/core#1344 Fix logic for displaying BillingName and Credit Card De… #15651

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

seamuslee001
Copy link
Contributor

…tails in email Receipts

Overview

This continues the patterns set by #15532 and #15646

Before

Complex logic used to include BillingName and also credit card details

After

Less complex logic

ping @eileenmcnaughton @mattwire

@civibot
Copy link

civibot bot commented Oct 29, 2019

(Standard links)

@civibot civibot bot added the master label Oct 29, 2019
@eileenmcnaughton
Copy link
Contributor

Oh dang - I missed that you did this

{if $is_pay_later}
===========================================================
{ts}Registered Email{/ts}

===========================================================
{$email}
{elseif $amount GT 0 OR $membership_amount GT 0 }
{elseif $billingName}
===========================================================
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I left this out to think about it more but as you see it is possible to have email AND billing name. I think we need to reverse it to be

{if billingName}

{elseif $email}

{/if}

(you might want to merge mine & rebase this & focus in on the small number of trickier ones)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton that will still work in mine because note the elseif i believe is linked to the {if $is_pay_later} not the {if $email}

@eileenmcnaughton
Copy link
Contributor

Hmm - I think mine will hit the same :-(

@@ -311,7 +311,7 @@
</tr>
{/if}

{if ! ($contributeMode eq 'notify' OR $contributeMode eq 'directIPN') and $is_monetary}
{if ($is_pay_later || $billingName)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you remove this file's changes for later the tests won't fail & we can do the others

@@ -126,14 +126,14 @@
{/foreach}
{/if}

{if !( $contributeMode eq 'notify' OR $contributeMode eq 'directIPN' ) and $is_monetary}
{if ($is_pay_later || $billingName)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think on this one we need to reverse the IF order

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we have 2 if statements here L129 an L130 and the elseif in L136 only relates to the if in L130 as far as i can tell

@@ -374,7 +374,7 @@
</tr>
{/if}

{if $contributeMode ne 'notify' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}
{if $billingName}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay - straight forward - we can get this merged easily

@@ -192,7 +192,7 @@
{if $checkNumber}
{ts}Check Number{/ts}: {$checkNumber}
{/if}
{if $contributeMode ne 'notify' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}
{if $billingName}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

straightforward

@@ -222,7 +222,7 @@
<td>
<table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;">

{if $contributeMode ne 'notify' and !$isAmountzero and !$is_pay_later }
{if $billingName}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@@ -79,7 +79,7 @@
{/if}

{if $isPrimary }
{if $contributeMode ne 'notify' and !$isAmountzero and !$is_pay_later }
{if $billingName}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@@ -154,14 +154,14 @@
{/foreach}
{/if}

{if !( $contributeMode eq 'notify' OR $contributeMode eq 'directIPN' ) and $is_monetary}
{if ($is_pay_later || $billingName)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to reverse the if order on this one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would that help with this if tho, this is the if saying are we printing either the Registered Email or Billing Name sections. Then we do or are you suggesting we completely get rid of the outer if all together?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right - the outer if is not required we want

{if $billingName}
.... show billing name & email
{elseif $email}
... show email
{/if}

I actually already did this on the same receipt but the html version

@@ -172,7 +172,7 @@
{$email}
{/if} {* End ! is_pay_later condition. *}
{/if}
{if $contributeMode eq 'direct' AND !$is_pay_later AND ( $amount GT 0 OR $membership_amount GT 0 ) }
{if $credit_card_type}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 3 patterns here

  1. specific tested template requiring test changes
  2. billingName + email combos
  3. straight forward

Maybe pull 1 & 2 out & we'll get all the 3s merged first?

@seamuslee001
Copy link
Contributor Author

@eileenmcnaughton rebased after latest template fixes, It will need to be re-run after we merge your change.

@eileenmcnaughton
Copy link
Contributor

test this please

magnolia61 pushed a commit to magnolia61/civicrm-core that referenced this pull request Nov 1, 2019
@mattwire
Copy link
Contributor

mattwire commented Nov 1, 2019

Tests passed - merging per tag

@mattwire mattwire merged commit 5dced02 into civicrm:master Nov 1, 2019
@seamuslee001 seamuslee001 deleted the dev_core_1344 branch November 1, 2019 19:59
eileenmcnaughton pushed a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 2, 2019
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.

3 participants