CRM-15168 more title metadate fixes (& some whitespace snuck in)
[civicrm-core.git] / xml / schema / Contribute / Contribution.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contribute</base>
5 <class>Contribution</class>
6 <name>civicrm_contribution</name>
7 <add>1.3</add>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <uniqueName>contribution_id</uniqueName>
12 <type>int unsigned</type>
13 <required>true</required>
14 <import>true</import>
15 <title>Contribution ID</title>
16 <comment>Contribution ID</comment>
17 <add>1.3</add>
18 </field>
19 <primaryKey>
20 <name>id</name>
21 <autoincrement>true</autoincrement>
22 </primaryKey>
23 <field>
24 <name>contact_id</name>
25 <uniqueName>contribution_contact_id</uniqueName>
26 <title>Contact ID</title>
27 <type>int unsigned</type>
28 <required>true</required>
29 <import>true</import>
30 <headerPattern>/contact(.?id)?/i</headerPattern>
31 <dataPattern>/^\d+$/</dataPattern>
32 <comment>FK to Contact ID</comment>
33 <html>
34 <type>Autocomplete-Select</type>
35 </html>
36 <add>1.3</add>
37 </field>
38 <foreignKey>
39 <name>contact_id</name>
40 <table>civicrm_contact</table>
41 <key>id</key>
42 <add>1.3</add>
43 <onDelete>CASCADE</onDelete>
44 </foreignKey>
45 <field>
46 <name>solicitor_id</name>
47 <title>Solicitor ID</title>
48 <type>int unsigned</type>
49 <comment>FK to Solicitor ID</comment>
50 <add>1.4</add>
51 <drop>2.2</drop>
52 </field>
53 <foreignKey>
54 <name>solicitor_id</name>
55 <table>civicrm_contact</table>
56 <key>id</key>
57 <add>1.4</add>
58 <drop>2.2</drop>
59 <onDelete>SET NULL</onDelete>
60 </foreignKey>
61 <field>
62 <name>contribution_type_id</name>
63 <title>Contribution Type</title>
64 <export>false</export>
65 <type>int unsigned</type>
66 <comment>FK to Contribution Type</comment>
67 <add>1.3</add>
68 <drop>4.3</drop>
69 </field>
70 <foreignKey>
71 <name>contribution_type_id</name>
72 <table>civicrm_contribution_type</table>
73 <key>id</key>
74 <add>1.3</add>
75 <drop>4.3</drop>
76 <onDelete>SET NULL</onDelete>
77 </foreignKey>
78 <field>
79 <name>financial_type_id</name>
80 <title>Financial Type</title>
81 <export>false</export>
82 <type>int unsigned</type>
83 <comment>FK to Financial Type for (total_amount - non_deductible_amount).</comment>
84 <pseudoconstant>
85 <table>civicrm_financial_type</table>
86 <keyColumn>id</keyColumn>
87 <labelColumn>name</labelColumn>
88 </pseudoconstant>
89 <html>
90 <type>Select</type>
91 </html>
92 <add>4.3</add>
93 </field>
94 <foreignKey>
95 <name>financial_type_id</name>
96 <table>civicrm_financial_type</table>
97 <key>id</key>
98 <add>4.3</add>
99 </foreignKey>
100 <field>
101 <name>contribution_page_id</name>
102 <title>Contribution Page</title>
103 <type>int unsigned</type>
104 <import>true</import>
105 <comment>The Contribution Page which triggered this contribution</comment>
106 <pseudoconstant>
107 <table>civicrm_contribution_page</table>
108 <keyColumn>id</keyColumn>
109 <labelColumn>title</labelColumn>
110 </pseudoconstant>
111 <html>
112 <type>Select</type>
113 </html>
114 <add>1.5</add>
115 </field>
116 <foreignKey>
117 <name>contribution_page_id</name>
118 <table>civicrm_contribution_page</table>
119 <key>id</key>
120 <onDelete>SET NULL</onDelete>
121 </foreignKey>
122 <field>
123 <name>payment_instrument_id</name>
124 <uniqueName>contribution_payment_instrument_id</uniqueName>
125 <title>Payment Instrument</title>
126 <type>int unsigned</type>
127 <comment>FK to Payment Instrument</comment>
128 <pseudoconstant>
129 <optionGroupName>payment_instrument</optionGroupName>
130 </pseudoconstant>
131 <html>
132 <type>Select</type>
133 </html>
134 <add>1.3</add>
135 </field>
136 <index>
137 <name>UI_contrib_payment_instrument_id</name>
138 <fieldName>payment_instrument_id</fieldName>
139 <add>1.6</add>
140 </index>
141 <field>
142 <name>receive_date</name>
143 <type>datetime</type>
144 <import>true</import>
145 <headerPattern>/receive(.?date)?/i</headerPattern>
146 <dataPattern>/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/</dataPattern>
147 <comment>when was gift received</comment>
148 <add>1.3</add>
149 <html>
150 <type>Select Date</type>
151 </html>
152 </field>
153 <field>
154 <name>non_deductible_amount</name>
155 <title>Non-deductible Amount</title>
156 <type>decimal</type>
157 <default>0</default>
158 <import>true</import>
159 <headerPattern>/non?.?deduct/i</headerPattern>
160 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
161 <comment>Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.</comment>
162 <add>1.3</add>
163 <html>
164 <type>Text</type>
165 </html>
166 </field>
167 <field>
168 <name>total_amount</name>
169 <type>decimal</type>
170 <required>true</required>
171 <import>true</import>
172 <headerPattern>/^total|(.?^am(ou)?nt)/i</headerPattern>
173 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
174 <comment>Total amount of this contribution. Use market value for non-monetary gifts.</comment>
175 <add>1.3</add>
176 <html>
177 <type>Text</type>
178 </html>
179 </field>
180 <field>
181 <name>fee_amount</name>
182 <type>decimal</type>
183 <import>true</import>
184 <headerPattern>/fee(.?am(ou)?nt)?/i</headerPattern>
185 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
186 <comment>actual processor fee if known - may be 0.</comment>
187 <add>1.3</add>
188 <html>
189 <type>Text</type>
190 </html>
191 </field>
192 <field>
193 <name>net_amount</name>
194 <type>decimal</type>
195 <import>true</import>
196 <headerPattern>/net(.?am(ou)?nt)?/i</headerPattern>
197 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
198 <comment>actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.</comment>
199 <add>1.3</add>
200 <html>
201 <type>Text</type>
202 </html>
203 </field>
204 <field>
205 <name>trxn_id</name>
206 <title>Transaction ID</title>
207 <type>varchar</type>
208 <length>255</length>
209 <import>true</import>
210 <headerPattern>/tr(ansactio|x)n(.?id)?/i</headerPattern>
211 <comment>unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method</comment>
212 <html>
213 <type>Text</type>
214 </html>
215 <add>1.3</add>
216 </field>
217 <field>
218 <name>invoice_id</name>
219 <title>Invoice ID</title>
220 <type>varchar</type>
221 <length>255</length>
222 <import>true</import>
223 <headerPattern>/invoice(.?id)?/i</headerPattern>
224 <comment>unique invoice id, system generated or passed in</comment>
225 <html>
226 <type>Text</type>
227 </html>
228 <add>1.3</add>
229 </field>
230 <field>
231 <name>currency</name>
232 <type>varchar</type>
233 <length>3</length>
234 <default>NULL</default>
235 <import>true</import>
236 <headerPattern>/cur(rency)?/i</headerPattern>
237 <dataPattern>/^[A-Z]{3}$/i</dataPattern>
238 <comment>3 character string, value from config setting or input via user.</comment>
239 <add>1.3</add>
240 <pseudoconstant>
241 <table>civicrm_currency</table>
242 <keyColumn>name</keyColumn>
243 <labelColumn>full_name</labelColumn>
244 <nameColumn>numeric_code</nameColumn>
245 </pseudoconstant>
246 <html>
247 <type>Select</type>
248 </html>
249 </field>
250 <field>
251 <name>cancel_date</name>
252 <type>datetime</type>
253 <import>true</import>
254 <headerPattern>/cancel(.?date)?/i</headerPattern>
255 <dataPattern>/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/</dataPattern>
256 <comment>when was gift cancelled</comment>
257 <add>1.3</add>
258 <html>
259 <type>Select Date</type>
260 </html>
261 </field>
262 <field>
263 <name>cancel_reason</name>
264 <type>text</type>
265 <import>true</import>
266 <headerPattern>/(cancel.?)?reason/i</headerPattern>
267 <html>
268 <type>Text</type>
269 </html>
270 <add>1.3</add>
271 </field>
272 <field>
273 <name>receipt_date</name>
274 <type>datetime</type>
275 <import>true</import>
276 <headerPattern>/receipt(.?date)?/i</headerPattern>
277 <dataPattern>/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/</dataPattern>
278 <comment>when (if) receipt was sent. populated automatically for online donations w/ automatic receipting</comment>
279 <html>
280 <type>Select Date</type>
281 </html>
282 <add>1.3</add>
283 </field>
284 <field>
285 <name>thankyou_date</name>
286 <title>Thank-you Date</title>
287 <type>datetime</type>
288 <import>true</import>
289 <headerPattern>/thank(s|(.?you))?(.?date)?/i</headerPattern>
290 <dataPattern>/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/</dataPattern>
291 <comment>when (if) was donor thanked</comment>
292 <add>1.3</add>
293 <html>
294 <type>Select Date</type>
295 </html>
296 </field>
297 <field>
298 <name>source</name>
299 <uniqueName>contribution_source</uniqueName>
300 <title>Contribution Source</title>
301 <type>varchar</type>
302 <length>255</length>
303 <import>true</import>
304 <headerPattern>/source/i</headerPattern>
305 <comment>Origin of this Contribution.</comment>
306 <add>1.3</add>
307 <html>
308 <type>Text</type>
309 </html>
310 </field>
311 <field>
312 <name>amount_level</name>
313 <title>Amount Label</title>
314 <type>text</type>
315 <import>true</import>
316 <add>1.7</add>
317 <html>
318 <type>Text</type>
319 </html>
320 </field>
321 <field>
322 <name>note</name>
323 <type>text</type>
324 <comment>Note and/or Comment.</comment>
325 <import>true</import>
326 <headerPattern>/Note|Comment/i</headerPattern>
327 <dataPattern>//</dataPattern>
328 <add>1.4</add>
329 <drop>1.7</drop>
330 </field>
331 <index>
332 <name>UI_contrib_trxn_id</name>
333 <fieldName>trxn_id</fieldName>
334 <unique>true</unique>
335 <add>2.1</add>
336 </index>
337 <index>
338 <name>UI_contrib_invoice_id</name>
339 <fieldName>invoice_id</fieldName>
340 <unique>true</unique>
341 <add>2.1</add>
342 </index>
343 <field>
344 <name>contribution_recur_id</name>
345 <title>Recurring Contribution ID</title>
346 <type>int unsigned</type>
347 <comment>Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.</comment>
348 <add>1.4</add>
349 </field>
350 <foreignKey>
351 <name>contribution_recur_id</name>
352 <table>civicrm_contribution_recur</table>
353 <key>id</key>
354 <add>1.4</add>
355 <onDelete>SET NULL</onDelete>
356 </foreignKey>
357 <field>
358 <name>is_test</name>
359 <title>Test</title>
360 <type>boolean</type>
361 <default>0</default>
362 <import>true</import>
363 <html>
364 <type>CheckBox</type>
365 </html>
366 </field>
367 <field>
368 <name>is_pay_later</name>
369 <title>Is Pay Later</title>
370 <type>boolean</type>
371 <default>0</default>
372 <import>true</import>
373 <add>2.1</add>
374 <html>
375 <type>CheckBox</type>
376 </html>
377 </field>
378 <field>
379 <name>contribution_status_id</name>
380 <title>Contribution Status</title>
381 <type>int unsigned</type>
382 <default>1</default>
383 <import>true</import>
384 <export>true</export>
385 <headerPattern>/status/i</headerPattern>
386 <pseudoconstant>
387 <optionGroupName>contribution_status</optionGroupName>
388 </pseudoconstant>
389 <html>
390 <type>Select</type>
391 </html>
392 <add>1.6</add>
393 </field>
394 <index>
395 <name>index_contribution_status</name>
396 <fieldName>contribution_status_id</fieldName>
397 <add>1.6</add>
398 </index>
399 <index>
400 <name>received_date</name>
401 <fieldName>receive_date</fieldName>
402 <add>1.6</add>
403 </index>
404 <field>
405 <name>address_id</name>
406 <type>int unsigned</type>
407 <comment>Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.</comment>
408 <add>2.2</add>
409 </field>
410 <foreignKey>
411 <name>address_id</name>
412 <table>civicrm_address</table>
413 <key>id</key>
414 <add>2.2</add>
415 <onDelete>SET NULL</onDelete>
416 </foreignKey>
417 <field>
418 <name>check_number</name>
419 <title>Check Number</title>
420 <headerPattern>/check(.?number)?/i</headerPattern>
421 <type>varchar</type>
422 <length>255</length>
423 <html>
424 <type>Text</type>
425 <size>SIX</size>
426 </html>
427 <import>true</import>
428 <add>2.2</add>
429 </field>
430 <index>
431 <name>check_number</name>
432 <fieldName>check_number</fieldName>
433 <add>2.2</add>
434 </index>
435 <field>
436 <name>campaign_id</name>
437 <uniqueName>contribution_campaign_id</uniqueName>
438 <type>int unsigned</type>
439 <title>Campaign</title>
440 <import>true</import>
441 <comment>The campaign for which this contribution has been triggered.</comment>
442 <pseudoconstant>
443 <table>civicrm_campaign</table>
444 <keyColumn>id</keyColumn>
445 <labelColumn>title</labelColumn>
446 </pseudoconstant>
447 <add>3.4</add>
448 <html>
449 <type>Select</type>
450 </html>
451 </field>
452 <foreignKey>
453 <name>campaign_id</name>
454 <table>civicrm_campaign</table>
455 <key>id</key>
456 <onDelete>SET NULL</onDelete>
457 </foreignKey>
458 </table>