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