Commit | Line | Data |
---|---|---|
0f602e3f PJ |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
2c4c49ca | 3 | | CiviCRM version 4.7 | |
0f602e3f | 4 | +--------------------------------------------------------------------+ |
fa938177 | 5 | | Copyright CiviCRM LLC (c) 2004-2016 | |
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> | |
4db803dd | 32 | <th>{ts}Payment Method{/ts}</th> |
81f3d017 PJ |
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> | |
7e7e2e3f | 39 | <td>{$row.total_amount|crmMoney:$row.currency}</td> |
81f3d017 | 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} | |
636b20c5 | 54 | {ts 1=$entity}No payments found for this %1 record{/ts} |
81f3d017 | 55 | {/if} |
d4c0653f | 56 | {if !$suppressPaymentFormButtons} |
57 | <div class="crm-submit-buttons"> | |
58 | {include file="CRM/common/formButtons.tpl"} | |
59 | </div> | |
60 | {/if} | |
61 | {elseif $formType} | |
0f602e3f PJ |
62 | {include file="CRM/Contribute/Form/AdditionalInfo/$formType.tpl"} |
63 | {else} | |
64 | ||
0f602e3f PJ |
65 | <div class="crm-block crm-form-block crm-payment-form-block"> |
66 | ||
0f602e3f PJ |
67 | {if !$email} |
68 | <div class="messages status no-popup"> | |
69 | <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} | |
70 | </div> | |
71 | {/if} | |
540ea9be CW |
72 | {if $newCredit AND $contributionMode EQ null} |
73 | {if $contactId} | |
74 | {capture assign=ccModeLink}{crmURL p='civicrm/payment/add' q="reset=1&action=add&cid=`$contactId`&id=`$id`&component=`$component`&mode=live"}{/capture} | |
75 | {/if} | |
76 | {if $paymentType eq 'owed'} | |
77 | <div class="action-link css_right crm-link-credit-card-mode"> | |
5fffbbe4 | 78 | <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}">» {ts}submit credit card payment{/ts}</a> |
540ea9be CW |
79 | </div> |
80 | {/if} | |
81 | {/if} | |
0f602e3f PJ |
82 | <div class="crm-submit-buttons"> |
83 | {include file="CRM/common/formButtons.tpl"} | |
0f602e3f | 84 | </div> |
31037a42 | 85 | <table class="form-layout-compressed"> |
0f602e3f PJ |
86 | <tr> |
87 | <td class="font-size12pt label"><strong>{ts}Participant{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td> | |
88 | </tr> | |
89 | {if $contributionMode} | |
836cf509 | 90 | <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> |
31037a42 | 91 | {/if} |
0f602e3f PJ |
92 | <tr> |
93 | <td class='label'>{ts}Event{/ts}</td><td>{$eventName}</td> | |
94 | </tr> | |
0f602e3f PJ |
95 | <tr class="crm-payment-form-block-total_amount"> |
96 | <td class="label">{$form.total_amount.label}</td> | |
97 | <td> | |
0f2c3c03 | 98 | <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 |
99 | </td> |
100 | </tr> | |
101 | </table> | |
102 | <div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed" id="paymentDetails_Information"> | |
103 | <div class="crm-accordion-header"> | |
0f2c3c03 | 104 | {if $paymentType EQ 'refund'}{ts}Refund Details{/ts}{else}{ts}Payment Details{/ts}{/if} |
0f602e3f PJ |
105 | </div> |
106 | <div class="crm-accordion-body"> | |
107 | <table class="form-layout-compressed" > | |
b4989753 PJ |
108 | <tr class="crm-payment-form-block-trxn_date"> |
109 | <td class="label">{$form.trxn_date.label}</td> | |
110 | <td {$valueStyle}>{include file="CRM/common/jcalendar.tpl" elementName=trxn_date}<br /> | |
0f602e3f PJ |
111 | <span class="description">{ts}The date this payment was received.{/ts}</span> |
112 | </td> | |
113 | </tr> | |
114 | <tr class="crm-payment-form-block-payment_instrument_id"> | |
115 | <td class="label">{$form.payment_instrument_id.label}</td> | |
116 | <td {$valueStyle}>{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td> | |
117 | </td> | |
118 | </tr> | |
119 | {if $showCheckNumber || !$isOnline} | |
120 | <tr id="checkNumber" class="crm-payment-form-block-check_number"> | |
121 | <td class="label">{$form.check_number.label}</td> | |
ce22fda6 | 122 | <td>{$form.check_number.html}</td> |
0f602e3f PJ |
123 | </tr> |
124 | {/if} | |
125 | <tr class="crm-payment-form-block-trxn_id"> | |
126 | <td class="label">{$form.trxn_id.label}</td> | |
ce22fda6 | 127 | <td {$valueStyle}>{$form.trxn_id.html} {help id="id-trans_id"}</td> |
0f602e3f PJ |
128 | </tr> |
129 | {if $email and $outBound_option != 2} | |
130 | <tr class="crm-payment-form-block-is_email_receipt"> | |
131 | <td class="label"> | |
132 | {$form.is_email_receipt.label}</td><td>{$form.is_email_receipt.html} | |
0f2c3c03 | 133 | <span class="description">{ts 1=$email}Automatically email a receipt to %1?{/ts}</span> |
0f602e3f PJ |
134 | </td> |
135 | </tr> | |
0f602e3f PJ |
136 | {/if} |
137 | <tr id="fromEmail" class="crm-payment-form-block-receipt_date" style="display:none;"> | |
138 | <td class="label">{$form.from_email_address.label}</td> | |
139 | <td>{$form.from_email_address.html}</td> | |
140 | </tr> | |
7cdb890a PJ |
141 | <tr id='notice' class="crm-event-eventfees-form-block-receipt_text"> |
142 | <td class="label">{$form.receipt_text.label}</td> | |
143 | <td><span class="description"> | |
0f2c3c03 | 144 | {ts}Enter a message you want included at the beginning of the confirmation email.{/ts} |
7cdb890a PJ |
145 | </span><br /> |
146 | {$form.receipt_text.html|crmAddClass:huge} | |
147 | </td> | |
31037a42 | 148 | </tr> |
7cdb890a | 149 | <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 | 150 | <span class="description">{ts}Processing fee for this transaction (if applicable).{/ts}</span></td></tr> |
7cdb890a | 151 | <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 |
152 | <span class="description">{ts}Net value of the payment (Total Amount minus Fee).{/ts}</span></td></tr> |
153 | </table> | |
154 | </div> | |
155 | </div> | |
156 | ||
157 | <div class="accordion ui-accordion ui-widget ui-helper-reset"> | |
158 | {* Additional Detail / Honoree Information / Premium Information *} | |
159 | {foreach from=$allPanes key=paneName item=paneValue} | |
160 | ||
161 | <div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open neq 'true'}collapsed{/if}"> | |
162 | <div class="crm-accordion-header" id="{$paneValue.id}"> | |
163 | ||
164 | {$paneName} | |
165 | </div><!-- /.crm-accordion-header --> | |
166 | <div class="crm-accordion-body"> | |
167 | ||
168 | <div class="{$paneValue.id}"></div> | |
169 | </div><!-- /.crm-accordion-body --> | |
170 | </div><!-- /.crm-accordion-wrapper --> | |
171 | ||
172 | {/foreach} | |
173 | </div> | |
174 | ||
175 | ||
176 | ||
177 | {literal} | |
178 | <script type="text/javascript"> | |
179 | ||
7cdb890a | 180 | var url = "{/literal}{$dataUrl}{literal}"; |
0f602e3f | 181 | |
3cc60a06 | 182 | CRM.$(function($) { |
7cdb890a | 183 | showHideByValue( 'is_email_receipt', '', 'notice', 'table-row', 'radio', false ); |
0f602e3f PJ |
184 | showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false ); |
185 | }); | |
186 | {/literal} | |
187 | </script> | |
188 | ||
189 | <br /> | |
190 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> | |
191 | </div> | |
0f602e3f | 192 | {literal} |
0f602e3f | 193 | <script type="text/javascript"> |
27439cc1 CW |
194 | function verify() { |
195 | if (cj('#is_email_receipt').prop('checked')) { | |
196 | return confirm( '{/literal}{ts escape='js'}Click OK to save this payment record AND send a receipt to the contributor now{/ts}{literal}.' ); | |
197 | } | |
198 | } | |
3cc60a06 | 199 | CRM.$(function($) { |
27439cc1 CW |
200 | var $form = $('form.{/literal}{$form.formClass}{literal}'); |
201 | checkEmailDependancies(); | |
202 | $('#is_email_receipt', $form).click(function() { | |
203 | checkEmailDependancies(); | |
0f602e3f | 204 | }); |
0f602e3f | 205 | |
27439cc1 CW |
206 | function checkEmailDependancies() { |
207 | if ($('#is_email_receipt', $form).attr('checked')) { | |
208 | $('#fromEmail, #notice', $form).show(); | |
209 | $('#receiptDate', $form).hide(); | |
210 | } | |
211 | else { | |
212 | $('#fromEmail, #notice', $form).hide( ); | |
213 | $('#receiptDate', $form).show(); | |
214 | } | |
0f602e3f | 215 | } |
27439cc1 CW |
216 | |
217 | // bind first click of accordion header to load crm-accordion-body with snippet | |
218 | $('#adjust-option-type', $form).hide(); | |
219 | $('.crm-ajax-accordion .crm-accordion-header', $form).one('click', function() { | |
220 | loadPanes($(this).attr('id')); | |
221 | }); | |
222 | $('.crm-ajax-accordion:not(.collapsed) .crm-accordion-header', $form).each(function(index) { | |
223 | loadPanes($(this).attr('id')); | |
224 | }); | |
225 | // load panes function call for snippet based on id of crm-accordion-header | |
226 | function loadPanes(id) { | |
227 | var url = "{/literal}{crmURL p='civicrm/payment/add' q='formType=' h=0}{literal}" + id; | |
228 | {/literal} | |
229 | {if $contributionMode} | |
230 | url += "&mode={$contributionMode}"; | |
231 | {/if} | |
232 | {if $qfKey} | |
233 | url += "&qfKey={$qfKey}"; | |
234 | {/if} | |
235 | {literal} | |
236 | if (!$('div.'+ id, $form).html()) { | |
237 | CRM.loadPage(url, {target: $('div.' + id, $form)}); | |
238 | } | |
0f602e3f | 239 | } |
27439cc1 CW |
240 | |
241 | $('#fee_amount', $form).change( function() { | |
242 | var totalAmount = $('#total_amount', $form).val(); | |
243 | var feeAmount = $('#fee_amount', $form).val(); | |
244 | var netAmount = totalAmount.replace(/,/g, '') - feeAmount.replace(/,/g, ''); | |
245 | if (!$('#net_amount', $form).val() && totalAmount) { | |
246 | $('#net_amount', $form).val(CRM.formatMoney(netAmount, true)); | |
247 | } | |
0f602e3f | 248 | }); |
27439cc1 | 249 | }); |
0f602e3f | 250 | |
0f602e3f PJ |
251 | </script> |
252 | {/literal} | |
253 | {if !$contributionMode} | |
254 | {include file="CRM/common/showHideByFieldValue.tpl" | |
255 | trigger_field_id ="payment_instrument_id" | |
256 | trigger_value = '4' | |
257 | target_element_id ="checkNumber" | |
258 | target_element_type ="table-row" | |
259 | field_type ="select" | |
260 | invert = 0 | |
261 | } | |
262 | {/if} | |
0f602e3f | 263 | {/if} |