Merge pull request #17369 from civicrm/5.26
[civicrm-core.git] / templates / CRM / Contribute / Form / AdditionalPayment.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10 {if $transaction}
11 {include file="CRM/Contribute/Form/PaymentInfoBlock.tpl"}
12 {if !$suppressPaymentFormButtons}
13 <div class="crm-submit-buttons">
14 {include file="CRM/common/formButtons.tpl"}
15 </div>
16 {/if}
17 {else}
18
19 <div class="crm-block crm-form-block crm-payment-form-block">
20
21 {if !$email}
22 <div class="messages status no-popup">
23 <div class="icon inform-icon"></div>&nbsp;{ts}You will not be able to send an automatic email receipt for this payment because there is no email address recorded for this contact. If you want a receipt to be sent when this payment is recorded, click Cancel and then click Edit from the Summary tab to add an email address before recording the payment.{/ts}
24 </div>
25 {/if}
26 {if $newCredit AND $contributionMode EQ null}
27 {if $contactId}
28 {capture assign=ccModeLink}{crmURL p='civicrm/payment/add' q="reset=1&action=add&cid=`$contactId`&id=`$id`&component=`$component`&mode=live"}{/capture}
29 {/if}
30 {if $paymentType eq 'owed'}
31 <div class="action-link css_right crm-link-credit-card-mode">
32 <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}"><i class="crm-i fa-chevron-right"></i> {ts}submit credit card payment{/ts}</a>
33 </div>
34 {/if}
35 {/if}
36 <div class="crm-submit-buttons">
37 {include file="CRM/common/formButtons.tpl"}
38 </div>
39 <table class="form-layout-compressed">
40 <tr>
41 <td class="font-size12pt label"><strong>{if $component eq 'event'}{ts}Participant{/ts}{else}{ts}Contact{/ts}{/if}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
42 </tr>
43 {if $eventName}
44 <tr>
45 <td class='label'>{ts}Event{/ts}</td><td>{$eventName}</td>
46 </tr>
47 {/if}
48 <tr class="crm-payment-form-block-total_amount">
49 <td class="label">{$form.total_amount.label}</td>
50 <td>
51 <span id='totalAmount'>{$form.currency.html|crmAddClass:eight}&nbsp;{$form.total_amount.html|crmAddClass:eight}</span>&nbsp; <span class="status">{if $paymentType EQ 'refund' || $paymentAmt < 0}{ts}Refund Due :&nbsp;{$absolutePaymentAmount|crmMoney} {/ts}{else}{ts}Balance Owed{/ts} :&nbsp;{$paymentAmt|crmMoney}{/if}</span>
52 </td>
53 {if $email and $outBound_option != 2}
54 <tr class="crm-payment-form-block-is_email_receipt">
55 <td class="label">
56 {$form.is_email_receipt.label}
57 </td>
58 <td>{$form.is_email_receipt.html}&nbsp;
59 <span class="description">{ts 1=$email}Automatically email a receipt to %1?{/ts}</span>
60 </td>
61 </tr>
62 <tr id="fromEmail" class="crm-payment-form-block-from_email_address" style="display:none;">
63 <td class="label">{$form.from_email_address.label}</td>
64 <td>{$form.from_email_address.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin}</td>
65 </tr>
66 {/if}
67 {if $contributionMode}
68 <tr class="crm-payment-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>
69 {/if}
70 </tr>
71 </table>
72
73 <div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed" id="paymentDetails_Information">
74 {if !$contributionMode}
75 <div class="crm-accordion-header">
76 {if $paymentType EQ 'refund'}{ts}Refund Details{/ts}{else}{ts}Payment Details{/ts}{/if}
77 </div>
78 <div class="crm-accordion-body">
79 <table class="form-layout-compressed" >
80 <tr class="crm-payment-form-block-trxn_date">
81 <td class="label">{$form.trxn_date.label}</td>
82 <td>{$form.trxn_date.html}<br />
83 <span class="description">{ts}The date this payment was received.{/ts}</span>
84 </td>
85 </tr>
86 <tr class="crm-payment-form-block-payment_instrument_id">
87 <td class="label">{$form.payment_instrument_id.label}</td>
88 <td >{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
89 </td>
90 </tr>
91 <tr class="crm-payment-form-block-trxn_id">
92 <td class="label">{$form.trxn_id.label}</td>
93 <td>{$form.trxn_id.html} {help id="id-trans_id"}</td>
94 </tr>
95 <tr class="crm-payment-form-block-fee_amount"><td class="label">{$form.fee_amount.label}</td><td{$valueStyle}>{$form.fee_amount.html|crmMoney:$currency:'XXX':'YYY'}<br />
96 <span class="description">{ts}Processing fee for this transaction (if applicable).{/ts}</span></td></tr>
97 </table>
98 </div>
99 {/if}
100 {include file='CRM/Core/BillingBlockWrapper.tpl'}
101 </div>
102
103 {literal}
104 <script type="text/javascript">
105
106 var url = {/literal}{$dataUrl|@json_encode}{literal};
107
108 CRM.$(function($) {
109 showHideByValue( 'is_email_receipt', '', 'notice', 'table-row', 'radio', false );
110 showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false );
111 });
112 {/literal}
113 </script>
114
115 <br />
116 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
117 </div>
118 {literal}
119 <script type="text/javascript">
120 function verify() {
121 if (cj('#is_email_receipt').prop('checked')) {
122 return confirm( '{/literal}{ts escape='js'}Click OK to save this payment record AND send a receipt to the contributor now{/ts}{literal}.' );
123 }
124 }
125 CRM.$(function($) {
126 var $form = $('form.{/literal}{$form.formClass}{literal}');
127 checkEmailDependancies();
128 $('#is_email_receipt', $form).click(function() {
129 checkEmailDependancies();
130 });
131
132 function checkEmailDependancies() {
133 if ($('#is_email_receipt', $form).prop('checked')) {
134 $('#fromEmail', $form).show();
135 }
136 else {
137 $('#fromEmail', $form).hide( );
138 }
139 }
140
141 $('#fee_amount', $form).change( function() {
142 var totalAmount = $('#total_amount', $form).val();
143 var feeAmount = $('#fee_amount', $form).val();
144 var netAmount = totalAmount.replace(/,/g, '') - feeAmount.replace(/,/g, '');
145 if (!$('#net_amount', $form).val() && totalAmount) {
146 $('#net_amount', $form).val(CRM.formatMoney(netAmount, true));
147 }
148 });
149 });
150
151 </script>
152 {/literal}
153 {/if}