CRM-15168 more title metadate fixes (& some whitespace snuck in)
[civicrm-core.git] / xml / schema / Contribute / Contribution.xml
CommitLineData
6d68a4cb 1<?xml version="1.0" encoding="iso-8859-1" ?>
6a488035 2
6d68a4cb
CW
3<table>
4 <base>CRM/Contribute</base>
5 <class>Contribution</class>
6 <name>civicrm_contribution</name>
7 <add>1.3</add>
6a488035 8 <log>true</log>
6d68a4cb
CW
9 <field>
10 <name>id</name>
6a488035 11 <uniqueName>contribution_id</uniqueName>
6d68a4cb 12 <type>int unsigned</type>
6a488035 13 <required>true</required>
6d68a4cb 14 <import>true</import>
6a488035 15 <title>Contribution ID</title>
6d68a4cb
CW
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>
6a488035
TO
25 <uniqueName>contribution_contact_id</uniqueName>
26 <title>Contact ID</title>
6d68a4cb
CW
27 <type>int unsigned</type>
28 <required>true</required>
6a488035
TO
29 <import>true</import>
30 <headerPattern>/contact(.?id)?/i</headerPattern>
31 <dataPattern>/^\d+$/</dataPattern>
6d68a4cb 32 <comment>FK to Contact ID</comment>
614d72ec 33 <html>
34 <type>Autocomplete-Select</type>
35 </html>
6d68a4cb
CW
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>
6a488035 43 <onDelete>CASCADE</onDelete>
6d68a4cb
CW
44 </foreignKey>
45 <field>
46 <name>solicitor_id</name>
6a488035 47 <title>Solicitor ID</title>
6d68a4cb
CW
48 <type>int unsigned</type>
49 <comment>FK to Solicitor ID</comment>
50 <add>1.4</add>
6a488035 51 <drop>2.2</drop>
6d68a4cb
CW
52 </field>
53 <foreignKey>
54 <name>solicitor_id</name>
55 <table>civicrm_contact</table>
56 <key>id</key>
57 <add>1.4</add>
6a488035
TO
58 <drop>2.2</drop>
59 <onDelete>SET NULL</onDelete>
6d68a4cb
CW
60 </foreignKey>
61 <field>
62 <name>contribution_type_id</name>
6a488035
TO
63 <title>Contribution Type</title>
64 <export>false</export>
65 <type>int unsigned</type>
66 <comment>FK to Contribution Type</comment>
6d68a4cb
CW
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>
6a488035 76 <onDelete>SET NULL</onDelete>
6d68a4cb
CW
77 </foreignKey>
78 <field>
6a488035
TO
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>
6d68a4cb
CW
84 <pseudoconstant>
85 <table>civicrm_financial_type</table>
86 <keyColumn>id</keyColumn>
87 <labelColumn>name</labelColumn>
88 </pseudoconstant>
614d72ec 89 <html>
e0991796 90 <type>Select</type>
614d72ec 91 </html>
6a488035 92 <add>4.3</add>
6d68a4cb
CW
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>
6a488035
TO
102 <title>Contribution Page</title>
103 <type>int unsigned</type>
104 <import>true</import>
6d68a4cb
CW
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>
614d72ec 111 <html>
e0991796 112 <type>Select</type>
614d72ec 113 </html>
6d68a4cb
CW
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>
6a488035
TO
120 <onDelete>SET NULL</onDelete>
121 </foreignKey>
6d68a4cb 122 <field>
6a488035
TO
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>
6d68a4cb 129 <optionGroupName>payment_instrument</optionGroupName>
6a488035 130 </pseudoconstant>
614d72ec 131 <html>
e0991796 132 <type>Select</type>
614d72ec 133 </html>
6a488035 134 <add>1.3</add>
6d68a4cb 135 </field>
6a488035
TO
136 <index>
137 <name>UI_contrib_payment_instrument_id</name>
6d68a4cb 138 <fieldName>payment_instrument_id</fieldName>
6a488035 139 <add>1.6</add>
6d68a4cb
CW
140 </index>
141 <field>
142 <name>receive_date</name>
143 <type>datetime</type>
6a488035
TO
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>
6d68a4cb
CW
147 <comment>when was gift received</comment>
148 <add>1.3</add>
614d72ec 149 <html>
150 <type>Select Date</type>
151 </html>
6d68a4cb
CW
152 </field>
153 <field>
154 <name>non_deductible_amount</name>
6a488035
TO
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>
6d68a4cb
CW
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>
614d72ec 163 <html>
164 <type>Text</type>
165 </html>
6a488035 166 </field>
6d68a4cb
CW
167 <field>
168 <name>total_amount</name>
169 <type>decimal</type>
6a488035
TO
170 <required>true</required>
171 <import>true</import>
172 <headerPattern>/^total|(.?^am(ou)?nt)/i</headerPattern>
173 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
6d68a4cb
CW
174 <comment>Total amount of this contribution. Use market value for non-monetary gifts.</comment>
175 <add>1.3</add>
614d72ec 176 <html>
177 <type>Text</type>
178 </html>
6a488035 179 </field>
6d68a4cb
CW
180 <field>
181 <name>fee_amount</name>
182 <type>decimal</type>
6a488035
TO
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>
6d68a4cb 187 <add>1.3</add>
614d72ec 188 <html>
189 <type>Text</type>
190 </html>
6d68a4cb
CW
191 </field>
192 <field>
193 <name>net_amount</name>
194 <type>decimal</type>
6a488035
TO
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>
6d68a4cb 199 <add>1.3</add>
614d72ec 200 <html>
201 <type>Text</type>
202 </html>
6a488035 203 </field>
6d68a4cb
CW
204 <field>
205 <name>trxn_id</name>
6a488035 206 <title>Transaction ID</title>
6d68a4cb
CW
207 <type>varchar</type>
208 <length>255</length>
6a488035
TO
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>
614d72ec 212 <html>
213 <type>Text</type>
214 </html>
6d68a4cb
CW
215 <add>1.3</add>
216 </field>
217 <field>
218 <name>invoice_id</name>
6a488035 219 <title>Invoice ID</title>
6d68a4cb
CW
220 <type>varchar</type>
221 <length>255</length>
6a488035
TO
222 <import>true</import>
223 <headerPattern>/invoice(.?id)?/i</headerPattern>
224 <comment>unique invoice id, system generated or passed in</comment>
614d72ec 225 <html>
226 <type>Text</type>
b05e6d0d 227 </html>
6d68a4cb 228 <add>1.3</add>
614d72ec 229 </field>
6d68a4cb
CW
230 <field>
231 <name>currency</name>
232 <type>varchar</type>
6a488035
TO
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>
bd44e0df
AS
239 <add>1.3</add>
240 <pseudoconstant>
241 <table>civicrm_currency</table>
242 <keyColumn>name</keyColumn>
a38a89fc
CW
243 <labelColumn>full_name</labelColumn>
244 <nameColumn>numeric_code</nameColumn>
bd44e0df 245 </pseudoconstant>
614d72ec 246 <html>
e0991796 247 <type>Select</type>
614d72ec 248 </html>
6d68a4cb
CW
249 </field>
250 <field>
251 <name>cancel_date</name>
252 <type>datetime</type>
6a488035
TO
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>
6d68a4cb
CW
256 <comment>when was gift cancelled</comment>
257 <add>1.3</add>
614d72ec 258 <html>
259 <type>Select Date</type>
260 </html>
6d68a4cb
CW
261 </field>
262 <field>
263 <name>cancel_reason</name>
264 <type>text</type>
6a488035
TO
265 <import>true</import>
266 <headerPattern>/(cancel.?)?reason/i</headerPattern>
614d72ec 267 <html>
268 <type>Text</type>
269 </html>
b05e6d0d 270 <add>1.3</add>
6d68a4cb
CW
271 </field>
272 <field>
273 <name>receipt_date</name>
274 <type>datetime</type>
6a488035
TO
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>
614d72ec 279 <html>
280 <type>Select Date</type>
281 </html>
b05e6d0d 282 <add>1.3</add>
6d68a4cb
CW
283 </field>
284 <field>
6a488035
TO
285 <name>thankyou_date</name>
286 <title>Thank-you Date</title>
6d68a4cb 287 <type>datetime</type>
6a488035
TO
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>
6d68a4cb
CW
291 <comment>when (if) was donor thanked</comment>
292 <add>1.3</add>
614d72ec 293 <html>
294 <type>Select Date</type>
295 </html>
6d68a4cb
CW
296 </field>
297 <field>
6a488035
TO
298 <name>source</name>
299 <uniqueName>contribution_source</uniqueName>
300 <title>Contribution Source</title>
6d68a4cb 301 <type>varchar</type>
6a488035
TO
302 <length>255</length>
303 <import>true</import>
304 <headerPattern>/source/i</headerPattern>
6d68a4cb
CW
305 <comment>Origin of this Contribution.</comment>
306 <add>1.3</add>
614d72ec 307 <html>
308 <type>Text</type>
309 </html>
6d68a4cb
CW
310 </field>
311 <field>
6a488035
TO
312 <name>amount_level</name>
313 <title>Amount Label</title>
6d68a4cb 314 <type>text</type>
6a488035 315 <import>true</import>
6d68a4cb 316 <add>1.7</add>
614d72ec 317 <html>
318 <type>Text</type>
319 </html>
6d68a4cb 320 </field>
6a488035
TO
321 <field>
322 <name>note</name>
323 <type>text</type>
324 <comment>Note and/or Comment.</comment>
6a488035
TO
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>
6d68a4cb
CW
343 <field>
344 <name>contribution_recur_id</name>
b05e6d0d 345 <title>Recurring Contribution ID</title>
6d68a4cb
CW
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>
6a488035
TO
355 <onDelete>SET NULL</onDelete>
356 </foreignKey>
6d68a4cb
CW
357 <field>
358 <name>is_test</name>
6a488035
TO
359 <title>Test</title>
360 <type>boolean</type>
361 <default>0</default>
362 <import>true</import>
614d72ec 363 <html>
364 <type>CheckBox</type>
365 </html>
6a488035 366 </field>
6d68a4cb
CW
367 <field>
368 <name>is_pay_later</name>
6a488035
TO
369 <title>Is Pay Later</title>
370 <type>boolean</type>
371 <default>0</default>
372 <import>true</import>
6d68a4cb 373 <add>2.1</add>
614d72ec 374 <html>
375 <type>CheckBox</type>
376 </html>
6a488035
TO
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>
6d68a4cb
CW
386 <pseudoconstant>
387 <optionGroupName>contribution_status</optionGroupName>
388 </pseudoconstant>
614d72ec 389 <html>
e0991796 390 <type>Select</type>
614d72ec 391 </html>
6a488035
TO
392 <add>1.6</add>
393 </field>
6a488035
TO
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>
6d68a4cb
CW
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>
6a488035
TO
415 <onDelete>SET NULL</onDelete>
416 </foreignKey>
6d68a4cb
CW
417 <field>
418 <name>check_number</name>
6a488035
TO
419 <title>Check Number</title>
420 <headerPattern>/check(.?number)?/i</headerPattern>
6d68a4cb 421 <type>varchar</type>
6a488035 422 <length>255</length>
614d72ec 423 <html>
424 <type>Text</type>
425 <size>SIX</size>
426 </html>
6a488035 427 <import>true</import>
6d68a4cb
CW
428 <add>2.2</add>
429 </field>
6a488035
TO
430 <index>
431 <name>check_number</name>
432 <fieldName>check_number</fieldName>
433 <add>2.2</add>
434 </index>
6d68a4cb 435 <field>
6a488035
TO
436 <name>campaign_id</name>
437 <uniqueName>contribution_campaign_id</uniqueName>
438 <type>int unsigned</type>
e1ab2e91 439 <title>Campaign</title>
6d68a4cb
CW
440 <import>true</import>
441 <comment>The campaign for which this contribution has been triggered.</comment>
3e3eacd0
CW
442 <pseudoconstant>
443 <table>civicrm_campaign</table>
444 <keyColumn>id</keyColumn>
445 <labelColumn>title</labelColumn>
3e3eacd0 446 </pseudoconstant>
6d68a4cb 447 <add>3.4</add>
614d72ec 448 <html>
449 <type>Select</type>
450 </html>
6d68a4cb
CW
451 </field>
452 <foreignKey>
453 <name>campaign_id</name>
454 <table>civicrm_campaign</table>
455 <key>id</key>
6a488035
TO
456 <onDelete>SET NULL</onDelete>
457 </foreignKey>
458</table>