Merge pull request #18158 from mattwire/createProfileContact
[civicrm-core.git] / xml / templates / message_templates / event_offline_receipt_html.tpl
index 15fec07acc58f33b3f23ece9d95e6b749e176651..b3748bcab7fe37a7b0f61b4592c27ce30a24cd3b 100644 (file)
@@ -10,7 +10,6 @@
 {capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture}
 {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
-<center>
   <table id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left; width:100%; max-width:700px; padding:0; margin:0; border:0px;">
 
   <!-- BEGIN HEADER -->
       {if !empty($lineItem)}
        {foreach from=$lineItem item=value key=priceset}
         {if $value neq 'skip'}
-         {if $isPrimary}
+         {if !empty($isPrimary)}
           {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}
            <tr>
             <td colspan="2" {$labelStyle}>
                <td>
                 {$line.unit_price*$line.qty|crmMoney}
                </td>
-               {if $line.tax_rate != "" || $line.tax_amount != ""}
+               {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")}
                 <td>
                  {$line.tax_rate|string_format:"%.2f"}%
                 </td>
         {/if}
        {/foreach}
        {if !empty($dataArray)}
+        {if isset($totalAmount) and isset($totalTaxAmount)}
         <tr>
          <td {$labelStyle}>
           {ts}Amount Before Tax:{/ts}
           {$totalAmount-$totalTaxAmount|crmMoney}
          </td>
         </tr>
+        {/if}
         {foreach from=$dataArray item=value key=priceset}
           <tr>
            {if $priceset || $priceset == 0}
-            <td>&nbsp;{$taxTerm} {$priceset|string_format:"%.2f"}%</td>
+            <td>&nbsp;{if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%</td>
             <td>&nbsp;{$value|crmMoney:$currency}</td>
            {else}
-            <td>&nbsp;{ts}No{/ts} {$taxTerm}</td>
+            <td>&nbsp;{ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}</td>
             <td>&nbsp;{$value|crmMoney:$currency}</td>
            {/if}
           </tr>
         </td>
        </tr>
       {/if}
-      {if $isPrimary}
+      {if !empty($isPrimary)}
        <tr>
         <td {$labelStyle}>
-        {if $balanceAmount}
+        {if isset($balanceAmount)}
            {ts}Total Paid{/ts}
         {else}
            {ts}Total Amount{/ts}
   </tr>
 
  </table>
-</center>
 
 </body>
 </html>