Merge pull request #10260 from eileenmcnaughton/cont_soft
[civicrm-core.git] / templates / CRM / Contribute / Form / AdditionalPayment.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2017 |
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 $transaction}
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}Payment Method{/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:$row.currency}</td>
40 <td>{$row.financial_type}</td>
41 <td>{$row.payment_instrument}{if $row.check_number} (#{$row.check_number}){/if}</td>
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 payments found for this %1 record{/ts}
55 {/if}
56 {if !$suppressPaymentFormButtons}
57 <div class="crm-submit-buttons">
58 {include file="CRM/common/formButtons.tpl"}
59 </div>
60 {/if}
61 {else}
62
63 <div class="crm-block crm-form-block crm-payment-form-block">
64
65 {if !$email}
66 <div class="messages status no-popup">
67 <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}
68 </div>
69 {/if}
70 {if $newCredit AND $contributionMode EQ null}
71 {if $contactId}
72 {capture assign=ccModeLink}{crmURL p='civicrm/payment/add' q="reset=1&action=add&cid=`$contactId`&id=`$id`&component=`$component`&mode=live"}{/capture}
73 {/if}
74 {if $paymentType eq 'owed'}
75 <div class="action-link css_right crm-link-credit-card-mode">
76 <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}">&raquo; {ts}submit credit card payment{/ts}</a>
77 </div>
78 {/if}
79 {/if}
80 <div class="crm-submit-buttons">
81 {include file="CRM/common/formButtons.tpl"}
82 </div>
83 <table class="form-layout-compressed">
84 <tr>
85 <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>
86 </tr>
87 {if $contributionMode}
88 <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>
89 {/if}
90 {if $eventName}
91 <tr>
92 <td class='label'>{ts}Event{/ts}</td><td>{$eventName}</td>
93 </tr>
94 {/if}
95 <tr class="crm-payment-form-block-total_amount">
96 <td class="label">{$form.total_amount.label}</td>
97 <td>
98 <span id='totalAmount'>{$form.currency.html|crmAddClass:eight}&nbsp;{$form.total_amount.html|crmAddClass:eight}</span>&nbsp; <span class="status">{if $paymentType EQ 'refund'}{ts}Refund Due{/ts}{else}{ts}Balance Owed{/ts}{/if}:&nbsp;{$paymentAmt|crmMoney}</span>
99 </td>
100 {if $email and $outBound_option != 2}
101 <tr class="crm-payment-form-block-is_email_receipt">
102 <td class="label">
103 {$form.is_email_receipt.label}
104 </td>
105 <td>{$form.is_email_receipt.html}&nbsp;
106 <span class="description">{ts 1=$email}Automatically email a receipt to %1?{/ts}</span>
107 </td>
108 </tr>
109 <tr id="fromEmail" class="crm-payment-form-block-from_email_address" style="display:none;">
110 <td class="label">{$form.from_email_address.label}</td>
111 <td>{$form.from_email_address.html}</td>
112 </tr>
113 {/if}
114 </tr>
115 </table>
116
117 <div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed" id="paymentDetails_Information">
118 {if !$contributionMode}
119 <div class="crm-accordion-header">
120 {if $paymentType EQ 'refund'}{ts}Refund Details{/ts}{else}{ts}Payment Details{/ts}{/if}
121 </div>
122 <div class="crm-accordion-body">
123 <table class="form-layout-compressed" >
124 <tr class="crm-payment-form-block-trxn_date">
125 <td class="label">{$form.trxn_date.label}</td>
126 <td>{$form.trxn_date.html}<br />
127 <span class="description">{ts}The date this payment was received.{/ts}</span>
128 </td>
129 </tr>
130 <tr class="crm-payment-form-block-payment_instrument_id">
131 <td class="label">{$form.payment_instrument_id.label}</td>
132 <td >{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
133 </td>
134 </tr>
135 {if $showCheckNumber || !$isOnline}
136 <tr id="checkNumber" class="crm-payment-form-block-check_number">
137 <td class="label">{$form.check_number.label}</td>
138 <td>{$form.check_number.html}</td>
139 </tr>
140 {/if}
141 <tr class="crm-payment-form-block-trxn_id">
142 <td class="label">{$form.trxn_id.label}</td>
143 <td>{$form.trxn_id.html} {help id="id-trans_id"}</td>
144 </tr>
145 <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 />
146 <span class="description">{ts}Processing fee for this transaction (if applicable).{/ts}</span></td></tr>
147 <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 />
148 <span class="description">{ts}Net value of the payment (Total Amount minus Fee).{/ts}</span></td></tr>
149 </table>
150 </div>
151 {/if}
152 {include file='CRM/Core/BillingBlockWrapper.tpl'}
153 </div>
154
155 {literal}
156 <script type="text/javascript">
157
158 var url = "{/literal}{$dataUrl}{literal}";
159
160 CRM.$(function($) {
161 showHideByValue( 'is_email_receipt', '', 'notice', 'table-row', 'radio', false );
162 showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false );
163 });
164 {/literal}
165 </script>
166
167 <br />
168 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
169 </div>
170 {literal}
171 <script type="text/javascript">
172 function verify() {
173 if (cj('#is_email_receipt').prop('checked')) {
174 return confirm( '{/literal}{ts escape='js'}Click OK to save this payment record AND send a receipt to the contributor now{/ts}{literal}.' );
175 }
176 }
177 CRM.$(function($) {
178 var $form = $('form.{/literal}{$form.formClass}{literal}');
179 checkEmailDependancies();
180 $('#is_email_receipt', $form).click(function() {
181 checkEmailDependancies();
182 });
183
184 function checkEmailDependancies() {
185 if ($('#is_email_receipt', $form).prop('checked')) {
186 $('#fromEmail', $form).show();
187 }
188 else {
189 $('#fromEmail', $form).hide( );
190 }
191 }
192
193 $('#fee_amount', $form).change( function() {
194 var totalAmount = $('#total_amount', $form).val();
195 var feeAmount = $('#fee_amount', $form).val();
196 var netAmount = totalAmount.replace(/,/g, '') - feeAmount.replace(/,/g, '');
197 if (!$('#net_amount', $form).val() && totalAmount) {
198 $('#net_amount', $form).val(CRM.formatMoney(netAmount, true));
199 }
200 });
201 });
202
203 </script>
204 {/literal}
205 {if !$contributionMode}
206 {include file="CRM/common/showHideByFieldValue.tpl"
207 trigger_field_id ="payment_instrument_id"
208 trigger_value = '4'
209 target_element_id ="checkNumber"
210 target_element_type ="table-row"
211 field_type ="select"
212 invert = 0
213 }
214 {/if}
215 {/if}