Merge pull request #20060 from demeritcowboy/grantview
[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 <component>CiviGrant</component>
11 <paths>
12 <add>civicrm/grant/add?reset=1&amp;action=add&amp;context=standalone</add>
13 <view>civicrm/contact/view/grant?reset=1&amp;action=view&amp;id=[id]&amp;cid=[contact_id]</view>
14 <update>civicrm/contact/view/grant?reset=1&amp;action=update&amp;id=[id]&amp;cid=[contact_id]</update>
15 <delete>civicrm/contact/view/grant?reset=1&amp;action=delete&amp;id=[id]&amp;cid=[contact_id]</delete>
16 </paths>
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 <html>
26 <type>Number</type>
27 </html>
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>
43 <html>
44 <type>EntityRef</type>
45 <label>Contact</label>
46 </html>
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>
54 </foreignKey>
55 <field>
56 <name>application_received_date</name>
57 <title>Application received date</title>
58 <uniqueName>grant_application_received_date</uniqueName>
59 <type>date</type>
60 <export>true</export>
61 <import>true</import>
62 <comment>Date on which grant application was received by donor.</comment>
63 <add>1.8</add>
64 <html>
65 <type>Select Date</type>
66 <formatType>activityDate</formatType>
67 </html>
68 </field>
69 <field>
70 <name>decision_date</name>
71 <title>Decision date</title>
72 <uniqueName>grant_decision_date</uniqueName>
73 <type>date</type>
74 <comment>Date on which grant decision was made.</comment>
75 <import>true</import>
76 <add>1.8</add>
77 <html>
78 <type>Select Date</type>
79 <formatType>activityDate</formatType>
80 </html>
81 </field>
82 <field>
83 <name>money_transfer_date</name>
84 <uniqueName>grant_money_transfer_date</uniqueName>
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>
90 <html>
91 <type>Select Date</type>
92 <formatType>activityDate</formatType>
93 </html>
94 </field>
95 <field>
96 <name>grant_due_date</name>
97 <type>date</type>
98 <title>Grant Report Due Date</title>
99 <comment>Date on which grant report is due.</comment>
100 <add>1.8</add>
101 <import>true</import>
102 <html>
103 <type>Select Date</type>
104 <formatType>activityDate</formatType>
105 </html>
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>
114 <html>
115 <type>CheckBox</type>
116 </html>
117 </field>
118 <field>
119 <name>grant_type_id</name>
120 <type>int unsigned</type>
121 <title>Grant Type</title>
122 <pseudoconstant>
123 <optionGroupName>grant_type</optionGroupName>
124 </pseudoconstant>
125 <html>
126 <type>Select</type>
127 </html>
128 <export>true</export>
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>
138 <field>
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>
147 <html>
148 <type>Text</type>
149 </html>
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>
158 <html>
159 <type>Text</type>
160 </html>
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>
170 <html>
171 <type>Text</type>
172 </html>
173 </field>
174 <field>
175 <name>currency</name>
176 <title>Grant Currency</title>
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>
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>
192 </field>
193 <field>
194 <name>rationale</name>
195 <type>text</type>
196 <title>Grant Rationale</title>
197 <comment>Grant rationale.</comment>
198 <html>
199 <type>TextArea</type>
200 <rows>4</rows>
201 <cols>60</cols>
202 </html>
203 <import>true</import>
204 <add>1.8</add>
205 </field>
206 <field>
207 <name>status_id</name>
208 <type>int unsigned</type>
209 <title>Grant Status</title>
210 <uniqueName>grant_status_id</uniqueName>
211 <required>true</required>
212 <import>true</import>
213 <export>false</export>
214 <comment>ID of Grant status.</comment>
215 <pseudoconstant>
216 <optionGroupName>grant_status</optionGroupName>
217 </pseudoconstant>
218 <html>
219 <type>Select</type>
220 </html>
221 <add>1.8</add>
222 </field>
223 <index>
224 <name>index_status_id</name>
225 <fieldName>status_id</fieldName>
226 <add>1.8</add>
227 </index>
228 <field>
229 <name>financial_type_id</name>
230 <title>Financial Type ID</title>
231 <type>int unsigned</type>
232 <default>NULL</default>
233 <pseudoconstant>
234 <table>civicrm_financial_type</table>
235 <keyColumn>id</keyColumn>
236 <labelColumn>name</labelColumn>
237 </pseudoconstant>
238 <comment>FK to Financial Type.</comment>
239 <html>
240 <label>Financial Type</label>
241 </html>
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>
248 <onDelete>SET NULL</onDelete>
249 <add>4.3</add>
250 </foreignKey>
251 </table>