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