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