From feb6d63ac4670a2e88ed499bc50db5b26c084d0b Mon Sep 17 00:00:00 2001
From: Joe Murray <joe.murray@jmaconsulting.biz>
Date: Tue, 16 Jul 2013 12:52:50 -0400
Subject: [PATCH] Fixed formatting of messages, added currency support

---
 sql/message_templates/grant_approved_html.tpl |  8 ++--
 .../grant_approved_subject.tpl                |  2 +-
 sql/message_templates/grant_approved_text.tpl |  5 ++-
 .../grant_awaiting_info_html.tpl              | 11 +++---
 .../grant_awaiting_info_subject.tpl           |  2 +-
 .../grant_awaiting_info_text.tpl              | 14 +++----
 sql/message_templates/grant_eligible_html.tpl |  8 ++--
 .../grant_eligible_subject.tpl                |  2 +-
 sql/message_templates/grant_eligible_text.tpl |  9 +++--
 .../grant_ineligible_html.tpl                 | 11 +++---
 .../grant_ineligible_subject.tpl              |  2 +-
 .../grant_ineligible_text.tpl                 | 12 +++---
 sql/message_templates/grant_paid_html.tpl     |  8 ++--
 sql/message_templates/grant_paid_text.tpl     |  9 +++--
 .../grant_payment_check_html.tpl              | 18 ++++-----
 .../grant_payment_report_html.tpl             | 38 +++++++++----------
 .../grant_submitted_html.tpl                  |  8 ++--
 .../grant_submitted_text.tpl                  |  9 +++--
 .../grant_withdrawn_html.tpl                  | 10 ++---
 .../grant_withdrawn_subject.tpl               |  2 +-
 .../grant_withdrawn_text.tpl                  | 19 +++++-----
 21 files changed, 105 insertions(+), 102 deletions(-)

