Merge pull request #12910 from monishdeb/dev-core-394
[civicrm-core.git] / templates / CRM / Contribute / Page / PaymentInfo.tpl
CommitLineData
f9af96d6
PJ
1{*
2 +--------------------------------------------------------------------+
fee14197 3 | CiviCRM version 5 |
f9af96d6 4 +--------------------------------------------------------------------+
8c9251b3 5 | Copyright CiviCRM LLC (c) 2004-2018 |
f9af96d6
PJ
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25*}
685dc433 26{if $show eq 'payments'}
f9af96d6 27{literal}
1a0d17b9 28<script type='text/javascript'>
3cc60a06 29CRM.$(function($) {
ae8f569f 30 if ($("#payment-info").length) {
685dc433 31 var dataUrl = {/literal}'{crmURL p="civicrm/payment/view" h=0 q="action=browse&id=$componentId&cid=`$contactId`&component=$component&context=payment_info&snippet=4"}'{literal};
ae8f569f 32 $.ajax({
0b2b58ea
PJ
33 url: dataUrl,
34 async: false,
35 success: function(html) {
ae8f569f 36 $("#payment-info").html(html).trigger('crmLoad');
0b2b58ea
PJ
37 }
38 });
8838f818 39 // Fixme: Possible bug - the following line won't be processed by smarty because it's in a literal block
a32709be
PB
40 var taxAmount = "{$totalTaxAmount}";
41 if (taxAmount) {
97353519 42 $('.total_amount-section').show();
a32709be
PB
43 }
44 else {
97353519 45 $('.total_amount-section').remove();
a32709be 46 }
0b2b58ea 47 }
1a0d17b9
PJ
48});
49</script>
f9af96d6
PJ
50{/literal}
51{/if}
52{if $context eq 'payment_info'}
53<table id='info'>
54 <tr class="columnheader">
55 {if $component eq "event"}
56 <th>{ts}Total Fee(s){/ts}</th>
685dc433 57 {else}
02fc97b3 58 <th>{ts}Contribution Total{/ts}</th>
f9af96d6
PJ
59 {/if}
60 <th class="right">{ts}Total Paid{/ts}</th>
61 <th class="right">{ts}Balance{/ts}</th>
62 </tr>
63 <tr>
eb6acea3 64 <td>{$paymentInfo.total|crmMoney:$paymentInfo.currency}</td>
f9af96d6
PJ
65 <td class='right'>
66 {if $paymentInfo.paid > 0}
eb6acea3 67 {$paymentInfo.paid|crmMoney:$paymentInfo.currency}
deaf00c2 68 {if !$hideButtonLinks}
685dc433
PN
69 <br/>
70 <a class="crm-hover-button action-item crm-popup medium-popup" href='{crmURL p="civicrm/payment" q="view=transaction&cid=`$cid`&id=`$paymentInfo.id`&component=`$paymentInfo.component`&action=browse"}'>
71 <i class="crm-i fa-list"></i>
72 {ts}view payments{/ts}
73 </a>
74 {/if}
f9af96d6
PJ
75 {/if}
76 </td>
eb6acea3 77 <td class="right" id="payment-info-balance" data-balance="{$paymentInfo.balance}">{$paymentInfo.balance|crmMoney:$paymentInfo.currency}</td>
f9af96d6
PJ
78 </tr>
79</table>
685dc433 80{if $paymentInfo.balance and !$paymentInfo.payLater && !$hideButtonLinks}
e8cf3013
PJ
81 {if $paymentInfo.balance > 0}
82 {assign var=paymentButtonName value='Record Payment'}
83 {elseif $paymentInfo.balance < 0}
84 {assign var=paymentButtonName value='Record Refund'}
85 {/if}
a2c70872 86 <a class="action-item crm-hover-button" href='{crmURL p="civicrm/payment" q="action=add&reset=1&component=`$component`&id=`$id`&cid=`$cid`"}'><i class="crm-i fa-plus-circle"></i> {ts}{$paymentButtonName}{/ts}</a>
f9af96d6 87{/if}
b22f0cad 88{/if}