Commit | Line | Data |
---|---|---|
0f602e3f PJ |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
2c4c49ca | 3 | | CiviCRM version 4.7 | |
0f602e3f | 4 | +--------------------------------------------------------------------+ |
2a73d3b0 | 5 | | Copyright CiviCRM LLC (c) 2004-2017 | |
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} |
9b2e3ee6 | 27 | {include file="CRM/Contribute/Form/PaymentInfoBlock.tpl"} |
d4c0653f | 28 | {if !$suppressPaymentFormButtons} |
29 | <div class="crm-submit-buttons"> | |
30 | {include file="CRM/common/formButtons.tpl"} | |
31 | </div> | |
32 | {/if} | |
0f602e3f PJ |
33 | {else} |
34 | ||
0f602e3f PJ |
35 | <div class="crm-block crm-form-block crm-payment-form-block"> |
36 | ||
0f602e3f | 37 | {if !$email} |
23cb875c | 38 | <div class="messages status no-popup"> |
39 | <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} | |
40 | </div> | |
0f602e3f | 41 | {/if} |
540ea9be CW |
42 | {if $newCredit AND $contributionMode EQ null} |
43 | {if $contactId} | |
44 | {capture assign=ccModeLink}{crmURL p='civicrm/payment/add' q="reset=1&action=add&cid=`$contactId`&id=`$id`&component=`$component`&mode=live"}{/capture} | |
45 | {/if} | |
46 | {if $paymentType eq 'owed'} | |
47 | <div class="action-link css_right crm-link-credit-card-mode"> | |
5fffbbe4 | 48 | <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}">» {ts}submit credit card payment{/ts}</a> |
540ea9be CW |
49 | </div> |
50 | {/if} | |
51 | {/if} | |
0f602e3f PJ |
52 | <div class="crm-submit-buttons"> |
53 | {include file="CRM/common/formButtons.tpl"} | |
0f602e3f | 54 | </div> |
31037a42 | 55 | <table class="form-layout-compressed"> |
0f602e3f | 56 | <tr> |
685dc433 | 57 | <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 | 58 | </tr> |
685dc433 PN |
59 | {if $eventName} |
60 | <tr> | |
61 | <td class='label'>{ts}Event{/ts}</td><td>{$eventName}</td> | |
62 | </tr> | |
63 | {/if} | |
0f602e3f PJ |
64 | <tr class="crm-payment-form-block-total_amount"> |
65 | <td class="label">{$form.total_amount.label}</td> | |
66 | <td> | |
0f2c3c03 | 67 | <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 | 68 | </td> |
23cb875c | 69 | {if $email and $outBound_option != 2} |
70 | <tr class="crm-payment-form-block-is_email_receipt"> | |
71 | <td class="label"> | |
72 | {$form.is_email_receipt.label} | |
73 | </td> | |
74 | <td>{$form.is_email_receipt.html} | |
75 | <span class="description">{ts 1=$email}Automatically email a receipt to %1?{/ts}</span> | |
76 | </td> | |
77 | </tr> | |
78 | <tr id="fromEmail" class="crm-payment-form-block-from_email_address" style="display:none;"> | |
79 | <td class="label">{$form.from_email_address.label}</td> | |
80 | <td>{$form.from_email_address.html}</td> | |
81 | </tr> | |
82 | {/if} | |
9580e4a2 | 83 | {if $contributionMode} |
84 | <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> | |
85 | {/if} | |
0f602e3f PJ |
86 | </tr> |
87 | </table> | |
794d4fc0 | 88 | |
0f602e3f | 89 | <div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed" id="paymentDetails_Information"> |
794d4fc0 | 90 | {if !$contributionMode} |
0f602e3f | 91 | <div class="crm-accordion-header"> |
0f2c3c03 | 92 | {if $paymentType EQ 'refund'}{ts}Refund Details{/ts}{else}{ts}Payment Details{/ts}{/if} |
0f602e3f PJ |
93 | </div> |
94 | <div class="crm-accordion-body"> | |
95 | <table class="form-layout-compressed" > | |
b4989753 PJ |
96 | <tr class="crm-payment-form-block-trxn_date"> |
97 | <td class="label">{$form.trxn_date.label}</td> | |
f7fb5615 | 98 | <td>{$form.trxn_date.html}<br /> |
0f602e3f PJ |
99 | <span class="description">{ts}The date this payment was received.{/ts}</span> |
100 | </td> | |
101 | </tr> | |
102 | <tr class="crm-payment-form-block-payment_instrument_id"> | |
103 | <td class="label">{$form.payment_instrument_id.label}</td> | |
f7fb5615 | 104 | <td >{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td> |
0f602e3f PJ |
105 | </td> |
106 | </tr> | |
107 | {if $showCheckNumber || !$isOnline} | |
108 | <tr id="checkNumber" class="crm-payment-form-block-check_number"> | |
109 | <td class="label">{$form.check_number.label}</td> | |
ce22fda6 | 110 | <td>{$form.check_number.html}</td> |
0f602e3f PJ |
111 | </tr> |
112 | {/if} | |
113 | <tr class="crm-payment-form-block-trxn_id"> | |
114 | <td class="label">{$form.trxn_id.label}</td> | |
f7fb5615 | 115 | <td>{$form.trxn_id.html} {help id="id-trans_id"}</td> |
0f602e3f | 116 | </tr> |
23cb875c | 117 | <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 | 118 | <span class="description">{ts}Processing fee for this transaction (if applicable).{/ts}</span></td></tr> |
f7fb5615 | 119 | <tr class="crm-payment-form-block-net_amount"><td class="label">{$form.net_amount.label}</td><td>{$form.net_amount.html|crmMoney:$currency:'':1}<br /> |
0f602e3f PJ |
120 | <span class="description">{ts}Net value of the payment (Total Amount minus Fee).{/ts}</span></td></tr> |
121 | </table> | |
122 | </div> | |
794d4fc0 | 123 | {/if} |
9f89c7a2 | 124 | {include file='CRM/Core/BillingBlockWrapper.tpl'} |
0f602e3f PJ |
125 | </div> |
126 | ||
0f602e3f PJ |
127 | {literal} |
128 | <script type="text/javascript"> | |
129 | ||
7cdb890a | 130 | var url = "{/literal}{$dataUrl}{literal}"; |
0f602e3f | 131 | |
3cc60a06 | 132 | CRM.$(function($) { |
7cdb890a | 133 | showHideByValue( 'is_email_receipt', '', 'notice', 'table-row', 'radio', false ); |
0f602e3f PJ |
134 | showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false ); |
135 | }); | |
136 | {/literal} | |
137 | </script> | |
138 | ||
139 | <br /> | |
140 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> | |
141 | </div> | |
0f602e3f | 142 | {literal} |
0f602e3f | 143 | <script type="text/javascript"> |
27439cc1 CW |
144 | function verify() { |
145 | if (cj('#is_email_receipt').prop('checked')) { | |
146 | return confirm( '{/literal}{ts escape='js'}Click OK to save this payment record AND send a receipt to the contributor now{/ts}{literal}.' ); | |
147 | } | |
148 | } | |
3cc60a06 | 149 | CRM.$(function($) { |
27439cc1 CW |
150 | var $form = $('form.{/literal}{$form.formClass}{literal}'); |
151 | checkEmailDependancies(); | |
152 | $('#is_email_receipt', $form).click(function() { | |
153 | checkEmailDependancies(); | |
0f602e3f | 154 | }); |
0f602e3f | 155 | |
27439cc1 | 156 | function checkEmailDependancies() { |
9beed6cf PN |
157 | if ($('#is_email_receipt', $form).prop('checked')) { |
158 | $('#fromEmail', $form).show(); | |
27439cc1 CW |
159 | } |
160 | else { | |
9beed6cf | 161 | $('#fromEmail', $form).hide( ); |
27439cc1 | 162 | } |
0f602e3f | 163 | } |
9f89c7a2 | 164 | |
27439cc1 CW |
165 | $('#fee_amount', $form).change( function() { |
166 | var totalAmount = $('#total_amount', $form).val(); | |
167 | var feeAmount = $('#fee_amount', $form).val(); | |
168 | var netAmount = totalAmount.replace(/,/g, '') - feeAmount.replace(/,/g, ''); | |
169 | if (!$('#net_amount', $form).val() && totalAmount) { | |
170 | $('#net_amount', $form).val(CRM.formatMoney(netAmount, true)); | |
171 | } | |
0f602e3f | 172 | }); |
27439cc1 | 173 | }); |
0f602e3f | 174 | |
0f602e3f PJ |
175 | </script> |
176 | {/literal} | |
177 | {if !$contributionMode} | |
178 | {include file="CRM/common/showHideByFieldValue.tpl" | |
179 | trigger_field_id ="payment_instrument_id" | |
180 | trigger_value = '4' | |
181 | target_element_id ="checkNumber" | |
182 | target_element_type ="table-row" | |
183 | field_type ="select" | |
184 | invert = 0 | |
185 | } | |
186 | {/if} | |
0f602e3f | 187 | {/if} |