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