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