Merge pull request #2240 from totten/4.4-setCriteriaModel
[civicrm-core.git] / xml / schema / Financial / FinancialAccount.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Financial</base>
5 <class>FinancialAccount</class>
6 <name>civicrm_financial_account</name>
7 <add>3.2</add>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <type>int unsigned</type>
12 <required>true</required>
13 <comment>ID</comment>
14 <add>3.2</add>
15 </field>
16 <primaryKey>
17 <name>id</name>
18 <autoincrement>true</autoincrement>
19 </primaryKey>
20 <field>
21 <name>name</name>
22 <type>varchar</type>
23 <length>255</length>
24 <required>true</required>
25 <comment>Financial Account Name.</comment>
26 <add>3.2</add>
27 </field>
28 <field>
29 <name>contact_id</name>
30 <uniqueName>financial_account_contact_id</uniqueName>
31 <title>Contact ID</title>
32 <type>int unsigned</type>
33 <comment>FK to Contact ID that is responsible for the funds in this account</comment>
34 <add>4.3</add>
35 </field>
36 <foreignKey>
37 <name>contact_id</name>
38 <table>civicrm_contact</table>
39 <key>id</key>
40 <add>4.3</add>
41 <onDelete>SET NULL</onDelete>
42 </foreignKey>
43 <field>
44 <name>account_type_id</name>
45 <type>int unsigned</type>
46 <required>true</required>
47 <add>3.2</add>
48 <drop>4.3</drop>
49 </field>
50 <field>
51 <name>financial_account_type_id</name>
52 <type>int unsigned</type>
53 <required>true</required>
54 <default>3</default>
55 <add>4.3</add>
56 <comment>pseudo FK into civicrm_option_value.</comment>
57 <pseudoconstant>
58 <optionGroupName>financial_account_type</optionGroupName>
59 </pseudoconstant>
60 </field>
61 <field>
62 <name>accounting_code</name>
63 <title>Accounting Code</title>
64 <type>varchar</type>
65 <length>64</length>
66 <export>true</export>
67 <comment>Optional value for mapping monies owed and received to accounting system codes.</comment>
68 <add>4.3</add>
69 </field>
70 <field>
71 <name>account_type_code</name>
72 <title>Account Type Code</title>
73 <type>varchar</type>
74 <length>64</length>
75 <export>true</export>
76 <comment>Optional value for mapping account types to accounting system account categories (QuickBooks Account Type Codes for example).</comment>
77 <add>4.3</add>
78 </field>
79 <field>
80 <name>description</name>
81 <type>varchar</type>
82 <length>255</length>
83 <comment>Financial Type Description.</comment>
84 <add>4.3</add>
85 </field>
86 <field>
87 <name>parent_id</name>
88 <type>int unsigned</type>
89 <comment>Parent ID in account hierarchy</comment>
90 <add>4.3</add>
91 </field>
92 <foreignKey>
93 <name>parent_id</name>
94 <table>civicrm_financial_account</table>
95 <key>id</key>
96 <add>4.3</add>
97 </foreignKey>
98 <field>
99 <name>is_header_account</name>
100 <type>boolean</type>
101 <default>0</default>
102 <comment>Is this a header account which does not allow transactions to be posted against it directly, but only to its sub-accounts?</comment>
103 <add>4.3</add>
104 </field>
105 <field>
106 <name>is_deductible</name>
107 <type>boolean</type>
108 <default>1</default>
109 <comment>Is this account tax-deductible?</comment>
110 <add>4.3</add>
111 </field>
112 <field>
113 <name>is_tax</name>
114 <type>boolean</type>
115 <default>0</default>
116 <comment>Is this account for taxes?</comment>
117 <add>4.3</add>
118 </field>
119 <field>
120 <name>tax_rate</name>
121 <type>decimal</type>
122 <length>10,8</length>
123 <comment>The percentage of the total_amount that is due for this tax.</comment>
124 <add>4.3</add>
125 </field>
126 <field>
127 <name>is_reserved</name>
128 <type>boolean</type>
129 <comment>Is this a predefined system object?</comment>
130 <add>4.3</add>
131 </field>
132 <field>
133 <name>is_active</name>
134 <type>boolean</type>
135 <comment>Is this property active?</comment>
136 <add>4.3</add>
137 </field>
138 <field>
139 <name>is_default</name>
140 <type>boolean</type>
141 <comment>Is this account the default one (or default tax one) for its financial_account_type?</comment>
142 <add>4.3</add>
143 </field>
144 <index>
145 <name>UI_name</name>
146 <fieldName>name</fieldName>
147 <unique>true</unique>
148 <add>4.3</add>
149 </index>
150 </table>