dev/core#2035 Invoice template - show Amount paid even when it is fully paid
authoreileen <emcnaughton@wikimedia.org>
Sat, 26 Sep 2020 00:43:38 +0000 (12:43 +1200)
committereileen <emcnaughton@wikimedia.org>
Sat, 26 Sep 2020 02:48:10 +0000 (14:48 +1200)
In https://github.com/civicrm/civicrm-core/pull/16680/files?w=1#diff-b211e0dac858fdad5d480c118d645e0bR129 there was a change from
'show amount paid & due depending on pay-later status' to 'show amount paid & due depending on whether payment is due'

This has been experienced as a regression and, being an invoice, there seems no reason to only change it sometimes.

This change just alters the template that new installs will receive. If approved another step is needed to update existing
installs (unless they have customised the template)

tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php
xml/templates/message_templates/contribution_invoice_receipt_html.tpl

index 01172c613359889fd893bfbd85a6f5d7cbf73086..a8d020da56c1e720b0a96159b33dc630c756f1c5 100644 (file)
@@ -74,8 +74,7 @@ class CRM_Contribute_Form_Task_InvoiceTest extends CiviUnitTestCase {
     $this->assertContains('PAYMENT ADVICE', $invoiceHTML[$contribution['id']]);
 
     $this->assertContains('AMOUNT DUE:</font></b></td>
-                  <td style="text-align:right;"><b><font size="1">$ 92.00</font></b></td>', $invoiceHTML[$contribution3['id']]);
-
+                <td style="text-align:right;"><b><font size="1">$ 92.00</font></b></td>', $invoiceHTML[$contribution3['id']]);
   }
 
   /**
index d6093e8510f7f090825e838f39b962c5963b2887..2222bf0b5c05c6c24d0e9bf1429fdc4d0173bb85 100644 (file)
                 <td style="text-align:right;white-space: nowrap"><b><font size="1">{ts 1=$defaultCurrency}TOTAL %1{/ts}</font></b></td>
                 <td style="text-align:right;"><font size="1">{$amount|crmMoney:$currency}</font></td>
               </tr>
-             {if $amountDue != 0}
-                <tr>
-                  <td colspan="3"></td>
-                  <td style="text-align:right;white-space: nowrap"><font size="1">
-                    {if $contribution_status_id == $refundedStatusId}
-                      {ts}Amount Credited{/ts}
-                    {else}
-                      {ts}Amount Paid{/ts}
-                    {/if}
-                   </font>
-                  </td>
-                  <td style="text-align:right;"><font size="1">{$amountPaid|crmMoney:$currency}</font></td>
-                </tr>
-                <tr>
-                  <td colspan="3"></td>
-                  <td colspan="2"><hr></hr></td>
-                </tr>
-                <tr>
-                  <td colspan="3"></td>
-                  <td style="text-align:right;white-space: nowrap" ><b><font size="1">{ts}AMOUNT DUE:{/ts}</font></b></td>
-                  <td style="text-align:right;"><b><font size="1">{$amountDue|crmMoney:$currency}</font></b></td>
-                </tr>
-              {/if}
+              <tr>
+                <td colspan="3"></td>
+                <td style="text-align:right;white-space: nowrap"><font size="1">
+                  {if $contribution_status_id == $refundedStatusId}
+                    {ts}Amount Credited{/ts}
+                  {else}
+                    {ts}Amount Paid{/ts}
+                  {/if}
+                 </font>
+                </td>
+                <td style="text-align:right;"><font size="1">{$amountPaid|crmMoney:$currency}</font></td>
+              </tr>
+              <tr>
+                <td colspan="3"></td>
+                <td colspan="2"><hr></hr></td>
+              </tr>
+              <tr>
+                <td colspan="3"></td>
+                <td style="text-align:right;white-space: nowrap" ><b><font size="1">{ts}AMOUNT DUE:{/ts}</font></b></td>
+                <td style="text-align:right;"><b><font size="1">{$amountDue|crmMoney:$currency}</font></b></td>
+              </tr>
+
               <br/><br/><br/>
               <tr>
                 <td colspan="5"></td>