CRM-13965 : introduce new event token for 'balance' amount info display for schedule...
[civicrm-core.git] / templates / CRM / Contribute / Form / AdditionalPayment.tpl
CommitLineData
0f602e3f
PJ
1{*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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*}
26{if $formType}
27 {include file="CRM/Contribute/Form/AdditionalInfo/$formType.tpl"}
28{else}
29
e8cf3013
PJ
30{if $paymentType eq 'refund'}
31<h3>{ts}New Event Refund{/ts}</h3>
32{else}
0f602e3f 33<h3>{if $component eq 'event'}{if $contributionMode}{ts}Credit Card Event Payment{/ts}{else}{ts}New Event Payement{/ts}{/if}{/if}</h3>
e8cf3013 34{/if}
0f602e3f
PJ
35<div class="crm-block crm-form-block crm-payment-form-block">
36
37 {if $contributionMode == 'test'}
38 {assign var=contribMode value="TEST"}
39 {elseif $contributionMode == 'live'}
40 {assign var=contribMode value="LIVE"}
41 {/if}
42
43 {if !$email}
44 <div class="messages status no-popup">
45 <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}
46 </div>
47 {/if}
48 <div class="crm-submit-buttons">
49 {include file="CRM/common/formButtons.tpl"}
50 {if $newCredit AND $contributionMode EQ null}
51 {if $contactId}
52 {capture assign=ccModeLink}{crmURL p='civicrm/payment/add' q="reset=1&action=add&cid=`$contactId`&id=`$id`&component=`$component`&mode=live"}{/capture}
53 {/if}
e8cf3013
PJ
54 {if $paymentType eq 'owed'}
55 <span class="action-link crm-link-credit-card-mode">&nbsp;<a href="{$ccModeLink}">&raquo; {ts}submit credit card payment{/ts}</a>
56 {/if}
0f602e3f
PJ
57 {/if}
58 </div>
59 <table class="form-layout-compressed">
60 <tr>
61 <td class="font-size12pt label"><strong>{ts}Participant{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
62 </tr>
63 {if $contributionMode}
64 <tr class="crm-payment-form-block-payment_processor_id"><td class="label nowrap">{$form.payment_processor_id.label}<span class="marker"> * </span></td><td>{$form.payment_processor_id.html}</td></tr>
65 {/if}
66 <tr>
67 <td class='label'>{ts}Event{/ts}</td><td>{$eventName}</td>
68 </tr>
69 <tr class="crm-payment-form-block-contribution_type_id crm-payment-form-block-financial_type_id">
70 <td class="label">{$form.financial_type_id.label}</td><td{$valueStyle}>{$form.financial_type_id.html}&nbsp;
71 </td>
72 </tr>
73 <tr class="crm-payment-form-block-total_amount">
74 <td class="label">{$form.total_amount.label}</td>
75 <td>
76 <span id='totalAmount'>{$form.currency.html|crmAddClass:eight}&nbsp;{$form.total_amount.html|crmAddClass:eight}</span> {$paymentAmt}
77 </td>
78 </tr>
79 </table>
80 <div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed" id="paymentDetails_Information">
81 <div class="crm-accordion-header">
82 {ts}Payment Details{/ts}
83 </div>
84 <div class="crm-accordion-body">
85 <table class="form-layout-compressed" >
b4989753
PJ
86 <tr class="crm-payment-form-block-trxn_date">
87 <td class="label">{$form.trxn_date.label}</td>
88 <td {$valueStyle}>{include file="CRM/common/jcalendar.tpl" elementName=trxn_date}<br />
0f602e3f
PJ
89 <span class="description">{ts}The date this payment was received.{/ts}</span>
90 </td>
91 </tr>
92 <tr class="crm-payment-form-block-payment_instrument_id">
93 <td class="label">{$form.payment_instrument_id.label}</td>
94 <td {$valueStyle}>{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
95 </td>
96 </tr>
97 {if $showCheckNumber || !$isOnline}
98 <tr id="checkNumber" class="crm-payment-form-block-check_number">
99 <td class="label">{$form.check_number.label}</td>
100 <td>{$form.check_number.html|crmReplace:class:six}</td>
101 </tr>
102 {/if}
103 <tr class="crm-payment-form-block-trxn_id">
104 <td class="label">{$form.trxn_id.label}</td>
105 <td {$valueStyle}>{$form.trxn_id.html|crmReplace:class:twelve} {help id="id-trans_id"}</td>
106 </tr>
107 {if $email and $outBound_option != 2}
108 <tr class="crm-payment-form-block-is_email_receipt">
109 <td class="label">
110 {$form.is_email_receipt.label}</td><td>{$form.is_email_receipt.html}&nbsp;
111 <span class="description">{ts 1=$email}Automatically email a receipt for this payment to %1?{/ts}</span>
112 </td>
113 </tr>
114 {elseif $context eq 'standalone' and $outBound_option != 2 }
115 <tr id="email-receipt" style="display:none;" class="crm-payment-form-block-is_email_receipt">
116 <td class="label">{$form.is_email_receipt.label}</td>
117 <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>
118 </td>
119 </tr>
120 {/if}
121 <tr id="fromEmail" class="crm-payment-form-block-receipt_date" style="display:none;">
122 <td class="label">{$form.from_email_address.label}</td>
123 <td>{$form.from_email_address.html}</td>
124 </tr>
125 <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 />
126 <span class="description">{ts}Processing fee for this transaction (if applicable).{/ts}</span></td></tr>
127 <tr class="crm-payment-form-block-net_amount"><td class="label">{$form.net_amount.label}</td><td{$valueStyle}>{$form.net_amount.html|crmMoney:$currency:'':1}<br />
128 <span class="description">{ts}Net value of the payment (Total Amount minus Fee).{/ts}</span></td></tr>
129 </table>
130 </div>
131 </div>
132
133<div class="accordion ui-accordion ui-widget ui-helper-reset">
134 {* Additional Detail / Honoree Information / Premium Information *}
135 {foreach from=$allPanes key=paneName item=paneValue}
136
137 <div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open neq 'true'}collapsed{/if}">
138 <div class="crm-accordion-header" id="{$paneValue.id}">
139
140 {$paneName}
141 </div><!-- /.crm-accordion-header -->
142 <div class="crm-accordion-body">
143
144 <div class="{$paneValue.id}"></div>
145 </div><!-- /.crm-accordion-body -->
146 </div><!-- /.crm-accordion-wrapper -->
147
148 {/foreach}
149 </div>
150
151
152
153 {literal}
154 <script type="text/javascript">
155
156 var url = "{/literal}{$dataUrl}{literal}";
157
158 cj( function( ) {
159 showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false );
160 });
161 {/literal}
162 </script>
163
164<br />
165<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
166</div>
167
168 {literal}
169 <script type="text/javascript">
170 function verify( ) {
171 if (cj('#is_email_receipt').attr( 'checked' )) {
172 var ok = confirm( '{/literal}{ts escape='js'}Click OK to save this payment record AND send a receipt to the contributor now{/ts}{literal}.' );
173 if (!ok) {
174 return false;
175 }
176 }
177 }
178 </script>
179 {/literal}
180
181 {literal}
182 <script type="text/javascript">
183 cj( function( ) {
184 checkEmailDependancies( );
185 cj('#is_email_receipt').click( function( ) {
186 checkEmailDependancies( );
187 });
188 });
189
190 function checkEmailDependancies( ) {
191 if (cj('#is_email_receipt').attr( 'checked' )) {
192 cj('#fromEmail').show( );
193 cj('#receiptDate').hide( );
194 }
195 else {
196 cj('#fromEmail').hide( );
197 cj('#receiptDate').show( );
198 }
199 }
200
201 // bind first click of accordion header to load crm-accordion-body with snippet
202 // everything else taken care of by cj().crm-accordions()
203 cj(function() {
204 cj('#adjust-option-type').hide();
205 cj('.crm-ajax-accordion .crm-accordion-header').one('click', function() {
206 loadPanes(cj(this).attr('id'));
207 });
208 cj('.crm-ajax-accordion:not(.collapsed) .crm-accordion-header').each(function(index) {
209 loadPanes(cj(this).attr('id'));
210 });
211 });
212 // load panes function call for snippet based on id of crm-accordion-header
213 function loadPanes( id ) {
214 var url = "{/literal}{crmURL p='civicrm/payment/add' q='snippet=4&formType=' h=0}{literal}" + id;
215 {/literal}
216 {if $contributionMode}
217 url = url + "&mode={$contributionMode}";
218 {/if}
219 {if $qfKey}
220 url = url + "&qfKey={$qfKey}";
221 {/if}
222 {literal}
223 if (! cj('div.'+id).html()) {
224 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}...';
225 cj('div.'+id).html(loading);
226 cj.ajax({
227 url : url,
228 success: function(data) { cj('div.'+id).html(data); }
229 });
230 }
231 }
232
233cj('#fee_amount').change( function() {
234 var totalAmount = cj('#total_amount').val();
235 var feeAmount = cj('#fee_amount').val();
236 var netAmount = totalAmount.replace(/,/g, '') - feeAmount.replace(/,/g, '');
237 if (!cj('#net_amount').val()) {
238 cj('#net_amount').val(netAmount);
239 }
240});
241 </script>
242 {/literal}
243 {if !$contributionMode}
244 {include file="CRM/common/showHideByFieldValue.tpl"
245 trigger_field_id ="payment_instrument_id"
246 trigger_value = '4'
247 target_element_id ="checkNumber"
248 target_element_type ="table-row"
249 field_type ="select"
250 invert = 0
251 }
252 {/if}
253
254 {* include jscript to warn if unsaved form field changes *}
255 {include file="CRM/common/formNavigate.tpl"}
256
257{/if}
258{literal}
259<script type="text/javascript">
260cj(function() {
261 cj().crmAccordions();
262});
263</script>
264{/literal}