Import from SVN (r45945, r596)
[civicrm-core.git] / templates / CRM / Financial / Form / FinancialAccount.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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{* this template is used for adding/editing/deleting financial type *}
27<h3>{if $action eq 1}{ts}New Financial Account{/ts}{elseif $action eq 2}{ts}Edit Financial Account{/ts}{else}{ts}Delete Financial Account{/ts}{/if}</h3>
28<div class="crm-block crm-form-block crm-contribution_type-form-block crm-financial_type-form-block">
29{if $action eq 8}
30 <div class="messages status no-popup">
31 <div class="icon inform-icon"></div>
32 {ts}WARNING: You cannot delete a {$delName} Financial Account if it is currently used by any Financial Types. Consider disabling this option instead.{/ts} {ts}Deleting a financial type cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
33 </div>
34{else}
35 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
36 <table class="form-layout-compressed">
37 <tr class="crm-contribution-form-block-name">
38 <td class="label">{$form.name.label}</td>
39 <td class="html-adjust">{$form.name.html}</td>
40 </tr>
41 <tr class="crm-contribution-form-block-description">
42 <td class="label">{$form.description.label}</td>
43 <td class="html-adjust">{$form.description.html}</td>
44 </tr>
45 <tr class="crm-contribution-form-block-organisation_name">
46 <td class="label">{$form.contact_name.label}&nbsp;{help id="id-financial-owner" file="CRM/Contact/Form/Contact.hlp"}</td>
47 <td class="html-adjust">{$form.contact_name.html|crmReplace:class:twenty}<br />
48 <span class="description">{ts}Use this field to indicate the organization that owns this account.{/ts}</span>
49 </td>
50 </tr>
51 <tr class="crm-contribution-form-block-financial_account_type_id">
52 <td class="label">{$form.financial_account_type_id.label}</td>
53 <td class="html-adjust">{$form.financial_account_type_id.html|crmReplace:class:twenty}</td>
54 </tr>
55 <tr class="crm-contribution-form-block-accounting_code">
56 <td class="label">{$form.accounting_code.label}</td>
57 <td class="html-adjust">{$form.accounting_code.html}<br />
58 <span class="description">{ts}Enter the corresponding account code used in your accounting system. This code will be available for contribution export, and included in accounting batch exports.{/ts}</span>
59 </td>
60 </tr>
61 <tr class="crm-contribution-form-block-account_type_code">
62 <td class="label">{$form.account_type_code.label}</td>
63 <td class="html-adjust">{$form.account_type_code.html}<br />
64 <span class="description">{ts}Enter an account type code for this account. Account type codes are required for QuickBooks integration and will be included in all accounting batch exports.{/ts}</span>
65 </td>
66 </tr>
67 <tr class="crm-contribution-form-block-is_deductible">
68 <td class="label">{$form.is_deductible.label}</td>
69 <td class="html-adjust">{$form.is_deductible.html}<br />
70 <span class="description">{ts}Are monies received into this account tax-deductible?{/ts}</span>
71 </td>
72 </tr>
73 <tr class="crm-contribution-form-block-is_active">
74 <td class="label">{$form.is_active.label}</td>
75 <td class="html-adjust">{$form.is_active.html}</td>
76 </tr>
77 <tr class="crm-contribution-form-block-is_tax">
78 <td class="label">{$form.is_tax.label}</td>
79 <td class="html-adjust">{$form.is_tax.html}<br />
80 <span class="description">{ts}Does this account hold taxes collected? NB: for information only - not used by core CiviCRM.{/ts}</span>
81 </td>
82 </tr>
83 <tr class="crm-contribution-form-block-tax_rate">
84 <td class="label">{$form.tax_rate.label}</td>
85 <td class="html-adjust">{$form.tax_rate.html}<br />
86 <span class="description">{ts}The default rate used to calculate the taxes collected into this account (e.g. for tax rate of 8.27%, enter 8.27). NB: for information only - not used by core CiviCRM.{/ts}</span>
87 </td>
88 </tr>
89 <tr class="crm-contribution-form-block-is_default">
90 <td class="label">{$form.is_default.label}</td>
91 <td class="html-adjust">{$form.is_default.html}<br />
92 <span class="description">{ts}Is this account to be used as the default account for its financial account type when associating financial accounts with financial types?{/ts}</span>
93 </td>
94 </tr>
95 </table>
96{/if}
97 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="botttom"}</div>
98</div>
99
100{literal}
101<script type="text/javascript">
102var dataUrl = "{/literal}{$dataURL}{literal}";
103cj('#contact_name').autocomplete( dataUrl, {
104 width : 250,
105 selectFirst : false,
106 matchCase : true,
107 matchContains: true
108}).result( function(event, data, formatted) {
109 ( parseInt( data[1] ) ) ? cj( "#contact_id" ).val( data[1] ) : cj( "#contact_id" ).val('');
110});
111
112// remove current account owner id when current owner removed.
113cj("form").submit(function() {
114 if (!cj('#contact_name').val()) cj( "#contact_id" ).val('');
115});
116
117//current employer default setting
118var employerId = "{/literal}{$organisationId}{literal}";
119if ( employerId ) {
120 var dataUrl = "{/literal}{crmURL p='civicrm/ajax/rest' h=0 q="className=CRM_Contact_Page_AJAX&fnName=getContactList&json=1&context=contact&org=1&id=" }{literal}" + employerId ;
121 cj.ajax({
122 url : dataUrl,
123 async : false,
124 success : function(html){
125 //fixme for showing address in div
126 htmlText = html.split( '|' , 2);
127 cj('input#contact_name').val(htmlText[0]);
128 cj('input#contact_id').val(htmlText[1]);
129 }
130 });
131}
132
133cj("input#contact_name").click( function( ) {
134 cj("input#contact_id").val('');
135});
136</script>
137{/literal}