diff --git a/sql/message_templates/grant_approved_html.tpl b/sql/message_templates/grant_approved_html.tpl
index 2d8b756..62309e3 100644
--- a/sql/message_templates/grant_approved_html.tpl
+++ b/sql/message_templates/grant_approved_html.tpl
@@ -10,15 +10,15 @@
     {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
     <p>Dear {contact.display_name},</p>
-    <p>This is being sent to you as a receipt of {$grant_status} grant.</p>
+    <p>Your grant application below has been approved.</p>
 Grant Program Name: {$grant_programs} <br>
-Grant  Type             : {$grant_type}<br>
-Total Amount            : {$grant.amount_total}<br>
+Grant Type: {$grant_type}<br>
+Total Amount: {$grant.amount_total|crmMoney:$currency}<br>
 {if customField}
 {foreach from=$customField key=key item=data}
 <b>{$customGroup.$key}</b><br>
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
diff --git a/sql/message_templates/grant_approved_subject.tpl b/sql/message_templates/grant_approved_subject.tpl
index 61b9691..48028b8 100644
--- a/sql/message_templates/grant_approved_subject.tpl
+++ b/sql/message_templates/grant_approved_subject.tpl
@@ -1 +1 @@
-Receipt for {$grant_status} Grant
+Grant application approved
diff --git a/sql/message_templates/grant_approved_text.tpl b/sql/message_templates/grant_approved_text.tpl
index 93b230a..192beb9 100644
--- a/sql/message_templates/grant_approved_text.tpl
+++ b/sql/message_templates/grant_approved_text.tpl
@@ -1,8 +1,9 @@
 Dear {contact.display_name},
-        This is being sent to you as a receipt of {$grant_status} grant.
+
+Your grant application below has been approved.
 Grant Program Name: {$grant_programs}  <br>
 Grant  Type    {$grant_type}
-Total Amount: {$grant.amount_total}
+Total Amount: {$grant.amount_total|crmMoney:$currency}
 {if customField}
 {foreach from=$customField key=key item=data}
 {$customGroup.$key}
diff --git a/sql/message_templates/grant_awaiting_info_html.tpl b/sql/message_templates/grant_awaiting_info_html.tpl
index 66176a9..cf5bd4f 100644
--- a/sql/message_templates/grant_awaiting_info_html.tpl
+++ b/sql/message_templates/grant_awaiting_info_html.tpl
@@ -10,19 +10,18 @@
     {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
     <p>Dear {contact.display_name},</p>
-    <p>This is being sent to you as a receipt of {$grant_status} grant.</p>
+    <p>Processing of your grant application has been put on hold while we await further information from you.</p>
 Grant Program Name: {$grant_programs} <br>
-Grant  Type             : {$grant_type}<br>
-Total Amount            : {$grant.amount_total}<br>
+Grant Type: {$grant_type}<br>
+Total Amount: {$grant.amount_total|crmMoney:$currency}<br>
 {if $grant.grant_incomplete_reason}
-Grant Incomplete Reason:
-{$grant.grant_incomplete_reason}<br>
+Grant Incomplete Reason: {$grant.grant_incomplete_reason}<br>
 {/if}
 {if customField}
 {foreach from=$customField key=key item=data}
 <b>{$customGroup.$key}</b><br>
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
diff --git a/sql/message_templates/grant_awaiting_info_subject.tpl b/sql/message_templates/grant_awaiting_info_subject.tpl
index 61b9691..3e802f9 100644
--- a/sql/message_templates/grant_awaiting_info_subject.tpl
+++ b/sql/message_templates/grant_awaiting_info_subject.tpl
@@ -1 +1 @@
-Receipt for {$grant_status} Grant
+Awaiting information regarding your {$grant_type} application
diff --git a/sql/message_templates/grant_awaiting_info_text.tpl b/sql/message_templates/grant_awaiting_info_text.tpl
index 813a70d..4b50b44 100644
--- a/sql/message_templates/grant_awaiting_info_text.tpl
+++ b/sql/message_templates/grant_awaiting_info_text.tpl
@@ -1,17 +1,17 @@
 Dear {contact.display_name},
-        This is being sent to you as a receipt of {$grant_status} grant.
-Grant Program Name: {$grant_programs}  <br>
-Grant  Type    {$grant_type}<br>
-Total Amount: {$grant.amount_total}<br>
+
+Processing of your grant application has been put on hold while we await further information from you.
+Grant Program Name: {$grant_programs}
+Grant Type: {$grant_type}<br>
+Total Amount: {$grant.amount_total|crmMoney:$currency}
 {if $grant.grant_incomplete_reason}
-Grant Incomplete Reason:
-{$grant.grant_incomplete_reason}<br>
+Grant Incomplete Reason: {$grant.grant_incomplete_reason}
 {/if}
 {if customField}
 {foreach from=$customField key=key item=data}
 {$customGroup.$key}
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
\ No newline at end of file
diff --git a/sql/message_templates/grant_eligible_html.tpl b/sql/message_templates/grant_eligible_html.tpl
index 2d8b756..7c0b03f 100644
--- a/sql/message_templates/grant_eligible_html.tpl
+++ b/sql/message_templates/grant_eligible_html.tpl
@@ -10,15 +10,15 @@
     {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
     <p>Dear {contact.display_name},</p>
-    <p>This is being sent to you as a receipt of {$grant_status} grant.</p>
+    <p>We have determined that the grant application below is eligible to receive an award. The actual amount to be awarded will be determined at a later date.</p>
 Grant Program Name: {$grant_programs} <br>
-Grant  Type             : {$grant_type}<br>
-Total Amount            : {$grant.amount_total}<br>
+Grant Type: {$grant_type}<br>
+Total Amount: {$grant.amount_total|crmMoney:$currency}<br>
 {if customField}
 {foreach from=$customField key=key item=data}
 <b>{$customGroup.$key}</b><br>
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
diff --git a/sql/message_templates/grant_eligible_subject.tpl b/sql/message_templates/grant_eligible_subject.tpl
index 61b9691..ebd3a44 100644
--- a/sql/message_templates/grant_eligible_subject.tpl
+++ b/sql/message_templates/grant_eligible_subject.tpl
@@ -1 +1 @@
-Receipt for {$grant_status} Grant
+Your {$grant_type} grant application is eligible
diff --git a/sql/message_templates/grant_eligible_text.tpl b/sql/message_templates/grant_eligible_text.tpl
index 93b230a..5bb14f3 100644
--- a/sql/message_templates/grant_eligible_text.tpl
+++ b/sql/message_templates/grant_eligible_text.tpl
@@ -1,13 +1,14 @@
 Dear {contact.display_name},
-        This is being sent to you as a receipt of {$grant_status} grant.
+
+We have determined that the grant application below is eligible to receive an award. The actual amount to be awarded will be determined at a later date.
 Grant Program Name: {$grant_programs}  <br>
-Grant  Type    {$grant_type}
-Total Amount: {$grant.amount_total}
+Grant Type: {$grant_type}
+Total Amount: {$grant.amount_total|crmMoney:$currency}
 {if customField}
 {foreach from=$customField key=key item=data}
 {$customGroup.$key}
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
\ No newline at end of file
diff --git a/sql/message_templates/grant_ineligible_html.tpl b/sql/message_templates/grant_ineligible_html.tpl
index 4492245..5068cbc 100644
--- a/sql/message_templates/grant_ineligible_html.tpl
+++ b/sql/message_templates/grant_ineligible_html.tpl
@@ -10,19 +10,18 @@
     {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
     <p>Dear {contact.display_name},</p>
-    <p>This is being sent to you as a receipt of {$grant_status} grant.</p>
+    <p>We regret to inform you that the application below is ineligible.</p>
 Grant Program Name: {$grant_programs} <br>
-Grant  Type             : {$grant_type}<br>
-Total Amount            : {$grant.amount_total}<br>
+Grant Type: {$grant_type}<br>
+Total Amount: {$grant.amount_total|crmMoney:$currency}<br>
 {if $grant.grant_rejected_reason}
-Grant Ineligible Reason:
-{$grant.$grant.grant_rejected_reason}<br>
+Grant Ineligible Reason: {$grant.$grant.grant_rejected_reason}<br>
 {/if}
 {if customField}
 {foreach from=$customField key=key item=data}
 <b>{$customGroup.$key}</b><br>
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
diff --git a/sql/message_templates/grant_ineligible_subject.tpl b/sql/message_templates/grant_ineligible_subject.tpl
index 6cad7a0..2f4c4e5 100644
--- a/sql/message_templates/grant_ineligible_subject.tpl
+++ b/sql/message_templates/grant_ineligible_subject.tpl
@@ -1 +1 @@
-Receipt for {$grant_status} Grant
\ No newline at end of file
+Your {$grant_type} Grant Application
\ No newline at end of file
diff --git a/sql/message_templates/grant_ineligible_text.tpl b/sql/message_templates/grant_ineligible_text.tpl
index 8cd8dd9..3191943 100644
--- a/sql/message_templates/grant_ineligible_text.tpl
+++ b/sql/message_templates/grant_ineligible_text.tpl
@@ -1,17 +1,17 @@
 Dear {contact.display_name},
-        This is being sent to you as a receipt of {$grant_status} grant.
+
+We regret to inform you that the application below is ineligible.
 Grant Program Name: {$grant_programs}  <br>
-Grant  Type    {$grant_type}
-Total Amount: {$grant.amount_total}
+Grant Type: {$grant_type}
+Total Amount: {$grant.amount_total|crmMoney:$currency}
 {if $grant.grant_rejected_reason}
-Grant Ineligible Reason:
-{$grant.grant_rejected_reason}<br>
+Grant Ineligible Reason: {$grant.grant_rejected_reason}<br>
 {/if}
 {if customField}
 {foreach from=$customField key=key item=data}
 {$customGroup.$key}
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
\ No newline at end of file
diff --git a/sql/message_templates/grant_paid_html.tpl b/sql/message_templates/grant_paid_html.tpl
index 2d8b756..06ebaf2 100644
--- a/sql/message_templates/grant_paid_html.tpl
+++ b/sql/message_templates/grant_paid_html.tpl
@@ -10,15 +10,15 @@
     {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
     <p>Dear {contact.display_name},</p>
-    <p>This is being sent to you as a receipt of {$grant_status} grant.</p>
+    <p>~We have just created a payment for the application listed below.</p>
 Grant Program Name: {$grant_programs} <br>
-Grant  Type             : {$grant_type}<br>
-Total Amount            : {$grant.amount_total}<br>
+Grant Type: {$grant_type}<br>
+Total Amount: {$grant.amount_total|crmMoney:$currency}<br>
 {if customField}
 {foreach from=$customField key=key item=data}
 <b>{$customGroup.$key}</b><br>
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
diff --git a/sql/message_templates/grant_paid_text.tpl b/sql/message_templates/grant_paid_text.tpl
index 93b230a..f6aa2ad 100644
--- a/sql/message_templates/grant_paid_text.tpl
+++ b/sql/message_templates/grant_paid_text.tpl
@@ -1,13 +1,14 @@
 Dear {contact.display_name},
-        This is being sent to you as a receipt of {$grant_status} grant.
+
+We have just created a payment for the application listed below.
 Grant Program Name: {$grant_programs}  <br>
-Grant  Type    {$grant_type}
-Total Amount: {$grant.amount_total}
+Grant Type: {$grant_type}
+Total Amount: {$grant.amount_total|crmMoney:$currency}
 {if customField}
 {foreach from=$customField key=key item=data}
 {$customGroup.$key}
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
\ No newline at end of file
diff --git a/sql/message_templates/grant_payment_check_html.tpl b/sql/message_templates/grant_payment_check_html.tpl
index 1d90a8e..f55a517 100644
--- a/sql/message_templates/grant_payment_check_html.tpl
+++ b/sql/message_templates/grant_payment_check_html.tpl
@@ -13,14 +13,14 @@
       </tr>
       <tr>
         <td width="85%">total_in_words</td><td width="15%" style="float:right; text-align:right;">check_total</td>
-      </tr> 
+      </tr>
       </table>
       </div>
       <div style="height:60px" >
       <table width="100%" cellpadding=0 cellspacing=0 ;">
       <tr>
          <td width="100%">payable_to_name</td>
-      </tr> 
+      </tr>
       <tr>
          <td width="100%">payable_to_address</td>
       </tr>
@@ -34,14 +34,14 @@
     </table>
     </div>
     <div style="height:300px" >
-    <div style="float:right; text-align:right;"> payment_id </div>    
+    <div style="float:right; text-align:right;"> payment_id </div>
      <table width="100%"  cellpadding=0 cellspacing=0 >
        <tr><td width="100%" colspan="4">RE: payment_reason</td></tr>
        <tr><td width="15%">Payment Date</td><td width="15%">Grant ID</td><td width="50%">Payee</td><td width="20%">Amount</td></tr>
-       <tr><td width="15%">payment_details</td> </tr> 
+       <tr><td width="15%">payment_details</td> </tr>
       <tr>
-      <td width="15%"></td><td width="15%%"></td><td width="50%" style="text-align:right;" >Total Amount&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="15%"  >CAD :amount</td>
-      </tr> 
+      <td width="15%"></td><td width="15%%"></td><td width="50%" style="text-align:right;" >Total Amount&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="15%"  >currency amount</td>
+      </tr>
      </table>
    </div>
     <div style="height:265px" >
@@ -50,10 +50,10 @@
       <tr><td width="100%" colspan="4">RE: payment_reason</td></tr>
       <tr><td width="15%">Payment Date</td><td width="15%">Grant ID</td><td width="50%">Payee</td><td width="20%">Amount</td></tr>
       <tr><td width="15%">payment_details</td>
-      </tr> 
+      </tr>
       <tr>
-      <td width="15%"></td><td width="15%%"></td><td width="50%" style="text-align:right; ">Total Amount&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="20%"  >CAD :amount</td>
-      </tr> 
+      <td width="15%"></td><td width="15%%"></td><td width="50%" style="text-align:right; ">Total Amount&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="20%"  >currency amount</td>
+      </tr>
     </table>
     </div>
   </body>
diff --git a/sql/message_templates/grant_payment_report_html.tpl b/sql/message_templates/grant_payment_report_html.tpl
index 162fde0..1d90484 100644
--- a/sql/message_templates/grant_payment_report_html.tpl
+++ b/sql/message_templates/grant_payment_report_html.tpl
@@ -7,21 +7,21 @@
   <body>
   {assign var='page' value=1}
   <div style="float:right; text-align:right; margin-top:-50px;"> Page: {$page} </div>
-    <table width="100%" cellpadding=0 cellspacing=0  > 
+    <table width="100%" cellpadding=0 cellspacing=0  >
       <tr>
-	<td width="50%" align="right"><b><font size="2">{$domain_name}</font></b></td><td width="25%" align="right" ><b><font size="2">Run By :</font></b></td><td width="25%" align="left" ><font size="2">{$contact}</font></td>
+	<td width="50%" align="right"><b><font size="2">{$domain_name}</font></b></td><td width="25%" align="right" ><b><font size="2">Run By:</font></b></td><td width="25%" align="left" ><font size="2">{$contact}</font></td>
       </tr>
       <tr>
-       <td width="50%" align="right"></td><td width="25%" align="right" ><b><font size="2">Date :</font></b></td><td width="25%" align="left" ><font size="2">{$date}</font></td>
+       <td width="50%" align="right"></td><td width="25%" align="right" ><b><font size="2">Date:</font></b></td><td width="25%" align="left" ><font size="2">{$date}</font></td>
        </tr>
        <tr>
-       <td width="50%" align="right"><b><font size="2">A/P Cheque Register</font></b></td><td width="25%" align="right" ><b><font size="2">Time :</font></b></td><td width="25%" align="left" ><font size="2">{$time}</font></td>
-       </tr> 
+       <td width="50%" align="right"><b><font size="2">A/P Cheque Register</font></b></td><td width="25%" align="right" ><b><font size="2">Time:</font></b></td><td width="25%" align="left" ><font size="2">{$time}</font></td>
+       </tr>
     </table>
   </br>
-  <table width="100%" cellpadding=0 cellspacing=0  > 
+  <table width="100%" cellpadding=0 cellspacing=0  >
     <tr>
-      <td width="25%" align="center" ><b><font size="2">Batch ID:{$batch_number}</font></b></td><td width="25%" align="center" ><b><font size="2">Currency: CAD</font></b></td><td width="25%" align="center" ><b><font size="2">Accounting Year: 2012</font></b></td>
+      <td width="25%" align="center" ><b><font size="2">Batch ID:{$batch_number}</font></b></td><td width="25%" align="center" ><b><font size="2">Currency: {$currency}</font></b></td><td width="25%" align="center" ><b><font size="2">Accounting Year: 2012</font></b></td>
     </tr>
   </table> <hr/></br></br>
   <table width="100%" cellpadding=0 cellspacing=0  >
@@ -37,23 +37,23 @@
     <tr style="page-break-after:always">
 <td width="10%"><font size="2">{$data.payment_number}</font></td><td width="10%"><font size="2">{$key}</font></td><td width="20%"><font size="2">{$data.payable_to_name}</font></td><td width="25%" align="center" ><b><font size="2">Account:{$data.account_name}</font></b></td><td width="12%" align="right" ><font size="2" >{$data.amount}&nbsp;</font></td><td width="12%"><font size="2">{$data.payment_date}</font></td><td width="15%"><font size="2">&nbsp;{$contact}</font></td><td width="14%"><font size="2">{$data.payment_created_date}</font></td><td width="12%" ><font size="2">{$data.replaces_payment_id}</font></td>
     </tr>
-     </table>  
+     </table>
     <div style="float:right; text-align:right; margin-top:-50px;"> Page: {$page} </div>
-     <table width="100%" cellpadding=0 cellspacing=0  > 
+     <table width="100%" cellpadding=0 cellspacing=0  >
       <tr>
-	<td width="50%" align="right"><b><font size="2">{$domain_name}</font></b></td><td width="25%" align="right" ><b><font size="2">Run By :</font></b></td><td width="25%" align="left" ><font size="2">{$contact}</font></td>
+	<td width="50%" align="right"><b><font size="2">{$domain_name}</font></b></td><td width="25%" align="right" ><b><font size="2">Run By:</font></b></td><td width="25%" align="left" ><font size="2">{$contact}</font></td>
       </tr>
       <tr>
-       <td width="50%" align="right"></td><td width="25%" align="right" ><b><font size="2">Date :</font></b></td><td width="25%" align="left" ><font size="2">{$date}</font></td>
+       <td width="50%" align="right"></td><td width="25%" align="right" ><b><font size="2">Date:</font></b></td><td width="25%" align="left" ><font size="2">{$date}</font></td>
        </tr>
        <tr>
-       <td width="50%" align="right"><b><font size="2">A/P Cheque Register</font></b></td><td width="25%" align="right" ><b><font size="2">Time :</font></b></td><td width="25%" align="left" ><font size="2">{$time}</font></td>
-       </tr> 
+       <td width="50%" align="right"><b><font size="2">A/P Cheque Register</font></b></td><td width="25%" align="right" ><b><font size="2">Time:</font></b></td><td width="25%" align="left" ><font size="2">{$time}</font></td>
+       </tr>
     </table>
   </br>
-  <table width="100%" cellpadding=0 cellspacing=0  > 
+  <table width="100%" cellpadding=0 cellspacing=0  >
     <tr>
-      <td width="25%" align="center" ><b><font size="2">Batch ID:{$batch_number}</font></b></td><td width="25%" align="center" ><b><font size="2">Currency: CAD</font></b></td><td width="25%" align="center" ><b><font size="2">Account:{$account_name}</font></b></td><td width="25%" align="center" ><b><font size="2">Accounting Year: 2012</font></b></td>
+      <td width="25%" align="center" ><b><font size="2">Batch ID:{$batch_number}</font></b></td><td width="25%" align="center" ><b><font size="2">Currency: {$currency}</font></b></td><td width="25%" align="center" ><b><font size="2">Account:{$account_name}</font></b></td><td width="25%" align="center" ><b><font size="2">Accounting Year: 2012</font></b></td>
     </tr>
   </table> <hr/></br></br>
   <table width="100%" cellpadding=0 cellspacing=0  >
@@ -69,11 +69,11 @@
     {assign var='count' value=$count+1}
     {/foreach}
     {/if}
-  </table>  
+  </table>
   <br><br><hr>
   <table width="100%" cellpadding=0 cellspacing=0  >
-  <tr><td colspan="2"><b>Statistics:</b></td></tr> 
-  <tr><td width="50%">Number of cheques : {$total_payments}</td><td width="50%">Total amount : {$total_amount} </td></tr>
-  </table>  
+  <tr><td colspan="2"><b>Statistics:</b></td></tr>
+  <tr><td width="50%">Number of cheques: {$total_payments}</td><td width="50%">Total amount: {$total_amount} </td></tr>
+  </table>
 </body>
 </html>
\ No newline at end of file
diff --git a/sql/message_templates/grant_submitted_html.tpl b/sql/message_templates/grant_submitted_html.tpl
index 2d8b756..e253801 100644
--- a/sql/message_templates/grant_submitted_html.tpl
+++ b/sql/message_templates/grant_submitted_html.tpl
@@ -10,15 +10,15 @@
     {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
     <p>Dear {contact.display_name},</p>
-    <p>This is being sent to you as a receipt of {$grant_status} grant.</p>
+    <p>This is to let you know that we have received your application as detailed below.</p>
 Grant Program Name: {$grant_programs} <br>
-Grant  Type             : {$grant_type}<br>
-Total Amount            : {$grant.amount_total}<br>
+Grant Type: {$grant_type}<br>
+Total Amount: {$grant.amount_total|crmMoney:$currency}<br>
 {if customField}
 {foreach from=$customField key=key item=data}
 <b>{$customGroup.$key}</b><br>
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
diff --git a/sql/message_templates/grant_submitted_text.tpl b/sql/message_templates/grant_submitted_text.tpl
index 93b230a..bba2b24 100644
--- a/sql/message_templates/grant_submitted_text.tpl
+++ b/sql/message_templates/grant_submitted_text.tpl
@@ -1,13 +1,14 @@
 Dear {contact.display_name},
-        This is being sent to you as a receipt of {$grant_status} grant.
+
+This is to let you know that we have received your application as detailed below.
 Grant Program Name: {$grant_programs}  <br>
-Grant  Type    {$grant_type}
-Total Amount: {$grant.amount_total}
+Grant Type: {$grant_type}
+Total Amount: {$grant.amount_total|crmMoney:$currency}
 {if customField}
 {foreach from=$customField key=key item=data}
 {$customGroup.$key}
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
\ No newline at end of file
diff --git a/sql/message_templates/grant_withdrawn_html.tpl b/sql/message_templates/grant_withdrawn_html.tpl
index 0749e5e..eb8165c 100644
--- a/sql/message_templates/grant_withdrawn_html.tpl
+++ b/sql/message_templates/grant_withdrawn_html.tpl
@@ -10,15 +10,15 @@
     {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
     <p>Dear {contact.display_name},</p>
-    <p>This is being sent to you as a receipt of {$grant_status} grant.</p>
-Grant Program Name      : {$grant_programs} <br>
-Grant  Type             : {$grant_type}<br>
-Total Amount            : {$grant.amount_total}<br>
+    <p>Thank you for the notification that you want the grant application below and any associated award to be withdrawn. We have completed the withdrawal now.</p>
+Grant Program Name: {$grant_programs} <br>
+Grant Type: {$grant_type}<br>
+Total Amount: {$grant.amount_total|crmMoney:$currency}<br>
 {if customField}
 {foreach from=$customField key=key item=data}
 <b>{$customGroup.$key}</b><br>
 {foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
+{$ddata.label}: {$ddata.value}<br>
 {/foreach}
 {/foreach}
 {/if}
diff --git a/sql/message_templates/grant_withdrawn_subject.tpl b/sql/message_templates/grant_withdrawn_subject.tpl
index 6cad7a0..0480f9b 100644
--- a/sql/message_templates/grant_withdrawn_subject.tpl
+++ b/sql/message_templates/grant_withdrawn_subject.tpl
@@ -1 +1 @@
-Receipt for {$grant_status} Grant
\ No newline at end of file
+Withdrawal of Grant Application
\ No newline at end of file
diff --git a/sql/message_templates/grant_withdrawn_text.tpl b/sql/message_templates/grant_withdrawn_text.tpl
index 93b230a..84c2b78 100644
--- a/sql/message_templates/grant_withdrawn_text.tpl
+++ b/sql/message_templates/grant_withdrawn_text.tpl
@@ -1,13 +1,14 @@
 Dear {contact.display_name},
-        This is being sent to you as a receipt of {$grant_status} grant.
+
+Thank you for the notification that you want the grant application below and any associated award to be withdrawn. We have completed the withdrawal now.
 Grant Program Name: {$grant_programs}  <br>
-Grant  Type    {$grant_type}
-Total Amount: {$grant.amount_total}
+Grant Type:    {$grant_type}
+Total Amount: {$grant.amount_total|crmMoney:$currency}
 {if customField}
-{foreach from=$customField key=key item=data}
-{$customGroup.$key}
-{foreach from=$data key=dkey item=ddata}
-{$ddata.label} : {$ddata.value}<br>
-{/foreach}
-{/foreach}
+  {foreach from=$customField key=key item=data}
+    {$customGroup.$key}
+    {foreach from=$data key=dkey item=ddata}
+{$ddata.label}: {$ddata.value}<br>
+    {/foreach}
+  {/foreach}
 {/if}
\ No newline at end of file
-- 
GitLab