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