whitespace fixups
[civicrm-core.git] / xml / templates / message_templates / contribution_offline_receipt_html.tpl
index 433b3bc55eef4a98374b33d016b164bcf72fd1a3..829afa01e33bfe4506c7a4b6c494a5fb645a9c8c 100644 (file)
@@ -58,7 +58,7 @@
            <th>{ts}Item{/ts}</th>
            <th>{ts}Qty{/ts}</th>
            <th>{ts}Each{/ts}</th>
-           {if $totalTaxAmount}
+           {if $getTaxDetails}
              <th>{ts}Subtotal{/ts}</th>
              <th>{ts}Tax Rate{/ts}</th>
              <th>{ts}Tax Amount{/ts}</th>
             <td>
              {$line.unit_price|crmMoney:$currency}
             </td>
-            {if $totalTaxAmount}
+            {if $getTaxDetails}
               <td>
                 {$line.unit_price*$line.qty|crmMoney:$currency}
               </td>
-              <td>
-                {$line.tax_rate|crmMoney:$currency}
-              </td>
-              <td>
-                {$line.tax_amount|crmMoney:$currency}
-              </td>
+              {if $line.tax_rate != "" || $line.tax_amount != ""}
+                <td>
+                  {$line.tax_rate|string_format:"%.2f"}%
+                </td>
+                <td>
+                  {$line.tax_amount|crmMoney:$currency}
+                </td>
+              {else}
+                <td></td>
+                <td></td>
+              {/if}
             {/if}
             <td>
-             {$line.line_total|crmMoney:$currency}
+             {$line.line_total+$line.tax_amount|crmMoney:$currency}
             </td>
            </tr>
           {/foreach}
        </tr>
       {/foreach}
      {/if}
-     {if $dataArray && $totalTaxAmount}
+     {if $getTaxDetails && $dataArray}
        <tr>
          <td {$labelStyle}>
            {ts} Amount before Tax : {/ts}
 
       {foreach from=$dataArray item=value key=priceset}
         <tr>
-        {if $priceset}
-          <td>&nbsp;{ts}Vat{/ts}{$priceset|string_format:"%.2f"}%</td>    
+        {if $priceset ||  $priceset == 0 || $value != ''}
+          <td>&nbsp;{$taxTerm} {$priceset|string_format:"%.2f"}%</td>
           <td>&nbsp;{$value|crmMoney:$currency}</td>
-        {elseif  $priceset == 0}
-          <td>&nbsp;{ts}No Vat{/ts}</td>
+        {else}
+          <td>&nbsp;{ts}No{/ts} {$taxTerm}</td>
           <td>&nbsp;{$value|crmMoney:$currency}</td>
         {/if}
         </tr>
       {/foreach}
      {/if}
 
-     {if $totalTaxAmount}
+     {if isset($totalTaxAmount) && $totalTaxAmount !== 'null'}
       <tr>
         <td {$labelStyle}>
           {ts}Total Tax Amount{/ts}