Merge pull request #22850 from ixiam/dev_Issue#3080
[civicrm-core.git] / templates / CRM / Financial / Form / PaymentEdit.tpl
CommitLineData
9b2e3ee6
MD
1{*
2 +--------------------------------------------------------------------+
1188c7a8 3 | Copyright CiviCRM LLC. All rights reserved. |
9b2e3ee6 4 | |
1188c7a8
TO
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
9b2e3ee6
MD
8 +--------------------------------------------------------------------+
9*}
10
11{crmRegion name="payment-edit-block"}
12 <div id="payment-edit-section" class="crm-section billing_mode-section">
4ee75265 13 {foreach from=$paymentFields key=fieldName item=paymentField}
14 {assign var='name' value=$fieldName}
9b2e3ee6
MD
15 <div class="crm-container {$name}-section">
16 <div class="label">{$form.$name.label}
9b2e3ee6
MD
17 </div>
18 <div class="content">{if $name eq 'total_amount'}{$currency}&nbsp;&nbsp;{/if}{$form.$name.html}
9b2e3ee6
MD
19 </div>
20 <div class="clear"></div>
21 </div>
22 {/foreach}
23 </div>
24{/crmRegion}
25<div class="crm-submit-buttons">
26 {include file="CRM/common/formButtons.tpl" location="bottom"}
27</div>
4ee75265 28
29{literal}
30<script type="text/javascript">
31CRM.$(function ($) {
32
33 showHideFieldsByPaymentInstrumentID();
34 $('#payment_instrument_id').on('change', showHideFieldsByPaymentInstrumentID);
35
36 function showHideFieldsByPaymentInstrumentID() {
37 var paymentInstrumentLabel = $('#payment_instrument_id option:selected').text();
38 if (paymentInstrumentLabel == ts('Credit Card')) {
39 $('.check_number-section').hide();
40 $('.card_type_id-section, .pan_truncation-section').show();
41 }
42 else if (paymentInstrumentLabel == ts('Check')) {
43 $('.card_type_id-section, .pan_truncation-section').hide();
44 $('.check_number-section').show();
45 }
46 else {
47 $('.card_type_id-section, .pan_truncation-section, .check_number-section').hide();
48 }
49 }
50});
51</script>
52{/literal}