Merge pull request #15435 from MegaphoneJon/reporting-21
[civicrm-core.git] / templates / CRM / Contribute / Form / AdditionalPayment.tpl
CommitLineData
0f602e3f
PJ
1{*
2 +--------------------------------------------------------------------+
1188c7a8 3 | Copyright CiviCRM LLC. All rights reserved. |
0f602e3f 4 | |
1188c7a8
TO
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 |
0f602e3f
PJ
8 +--------------------------------------------------------------------+
9*}
81f3d017 10{if $transaction}
9b2e3ee6 11 {include file="CRM/Contribute/Form/PaymentInfoBlock.tpl"}
d4c0653f 12 {if !$suppressPaymentFormButtons}
13 <div class="crm-submit-buttons">
14 {include file="CRM/common/formButtons.tpl"}
15 </div>
16 {/if}
0f602e3f
PJ
17{else}
18
0f602e3f
PJ
19<div class="crm-block crm-form-block crm-payment-form-block">
20
0f602e3f 21 {if !$email}
23cb875c 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>
0f602e3f 25 {/if}
540ea9be
CW
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">
13a3d214 32 <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}submit credit card payment{/ts}</a>
540ea9be
CW
33 </div>
34 {/if}
35 {/if}
0f602e3f
PJ
36 <div class="crm-submit-buttons">
37 {include file="CRM/common/formButtons.tpl"}
0f602e3f 38 </div>
31037a42 39 <table class="form-layout-compressed">
0f602e3f 40 <tr>
685dc433 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>
0f602e3f 42 </tr>
685dc433
PN
43 {if $eventName}
44 <tr>
45 <td class='label'>{ts}Event{/ts}</td><td>{$eventName}</td>
46 </tr>
47 {/if}
0f602e3f
PJ
48 <tr class="crm-payment-form-block-total_amount">
49 <td class="label">{$form.total_amount.label}</td>
50 <td>
4356c7dc 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>
0f602e3f 52 </td>
23cb875c 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>
c351f795 64 <td>{$form.from_email_address.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin}</td>
23cb875c 65 </tr>
66 {/if}
9580e4a2 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}
0f602e3f
PJ
70 </tr>
71 </table>
794d4fc0 72
0f602e3f 73 <div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed" id="paymentDetails_Information">
794d4fc0 74 {if !$contributionMode}
0f602e3f 75 <div class="crm-accordion-header">
0f2c3c03 76 {if $paymentType EQ 'refund'}{ts}Refund Details{/ts}{else}{ts}Payment Details{/ts}{/if}
0f602e3f
PJ
77 </div>
78 <div class="crm-accordion-body">
79 <table class="form-layout-compressed" >
b4989753
PJ
80 <tr class="crm-payment-form-block-trxn_date">
81 <td class="label">{$form.trxn_date.label}</td>
f7fb5615 82 <td>{$form.trxn_date.html}<br />
0f602e3f
PJ
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>
f7fb5615 88 <td >{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
0f602e3f
PJ
89 </td>
90 </tr>
0f602e3f
PJ
91 <tr class="crm-payment-form-block-trxn_id">
92 <td class="label">{$form.trxn_id.label}</td>
f7fb5615 93 <td>{$form.trxn_id.html} {help id="id-trans_id"}</td>
0f602e3f 94 </tr>
d0b7e8ca 95 <tr class="crm-payment-form-block-fee_amount"><td class="label">{$form.fee_amount.label}</td><td{$valueStyle}>{$form.fee_amount.html}<br />
0f602e3f 96 <span class="description">{ts}Processing fee for this transaction (if applicable).{/ts}</span></td></tr>
0f602e3f
PJ
97 </table>
98 </div>
794d4fc0 99 {/if}
9f89c7a2 100 {include file='CRM/Core/BillingBlockWrapper.tpl'}
0f602e3f
PJ
101 </div>
102
0f602e3f
PJ
103 {literal}
104 <script type="text/javascript">
105
8838f818 106 var url = {/literal}{$dataUrl|@json_encode}{literal};
0f602e3f 107
3cc60a06 108 CRM.$(function($) {
7cdb890a 109 showHideByValue( 'is_email_receipt', '', 'notice', 'table-row', 'radio', false );
0f602e3f
PJ
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>
0f602e3f 118 {literal}
0f602e3f 119 <script type="text/javascript">
27439cc1
CW
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 }
3cc60a06 125 CRM.$(function($) {
27439cc1
CW
126 var $form = $('form.{/literal}{$form.formClass}{literal}');
127 checkEmailDependancies();
128 $('#is_email_receipt', $form).click(function() {
129 checkEmailDependancies();
0f602e3f 130 });
0f602e3f 131
27439cc1 132 function checkEmailDependancies() {
9beed6cf
PN
133 if ($('#is_email_receipt', $form).prop('checked')) {
134 $('#fromEmail', $form).show();
27439cc1
CW
135 }
136 else {
9beed6cf 137 $('#fromEmail', $form).hide( );
27439cc1 138 }
0f602e3f 139 }
9f89c7a2 140
27439cc1
CW
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 }
0f602e3f 148 });
27439cc1 149 });
0f602e3f 150
0f602e3f
PJ
151 </script>
152 {/literal}
0f602e3f 153{/if}