Formatting cleanup on contribution/recur templates
authorMatthew Wire <mjw@mjwconsult.co.uk>
Sat, 13 Jun 2020 12:05:35 +0000 (13:05 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Sat, 13 Jun 2020 12:05:42 +0000 (13:05 +0100)
templates/CRM/Contribute/Form/AdditionalInfo/Payment.tpl
templates/CRM/Contribute/Form/Contribution.tpl
templates/CRM/Contribute/Form/Contribution/Main.tpl

index a6810dd89aa5127b5fe0782d4ed240304e2473b5..0a3921c8cfd24ee17ac2695cc9c393ed2ede9733 100644 (file)
@@ -1,51 +1,57 @@
-
+{*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved.                        |
+ |                                                                    |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
+ +--------------------------------------------------------------------+
+*}
 {* build recurring contribution block. *}
 {if $buildRecurBlock}
 {literal}
   <script type="text/javascript" >
 
-    function enablePeriod( )
-    {
-      var frUnit = cj( '#frequency_unit' );
-      var frInerval = cj( '#frequency_interval' );
-      var installments = cj( '#installments' );
+    function enablePeriod() {
+      var frUnit = cj('#frequency_unit');
+      var frInerval = cj('#frequency_interval');
+      var installments = cj('#installments');
       isDisabled = false;
 
-      if ( cj( 'input:radio[name="is_recur"]:checked').val() == 0 )  {
+      if (cj('input:radio[name="is_recur"]:checked').val() == 0)  {
         isDisabled = true;
-        frInerval.val( '' );
-        installments.val( '' );
+        frInerval.val('');
+        installments.val('');
       }
 
-      frUnit.prop( 'disabled', isDisabled );
-      frInerval.prop( 'disabled', isDisabled );
-      installments.prop( 'disabled', isDisabled );
+      frUnit.prop('disabled', isDisabled);
+      frInerval.prop('disabled', isDisabled);
+      installments.prop('disabled', isDisabled);
     }
 
-    function buildRecurBlock( processorId ) {
-      if ( !processorId ) processorId = cj( "#payment_processor_id" ).val( );
+    function buildRecurBlock(processorId) {
+      if (!processorId) processorId = cj("#payment_processor_id").val();
       var recurPaymentProIds = {/literal}'{$recurringPaymentProcessorIds}'{literal};
-      var funName = ( cj.inArray(processorId, recurPaymentProIds.split(',')) > -1 ) ? 'show' : 'hide';
+      var funName = (cj.inArray(processorId, recurPaymentProIds.split(',')) > -1) ? 'show' : 'hide';
 
       var priceSet = cj("#price_set_id");
-      if ( priceSet && priceSet.val( ) ) {
+      if (priceSet && priceSet.val()) {
         funName = 'hide';
         //reset the values of recur block.
-        if ( cj( 'input:radio[name="is_recur"]:checked').val() ) {
+        if (cj('input:radio[name="is_recur"]:checked').val()) {
           cj("#installments").val('');
           cj("#frequency_interval").val('');
-          cj( 'input:radio[name="is_recur"]')[0].checked = true;
+          cj('input:radio[name="is_recur"]')[0].checked = true;
         }
       }
 
-
-      enablePeriod( );
-      eval( 'cj( "#recurringPaymentBlock" ).' + funName + "( )" );
+      enablePeriod();
+      eval('cj("#recurringPaymentBlock").' + funName + "()");
     }
 
     CRM.$(function($) {
-      buildRecurBlock( null );
-      enablePeriod( );
+      buildRecurBlock(null);
+      enablePeriod();
     });
 
   </script>
index 0df23f41bd89addd667a48563990654425edaf8e..f3674420c14f564fe6499fb0f41158fb4cc5bab8 100644 (file)
 {else}
   {include file="CRM/Contribute/Form/AdditionalInfo/Payment.tpl"}
   {if $contributionMode}
-  <div class="help">
-    {if $contactId && $payNow}
-      {ts 1=$displayName 2=$contributionMode|upper}Use this form to edit a contribution on behalf of %1. <strong>A
-      %2 transaction will be submitted</strong> using the selected payment processor.{/ts}
-    {elseif $contactId}
-      {ts 1=$displayName 2=$contributionMode|upper}Use this form to submit a new contribution on behalf of %1. <strong>A
-      %2 transaction will be submitted</strong> using the selected payment processor.{/ts}
-    {else}
-      {ts 1=$displayName 2=$contributionMode|upper}Use this form to submit a new contribution. <strong>A %2 transaction will be submitted</strong> using the selected payment processor.{/ts}
-    {/if}
-  </div>
+    <div class="help">
+      {if $contactId && $payNow}
+        {ts 1=$displayName 2=$contributionMode|upper}Use this form to edit a contribution on behalf of %1. <strong>A
+          %2 transaction will be submitted</strong> using the selected payment processor.{/ts}
+      {elseif $contactId}
+        {ts 1=$displayName 2=$contributionMode|upper}Use this form to submit a new contribution on behalf of %1. <strong>A
+          %2 transaction will be submitted</strong> using the selected payment processor.{/ts}
+      {else}
+        {ts 1=$displayName 2=$contributionMode|upper}Use this form to submit a new contribution. <strong>A %2 transaction will be submitted</strong> using the selected payment processor.{/ts}
+      {/if}
+    </div>
   {/if}
 
   <div class="crm-block crm-form-block crm-contribution-form-block">
 
-  {if !$email and $action neq 8 and $context neq 'standalone'}
-  <div class="messages status no-popup">
-    <div class="icon inform-icon"></div>&nbsp;{ts}You will not be able to send an automatic email receipt for this contribution because there is no email address recorded for this contact. If you want a receipt to be sent when this contribution is recorded, click Cancel and then click Edit from the Summary tab to add an email address before recording the contribution.{/ts}
-  </div>
-  {/if}
-
-  {if $action eq 8}
-  <div class="messages status no-popup">
-    <div class="icon inform-icon"></div>
-    {ts}WARNING: Deleting this contribution will result in the loss of the associated financial transactions (if any).{/ts} {ts}Do you want to continue?{/ts}
-  </div>
-  {else}
-    {if $newCredit AND $action EQ 1 AND $contributionMode EQ null}
-    <div class="action-link css_right crm-link-credit-card-mode">
-      {if $contactId}
-        {capture assign=ccModeLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=add&cid=`$contactId`&context=`$context`&mode=live"}{/capture}
-      {else}
-        {capture assign=ccModeLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=add&context=standalone&mode=live"}{/capture}
-      {/if}
-     <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}"><i class="crm-i fa-credit-card" aria-hidden="true"></i> {ts}submit credit card contribution{/ts}</a>
-    </div>
+    {if !$email and $action neq 8 and $context neq 'standalone'}
+      <div class="messages status no-popup">
+        <div class="icon inform-icon"></div>&nbsp;{ts}You will not be able to send an automatic email receipt for this contribution because there is no email address recorded for this contact. If you want a receipt to be sent when this contribution is recorded, click Cancel and then click Edit from the Summary tab to add an email address before recording the contribution.{/ts}
+      </div>
     {/if}
-  <div class="crm-submit-buttons">
-    {include file="CRM/common/formButtons.tpl"}
-  </div>
-  {if $isOnline}{assign var=valueStyle value=" class='view-value'"}{else}{assign var=valueStyle value=""}{/if}
-  <table class="form-layout-compressed">
-    <tr class="crm-contribution-form-block-contact_id">
-      <td class="label">{$form.contact_id.label}</td>
-      <td>{$form.contact_id.html}</td>
-    </tr>
-    <tr class="crm-contribution-form-block-contribution_type_id crm-contribution-form-block-financial_type_id">
-      <td class="label">{$form.financial_type_id.label}</td><td{$valueStyle}>{$form.financial_type_id.html}&nbsp;
-      {if $is_test}
-        {ts}(test){/ts}
-      {/if} {help id="id-financial_type"}
-      </td>
-    </tr>
-    {if $action eq 2 and $lineItem and !$defaultContribution}
-    <tr>
-      <td class="label">{ts}Contribution Amount{/ts}</td>
-      <td>{include file="CRM/Price/Page/LineItem.tpl" context="Contribution"}</td>
-    </tr>
+
+    {if $action eq 8}
+      <div class="messages status no-popup">
+        <div class="icon inform-icon"></div>
+        {ts}WARNING: Deleting this contribution will result in the loss of the associated financial transactions (if any).{/ts} {ts}Do you want to continue?{/ts}
+      </div>
     {else}
-    <tr  class="crm-contribution-form-block-total_amount">
-      <td class="label">{$form.total_amount.label}</td>
-      <td {$valueStyle}>
-        <span id='totalAmount'>{$form.currency.html|crmAddClass:eight}&nbsp;{$form.total_amount.html|crmAddClass:eight}</span>
-        {if $freezeFinancialType}
-          {help id="id-total_amount"}
+    {if $newCredit AND $action EQ 1 AND $contributionMode EQ null}
+      <div class="action-link css_right crm-link-credit-card-mode">
+        {if $contactId}
+          {capture assign=ccModeLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=add&cid=`$contactId`&context=`$context`&mode=live"}{/capture}
+        {else}
+          {capture assign=ccModeLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=add&context=standalone&mode=live"}{/capture}
         {/if}
-        {if !$payNow}
-          {if $hasPriceSets}
-            <span id='totalAmountORPriceSet'> {ts}OR{/ts}</span>
-            <span id='selectPriceSet'>{$form.price_set_id.html}</span>
-            <div id="priceset" class="hiddenElement"></div>
-          {/if}
+        <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}"><i class="crm-i fa-credit-card" aria-hidden="true"></i> {ts}submit credit card contribution{/ts}</a>
+      </div>
+    {/if}
+      <div class="crm-submit-buttons">
+        {include file="CRM/common/formButtons.tpl"}
+      </div>
+      {if $isOnline}{assign var=valueStyle value=" class='view-value'"}{else}{assign var=valueStyle value=""}{/if}
+      <table class="form-layout-compressed">
+        <tr class="crm-contribution-form-block-contact_id">
+          <td class="label">{$form.contact_id.label}</td>
+          <td>{$form.contact_id.html}</td>
+        </tr>
+        <tr class="crm-contribution-form-block-contribution_type_id crm-contribution-form-block-financial_type_id">
+          <td class="label">{$form.financial_type_id.label}</td><td{$valueStyle}>{$form.financial_type_id.html}&nbsp;
+            {if $is_test}
+              {ts}(test){/ts}
+            {/if} {help id="id-financial_type"}
+          </td>
+        </tr>
+        {if $action eq 2 and $lineItem and !$defaultContribution}
+          <tr>
+            <td class="label">{ts}Contribution Amount{/ts}</td>
+            <td>{include file="CRM/Price/Page/LineItem.tpl" context="Contribution"}</td>
+          </tr>
+        {else}
+          <tr  class="crm-contribution-form-block-total_amount">
+            <td class="label">{$form.total_amount.label}</td>
+            <td {$valueStyle}>
+              <span id='totalAmount'>{$form.currency.html|crmAddClass:eight}&nbsp;{$form.total_amount.html|crmAddClass:eight}</span>
+              {if $freezeFinancialType}
+                {help id="id-total_amount"}
+              {/if}
+              {if !$payNow}
+                {if $hasPriceSets}
+                  <span id='totalAmountORPriceSet'> {ts}OR{/ts}</span>
+                  <span id='selectPriceSet'>{$form.price_set_id.html}</span>
+                  <div id="priceset" class="hiddenElement"></div>
+                {/if}
 
-          {if $ppID}{ts}<a class='action-item crm-hover-button' onclick='adjustPayment();'>adjust payment amount</a>{/ts}{help id="adjust-payment-amount"}{/if}
-          <div id="totalAmountBlock">
-            {if $hasPriceSets}<span class="description">{ts}Alternatively, you can use a price set.{/ts}</span>{/if}
-            <div id="totalTaxAmount" class="label"></div>
-          </div>
-        {/if}
-      </td>
-    </tr>
-
-      {if $buildRecurBlock && !$payNow}
-      <tr id='recurringPaymentBlock' class='hiddenElement'>
-        <td></td>
-        <td>
-          <strong>{$form.is_recur.html} {ts}every{/ts}
-            &nbsp;{$form.frequency_interval.html}
-            &nbsp;{$form.frequency_unit.html}&nbsp;
-            {ts}for{/ts}
-            &nbsp;{$form.installments.html}
-            &nbsp;{$form.installments.label}
-          </strong>
-          <br />
-          <span class="description">
+                {if $ppID}{ts}<a class='action-item crm-hover-button' onclick='adjustPayment();'>adjust payment amount</a>{/ts}{help id="adjust-payment-amount"}{/if}
+                <div id="totalAmountBlock">
+                  {if $hasPriceSets}<span class="description">{ts}Alternatively, you can use a price set.{/ts}</span>{/if}
+                  <div id="totalTaxAmount" class="label"></div>
+                </div>
+              {/if}
+            </td>
+          </tr>
+
+          {if $buildRecurBlock && !$payNow}
+            <tr id='recurringPaymentBlock' class='hiddenElement'>
+              <td></td>
+              <td>
+                <strong>{$form.is_recur.html} {ts}every{/ts}
+                  &nbsp;{$form.frequency_interval.html}
+                  &nbsp;{$form.frequency_unit.html}&nbsp;
+                  {ts}for{/ts}
+                  &nbsp;{$form.installments.html}
+                  &nbsp;{$form.installments.label}
+                </strong>
+                <br />
+                <span class="description">
             {ts}Your recurring contribution will be processed automatically for the number of installments you specify. You can leave the number of installments blank if you want to make an open-ended commitment. In either case, you can choose to cancel at any time. You will receive an email receipt for each recurring contribution. The receipts will include a link you can use if you decide to modify or cancel your future contributions.{/ts}
           </span>
-        </td>
-      </tr>
-      {/if}
+              </td>
+            </tr>
+          {/if}
 
-    <tr id="adjust-option-type" class="crm-contribution-form-block-option_type">
-      <td class="label"></td><td {$valueStyle}>{$form.option_type.html}</td>
-    </tr>
-    {/if}
-    {if $contributionMode && $processorSupportsFutureStartDate}
-    <tr id='start_date' class="crm-contribution-form-block-receive_date">
-      <td class="label">{ts}Start Date{/ts}</td>
-      <td {$valueStyle}>{if $hideCalender neq true}{$form.receive_date.html}{/if}<br />
-        <span class="description">{ts}You can set a start date for recurring contributions and the first payment will be on that date. For a single post-dated contribution you must select recurring and choose one installment{/ts}</span>
-      </td>
-    </tr>
-    {/if}
+          <tr id="adjust-option-type" class="crm-contribution-form-block-option_type">
+            <td class="label"></td><td {$valueStyle}>{$form.option_type.html}</td>
+          </tr>
+        {/if}
+        {if $contributionMode && $processorSupportsFutureStartDate}
+          <tr id='start_date' class="crm-contribution-form-block-receive_date">
+            <td class="label">{ts}Start Date{/ts}</td>
+            <td {$valueStyle}>{if $hideCalender neq true}{$form.receive_date.html}{/if}<br />
+              <span class="description">{ts}You can set a start date for recurring contributions and the first payment will be on that date. For a single post-dated contribution you must select recurring and choose one installment{/ts}</span>
+            </td>
+          </tr>
+        {/if}
+
+        <tr class="crm-contribution-form-block-source">
+          <td class="label">{$form.source.label}</td>
+          <td {$valueStyle}>{$form.source.html|crmAddClass:huge} {help id="id-contrib_source"}
+          </td>
+        </tr>
 
-  <tr class="crm-contribution-form-block-source">
-    <td class="label">{$form.source.label}</td>
-    <td {$valueStyle}>{$form.source.html|crmAddClass:huge} {help id="id-contrib_source"}
-    </td>
-  </tr>
-
-  {* CRM-7362 --add campaign to contributions *}
-  {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" campaignTrClass="crm-contribution-form-block-campaign_id"}
-
-    {if !$contributionMode || $payNow}
-      <tr class="crm-contribution-form-block-contribution_status_id">
-        <td class="label">{$form.contribution_status_id.label}</td>
-        <td>{$form.contribution_status_id.html}
-        {if $contribution_status_id eq 2}{if $is_pay_later }: {ts}Pay Later{/ts} {else}: {ts}Incomplete Transaction{/ts}{/if}{/if}
-        </td>
-        <td>
-        {if !$isUsePaymentBlock && $contactId && $contribID && $contributionMode EQ null && $contribution_status_id eq 2}
-          {capture assign=payNowLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=update&id=`$contribID`&cid=`$contactId`&context=`$context`&mode=live"}{/capture}
-          <a class="open-inline action-item crm-hover-button" href="{$payNowLink}"><i class="crm-i fa-credit-card" aria-hidden="true"></i> {ts}Pay with Credit Card{/ts}</a>
+        {* CRM-7362 --add campaign to contributions *}
+        {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" campaignTrClass="crm-contribution-form-block-campaign_id"}
+
+        {if !$contributionMode || $payNow}
+          <tr class="crm-contribution-form-block-contribution_status_id">
+            <td class="label">{$form.contribution_status_id.label}</td>
+            <td>{$form.contribution_status_id.html}
+              {if $contribution_status_id eq 2}{if $is_pay_later }: {ts}Pay Later{/ts} {else}: {ts}Incomplete Transaction{/ts}{/if}{/if}
+            </td>
+            <td>
+              {if !$isUsePaymentBlock && $contactId && $contribID && $contributionMode EQ null && $contribution_status_id eq 2}
+                {capture assign=payNowLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=update&id=`$contribID`&cid=`$contactId`&context=`$context`&mode=live"}{/capture}
+                <a class="open-inline action-item crm-hover-button" href="{$payNowLink}"><i class="crm-i fa-credit-card" aria-hidden="true"></i> {ts}Pay with Credit Card{/ts}</a>
+              {/if}
+            </td>
+          </tr>
+        {/if}
+
+        {if !$contributionMode}
+          {* Cancellation / Refunded fields are hidden unless contribution status is set to Cancelled or Refunded*}
+          <tr id="cancelInfo" class="crm-contribution-form-block-cancelInfo">
+            <td>&nbsp;</td>
+            <td><fieldset><legend>{ts}Cancellation or Refund Information{/ts}</legend>
+                <table class="form-layout-compressed">
+                  <tr id="cancelDate" class="crm-contribution-form-block-cancel_date">
+                    <td class="label">{$form.cancel_date.label}</td>
+                    <td>
+                      {if $hideCalendar neq true}
+                        {$form.cancel_date.html}
+                      {else}
+                        {$form.cancel_date.value|crmDate}
+                      {/if}
+                    </td>
+                  </tr>
+                  <tr id="cancelDescription" class="crm-contribution-form-block-cancel_reason">
+                    <td class="label">&nbsp;</td>
+                    <td class="description">{ts}Enter the cancellation or refunded date, or you can skip this field and the cancellation date or refunded date will be automatically set to TODAY.{/ts}</td>
+                  </tr>
+                  <tr id="cancelReason">
+                    <td class="label" style="vertical-align: top;">{$form.cancel_reason.label}</td>
+                    <td>{$form.cancel_reason.html}</td>
+                  </tr>
+                  <tr id="refundTrxnID">
+                    <td class="label" style="vertical-align: top;">{$form.refund_trxn_id.label}</td>
+                    <td>{$form.refund_trxn_id.html}</td>
+                  </tr>
+                </table>
+              </fieldset>
+            </td>
+          </tr>
+          <tr class="crm-contribution-form-block-receive_date">
+            <td class="label">{$form.receive_date.label}</td>
+            <td>{$form.receive_date.html}<br />
+              <span class="description">{ts}The date this contribution was received.{/ts}</span>
+            </td>
+          </tr>
+        {/if}
+        {if $form.revenue_recognition_date && !$payNow}
+          <tr class="crm-contribution-form-block-revenue_recognition_date">
+            <td class="label">{$form.revenue_recognition_date.label}</td>
+            <td>{$form.revenue_recognition_date.html}</td>
+          </tr>
         {/if}
-      </td>
-      </tr>
-    {/if}
+
+        {if $email and $outBound_option != 2}
+          <tr class="crm-contribution-form-block-is_email_receipt">
+            <td class="label">{$form.is_email_receipt.label}</td>
+            <td>{$form.is_email_receipt.html}&nbsp;
+              <span class="description">{ts 1=$email}Automatically email a receipt for this payment to %1?{/ts}</span>
+            </td>
+          </tr>
+        {elseif $context eq 'standalone' and $outBound_option != 2 }
+          <tr id="email-receipt" style="display:none;" class="crm-contribution-form-block-is_email_receipt">
+            <td class="label">{$form.is_email_receipt.label}</td>
+            <td>{$form.is_email_receipt.html} <span class="description">{ts}Automatically email a receipt for this payment to {/ts}<span id="email-address"></span>?</span>
+            </td>
+          </tr>
+        {/if}
+        <tr id="fromEmail" class="crm-contribution-form-block-receipt_date" style="display:none;">
+          <td class="label">{$form.from_email_address.label}</td>
+          <td>{$form.from_email_address.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin}</td>
+        </tr>
+        <tr id="receiptDate" class="crm-contribution-form-block-receipt_date">
+          <td class="label">{$form.receipt_date.label}</td>
+          <td>{$form.receipt_date.html}<br />
+            <span class="description">{ts}Date that a receipt was sent to the contributor.{/ts}</span>
+          </td>
+        </tr>
+        {if $form.payment_processor_id}
+          <tr class="crm-contribution-form-block-payment_processor_id"><td class="label nowrap">{$form.payment_processor_id.label}<span class="crm-marker"> * </span></td><td>{$form.payment_processor_id.html}</td></tr>
+        {/if}
+      </table>
 
     {if !$contributionMode}
-      {* Cancellation / Refunded fields are hidden unless contribution status is set to Cancelled or Refunded*}
-      <tr id="cancelInfo" class="crm-contribution-form-block-cancelInfo">
-        <td>&nbsp;</td>
-        <td><fieldset><legend>{ts}Cancellation or Refund Information{/ts}</legend>
-          <table class="form-layout-compressed">
-            <tr id="cancelDate" class="crm-contribution-form-block-cancel_date">
-              <td class="label">{$form.cancel_date.label}</td>
-              <td>
-                {if $hideCalendar neq true}
-                  {$form.cancel_date.html}
-                {else}
-                  {$form.cancel_date.value|crmDate}
-                {/if}
-              </td>
-            </tr>
-            <tr id="cancelDescription" class="crm-contribution-form-block-cancel_reason">
-              <td class="label">&nbsp;</td>
-              <td class="description">{ts}Enter the cancellation or refunded date, or you can skip this field and the cancellation date or refunded date will be automatically set to TODAY.{/ts}</td>
+      <fieldset class="payment-details_group">
+        <legend>
+          {ts}Payment Details{/ts}
+        </legend>
+        {if $isUsePaymentBlock}
+          {include file="CRM/Contribute/Form/PaymentInfoBlock.tpl"}
+        {else}
+          <table class="form-layout-compressed" >
+            <tr class="crm-contribution-form-block-payment_instrument_id">
+              <td class="label">{$form.payment_instrument_id.label}</td>
+              <td {$valueStyle}>{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
             </tr>
-            <tr id="cancelReason">
-              <td class="label" style="vertical-align: top;">{$form.cancel_reason.label}</td>
-              <td>{$form.cancel_reason.html}</td>
-            </tr>
-            <tr id="refundTrxnID">
-              <td class="label" style="vertical-align: top;">{$form.refund_trxn_id.label}</td>
-              <td>{$form.refund_trxn_id.html}</td>
+            <tr class="crm-contribution-form-block-trxn_id">
+              <td class="label">{$form.trxn_id.label}</td>
+              <td {$valueStyle}>{$form.trxn_id.html} {help id="id-trans_id"}</td>
             </tr>
           </table>
-        </fieldset>
-        </td>
-      </tr>
-      <tr class="crm-contribution-form-block-receive_date">
-        <td class="label">{$form.receive_date.label}</td>
-        <td>{$form.receive_date.html}<br />
-          <span class="description">{ts}The date this contribution was received.{/ts}</span>
-        </td>
-      </tr>
-    {/if}
-    {if $form.revenue_recognition_date && !$payNow}
-      <tr class="crm-contribution-form-block-revenue_recognition_date">
-        <td class="label">{$form.revenue_recognition_date.label}</td>
-        <td>{$form.revenue_recognition_date.html}</td>
-      </tr>
+        {/if}
+      </fieldset>
     {/if}
 
-    {if $email and $outBound_option != 2}
-      <tr class="crm-contribution-form-block-is_email_receipt">
-        <td class="label">{$form.is_email_receipt.label}</td>
-        <td>{$form.is_email_receipt.html}&nbsp;
-          <span class="description">{ts 1=$email}Automatically email a receipt for this payment to %1?{/ts}</span>
-        </td>
-      </tr>
-    {elseif $context eq 'standalone' and $outBound_option != 2 }
-      <tr id="email-receipt" style="display:none;" class="crm-contribution-form-block-is_email_receipt">
-        <td class="label">{$form.is_email_receipt.label}</td>
-        <td>{$form.is_email_receipt.html} <span class="description">{ts}Automatically email a receipt for this payment to {/ts}<span id="email-address"></span>?</span>
-        </td>
-      </tr>
-    {/if}
-    <tr id="fromEmail" class="crm-contribution-form-block-receipt_date" style="display:none;">
-      <td class="label">{$form.from_email_address.label}</td>
-      <td>{$form.from_email_address.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin}</td>
-    </tr>
-    <tr id="receiptDate" class="crm-contribution-form-block-receipt_date">
-      <td class="label">{$form.receipt_date.label}</td>
-      <td>{$form.receipt_date.html}<br />
-        <span class="description">{ts}Date that a receipt was sent to the contributor.{/ts}</span>
-      </td>
-    </tr>
-    {if $form.payment_processor_id}
-      <tr class="crm-contribution-form-block-payment_processor_id"><td class="label nowrap">{$form.payment_processor_id.label}<span class="crm-marker"> * </span></td><td>{$form.payment_processor_id.html}</td></tr>
+    {if !$isUsePaymentBlock}
+      {include file='CRM/Core/BillingBlockWrapper.tpl'}
     {/if}
-  </table>
-
-  {if !$contributionMode}
-    <fieldset class="payment-details_group">
-      <legend>
-        {ts}Payment Details{/ts}
-      </legend>
-      {if $isUsePaymentBlock}
-        {include file="CRM/Contribute/Form/PaymentInfoBlock.tpl"}
-      {else}
-        <table class="form-layout-compressed" >
-          <tr class="crm-contribution-form-block-payment_instrument_id">
-            <td class="label">{$form.payment_instrument_id.label}</td>
-            <td {$valueStyle}>{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
-            </td>
-          </tr>
-          <tr class="crm-contribution-form-block-trxn_id">
-            <td class="label">{$form.trxn_id.label}</td>
-            <td {$valueStyle}>{$form.trxn_id.html} {help id="id-trans_id"}</td>
-          </tr>
-        </table>
-      {/if}
-      </fieldset>
-  {/if}
-
-  {if !$isUsePaymentBlock}
-    {include file='CRM/Core/BillingBlockWrapper.tpl'}
-  {/if}
 
     <!-- start of soft credit -->
     {if !$payNow}
                 <div class="description">{ts}Search for the Personal Campaign Page by the fund-raiser's last name or email address.{/ts}</div>
 
                 <div class="spacer"></div>
-                 <div class="crm-contribution-form-block-pcp_details">
+                <div class="crm-contribution-form-block-pcp_details">
                   <table class="crm-contribution-form-table-credit_to_pcp">
                     <tr id="pcpDisplayRollID" class="crm-contribution-form-block-pcp_display_in_roll">
                       <td class="label">{$form.pcp_display_in_roll.label}</td>
                       <td class="label" style="vertical-align: top">{$form.pcp_personal_note.label}</td>
                       <td>
                         {$form.pcp_personal_note.html}
-                        <div
-                          class="description">{ts}Personal message submitted by contributor for display in the Honor Roll.{/ts}</div>
+                        <div class="description">{ts}Personal message submitted by contributor for display in the Honor Roll.{/ts}</div>
                       </td>
                     </tr>
                   </table>
     {/if}
     <!-- end of PCP -->
 
-  {if !$payNow}
-    {include file="CRM/common/customDataBlock.tpl"}
-  {/if}
+    {if !$payNow}
+      {include file="CRM/common/customDataBlock.tpl"}
+    {/if}
 
-  {literal}
-  <script type="text/javascript">
-    CRM.$(function($) {
-    {/literal}
-      {if $buildPriceSet}{literal}buildAmount();{/literal}{/if}
     {literal}
-
-    // bind first click of accordion header to load crm-accordion-body with snippet
-    // everything else taken care of by cj().crm-accordions()
-      cj('#adjust-option-type').hide();
-      cj('.crm-ajax-accordion .crm-accordion-header').one('click', function() {
-        loadPanes(cj(this).attr('id'));
-      });
-      cj('.crm-ajax-accordion:not(.collapsed) .crm-accordion-header').each(function(index) {
-        loadPanes(cj(this).attr('id'));
-      });
-    });
-    // load panes function calls for snippet based on id of crm-accordion-header
-    function loadPanes( id ) {
-      var url = "{/literal}{crmURL p='civicrm/contact/view/contribution' q="snippet=4&id=`$entityID`&formType=" h=0}{literal}" + id;
-      {/literal}
-      {if $contributionMode}
-        url = url + "&mode={$contributionMode}";
-      {/if}
-      {if $qfKey}
-        url = url + "&qfKey={$qfKey}";
-      {/if}
-      {literal}
-      if (! cj('div.'+id).html()) {
-        var loading = '<img src="{/literal}{$config->resourceBase}i/loading.gif{literal}" alt="{/literal}{ts escape='js'}loading{/ts}{literal}" />&nbsp;{/literal}{ts escape='js'}Loading{/ts}{literal}...';
-        cj('div.'+id).html(loading);
-        cj.ajax({
-          url    : url,
-          success: function(data) { cj('div.'+id).html(data).trigger('crmLoad'); }
+      <script type="text/javascript">
+        CRM.$(function($) {
+          {/literal}
+          {if $buildPriceSet}{literal}buildAmount();{/literal}{/if}
+          {literal}
+
+          // bind first click of accordion header to load crm-accordion-body with snippet
+          // everything else taken care of by cj().crm-accordions()
+          cj('#adjust-option-type').hide();
+          cj('.crm-ajax-accordion .crm-accordion-header').one('click', function() {
+            loadPanes(cj(this).attr('id'));
+          });
+          cj('.crm-ajax-accordion:not(.collapsed) .crm-accordion-header').each(function(index) {
+            loadPanes(cj(this).attr('id'));
+          });
         });
-      }
-    }
-
-  var url = {/literal}{$dataUrl|@json_encode}{literal};
-
-  {/literal}
-    {if $context eq 'standalone' and $outBound_option != 2 }
-      {literal}
-      CRM.$(function($) {
-
-        var $form = $("form.{/literal}{$form.formClass}{literal}");
-        $("#contact_id", $form).change(checkEmail);
-        checkEmail( );
-
-        function checkEmail( ) {
-          var data = $("#contact_id", $form).select2('data');
-          if (data && data.extra && data.extra.email && data.extra.email.length) {
-            $("#email-receipt", $form).show();
-            $("#email-address", $form).html(data.extra.email);
-          }
-          else {
-            $("#email-receipt", $form).hide();
+        // load panes function calls for snippet based on id of crm-accordion-header
+        function loadPanes(id) {
+          var url = "{/literal}{crmURL p='civicrm/contact/view/contribution' q="snippet=4&id=`$entityID`&formType=" h=0}{literal}" + id;
+          {/literal}
+          {if $contributionMode}
+          url = url + "&mode={$contributionMode}";
+          {/if}
+          {if $qfKey}
+          url = url + "&qfKey={$qfKey}";
+          {/if}
+          {literal}
+          if (! cj('div.'+id).html()) {
+            var loading = '<img src="{/literal}{$config->resourceBase}i/loading.gif{literal}" alt="{/literal}{ts escape='js'}loading{/ts}{literal}" />&nbsp;{/literal}{ts escape='js'}Loading{/ts}{literal}...';
+            cj('div.'+id).html(loading);
+            cj.ajax({
+              url    : url,
+              success: function(data) { cj('div.'+id).html(data).trigger('crmLoad'); }
+            });
           }
         }
 
-        showHideByValue( 'is_email_receipt', '', 'receiptDate', 'table-row', 'radio', true);
-        showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false );
-      });
+        var url = {/literal}{$dataUrl|@json_encode}{literal};
 
-    {/literal}
-    {/if}
-  </script>
-
-  <div class="accordion ui-accordion ui-widget ui-helper-reset">
-  {* Additional Detail / Honoree Information / Premium Information *}
-    {foreach from=$allPanes key=paneName item=paneValue}
+        {/literal}
+        {if $context eq 'standalone' and $outBound_option != 2}
+        {literal}
+        CRM.$(function($) {
 
-      <div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open neq 'true'}collapsed{/if}">
-        <div class="crm-accordion-header" id="{$paneValue.id}">
+          var $form = $("form.{/literal}{$form.formClass}{literal}");
+          $("#contact_id", $form).change(checkEmail);
+          checkEmail();
 
-          {$paneName}
-        </div><!-- /.crm-accordion-header -->
-        <div class="crm-accordion-body">
+          function checkEmail() {
+            var data = $("#contact_id", $form).select2('data');
+            if (data && data.extra && data.extra.email && data.extra.email.length) {
+              $("#email-receipt", $form).show();
+              $("#email-address", $form).html(data.extra.email);
+            }
+            else {
+              $("#email-receipt", $form).hide();
+            }
+          }
 
-          <div class="{$paneValue.id}"></div>
-        </div><!-- /.crm-accordion-body -->
-      </div><!-- /.crm-accordion-wrapper -->
+          showHideByValue('is_email_receipt', '', 'receiptDate', 'table-row', 'radio', true);
+          showHideByValue('is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false);
+        });
 
-    {/foreach}
+        {/literal}
+        {/if}
+      </script>
+
+      <div class="accordion ui-accordion ui-widget ui-helper-reset">
+        {* Additional Detail / Honoree Information / Premium Information *}
+        {foreach from=$allPanes key=paneName item=paneValue}
+          <div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open neq 'true'}collapsed{/if}">
+            <div class="crm-accordion-header" id="{$paneValue.id}">
+              {$paneName}
+            </div><!-- /.crm-accordion-header -->
+            <div class="crm-accordion-body">
+              <div class="{$paneValue.id}"></div>
+            </div><!-- /.crm-accordion-body -->
+          </div><!-- /.crm-accordion-wrapper -->
+        {/foreach}
+      </div>
+    {/if}
+    <br />
+    <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
   </div>
 
-  {/if}
-<br />
-<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
-</div>
-
-  {literal}
+{literal}
   <script type="text/javascript">
-  function verify( ) {
-    if (cj('#is_email_receipt').prop('checked' )) {
-      var ok = confirm( '{/literal}{ts escape='js'}Click OK to save this contribution record AND send a receipt to the contributor now{/ts}{literal}.' );
-      if (!ok) {
-        return false;
+    function verify() {
+      if (cj('#is_email_receipt').prop('checked')) {
+        var ok = confirm('{/literal}{ts escape='js'}Click OK to save this contribution record AND send a receipt to the contributor now{/ts}{literal}.');
+        if (!ok) {
+          return false;
+        }
       }
     }
-  }
   </script>
-  {/literal}
+{/literal}
 
   {if $action neq 8}
-    {literal}
+  {literal}
     <script type="text/javascript">
       CRM.$(function($) {
         var $form = $('form.{/literal}{$form.formClass}{literal}');
           checkEmailDependancies();
         });
 
-        function checkEmailDependancies( ) {
+        function checkEmailDependancies() {
           if ($('#is_email_receipt', $form).prop('checked')) {
             $('#fromEmail', $form).show();
             $('#receiptDate', $form).hide();
           }
         }
         {/literal}{if !$contributionMode}{literal}
-          showHideCancelInfo($('#contribution_status_id', $form));
+        showHideCancelInfo($('#contribution_status_id', $form));
 
-          $('#contribution_status_id', $form).change(function() {
-            showHideCancelInfo($('#contribution_status_id', $form));
-          });
+        $('#contribution_status_id', $form).change(function() {
+          showHideCancelInfo($('#contribution_status_id', $form));
+        });
 
-          function showHideCancelInfo(obj) {
-            var cancelInfo_show_ids = [{/literal}{$cancelInfo_show_ids}{literal}];
-            if (cancelInfo_show_ids.indexOf(obj.val()) > -1) {
-              $('#cancelInfo', $form).show();
-              $('#total_amount', $form).attr('readonly', true);
-            }
-            else {
-              $("#cancel_date", $form).val('');
-              $("#cancel_reason", $form).val('');
-              $('#cancelInfo', $form).hide();
-              $("#total_amount", $form).removeAttr('readonly');
-            }
+        function showHideCancelInfo(obj) {
+          var cancelInfo_show_ids = [{/literal}{$cancelInfo_show_ids}{literal}];
+          if (cancelInfo_show_ids.indexOf(obj.val()) > -1) {
+            $('#cancelInfo', $form).show();
+            $('#total_amount', $form).attr('readonly', true);
           }
+          else {
+            $("#cancel_date", $form).val('');
+            $("#cancel_reason", $form).val('');
+            $('#cancelInfo', $form).hide();
+            $("#total_amount", $form).removeAttr('readonly');
+          }
+        }
         {/literal}{/if}
       });
     </script>
 {literal}
 <script type="text/javascript">
 
-{/literal}
+  {/literal}
 
-// load form during form rule.
-{if $buildPriceSet}{literal}buildAmount( );{/literal}{/if}
+  // load form during form rule.
+  {if $buildPriceSet}{literal}buildAmount();{/literal}{/if}
 
-{literal}
+  {literal}
 
-// CRM-16451: set financial type of 'Price Set' in back office contribution
-// instead of selecting manually
-function buildAmount( priceSetId, financialtypeIds ) {
-  if (!priceSetId) priceSetId = cj("#price_set_id").val( );
-  var fname = '#priceset';
-  if (!priceSetId) {
-    // hide price set fields.
-    cj(fname).hide( );
-
-    // show/hide price set amount and total amount.
-    cj("#totalAmountORPriceSet").show( );
-    cj("#totalAmount").show( );
-    var choose = "{/literal}{ts escape='js'}Choose price set{/ts}{literal}";
-    cj("#price_set_id option[value='']").html( choose );
-
-    cj('label[for="total_amount"]').text('{/literal}{ts}Total Amount{/ts}{literal}');
-    cj(".crm-contribution-form-block-financial_type_id").show();
-    cj("#financial_type_id option[value='']").attr('selected', true);
-
-    //we might want to build recur block.
-    if (cj("#is_recur")) buildRecurBlock( null );
-    return;
-  }
+  // CRM-16451: set financial type of 'Price Set' in back office contribution
+  // instead of selecting manually
+  function buildAmount(priceSetId, financialtypeIds) {
+    if (!priceSetId) { priceSetId = cj("#price_set_id").val(); }
+    var fname = '#priceset';
+    if (!priceSetId) {
+      // hide price set fields.
+      cj(fname).hide();
+
+      // show/hide price set amount and total amount.
+      cj("#totalAmountORPriceSet").show();
+      cj("#totalAmount").show();
+      var choose = "{/literal}{ts escape='js'}Choose price set{/ts}{literal}";
+      cj("#price_set_id option[value='']").html(choose);
+
+      cj('label[for="total_amount"]').text('{/literal}{ts}Total Amount{/ts}{literal}');
+      cj(".crm-contribution-form-block-financial_type_id").show();
+      cj("#financial_type_id option[value='']").attr('selected', true);
+
+      //we might want to build recur block.
+      if (cj("#is_recur")) { buildRecurBlock(null); }
+      return;
+    }
 
-  //don't allow recurring w/ priceset.
-  if ( cj( "#is_recur" ) && cj( 'input:radio[name="is_recur"]:checked').val( ) ) {
-    //reset the values of recur block.
-    cj("#installments").val('');
-    cj("#frequency_interval").val('');
-    cj('input:radio[name="is_recur"]')[0].checked = true;
-    cj("#recurringPaymentBlock").hide( );
-  }
+    //don't allow recurring w/ priceset.
+    if (cj("#is_recur") && cj('input:radio[name="is_recur"]:checked').val()) {
+      //reset the values of recur block.
+      cj("#installments").val('');
+      cj("#frequency_interval").val('');
+      cj('input:radio[name="is_recur"]')[0].checked = true;
+      cj("#recurringPaymentBlock").hide();
+    }
 
-  var dataUrl = {/literal}"{crmURL h=0 q='snippet=4'}"{literal} + '&priceSetId=' + priceSetId;
+    var dataUrl = {/literal}"{crmURL h=0 q='snippet=4'}"{literal} + '&priceSetId=' + priceSetId;
 
-  var response = cj.ajax({
-    url: dataUrl,
-    async: false
-  }).responseText;
+    var response = cj.ajax({
+      url: dataUrl,
+      async: false
+    }).responseText;
 
-  cj( fname ).show( ).html( response ).trigger('crmLoad');
-  // freeze total amount text field.
-  cj( "#total_amount").val('');
+    cj(fname).show().html(response).trigger('crmLoad');
+    // freeze total amount text field.
+    cj( "#total_amount").val('');
 
-  cj( "#totalAmountORPriceSet" ).hide( );
-  cj( "#totalAmount").hide( );
-  var manual = "{/literal}{ts escape='js'}Manual contribution amount{/ts}{literal}";
-  cj("#price_set_id option[value='']").html( manual );
+    cj( "#totalAmountORPriceSet" ).hide();
+    cj( "#totalAmount").hide();
+    var manual = "{/literal}{ts escape='js'}Manual contribution amount{/ts}{literal}";
+    cj("#price_set_id option[value='']").html(manual);
 
-  cj('label[for="total_amount"]').text('{/literal}{ts}Price Sets{/ts}{literal}');
-  if (financialtypeIds) {
-    cj("#financial_type_id option[value="+financialtypeIds[priceSetId]+"]").prop('selected', true);
+    cj('label[for="total_amount"]').text('{/literal}{ts}Price Sets{/ts}{literal}');
+    if (financialtypeIds) {
+      cj("#financial_type_id option[value="+financialtypeIds[priceSetId]+"]").prop('selected', true);
+    }
+    cj(".crm-contribution-form-block-financial_type_id").css("display", "none");
   }
-  cj(".crm-contribution-form-block-financial_type_id").css("display", "none");
-}
 
-function adjustPayment( ) {
-  cj('#adjust-option-type').show();
-  cj("#total_amount").removeAttr("READONLY");
-  cj("#total_amount").css('background-color', '#ffffff');
-}
+  function adjustPayment() {
+    cj('#adjust-option-type').show();
+    cj("#total_amount").removeAttr("READONLY");
+    cj("#total_amount").css('background-color', '#ffffff');
+  }
 
-{/literal}{if $processorSupportsFutureStartDate}{literal}
-cj ('#is_recur').click( function( ) {
-  showStartDate( );
-});
+  {/literal}{if $processorSupportsFutureStartDate}{literal}
+  cj ('#is_recur').click(function() {
+    showStartDate();
+  });
 
-showStartDate( );
+  showStartDate();
 
-function showStartDate( ) {
-  if (!cj('#is_recur').is(':checked')) {
-    cj('#start_date').hide( );
-  }
-  else {
-    cj('#start_date').show( );
+  function showStartDate() {
+    if (!cj('#is_recur').is(':checked')) {
+      cj('#start_date').hide();
+    }
+    else {
+      cj('#start_date').show();
+    }
   }
-}
 
-{/literal}{/if}{literal}
-var thousandMarker = "{/literal}{$config->monetaryThousandSeparator}{literal}";
-var separator = "{/literal}{$config->monetaryDecimalPoint}{literal}";
+  {/literal}{/if}{literal}
+  var thousandMarker = "{/literal}{$config->monetaryThousandSeparator}{literal}";
+  var separator = "{/literal}{$config->monetaryDecimalPoint}{literal}";
 
-cj("#financial_type_id").on("change",function(){
+  cj("#financial_type_id").on("change", function() {
     cj('#total_amount').trigger("change");
-})
-
-cj("#currency").on("change",function(){
-  cj('#total_amount').trigger("change");
-})
-
-{/literal}{if $taxRates && $invoicing}{literal}
-CRM.$(function($) {
-  $('#total_amount').on("change",function(event) {
-    if (event.handled !== true) {
-      var freezeFinancialType = '{/literal}{$freezeFinancialType}{literal}';
-      if (!freezeFinancialType) {
-        var financialType = $('#financial_type_id').val();
-        var taxRates = '{/literal}{$taxRates}{literal}';
-        var taxTerm = '{/literal}{$taxTerm}{literal}';
-        taxRates = JSON.parse(taxRates);
-        var currencies = '{/literal}{$currencies}{literal}';
-        currencies = JSON.parse(currencies);
-        var currencySelect = $('#currency').val();
-        var currencySymbol = currencies[currencySelect];
-        var re= /\((.*?)\)/g;
-        for(m = re.exec(currencySymbol); m; m = re.exec(currencySymbol)){
-          currencySymbol = m[1];
-        }
-        var taxRate = taxRates[financialType];
-        if (!taxRate) {
-          taxRate = 0;
-          cj("#totalTaxAmount").hide( );
-        } else {
-          cj("#totalTaxAmount").show( );
+  })
+
+  cj("#currency").on("change", function() {
+    cj('#total_amount').trigger("change");
+  })
+
+  {/literal}{if $taxRates && $invoicing}{literal}
+  CRM.$(function($) {
+    $('#total_amount').on("change", function(event) {
+      if (event.handled !== true) {
+        var freezeFinancialType = '{/literal}{$freezeFinancialType}{literal}';
+        if (!freezeFinancialType) {
+          var financialType = $('#financial_type_id').val();
+          var taxRates = '{/literal}{$taxRates}{literal}';
+          var taxTerm = '{/literal}{$taxTerm}{literal}';
+          taxRates = JSON.parse(taxRates);
+          var currencies = '{/literal}{$currencies}{literal}';
+          currencies = JSON.parse(currencies);
+          var currencySelect = $('#currency').val();
+          var currencySymbol = currencies[currencySelect];
+          var re= /\((.*?)\)/g;
+          for(m = re.exec(currencySymbol); m; m = re.exec(currencySymbol)){
+            currencySymbol = m[1];
+          }
+          var taxRate = taxRates[financialType];
+          if (!taxRate) {
+            taxRate = 0;
+            cj("#totalTaxAmount").hide();
+          } else {
+            cj("#totalTaxAmount").show();
+          }
+          var totalAmount = $('#total_amount').val();
+          // replace all thousandMarker and change the separator to a dot
+          totalAmount = totalAmount.replace(thousandMarker,'').replace(separator,'.');
+
+          var totalTaxAmount = '{/literal}{$totalTaxAmount}{literal}';
+          var taxAmount = (taxRate/100)*totalAmount;
+          taxAmount = isNaN (taxAmount) ? 0:taxAmount;
+          var totalTaxAmount = taxAmount + Number(totalAmount);
+          totalTaxAmount = formatMoney( totalTaxAmount, 2, separator, thousandMarker );
+          $("#totalTaxAmount" ).html('{/literal}{ts 1=$taxTerm}Amount with %1 :{/ts}{literal} <span id="currencySymbolShow">' + currencySymbol + '</span> '+ totalTaxAmount);
         }
-        var totalAmount = $('#total_amount').val();
-        // replace all thousandMarker and change the separator to a dot
-        totalAmount = totalAmount.replace(thousandMarker,'').replace(separator,'.');
-
-        var totalTaxAmount = '{/literal}{$totalTaxAmount}{literal}';
-        var taxAmount = (taxRate/100)*totalAmount;
-        taxAmount = isNaN (taxAmount) ? 0:taxAmount;
-        var totalTaxAmount = taxAmount + Number(totalAmount);
-        totalTaxAmount = formatMoney( totalTaxAmount, 2, separator, thousandMarker );
-        $("#totalTaxAmount" ).html('{/literal}{ts 1=$taxTerm}Amount with %1 :{/ts}{literal} <span id="currencySymbolShow">' + currencySymbol + '</span> '+ totalTaxAmount);
+        event.handled = true;
       }
-      event.handled = true;
-    }
-    return false;
-  });
+      return false;
+    });
 
-  $('#total_amount').trigger("change");
-});
-{/literal}{/if}{literal}
+    $('#total_amount').trigger("change");
+  });
+  {/literal}{/if}{literal}
 
-CRM.$(function($) {
-  $('#price_set_id').click(function() {
-    if( $('#price_set_id').val() ) {
-      $('#totalAmountBlock').hide();
-    }
-    else {
-      $('#totalAmountBlock').show();
-    }
+  CRM.$(function($) {
+    $('#price_set_id').click(function() {
+      if($('#price_set_id').val()) {
+        $('#totalAmountBlock').hide();
+      }
+      else {
+        $('#totalAmountBlock').show();
+      }
+    });
   });
-});
-
-function formatMoney (amount, c, d, t){
-  var n = amount,
-  c = isNaN(c = Math.abs(c)) ? 2 : c,
-  d = d == undefined ? "," : d,
-  t = t == undefined ? "." : t, s = n < 0 ? "-" : "",
-  i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "",
-  j = (j = i.length) > 3 ? j % 3 : 0;
-return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
-};
+
+  function formatMoney(amount, c, d, t) {
+    var n = amount,
+            c = isNaN(c = Math.abs(c)) ? 2 : c,
+            d = d == undefined ? "," : d,
+            t = t == undefined ? "." : t, s = n < 0 ? "-" : "",
+            i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "",
+            j = (j = i.length) > 3 ? j % 3 : 0;
+    return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
+  };
 </script>
 {/literal}
index 6077fe49fdc4d4ed6422841ce2c9a6793905de3c..0b6a9443bb633358a9cd5aa5907cb1eaafbb0bb5 100644 (file)
     {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl" context="front-end"}
   </div>
 {else}
-  {literal}
+{literal}
   <script type="text/javascript">
 
-  // Putting these functions directly in template so they are available for standalone forms
-  function useAmountOther() {
-    var priceset = {/literal}{if $contriPriceset}'{$contriPriceset}'{else}0{/if}{literal};
-
-    for( i=0; i < document.Main.elements.length; i++ ) {
-      element = document.Main.elements[i];
-      if ( element.type == 'radio' && element.name == priceset ) {
-        if (element.value == '0' ) {
-          element.click();
-        }
-        else {
-          element.checked = false;
+    // Putting these functions directly in template so they are available for standalone forms
+    function useAmountOther() {
+      var priceset = {/literal}{if $contriPriceset}'{$contriPriceset}'{else}0{/if}{literal};
+
+      for( i=0; i < document.Main.elements.length; i++ ) {
+        element = document.Main.elements[i];
+        if ( element.type == 'radio' && element.name == priceset ) {
+          if (element.value == '0' ) {
+            element.click();
+          }
+          else {
+            element.checked = false;
+          }
         }
       }
     }
-  }
 
-  function clearAmountOther() {
-    var priceset = {/literal}{if $priceset}'#{$priceset}'{else}0{/if}{literal}
-    if( priceset ){
-      cj(priceset).val('');
-      cj(priceset).blur();
+    function clearAmountOther() {
+      var priceset = {/literal}{if $priceset}'#{$priceset}'{else}0{/if}{literal}
+      if( priceset ){
+        cj(priceset).val('');
+        cj(priceset).blur();
+      }
+      if (document.Main.amount_other == null) return; // other_amt field not present; do nothing
+      document.Main.amount_other.value = "";
     }
-    if (document.Main.amount_other == null) return; // other_amt field not present; do nothing
-    document.Main.amount_other.value = "";
-  }
 
   </script>
-  {/literal}
+{/literal}
 
   {if $action & 1024}
-  {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"}
+    {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"}
   {/if}
 
   {if $displayCaptchaWarning}
-  <div class="messages status no-popup">
+    <div class="messages status no-popup">
       {ts}To display reCAPTCHA on form you must get an API key from<br /> <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>{/ts}
-  </div>
+    </div>
   {/if}
 
   {include file="CRM/common/TrackingFields.tpl"}
 
   <div class="crm-contribution-page-id-{$contributionPageID} crm-block crm-contribution-main-form-block">
 
-  {if $contact_id && !$ccid}
-    <div class="messages status no-popup crm-not-you-message">
-      {ts 1=$display_name}Welcome %1{/ts}. (<a href="{crmURL p='civicrm/contribute/transact' q="cid=0&reset=1&id=`$contributionPageID`"}" title="{ts}Click here to do this for a different person.{/ts}">{ts 1=$display_name}Not %1, or want to do this for a different person{/ts}</a>?)
-    </div>
-  {/if}
-
-  <div id="intro_text" class="crm-public-form-item crm-section intro_text-section">
-    {$intro_text}
-  </div>
-  {include file="CRM/common/cidzero.tpl"}
-  {if $islifetime or $ispricelifetime }
-  <div class="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
-  {/if}
+    {if $contact_id && !$ccid}
+      <div class="messages status no-popup crm-not-you-message">
+        {ts 1=$display_name}Welcome %1{/ts}. (<a href="{crmURL p='civicrm/contribute/transact' q="cid=0&reset=1&id=`$contributionPageID`"}" title="{ts}Click here to do this for a different person.{/ts}">{ts 1=$display_name}Not %1, or want to do this for a different person{/ts}</a>?)
+      </div>
+    {/if}
 
-  {if !empty($useForMember) && !$ccid}
-    <div class="crm-public-form-item crm-section">
-      {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
+    <div id="intro_text" class="crm-public-form-item crm-section intro_text-section">
+      {$intro_text}
     </div>
-  {elseif !empty($ccid)}
-    {if $lineItem && $priceSetID && !$is_quick_config}
-      <div class="header-dark">
-        {ts}Contribution Information{/ts}{if $display_name} &ndash; {$display_name}{/if}
+    {include file="CRM/common/cidzero.tpl"}
+    {if $islifetime or $ispricelifetime}
+      <div class="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
+    {/if}
+
+    {if !empty($useForMember) && !$ccid}
+      <div class="crm-public-form-item crm-section">
+        {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
       </div>
-      {assign var="totalAmount" value=$pendingAmount}
-      {include file="CRM/Price/Page/LineItem.tpl" context="Contribution"}
+    {elseif !empty($ccid)}
+      {if $lineItem && $priceSetID && !$is_quick_config}
+        <div class="header-dark">
+          {ts}Contribution Information{/ts}{if $display_name} &ndash; {$display_name}{/if}
+        </div>
+        {assign var="totalAmount" value=$pendingAmount}
+        {include file="CRM/Price/Page/LineItem.tpl" context="Contribution"}
+      {else}
+        <div class="display-block">
+          <td class="label">{$form.total_amount.label}</td>
+          <td><span>{$form.total_amount.html|crmMoney}&nbsp;&nbsp;{if $taxAmount}{ts 1=$taxTerm 2=$taxAmount|crmMoney}(includes %1 of %2){/ts}{/if}</span></td>
+        </div>
+      {/if}
     {else}
-      <div class="display-block">
-        <td class="label">{$form.total_amount.label}</td>
-        <td><span>{$form.total_amount.html|crmMoney}&nbsp;&nbsp;{if $taxAmount}{ts 1=$taxTerm 2=$taxAmount|crmMoney}(includes %1 of %2){/ts}{/if}</span></td>
+      <div id="priceset-div">
+        {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
       </div>
     {/if}
-  {else}
-    <div id="priceset-div">
-    {include file="CRM/Price/Form/PriceSet.tpl" extends="Contribution"}
-    </div>
-  {/if}
 
-  {if !$ccid}
-    {crmRegion name='contribution-main-pledge-block'}
-    {if $pledgeBlock}
-      {if $is_pledge_payment}
-      <div class="crm-public-form-item crm-section {$form.pledge_amount.name}-section">
-        <div class="label">{$form.pledge_amount.label}&nbsp;<span class="crm-marker">*</span></div>
-        <div class="content">{$form.pledge_amount.html}</div>
-        <div class="clear"></div>
-      </div>
-      {else}
-        <div class="crm-public-form-item crm-section {$form.is_pledge.name}-section">
+    {if !$ccid}
+      {crmRegion name='contribution-main-pledge-block'}
+      {if $pledgeBlock}
+        {if $is_pledge_payment}
+          <div class="crm-public-form-item crm-section {$form.pledge_amount.name}-section">
+            <div class="label">{$form.pledge_amount.label}&nbsp;<span class="crm-marker">*</span></div>
+            <div class="content">{$form.pledge_amount.html}</div>
+            <div class="clear"></div>
+          </div>
+        {else}
+          <div class="crm-public-form-item crm-section {$form.is_pledge.name}-section">
+            <div class="label">&nbsp;</div>
+            <div class="content">
+              {$form.is_pledge.html}&nbsp;
+              {if $is_pledge_interval}
+                {$form.pledge_frequency_interval.html}&nbsp;
+              {/if}
+              {$form.pledge_frequency_unit.html}<span id="pledge_installments_num">&nbsp;{ts}for{/ts}&nbsp;{$form.pledge_installments.html}&nbsp;{ts}installments.{/ts}</span>
+            </div>
+            <div class="clear"></div>
+            {if $start_date_editable}
+              {if $is_date}
+                <div class="label">{$form.start_date.label}</div><div class="content">{$form.start_date.html}</div>
+              {else}
+                <div class="label">{$form.start_date.label}</div><div class="content">{$form.start_date.html}</div>
+              {/if}
+            {else}
+              <div class="label">{$form.start_date.label}</div>
+              <div class="content">{$start_date_display|date_format}</div>
+            {/if}
+            <div class="clear"></div>
+          </div>
+        {/if}
+      {/if}
+      {/crmRegion}
+
+      {if $form.is_recur}
+        <div class="crm-public-form-item crm-section {$form.is_recur.name}-section">
           <div class="label">&nbsp;</div>
           <div class="content">
-            {$form.is_pledge.html}&nbsp;
-            {if $is_pledge_interval}
-              {$form.pledge_frequency_interval.html}&nbsp;
+            {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
+            {if $is_recur_interval}
+              {$form.frequency_interval.html}
             {/if}
-            {$form.pledge_frequency_unit.html}<span id="pledge_installments_num">&nbsp;{ts}for{/ts}&nbsp;{$form.pledge_installments.html}&nbsp;{ts}installments.{/ts}</span>
-          </div>
-          <div class="clear"></div>
-          {if $start_date_editable}
-            {if $is_date}
-              <div class="label">{$form.start_date.label}</div><div class="content">{$form.start_date.html}</div>
+            {if $one_frequency_unit}
+              {$frequency_unit}
             {else}
-              <div class="label">{$form.start_date.label}</div><div class="content">{$form.start_date.html}</div>
+              {$form.frequency_unit.html}
             {/if}
-          {else}
-            <div class="label">{$form.start_date.label}</div>
-            <div class="content">{$start_date_display|date_format}</div>
-          {/if}
-        <div class="clear"></div>
-        </div>
-      {/if}
-    {/if}
-    {/crmRegion}
-
-    {if $form.is_recur}
-    <div class="crm-public-form-item crm-section {$form.is_recur.name}-section">
-      <div class="label">&nbsp;</div>
-      <div class="content">
-        {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
-        {if $is_recur_interval}
-          {$form.frequency_interval.html}
-        {/if}
-        {if $one_frequency_unit}
-          {$frequency_unit}
-          {else}
-          {$form.frequency_unit.html}
-        {/if}
-        {if $is_recur_installments}
-          <span id="recur_installments_num">
+            {if $is_recur_installments}
+              <span id="recur_installments_num">
           {ts}for{/ts} {$form.installments.html} {$form.installments.label}
           </span>
-        {/if}
-        <div id="recurHelp" class="description">
-          {$recurringHelpText}
+            {/if}
+            <div id="recurHelp" class="description">
+              {$recurringHelpText}
+            </div>
+          </div>
+          <div class="clear"></div>
         </div>
-      </div>
-      <div class="clear"></div>
-    </div>
-    {/if}
-    {if $pcpSupporterText}
-    <div class="crm-public-form-item crm-section pcpSupporterText-section">
-      <div class="label">&nbsp;</div>
-      <div class="content">{$pcpSupporterText}</div>
-      <div class="clear"></div>
-    </div>
-    {/if}
-    {if $showMainEmail}
-      {assign var=n value=email-$bltID}
-      <div class="crm-public-form-item crm-section {$form.$n.name}-section">
-        <div class="label">{$form.$n.label}</div>
-        <div class="content">
-          {$form.$n.html}
+      {/if}
+      {if $pcpSupporterText}
+        <div class="crm-public-form-item crm-section pcpSupporterText-section">
+          <div class="label">&nbsp;</div>
+          <div class="content">{$pcpSupporterText}</div>
+          <div class="clear"></div>
         </div>
-        <div class="clear"></div>
-      </div>
-    {/if}
+      {/if}
+      {if $showMainEmail}
+        {assign var=n value=email-$bltID}
+        <div class="crm-public-form-item crm-section {$form.$n.name}-section">
+          <div class="label">{$form.$n.label}</div>
+          <div class="content">
+            {$form.$n.html}
+          </div>
+          <div class="clear"></div>
+        </div>
+      {/if}
 
-    <div id='onBehalfOfOrg' class="crm-public-form-item crm-section">
-      {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl"}
-    </div>
+      <div id='onBehalfOfOrg' class="crm-public-form-item crm-section">
+        {include file="CRM/Contribute/Form/Contribution/OnBehalfOf.tpl"}
+      </div>
 
-    {* User account registration option. Displays if enabled for one of the profiles on this page. *}
-    <div class="crm-public-form-item crm-section cms_user-section">
-      {include file="CRM/common/CMSUser.tpl"}
-    </div>
-    <div class="crm-public-form-item crm-section premium_block-section">
-      {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
-    </div>
+      {* User account registration option. Displays if enabled for one of the profiles on this page. *}
+      <div class="crm-public-form-item crm-section cms_user-section">
+        {include file="CRM/common/CMSUser.tpl"}
+      </div>
+      <div class="crm-public-form-item crm-section premium_block-section">
+        {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
+      </div>
 
-    {if $honoreeProfileFields && $honoreeProfileFields|@count}
-      <fieldset class="crm-public-form-item crm-group honor_block-group">
-        {crmRegion name="contribution-soft-credit-block"}
-          <legend>{$honor_block_title}</legend>
-          <div class="crm-public-form-item crm-section honor_block_text-section">
-            {$honor_block_text}
-          </div>
+      {if $honoreeProfileFields && $honoreeProfileFields|@count}
+        <fieldset class="crm-public-form-item crm-group honor_block-group">
+          {crmRegion name="contribution-soft-credit-block"}
+            <legend>{$honor_block_title}</legend>
+            <div class="crm-public-form-item crm-section honor_block_text-section">
+              {$honor_block_text}
+            </div>
           {if $form.soft_credit_type_id.html}
             <div class="crm-public-form-item crm-section {$form.soft_credit_type_id.name}-section">
               <div class="content" >
               </div>
             </div>
           {/if}
-        {/crmRegion}
-        <div id="honorType" class="honoree-name-email-section">
-          {include file="CRM/UF/Form/Block.tpl" fields=$honoreeProfileFields mode=8 prefix='honor'}
-        </div>
-      </fieldset>
-    {/if}
+          {/crmRegion}
+          <div id="honorType" class="honoree-name-email-section">
+            {include file="CRM/UF/Form/Block.tpl" fields=$honoreeProfileFields mode=8 prefix='honor'}
+          </div>
+        </fieldset>
+      {/if}
 
-    <div class="crm-public-form-item crm-group custom_pre_profile-group">
-    {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
-    </div>
+      <div class="crm-public-form-item crm-group custom_pre_profile-group">
+        {include file="CRM/UF/Form/Block.tpl" fields=$customPre}
+      </div>
 
-    {if $isHonor}
-    <fieldset class="crm-public-form-item crm-group pcp-group">
-      <div class="crm-public-form-item crm-section pcp-section">
-        <div class="crm-public-form-item crm-section display_in_roll-section">
-          <div class="content">
-            {$form.pcp_display_in_roll.html} &nbsp;
-            {$form.pcp_display_in_roll.label}
-          </div>
-          <div class="clear"></div>
-        </div>
-        <div id="nameID" class="crm-public-form-item crm-section is_anonymous-section">
-          <div class="content">
-            {$form.pcp_is_anonymous.html}
-          </div>
-          <div class="clear"></div>
-        </div>
-        <div id="nickID" class="crm-public-form-item crm-section pcp_roll_nickname-section">
-          <div class="label">{$form.pcp_roll_nickname.label}</div>
-          <div class="content">{$form.pcp_roll_nickname.html}
-            <div class="description">{ts}Enter the name you want listed with this contribution. You can use a nick name like 'The Jones Family' or 'Sarah and Sam'.{/ts}</div>
+      {if $isHonor}
+        <fieldset class="crm-public-form-item crm-group pcp-group">
+          <div class="crm-public-form-item crm-section pcp-section">
+            <div class="crm-public-form-item crm-section display_in_roll-section">
+              <div class="content">
+                {$form.pcp_display_in_roll.html} &nbsp;
+                {$form.pcp_display_in_roll.label}
+              </div>
+              <div class="clear"></div>
+            </div>
+            <div id="nameID" class="crm-public-form-item crm-section is_anonymous-section">
+              <div class="content">
+                {$form.pcp_is_anonymous.html}
+              </div>
+              <div class="clear"></div>
+            </div>
+            <div id="nickID" class="crm-public-form-item crm-section pcp_roll_nickname-section">
+              <div class="label">{$form.pcp_roll_nickname.label}</div>
+              <div class="content">{$form.pcp_roll_nickname.html}
+                <div class="description">{ts}Enter the name you want listed with this contribution. You can use a nick name like 'The Jones Family' or 'Sarah and Sam'.{/ts}</div>
+              </div>
+              <div class="clear"></div>
+            </div>
+            <div id="personalNoteID" class="crm-public-form-item crm-section pcp_personal_note-section">
+              <div class="label">{$form.pcp_personal_note.label}</div>
+              <div class="content">
+                {$form.pcp_personal_note.html}
+                <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
+              </div>
+              <div class="clear"></div>
+            </div>
           </div>
+        </fieldset>
+      {/if}
+
+      {* end of ccid loop *}
+    {/if}
+
+    {if $form.payment_processor_id.label}
+      {* PP selection only works with JS enabled, so we hide it initially *}
+      <fieldset class="crm-public-form-item crm-group payment_options-group" style="display:none;">
+        <legend>{ts}Payment Options{/ts}</legend>
+        <div class="crm-public-form-item crm-section payment_processor-section">
+          <div class="label">{$form.payment_processor_id.label}</div>
+          <div class="content">{$form.payment_processor_id.html}</div>
           <div class="clear"></div>
         </div>
-        <div id="personalNoteID" class="crm-public-form-item crm-section pcp_personal_note-section">
-          <div class="label">{$form.pcp_personal_note.label}</div>
+      </fieldset>
+    {/if}
+
+    {if $is_pay_later}
+      <fieldset class="crm-public-form-item crm-group pay_later-group">
+        <legend>{ts}Payment Options{/ts}</legend>
+        <div class="crm-public-form-item crm-section pay_later_receipt-section">
+          <div class="label">&nbsp;</div>
           <div class="content">
-            {$form.pcp_personal_note.html}
-            <div class="description">{ts}Enter a message to accompany this contribution.{/ts}</div>
+            [x] {$pay_later_text}
           </div>
           <div class="clear"></div>
         </div>
-      </div>
-    </fieldset>
+      </fieldset>
     {/if}
 
-  {* end of ccid loop *}
-  {/if}
+    {include file="CRM/Core/BillingBlockWrapper.tpl"}
 
-  {if $form.payment_processor_id.label}
-  {* PP selection only works with JS enabled, so we hide it initially *}
-  <fieldset class="crm-public-form-item crm-group payment_options-group" style="display:none;">
-    <legend>{ts}Payment Options{/ts}</legend>
-    <div class="crm-public-form-item crm-section payment_processor-section">
-      <div class="label">{$form.payment_processor_id.label}</div>
-      <div class="content">{$form.payment_processor_id.html}</div>
-      <div class="clear"></div>
+    <div class="crm-public-form-item crm-group custom_post_profile-group">
+      {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
     </div>
-  </fieldset>
-  {/if}
 
-  {if $is_pay_later}
-  <fieldset class="crm-public-form-item crm-group pay_later-group">
-    <legend>{ts}Payment Options{/ts}</legend>
-    <div class="crm-public-form-item crm-section pay_later_receipt-section">
-      <div class="label">&nbsp;</div>
-      <div class="content">
-        [x] {$pay_later_text}
+    {if $is_monetary and $form.bank_account_number}
+      <div id="payment_notice">
+        <fieldset class="crm-public-form-item crm-group payment_notice-group">
+          <legend>{ts}Agreement{/ts}</legend>
+          {ts}Your account data will be used to charge your bank account via direct debit. While submitting this form you agree to the charging of your bank account via direct debit.{/ts}
+        </fieldset>
       </div>
-      <div class="clear"></div>
-    </div>
-  </fieldset>
-  {/if}
-
-  {include file="CRM/Core/BillingBlockWrapper.tpl"}
+    {/if}
 
-  <div class="crm-public-form-item crm-group custom_post_profile-group">
-  {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
+    {if $isCaptcha}
+      {include file='CRM/common/ReCAPTCHA.tpl'}
+    {/if}
+    <div id="crm-submit-buttons" class="crm-submit-buttons">
+      {include file="CRM/common/formButtons.tpl" location="bottom"}
+    </div>
+    {if $footer_text}
+      <div id="footer_text" class="crm-public-form-item crm-section contribution_footer_text-section">
+        <p>{$footer_text}</p>
+      </div>
+    {/if}
   </div>
+  <script type="text/javascript">
+    {if $isHonor}
+    pcpAnonymous();
+    {/if}
 
-  {if $is_monetary and $form.bank_account_number}
-  <div id="payment_notice">
-    <fieldset class="crm-public-form-item crm-group payment_notice-group">
-      <legend>{ts}Agreement{/ts}</legend>
-      {ts}Your account data will be used to charge your bank account via direct debit. While submitting this form you agree to the charging of your bank account via direct debit.{/ts}
-    </fieldset>
-  </div>
-  {/if}
+    {literal}
 
-  {if $isCaptcha}
-    {include file='CRM/common/ReCAPTCHA.tpl'}
-  {/if}
-  <div id="crm-submit-buttons" class="crm-submit-buttons">
-  {include file="CRM/common/formButtons.tpl" location="bottom"}
-  </div>
-  {if $footer_text}
-  <div id="footer_text" class="crm-public-form-item crm-section contribution_footer_text-section">
-    <p>{$footer_text}</p>
-  </div>
-  {/if}
-</div>
-<script type="text/javascript">
-  {if $isHonor}
-  pcpAnonymous();
-  {/if}
+    cj('input[name="soft_credit_type_id"]').on('change', function() {
+      enableHonorType();
+    });
 
-  {literal}
+    function enableHonorType() {
+      var selectedValue = cj('input[name="soft_credit_type_id"]:checked');
+      if ( selectedValue.val() > 0) {
+        cj('#honorType').show();
+      }
+      else {
+        cj('#honorType').hide();
+      }
+    }
 
-  cj('input[name="soft_credit_type_id"]').on('change', function() {
-    enableHonorType();
-  });
+    cj('input[id="is_recur"]').on('change', function() {
+      toggleRecur();
+    });
 
-  function enableHonorType( ) {
-    var selectedValue = cj('input[name="soft_credit_type_id"]:checked');
-    if ( selectedValue.val() > 0) {
-      cj('#honorType').show();
-    }
-    else {
-      cj('#honorType').hide();
-    }
-  }
-
-  cj('input[id="is_recur"]').on('change', function() {
-    toggleRecur();
-  });
-
-  function toggleRecur( ) {
-    var isRecur = cj('input[id="is_recur"]:checked');
-    var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
-    var quickConfig = {/literal}{$quickConfig}{literal};
-    if ( allowAutoRenew && cj("#auto_renew") && quickConfig) {
-      showHideAutoRenew( null );
-    }
-    if (isRecur.val() > 0) {
-      cj('#recurHelp').show();
-      cj('#amount_sum_label').text('{/literal}{ts escape='js'}Regular amount{/ts}{literal}');
-    }
-    else {
-      cj('#recurHelp').hide();
-      cj('#amount_sum_label').text('{/literal}{ts escape='js'}Total Amount{/ts}{literal}');
+    function toggleRecur() {
+      var isRecur = cj('input[id="is_recur"]:checked');
+      var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
+      var quickConfig = {/literal}{$quickConfig}{literal};
+      if ( allowAutoRenew && cj("#auto_renew") && quickConfig) {
+        showHideAutoRenew(null);
+      }
+      if (isRecur.val() > 0) {
+        cj('#recurHelp').show();
+        cj('#amount_sum_label').text('{/literal}{ts escape='js'}Regular amount{/ts}{literal}');
+      }
+      else {
+        cj('#recurHelp').hide();
+        cj('#amount_sum_label').text('{/literal}{ts escape='js'}Total Amount{/ts}{literal}');
+      }
     }
-  }
 
-  function pcpAnonymous( ) {
-    // clear nickname field if anonymous is true
-    if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
-      document.getElementById('pcp_roll_nickname').value = '';
-    }
-    if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
-      cj('#nickID').hide();
-      cj('#nameID').hide();
-      cj('#personalNoteID').hide();
-    }
-    else {
-      if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
-        cj('#nameID').show();
-        cj('#nickID').show();
-        cj('#personalNoteID').show();
+    function pcpAnonymous() {
+      // clear nickname field if anonymous is true
+      if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
+        document.getElementById('pcp_roll_nickname').value = '';
       }
-      else {
-        cj('#nameID').show();
+      if (!document.getElementsByName("pcp_display_in_roll")[0].checked) {
         cj('#nickID').hide();
+        cj('#nameID').hide();
         cj('#personalNoteID').hide();
       }
+      else {
+        if (document.getElementsByName("pcp_is_anonymous")[0].checked) {
+          cj('#nameID').show();
+          cj('#nickID').show();
+          cj('#personalNoteID').show();
+        }
+        else {
+          cj('#nameID').show();
+          cj('#nickID').hide();
+          cj('#personalNoteID').hide();
+        }
+      }
     }
-  }
-
-  CRM.$(function($) {
-    enableHonorType();
-    toggleRecur();
-    skipPaymentMethod();
-  });
-
-  CRM.$(function($) {
-    // highlight price sets
-    function updatePriceSetHighlight() {
-      $('#priceset .price-set-row span').removeClass('highlight');
-      $('#priceset .price-set-row input:checked').parent().addClass('highlight');
-    }
-    $('#priceset input[type="radio"]').change(updatePriceSetHighlight);
-    updatePriceSetHighlight();
-
-    // Update pledge contribution amount when pledge checkboxes change
-    $("input[name^='pledge_amount']").on('change', function() {
-      var total = 0;
-      $("input[name^='pledge_amount']:checked").each(function() {
-        total += Number($(this).attr('amount'));
+
+    CRM.$(function($) {
+      enableHonorType();
+      toggleRecur();
+      skipPaymentMethod();
+    });
+
+    CRM.$(function($) {
+      // highlight price sets
+      function updatePriceSetHighlight() {
+        $('#priceset .price-set-row span').removeClass('highlight');
+        $('#priceset .price-set-row input:checked').parent().addClass('highlight');
+      }
+      $('#priceset input[type="radio"]').change(updatePriceSetHighlight);
+      updatePriceSetHighlight();
+
+      // Update pledge contribution amount when pledge checkboxes change
+      $("input[name^='pledge_amount']").on('change', function() {
+        var total = 0;
+        $("input[name^='pledge_amount']:checked").each(function() {
+          total += Number($(this).attr('amount'));
+        });
+        $("input[name^='price_']").val(total.toFixed(2));
       });
-      $("input[name^='price_']").val(total.toFixed(2));
     });
-  });
-  {/literal}
-</script>
+    {/literal}
+  </script>
 {/if}
 {include file="CRM/Form/validate.tpl"}