Reformat whitespace in online membership receipt
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 17 Nov 2023 00:19:21 +0000 (13:19 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 17 Nov 2023 00:54:24 +0000 (13:54 +1300)
xml/templates/message_templates/membership_online_receipt_html.tpl

index 5ce49faf0b32204c3b10816b78e2520f5b290652..900a96362fb9834ca7511b288440512d3974ef0a 100644 (file)
@@ -33,8 +33,7 @@
   </tr>
   </table>
   <table style="width:100%; max-width:500px; border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse;">
-
-     {if $membership_assign && !$useForMember}
+    {if $membership_assign && !$useForMember}
       <tr>
        <th {$headerStyle}>
         {ts}Membership Information{/ts}
         </td>
        </tr>
       {/if}
-     {/if}
-
-
-     {if $amount}
+    {/if}
+    {if $amount}
       <tr>
-       <th {$headerStyle}>
-        {ts}Membership Fee{/ts}
-       </th>
+        <th {$headerStyle}>{ts}Membership Fee{/ts}</th>
       </tr>
 
       {if !$useForMember and isset($membership_amount) and !empty($is_quick_config)}
-
-       <tr>
-        <td {$labelStyle}>
-         {ts 1=$membership_name}%1 Membership{/ts}
-        </td>
-        <td {$valueStyle}>
-         {$membership_amount|crmMoney}
-        </td>
-       </tr>
-       {if $amount && !$is_separate_payment}
-         <tr>
+        <tr>
           <td {$labelStyle}>
-           {ts}Contribution Amount{/ts}
+            {ts 1=$membership_name}%1 Membership{/ts}
           </td>
           <td {$valueStyle}>
-           {$amount|crmMoney}
+            {$membership_amount|crmMoney}
           </td>
-         </tr>
-         <tr>
-           <td {$labelStyle}>
-           {ts}Total{/ts}
+        </tr>
+        {if $amount && !$is_separate_payment}
+          <tr>
+            <td {$labelStyle}>
+              {ts}Contribution Amount{/ts}
             </td>
             <td {$valueStyle}>
-            {$amount+$membership_amount|crmMoney}
-           </td>
-         </tr>
-       {/if}
-
+              {$amount|crmMoney}
+            </td>
+          </tr>
+          <tr>
+            <td {$labelStyle}>
+              {ts}Total{/ts}
+            </td>
+            <td {$valueStyle}>
+              {$amount+$membership_amount|crmMoney}
+            </td>
+          </tr>
+        {/if}
       {elseif empty($useForMember) && !empty($lineItem) and $priceSetID and empty($is_quick_config)}
-
-       {foreach from=$lineItem item=value key=priceset}
+        {foreach from=$lineItem item=value key=priceset}
+          <tr>
+            <td colspan="2" {$valueStyle}>
+              <table>
+                <tr>
+                  <th>{ts}Item{/ts}</th>
+                  <th>{ts}Qty{/ts}</th>
+                  <th>{ts}Each{/ts}</th>
+                  <th>{ts}Total{/ts}</th>
+                </tr>
+                {foreach from=$value item=line}
+                  <tr>
+                    <td>
+                      {$line.description|truncate:30:"..."}
+                    </td>
+                    <td>
+                      {$line.qty}
+                    </td>
+                    <td>
+                      {$line.unit_price|crmMoney}
+                    </td>
+                    <td>
+                      {$line.line_total|crmMoney}
+                    </td>
+                  </tr>
+                {/foreach}
+              </table>
+            </td>
+          </tr>
+        {/foreach}
         <tr>
-         <td colspan="2" {$valueStyle}>
-          <table>
-           <tr>
-            <th>{ts}Item{/ts}</th>
-            <th>{ts}Qty{/ts}</th>
-            <th>{ts}Each{/ts}</th>
-            <th>{ts}Total{/ts}</th>
-           </tr>
-           {foreach from=$value item=line}
-            <tr>
-             <td>
-              {$line.description|truncate:30:"..."}
-             </td>
-             <td>
-              {$line.qty}
-             </td>
-             <td>
-              {$line.unit_price|crmMoney}
-             </td>
-             <td>
-              {$line.line_total|crmMoney}
-             </td>
-            </tr>
-           {/foreach}
-          </table>
-         </td>
+          <td {$labelStyle}>
+            {ts}Total Amount{/ts}
+          </td>
+          <td {$valueStyle}>
+            {$amount|crmMoney}
+          </td>
         </tr>
-       {/foreach}
-       <tr>
-        <td {$labelStyle}>
-         {ts}Total Amount{/ts}
-        </td>
-        <td {$valueStyle}>
-         {$amount|crmMoney}
-        </td>
-       </tr>
 
       {else}
-       {if $useForMember && $lineItem and empty($is_quick_config)}
-       {foreach from=$lineItem item=value key=priceset}
-        <tr>
-         <td colspan="2" {$valueStyle}>
-          <table>
-           <tr>
-            <th>{ts}Item{/ts}</th>
-            <th>{ts}Fee{/ts}</th>
-            {if !empty($dataArray)}
-              <th>{ts}SubTotal{/ts}</th>
-              <th>{ts}Tax Rate{/ts}</th>
-              <th>{ts}Tax Amount{/ts}</th>
-              <th>{ts}Total{/ts}</th>
-            {/if}
-      <th>{ts}Membership Start Date{/ts}</th>
-      <th>{ts}Membership Expiration Date{/ts}</th>
-           </tr>
-           {foreach from=$value item=line}
+        {if $useForMember && $lineItem and empty($is_quick_config)}
+           {foreach from=$lineItem item=value key=priceset}
+             <tr>
+               <td colspan="2" {$valueStyle}>
+                <table>
+                  <tr>
+                    <th>{ts}Item{/ts}</th>
+                    <th>{ts}Fee{/ts}</th>
+                    {if !empty($dataArray)}
+                      <th>{ts}SubTotal{/ts}</th>
+                      <th>{ts}Tax Rate{/ts}</th>
+                      <th>{ts}Tax Amount{/ts}</th>
+                      <th>{ts}Total{/ts}</th>
+                    {/if}
+                    <th>{ts}Membership Start Date{/ts}</th>
+                    <th>{ts}Membership Expiration Date{/ts}</th>
+                  </tr>
+                  {foreach from=$value item=line}
+                    <tr>
+                      <td>
+                        {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
+                      </td>
+                      <td>
+                        {$line.line_total|crmMoney}
+                      </td>
+                      {if !empty($dataArray)}
+                        <td>
+                          {$line.unit_price*$line.qty|crmMoney}
+                        </td>
+                        {if ($line.tax_rate || $line.tax_amount != "")}
+                          <td>
+                            {$line.tax_rate|string_format:"%.2f"}%
+                          </td>
+                          <td>
+                           {$line.tax_amount|crmMoney}
+                          </td>
+                        {else}
+                          <td></td>
+                          <td></td>
+                        {/if}
+                        <td>
+                          {$line.line_total+$line.tax_amount|crmMoney}
+                        </td>
+                      {/if}
+                      <td>
+                        {$line.start_date}
+                      </td>
+                      <td>
+                        {$line.end_date}
+                      </td>
+                    </tr>
+                  {/foreach}
+                </table>
+               </td>
+             </tr>
+           {/foreach}
+           {if !empty($dataArray)}
             <tr>
-             <td>
-             {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
+             <td {$labelStyle}>
+              {ts}Amount Before Tax:{/ts}
              </td>
-             <td>
-              {$line.line_total|crmMoney}
+             <td {$valueStyle}>
+               {contribution.tax_exclusive_amount}
              </td>
-             {if !empty($dataArray)}
-              <td>
-               {$line.unit_price*$line.qty|crmMoney}
-              </td>
-              {if ($line.tax_rate || $line.tax_amount != "")}
-               <td>
-                {$line.tax_rate|string_format:"%.2f"}%
-               </td>
-               <td>
-                {$line.tax_amount|crmMoney}
-               </td>
-              {else}
-               <td></td>
-               <td></td>
-              {/if}
-              <td>
-               {$line.line_total+$line.tax_amount|crmMoney}
-              </td>
+            </tr>
+            {foreach from=$dataArray item=value key=priceset}
+             <tr>
+             {if $priceset || $priceset == 0}
+               <td>&nbsp;{$taxTerm} {$priceset|string_format:"%.2f"}%</td>
+               <td>&nbsp;{$value|crmMoney:$currency}</td>
+             {else}
+               <td>&nbsp;{ts}NO{/ts} {$taxTerm}</td>
+               <td>&nbsp;{$value|crmMoney:$currency}</td>
              {/if}
-             <td>
-              {$line.start_date}
+             </tr>
+            {/foreach}
+           {/if}
+         {/if}
+        {if $totalTaxAmount}
+           <tr>
+             <td {$labelStyle}>
+               {ts}Total Tax Amount{/ts}
              </td>
-       <td>
-              {$line.end_date}
+             <td {$valueStyle}>
+               {$totalTaxAmount|crmMoney:$currency}
              </td>
-            </tr>
-           {/foreach}
-          </table>
-         </td>
-        </tr>
-       {/foreach}
-       {if !empty($dataArray)}
-        <tr>
-         <td {$labelStyle}>
-          {ts}Amount Before Tax:{/ts}
-         </td>
-         <td {$valueStyle}>
-           {contribution.tax_exclusive_amount}
-         </td>
-        </tr>
-        {foreach from=$dataArray item=value key=priceset}
-         <tr>
-         {if $priceset || $priceset == 0}
-           <td>&nbsp;{$taxTerm} {$priceset|string_format:"%.2f"}%</td>
-           <td>&nbsp;{$value|crmMoney:$currency}</td>
-         {else}
-           <td>&nbsp;{ts}NO{/ts} {$taxTerm}</td>
-           <td>&nbsp;{$value|crmMoney:$currency}</td>
+           </tr>
          {/if}
-         </tr>
-        {/foreach}
-       {/if}
-       {/if}
-       {if $totalTaxAmount}
         <tr>
-         <td {$labelStyle}>
-          {ts}Total Tax Amount{/ts}
-         </td>
-         <td {$valueStyle}>
-          {$totalTaxAmount|crmMoney:$currency}
-         </td>
-        </tr>
-       {/if}
-       <tr>
-        <td {$labelStyle}>
-         {ts}Amount{/ts}
-        </td>
-        <td {$valueStyle}>
-         {$amount|crmMoney} {if isset($amount_level)} - {$amount_level}{/if}
-        </td>
-       </tr>
-
+           <td {$labelStyle}>
+             {ts}Amount{/ts}
+           </td>
+           <td {$valueStyle}>
+             {$amount|crmMoney} {if isset($amount_level)} - {$amount_level}{/if}
+           </td>
+         </tr>
       {/if}
 
-
-     {elseif isset($membership_amount)}
-
-
+    {elseif isset($membership_amount)}
       <tr>
-       <th {$headerStyle}>
-        {ts}Membership Fee{/ts}
-       </th>
+        <th {$headerStyle}>
+          {ts}Membership Fee{/ts}
+        </th>
       </tr>
       <tr>
-       <td {$labelStyle}>
-        {ts 1=$membership_name}%1 Membership{/ts}
-       </td>
-       <td {$valueStyle}>
-        {$membership_amount|crmMoney}
-       </td>
+        <td {$labelStyle}>
+          {ts 1=$membership_name}%1 Membership{/ts}
+        </td>
+        <td {$valueStyle}>
+          {$membership_amount|crmMoney}
+        </td>
       </tr>
+    {/if}
 
-
-     {/if}
-
-     {if !empty($receive_date)}
+    {if !empty($receive_date)}
       <tr>
-       <td {$labelStyle}>
-        {ts}Date{/ts}
-       </td>
-       <td {$valueStyle}>
-        {$receive_date|crmDate}
-       </td>
+        <td {$labelStyle}>
+          {ts}Date{/ts}
+        </td>
+        <td {$valueStyle}>
+          {$receive_date|crmDate}
+        </td>
       </tr>
-     {/if}
+    {/if}
 
-     {if !empty($is_monetary) and !empty($trxn_id)}
+    {if !empty($is_monetary) and !empty($trxn_id)}
       <tr>
        <td {$labelStyle}>
         {ts}Transaction #{/ts}
       </tr>
      {/if}
 
-     {if !empty($membership_trx_id)}
+    {if !empty($membership_trx_id)}
       <tr>
        <td {$labelStyle}>
-        {ts}Membership Transaction #{/ts}
+         {ts}Membership Transaction #{/ts}
        </td>
        <td {$valueStyle}>
-        {$membership_trx_id}
+         {$membership_trx_id}
        </td>
       </tr>
-     {/if}
-     {if !empty($is_recur)}
-       <tr>
+    {/if}
+    {if !empty($is_recur)}
+      <tr>
         <td colspan="2" {$labelStyle}>
-         {ts}This membership will be renewed automatically.{/ts}
-         {if $cancelSubscriptionUrl}
-           {ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
-         {/if}
+          {ts}This membership will be renewed automatically.{/ts}
+          {if $cancelSubscriptionUrl}
+            {ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
+          {/if}
         </td>
-       </tr>
-       {if $updateSubscriptionBillingUrl}
-         <tr>
+      </tr>
+      {if $updateSubscriptionBillingUrl}
+        <tr>
           <td colspan="2" {$labelStyle}>
-           {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by <a href="%1">visiting this web page</a>.{/ts}
+            {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by <a href="%1">visiting this web page</a>.{/ts}
           </td>
-         </tr>
-       {/if}
-     {/if}
+        </tr>
+      {/if}
+    {/if}
 
-     {if $honor_block_is_active}
+    {if $honor_block_is_active}
       <tr>
-       <th {$headerStyle}>
-        {$soft_credit_type}
-       </th>
+        <th {$headerStyle}>
+          {$soft_credit_type}
+        </th>
       </tr>
       {foreach from=$honoreeProfile item=value key=label}
         <tr>
-         <td {$labelStyle}>
-          {$label}
-         </td>
-         <td {$valueStyle}>
-          {$value}
-         </td>
+          <td {$labelStyle}>
+            {$label}
+          </td>
+          <td {$valueStyle}>
+            {$value}
+          </td>
         </tr>
       {/foreach}
-     {/if}
+    {/if}
 
-     {if !empty($pcpBlock)}
+    {if !empty($pcpBlock)}
       <tr>
-       <th {$headerStyle}>
-        {ts}Personal Campaign Page{/ts}
-       </th>
+        <th {$headerStyle}>
+          {ts}Personal Campaign Page{/ts}
+        </th>
       </tr>
       <tr>
-       <td {$labelStyle}>
-        {ts}Display In Honor Roll{/ts}
-       </td>
-       <td {$valueStyle}>
-        {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}
-       </td>
-      </tr>
-      {if $pcp_roll_nickname}
-       <tr>
         <td {$labelStyle}>
-         {ts}Nickname{/ts}
+          {ts}Display In Honor Roll{/ts}
         </td>
         <td {$valueStyle}>
-         {$pcp_roll_nickname}
+          {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}
         </td>
-       </tr>
+      </tr>
+      {if $pcp_roll_nickname}
+        <tr>
+          <td {$labelStyle}>
+            {ts}Nickname{/ts}
+          </td>
+          <td {$valueStyle}>
+            {$pcp_roll_nickname}
+          </td>
+        </tr>
       {/if}
       {if $pcp_personal_note}
-       <tr>
-        <td {$labelStyle}>
-         {ts}Personal Note{/ts}
-        </td>
-        <td {$valueStyle}>
-         {$pcp_personal_note}
-        </td>
-       </tr>
+        <tr>
+          <td {$labelStyle}>
+            {ts}Personal Note{/ts}
+          </td>
+          <td {$valueStyle}>
+            {$pcp_personal_note}
+          </td>
+        </tr>
       {/if}
-     {/if}
+    {/if}
 
-     {if !empty($onBehalfProfile)}
+    {if !empty($onBehalfProfile)}
       <tr>
-       <th {$headerStyle}>
-        {$onBehalfProfile_grouptitle}
-       </th>
+        <th {$headerStyle}>
+          {$onBehalfProfile_grouptitle}
+        </th>
       </tr>
       {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}
         <tr>
-         <td {$labelStyle}>
-          {$onBehalfName}
-         </td>
-         <td {$valueStyle}>
-          {$onBehalfValue}
-         </td>
+          <td {$labelStyle}>
+            {$onBehalfName}
+          </td>
+          <td {$valueStyle}>
+            {$onBehalfValue}
+          </td>
         </tr>
       {/foreach}
-     {/if}
+    {/if}
 
-     {if !empty($billingName)}
-       <tr>
-         <th {$headerStyle}>
-           {ts}Billing Name and Address{/ts}
-         </th>
+    {if !empty($billingName)}
+      <tr>
+        <th {$headerStyle}>
+          {ts}Billing Name and Address{/ts}
+        </th>
       </tr>
       <tr>
         <td colspan="2" {$valueStyle}>
       </tr>
     {/if}
 
-     {if !empty($credit_card_type)}
+    {if !empty($credit_card_type)}
       <tr>
-       <th {$headerStyle}>
-        {ts}Credit Card Information{/ts}
-       </th>
+        <th {$headerStyle}>
+          {ts}Credit Card Information{/ts}
+         </th>
       </tr>
       <tr>
-       <td colspan="2" {$valueStyle}>
-        {$credit_card_type}<br />
-        {$credit_card_number}<br />
-        {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}<br />
-       </td>
+        <td colspan="2" {$valueStyle}>
+          {$credit_card_type}<br />
+          {$credit_card_number}<br />
+          {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}<br />
+        </td>
       </tr>
-     {/if}
+    {/if}
 
-     {if !empty($selectPremium)}
+    {if !empty($selectPremium)}
       <tr>
-       <th {$headerStyle}>
-        {ts}Premium Information{/ts}
-       </th>
+        <th {$headerStyle}>
+          {ts}Premium Information{/ts}
+        </th>
       </tr>
       <tr>
-       <td colspan="2" {$labelStyle}>
-        {$product_name}
-       </td>
+        <td colspan="2" {$labelStyle}>
+          {$product_name}
+        </td>
       </tr>
       {if $option}
-       <tr>
-        <td {$labelStyle}>
-         {ts}Option{/ts}
-        </td>
-        <td {$valueStyle}>
-         {$option}
-        </td>
-       </tr>
+        <tr>
+          <td {$labelStyle}>
+            {ts}Option{/ts}
+          </td>
+          <td {$valueStyle}>
+            {$option}
+          </td>
+        </tr>
       {/if}
       {if $sku}
-       <tr>
-        <td {$labelStyle}>
-         {ts}SKU{/ts}
-        </td>
-        <td {$valueStyle}>
-         {$sku}
-        </td>
-       </tr>
+        <tr>
+          <td {$labelStyle}>
+            {ts}SKU{/ts}
+          </td>
+          <td {$valueStyle}>
+            {$sku}
+          </td>
+        </tr>
       {/if}
       {if $start_date}
-       <tr>
-        <td {$labelStyle}>
-         {ts}Start Date{/ts}
-        </td>
-        <td {$valueStyle}>
-         {$start_date|crmDate}
-        </td>
-       </tr>
+        <tr>
+          <td {$labelStyle}>
+            {ts}Start Date{/ts}
+          </td>
+          <td {$valueStyle}>
+            {$start_date|crmDate}
+          </td>
+        </tr>
       {/if}
       {if $end_date}
-       <tr>
-        <td {$labelStyle}>
-         {ts}End Date{/ts}
-        </td>
-        <td {$valueStyle}>
-         {$end_date|crmDate}
-        </td>
-       </tr>
+        <tr>
+          <td {$labelStyle}>
+            {ts}End Date{/ts}
+          </td>
+          <td {$valueStyle}>
+            {$end_date|crmDate}
+          </td>
+        </tr>
       {/if}
       {if !empty($contact_email) OR !empty($contact_phone)}
-       <tr>
-        <td colspan="2" {$valueStyle}>
-         <p>{ts}For information about this premium, contact:{/ts}</p>
-         {if !empty($contact_email)}
-          <p>{$contact_email}</p>
-         {/if}
-         {if !empty($contact_phone)}
-          <p>{$contact_phone}</p>
-         {/if}
-        </td>
-       </tr>
+        <tr>
+          <td colspan="2" {$valueStyle}>
+            <p>{ts}For information about this premium, contact:{/ts}</p>
+            {if !empty($contact_email)}
+              <p>{$contact_email}</p>
+            {/if}
+            {if !empty($contact_phone)}
+              <p>{$contact_phone}</p>
+            {/if}
+          </td>
+        </tr>
       {/if}
       {if $is_deductible AND !empty($price)}
         <tr>
-         <td colspan="2" {$valueStyle}>
-          <p>{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}</p>
+          <td colspan="2" {$valueStyle}>
+            <p>{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}</p>
          </td>
         </tr>
       {/if}
-     {/if}
+    {/if}
 
-     {if !empty($customPre)}
+    {if !empty($customPre)}
       <tr>
        <th {$headerStyle}>
-        {$customPre_grouptitle}
+         {$customPre_grouptitle}
        </th>
       </tr>
       {foreach from=$customPre item=customValue key=customName}
         <tr>
-         <td {$labelStyle}>
-          {$customName}
-         </td>
-         <td {$valueStyle}>
-          {$customValue}
-         </td>
+          <td {$labelStyle}>
+            {$customName}
+          </td>
+          <td {$valueStyle}>
+            {$customValue}
+          </td>
         </tr>
       {/foreach}
-     {/if}
+    {/if}
 
-     {if !empty($customPost)}
+    {if !empty($customPost)}
       <tr>
-       <th {$headerStyle}>
-        {$customPost_grouptitle}
-       </th>
+        <th {$headerStyle}>
+          {$customPost_grouptitle}
+        </th>
       </tr>
       {foreach from=$customPost item=customValue key=customName}
         <tr>
-         <td {$labelStyle}>
-          {$customName}
-         </td>
-         <td {$valueStyle}>
-          {$customValue}
-         </td>
+          <td {$labelStyle}>
+            {$customName}
+          </td>
+          <td {$valueStyle}>
+            {$customValue}
+          </td>
         </tr>
       {/foreach}
-     {/if}
+    {/if}
 
   </table>