Merge pull request #19086 from agileware/CIVICRM-1617
[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>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 <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>
40 <html>
41 <type>EntityRef</type>
42 </html>
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>
50 </foreignKey>
51 <field>
52 <name>application_received_date</name>
53 <title>Application received date</title>
54 <uniqueName>grant_application_received_date</uniqueName>
55 <type>date</type>
56 <export>true</export>
57 <import>true</import>
58 <comment>Date on which grant application was received by donor.</comment>
59 <add>1.8</add>
60 <html>
61 <type>Select Date</type>
62 <formatType>activityDate</formatType>
63 </html>
64 </field>
65 <field>
66 <name>decision_date</name>
67 <title>Decision date</title>
68 <uniqueName>grant_decision_date</uniqueName>
69 <type>date</type>
70 <comment>Date on which grant decision was made.</comment>
71 <import>true</import>
72 <add>1.8</add>
73 <html>
74 <type>Select Date</type>
75 <formatType>activityDate</formatType>
76 </html>
77 </field>
78 <field>
79 <name>money_transfer_date</name>
80 <uniqueName>grant_money_transfer_date</uniqueName>
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>
86 <html>
87 <type>Select Date</type>
88 <formatType>activityDate</formatType>
89 </html>
90 </field>
91 <field>
92 <name>grant_due_date</name>
93 <type>date</type>
94 <title>Grant Report Due Date</title>
95 <comment>Date on which grant report is due.</comment>
96 <add>1.8</add>
97 <import>true</import>
98 <html>
99 <type>Select Date</type>
100 <formatType>activityDate</formatType>
101 </html>
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>
110 <html>
111 <type>CheckBox</type>
112 </html>
113 </field>
114 <field>
115 <name>grant_type_id</name>
116 <type>int unsigned</type>
117 <title>Grant Type</title>
118 <pseudoconstant>
119 <optionGroupName>grant_type</optionGroupName>
120 </pseudoconstant>
121 <html>
122 <type>Select</type>
123 </html>
124 <export>true</export>
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>
134 <field>
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>
143 <html>
144 <type>Text</type>
145 </html>
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>
154 <html>
155 <type>Text</type>
156 </html>
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>
166 <html>
167 <type>Text</type>
168 </html>
169 </field>
170 <field>
171 <name>currency</name>
172 <title>Grant Currency</title>
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>
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>
188 </field>
189 <field>
190 <name>rationale</name>
191 <type>text</type>
192 <title>Grant Rationale</title>
193 <comment>Grant rationale.</comment>
194 <html>
195 <type>TextArea</type>
196 <rows>4</rows>
197 <cols>60</cols>
198 </html>
199 <import>true</import>
200 <add>1.8</add>
201 </field>
202 <field>
203 <name>status_id</name>
204 <type>int unsigned</type>
205 <title>Grant Status</title>
206 <uniqueName>grant_status_id</uniqueName>
207 <required>true</required>
208 <import>true</import>
209 <export>false</export>
210 <comment>Id of Grant status.</comment>
211 <pseudoconstant>
212 <optionGroupName>grant_status</optionGroupName>
213 </pseudoconstant>
214 <html>
215 <type>Select</type>
216 </html>
217 <add>1.8</add>
218 </field>
219 <index>
220 <name>index_status_id</name>
221 <fieldName>status_id</fieldName>
222 <add>1.8</add>
223 </index>
224 <field>
225 <name>financial_type_id</name>
226 <title>Financial Type</title>
227 <type>int unsigned</type>
228 <default>NULL</default>
229 <pseudoconstant>
230 <table>civicrm_financial_type</table>
231 <keyColumn>id</keyColumn>
232 <labelColumn>name</labelColumn>
233 </pseudoconstant>
234 <comment>FK to Financial Type.</comment>
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>
241 <onDelete>SET NULL</onDelete>
242 <add>4.3</add>
243 </foreignKey>
244 </table>