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