2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
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 |
8 +--------------------------------------------------------------------+
10 {* this template is used for adding/editing/deleting financial type *}
11 <div class="crm-block crm-form-block crm-financial_type-form-block">
13 <div class="messages status">
14 {icon icon="fa-info-circle"}{/icon}
15 {ts}WARNING: You cannot delete a financial type if it is currently used by any Contributions, Contribution Pages or Membership Types. Consider disabling this option instead.{/ts} {ts}Deleting a financial type cannot be undone. Unbalanced transactions may be created if you delete this account.{/ts} {ts}Do you want to continue?{/ts}
18 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
20 <table class="form-layout">
22 <tr class="crm-contribution-form-block-account_relationship">
23 <td class="label">{$form.account_relationship.label}</td>
24 <td class="html-adjust">{$form.account_relationship.html}</td>
26 <tr class="crm-contribution-form-block-financial_account_id">
27 <td class="label">{$form.financial_account_id.label}</td>
28 <td class="html-adjust">{$form.financial_account_id.html}</td>
33 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="botttom"}</div>
36 <script language="JavaScript" type="text/javascript">
39 $("#financial_account_id").change(function() {
41 relationID = "#account_relationship"
42 financialAccountID = "#financial_account_id"
43 callbackURL = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancialRelation'}"
45 var financialId = $("#financial_account_id").val();
46 var check = $(relationID).val();
47 if (check == 'select' || financialId == 'select') {
48 callbackURL = callbackURL+"&_value=" + financialId;
51 context: document.body,
52 success: function(data, textStatus) {
53 $(relationID).html("");//clear old options
54 data = eval(data);//get json array
56 for (i = 0; i < data.length; i++) {
57 if (data[i].selected == 'Selected') {
58 var idf = data[i].value;
60 $(relationID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
64 $(relationID).val(idf);
69 if (financialId == 'select') {
71 callbackURLs = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancial'}"
73 callbackURLs = callbackURLs + "&_value=select";
76 context: document.body,
77 success: function(data, textStatus) {
78 $(financialAccountID).html("");//clear old options
79 data = eval(data);//get json array
81 for (i = 0; i < data.length; i++) {
82 $(financialAccountID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
89 $("#account_relationship").change(function() {
91 relationID = "#account_relationship"
92 financialAccountID = "#financial_account_id"
93 callbackURLs = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancial'}"
95 var financialId = $("#account_relationship").val();
96 var check = $(financialAccountID).val();
97 callbackURLs = callbackURLs+"&_value="+financialId;
100 context: document.body,
101 success: function(data, textStatus) {
102 $(financialAccountID).html("");//clear old options
103 data = eval(data);//get json array
105 for (i = 0; i < data.length; i++) {
106 if (data[i].selected == 'Selected') {
107 var idf = data[i].value;
109 $(financialAccountID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
113 $(financialAccountID).val(idf);
117 if (financialId == 'select') {
119 callbackURL = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancialRelation'}"
121 callbackURL = callbackURL+"&_value=select";
124 context: document.body,
125 success: function(data, textStatus) {
126 $(relationID).html("");//clear old options
127 data = eval(data);//get json array
129 for (i = 0; i < data.length; i++) {
130 if (data[i].selected == 'Selected') {
131 var idf = data[i].value;
133 $(relationID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
137 $(relationID).val(idf);