Merge pull request #3749 from civicrm/4.4
[civicrm-core.git] / xml / schema / Grant / Grant.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2 <table>
3 <base>CRM/Grant</base>
4 <class>Grant</class>
5 <name>civicrm_grant</name>
6 <comment>This table stores information about grants given to a contact.</comment>
7 <add>1.8</add>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <type>int unsigned</type>
12 <uniqueName>grant_id</uniqueName>
13 <title>Grant ID</title>
14 <required>true</required>
15 <comment>Unique Grant id</comment>
16 <import>true</import>
17 <add>1.8</add>
18 </field>
19 <primaryKey>
20 <name>id</name>
21 <autoincrement>true</autoincrement>
22 </primaryKey>
23 <field>
24 <name>contact_id</name>
25 <type>int unsigned</type>
26 <uniqueName>grant_contact_id</uniqueName>
27 <title>Contact ID</title>
28 <export>true</export>
29 <required>true</required>
30 <comment>Contact ID of contact record given grant belongs to.</comment>
31 <add>1.8</add>
32 <html>
33 <type>Autocomplete-Select</type>
34 </html>
35 </field>
36 <foreignKey>
37 <name>contact_id</name>
38 <table>civicrm_contact</table>
39 <key>id</key>
40 <add>1.8</add>
41 <onDelete>CASCADE</onDelete>
42 </foreignKey>
43 <field>
44 <name>application_received_date</name>
45 <title>Application received date</title>
46 <type>date</type>
47 <export>true</export>
48 <comment>Date on which grant application was received by donor.</comment>
49 <add>1.8</add>
50 </field>
51 <field>
52 <name>decision_date</name>
53 <title>Decision date</title>
54 <type>date</type>
55 <comment>Date on which grant decision was made.</comment>
56 <import>true</import>
57 <add>1.8</add>
58 <html>
59 <type>Select Date</type>
60 </html>
61 </field>
62 <field>
63 <name>money_transfer_date</name>
64 <uniqueName>grant_money_transfer_date</uniqueName>
65 <title>Grant Money transfer date</title>
66 <type>date</type>
67 <comment>Date on which grant money transfer was made.</comment>
68 <import>true</import>
69 <add>1.8</add>
70 <html>
71 <type>Select Date</type>
72 </html>
73 </field>
74 <field>
75 <name>grant_due_date</name>
76 <type>date</type>
77 <title>Grant Due Date</title>
78 <comment>Date on which grant report is due.</comment>
79 <add>1.8</add>
80 <html>
81 <type>Select Date</type>
82 </html>
83 </field>
84 <field>
85 <name>grant_report_received</name>
86 <title>Grant report received</title>
87 <type>boolean</type>
88 <comment>Yes/No field stating whether grant report was received by donor.</comment>
89 <import>true</import>
90 <add>1.8</add>
91 <html>
92 <type>CheckBox</type>
93 </html>
94 </field>
95 <field>
96 <name>grant_type_id</name>
97 <type>int unsigned</type>
98 <title>Grant Type</title>
99 <pseudoconstant>
100 <optionGroupName>grant_type</optionGroupName>
101 </pseudoconstant>
102 <html>
103 <type>Select</type>
104 </html>
105 <export>true</export>
106 <required>true</required>
107 <comment>Type of grant. Implicit FK to civicrm_option_value in grant_type option_group.</comment>
108 <add>1.8</add>
109 </field>
110 <index>
111 <name>index_grant_type_id</name>
112 <fieldName>grant_type_id</fieldName>
113 <pseudoconstant>
114 <optionGroupName>grant_type</optionGroupName>
115 </pseudoconstant>
116 <html>
117 <type>Select</type>
118 </html>
119 <add>1.8</add>
120 </index>
121 <field>
122 <name>amount_total</name>
123 <title>Total Amount</title>
124 <type>decimal</type>
125 <required>true</required>
126 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
127 <import>true</import>
128 <comment>Requested grant amount, in default currency.</comment>
129 <add>1.8</add>
130 <html>
131 <type>Text</type>
132 </html>
133 </field>
134 <field>
135 <name>amount_requested</name>
136 <title>Amount Requested</title>
137 <type>decimal</type>
138 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
139 <comment>Requested grant amount, in original currency (optional).</comment>
140 <add>1.8</add>
141 <html>
142 <type>Text</type>
143 </html>
144 </field>
145 <field>
146 <name>amount_granted</name>
147 <title>Amount granted</title>
148 <type>decimal</type>
149 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
150 <import>true</import>
151 <comment>Granted amount, in default currency.</comment>
152 <add>1.8</add>
153 <html>
154 <type>Text</type>
155 </html>
156 </field>
157 <field>
158 <name>currency</name>
159 <title>Grant Currency</title>
160 <type>varchar</type>
161 <length>3</length>
162 <required>true</required>
163 <comment>3 character string, value from config setting or input via user.</comment>
164 <add>3.2</add>
165 <pseudoconstant>
166 <table>civicrm_currency</table>
167 <keyColumn>name</keyColumn>
168 <labelColumn>full_name</labelColumn>
169 <nameColumn>numeric_code</nameColumn>
170 </pseudoconstant>
171 <html>
172 <type>Select</type>
173 </html>
174 </field>
175 <field>
176 <name>currency</name>
177 <type>varchar</type>
178 <length>8</length>
179 <default>NULL</default>
180 <comment>3 character string, value from config setting or input via user.</comment>
181 <add>3.2</add>
182 <drop>4.3</drop>
183 </field>
184 <field>
185 <name>rationale</name>
186 <type>text</type>
187 <title>Grant Rationale</title>
188 <comment>Grant rationale.</comment>
189 <html>
190 <type>TextArea</type>
191 <rows>4</rows>
192 <cols>60</cols>
193 </html>
194 <import>true</import>
195 <add>1.8</add>
196 </field>
197 <field>
198 <name>status_id</name>
199 <type>int unsigned</type>
200 <title>Grant Status</title>
201 <uniqueName>grant_status_id</uniqueName>
202 <required>true</required>
203 <import>true</import>
204 <export>false</export>
205 <comment>Id of Grant status.</comment>
206 <pseudoconstant>
207 <optionGroupName>grant_status</optionGroupName>
208 </pseudoconstant>
209 <html>
210 <type>Select</type>
211 </html>
212 <add>1.8</add>
213 </field>
214 <index>
215 <name>index_status_id</name>
216 <fieldName>status_id</fieldName>
217 <add>1.8</add>
218 </index>
219 <field>
220 <name>financial_type_id</name>
221 <title>Financial Type</title>
222 <type>int unsigned</type>
223 <default>NULL</default>
224 <pseudoconstant>
225 <table>civicrm_financial_type</table>
226 <keyColumn>id</keyColumn>
227 <labelColumn>name</labelColumn>
228 </pseudoconstant>
229 <comment>FK to Financial Type.</comment>
230 <add>4.3</add>
231 </field>
232 <foreignKey>
233 <name>financial_type_id</name>
234 <table>civicrm_financial_type</table>
235 <key>id</key>
236 <onDelete>SET NULL</onDelete>
237 <add>4.3</add>
238 </foreignKey>
239 </table>