Merge pull request #15410 from herbdool/cloud-21
[civicrm-core.git] / xml / schema / Contribute / ContributionRecur.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2<table>
3 <base>CRM/Contribute</base>
4 <class>ContributionRecur</class>
5 <name>civicrm_contribution_recur</name>
6 <add>1.6</add>
7 <log>true</log>
8 <field>
9 <name>id</name>
23faf53d 10 <uniqueName>contribution_recur_id</uniqueName>
797b807e 11 <title>Recurring Contribution ID</title>
6a488035
TO
12 <type>int unsigned</type>
13 <required>true</required>
14 <comment>Contribution Recur ID</comment>
15 <add>1.6</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>true</autoincrement>
20 </primaryKey>
21 <field>
22 <name>contact_id</name>
c6821d8d 23 <title>Contact</title>
6a488035
TO
24 <type>int unsigned</type>
25 <required>true</required>
c6821d8d 26 <comment>Foreign key to civicrm_contact.id.</comment>
6a488035 27 <add>1.6</add>
c6821d8d
MWMC
28 <html>
29 <type>EntityRef</type>
30 </html>
6a488035
TO
31 </field>
32 <foreignKey>
33 <name>contact_id</name>
34 <table>civicrm_contact</table>
35 <key>id</key>
36 <add>1.6</add>
37 <onDelete>CASCADE</onDelete>
38 </foreignKey>
39 <field>
40 <name>amount</name>
797b807e 41 <title>Amount</title>
6a488035
TO
42 <type>decimal</type>
43 <required>true</required>
44 <comment>Amount to be contributed or charged each recurrence.</comment>
45 <add>1.6</add>
0c6c47a5 46 <html>
47 <type>Text</type>
48 </html>
6a488035
TO
49 </field>
50 <field>
51 <name>currency</name>
797b807e 52 <title>Currency</title>
6a488035
TO
53 <type>varchar</type>
54 <length>3</length>
55 <default>NULL</default>
56 <comment>3 character string, value from config setting or input via user.</comment>
57 <add>3.2</add>
bd44e0df
AS
58 <pseudoconstant>
59 <table>civicrm_currency</table>
60 <keyColumn>name</keyColumn>
a38a89fc 61 <labelColumn>full_name</labelColumn>
c3de5c5a 62 <nameColumn>name</nameColumn>
a8fdb24e 63 <abbrColumn>symbol</abbrColumn>
bd44e0df 64 </pseudoconstant>
614d72ec 65 <html>
e0991796 66 <type>Select</type>
614d72ec 67 </html>
6a488035
TO
68 </field>
69 <field>
70 <name>frequency_unit</name>
797b807e 71 <title>Frequency Unit</title>
dc73c80d 72 <type>varchar</type>
73 <length>8</length>
6a488035
TO
74 <default>'month'</default>
75 <comment>Time units for recurrence of payment.</comment>
f80ce889 76 <pseudoconstant>
77 <optionGroupName>recur_frequency_units</optionGroupName>
78 <keyColumn>name</keyColumn>
79 </pseudoconstant>
6a488035 80 <add>1.6</add>
614d72ec 81 <html>
82 <type>Select</type>
83 </html>
6a488035
TO
84 </field>
85 <field>
86 <name>frequency_interval</name>
797b807e 87 <title>Interval (number of units)</title>
6a488035
TO
88 <type>int unsigned</type>
89 <required>true</required>
90 <comment>Number of time units for recurrence of payment.</comment>
91 <add>1.6</add>
0c6c47a5 92 <html>
93 <type>Text</type>
94 </html>
6a488035
TO
95 </field>
96 <field>
97 <name>installments</name>
797b807e 98 <title>Number of Installments</title>
6a488035
TO
99 <type>int unsigned</type>
100 <comment>Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.</comment>
101 <add>1.6</add>
0c6c47a5 102 <html>
103 <type>Text</type>
104 </html>
6a488035
TO
105 </field>
106 <field>
107 <name>start_date</name>
c6821d8d 108 <title>Start Date</title>
6a488035
TO
109 <type>datetime</type>
110 <required>true</required>
111 <comment>The date the first scheduled recurring contribution occurs.</comment>
112 <add>1.6</add>
0c6c47a5 113 <html>
114 <type>Select Date</type>
c6821d8d 115 <formatType>activityDateTime</formatType>
0c6c47a5 116 </html>
74db51d3 117 <uniqueName>contribution_recur_start_date</uniqueName>
118 <uniqueTitle>Recurring Contribution Start Date</uniqueTitle>
6a488035
TO
119 </field>
120 <field>
121 <name>create_date</name>
c6821d8d 122 <title>Created Date</title>
6a488035
TO
123 <type>datetime</type>
124 <required>true</required>
125 <comment>When this recurring contribution record was created.</comment>
126 <add>1.6</add>
0c6c47a5 127 <html>
128 <type>Select Date</type>
c6821d8d 129 <formatType>activityDateTime</formatType>
0c6c47a5 130 </html>
74db51d3 131 <uniqueName>contribution_recur_create_date</uniqueName>
132 <uniqueTitle>Recurring Contribution Create Date</uniqueTitle>
6a488035
TO
133 </field>
134 <field>
135 <name>modified_date</name>
c6821d8d 136 <title>Modified Date</title>
6a488035
TO
137 <type>datetime</type>
138 <comment>Last updated date for this record. mostly the last time a payment was received</comment>
139 <add>1.6</add>
0c6c47a5 140 <html>
141 <type>Select Date</type>
c6821d8d 142 <formatType>activityDateTime</formatType>
0c6c47a5 143 </html>
74db51d3 144 <uniqueName>contribution_recur_modified_date</uniqueName>
145 <uniqueTitle>Recurring Contribution Modified Date</uniqueTitle>
6a488035
TO
146 </field>
147 <field>
148 <name>cancel_date</name>
c6821d8d 149 <title>Cancel Date</title>
6a488035
TO
150 <type>datetime</type>
151 <comment>Date this recurring contribution was cancelled by contributor- if we can get access to it</comment>
152 <add>1.6</add>
0c6c47a5 153 <html>
154 <type>Select Date</type>
9139737b 155 <formatType>activityDate</formatType>
0c6c47a5 156 </html>
74db51d3 157 <uniqueName>contribution_recur_cancel_date</uniqueName>
158 <uniqueTitle>Recurring Contribution Cancel Date</uniqueTitle>
6a488035 159 </field>
ac7a239e 160 <field>
161 <name>cancel_reason</name>
162 <type>text</type>
163 <title>Cancellation Reason</title>
164 <uniqueName>contribution_recur_cancel_reason</uniqueName>
74db51d3 165 <uniqueTitle>Recurring Contribution Cancel Reason</uniqueTitle>
ac7a239e 166 <comment>Free text field for a reason for cancelling</comment>
167 <html>
168 <type>Text</type>
169 <size>40</size>
170 </html>
171 <add>5.13</add>
172 </field>
6a488035
TO
173 <field>
174 <name>end_date</name>
797b807e 175 <title>Recurring Contribution End Date</title>
6a488035
TO
176 <type>datetime</type>
177 <comment>Date this recurring contribution finished successfully</comment>
178 <add>1.6</add>
0c6c47a5 179 <html>
180 <type>Select Date</type>
9139737b 181 <formatType>activityDate</formatType>
0c6c47a5 182 </html>
74db51d3 183 <uniqueName>contribution_recur_end_date</uniqueName>
184 <uniqueTitle>Recurring Contribution End Date</uniqueTitle>
6a488035 185 </field>
6d68a4cb 186 <field>
6a488035 187 <name>processor_id</name>
23faf53d 188 <uniqueName>contribution_recur_processor_id</uniqueName>
799e1e59 189 <title>Processor ID</title>
6d68a4cb 190 <type>varchar</type>
6a488035 191 <length>255</length>
6d68a4cb
CW
192 <comment>Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??</comment>
193 <add>1.6</add>
c6821d8d
MWMC
194 <html>
195 <type>Text</type>
196 </html>
6d68a4cb 197 </field>
011293bb
RT
198 <field>
199 <name>payment_token_id</name>
200 <title>Payment Token ID</title>
201 <type>int unsigned</type>
202 <comment>Optionally used to store a link to a payment token used for this recurring contribution.</comment>
203 <add>4.6</add>
204 </field>
205 <foreignKey>
206 <name>payment_token_id</name>
207 <table>civicrm_payment_token</table>
208 <key>id</key>
209 <add>4.6</add>
210 <onDelete>SET NULL</onDelete>
211 </foreignKey>
6d68a4cb
CW
212 <field>
213 <name>trxn_id</name>
23faf53d 214 <uniqueName>contribution_recur_trxn_id</uniqueName>
6a488035 215 <title>Transaction ID</title>
6d68a4cb
CW
216 <type>varchar</type>
217 <length>255</length>
6a488035 218 <comment>unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method</comment>
6d68a4cb 219 <add>1.6</add>
c6821d8d
MWMC
220 <html>
221 <type>Text</type>
222 </html>
6d68a4cb
CW
223 </field>
224 <field>
225 <name>invoice_id</name>
6a488035 226 <title>Invoice ID</title>
6d68a4cb
CW
227 <type>varchar</type>
228 <length>255</length>
6a488035 229 <comment>unique invoice id, system generated or passed in</comment>
6d68a4cb 230 <add>1.6</add>
c6821d8d
MWMC
231 <html>
232 <type>Text</type>
233 </html>
6d68a4cb 234 </field>
6a488035
TO
235 <index>
236 <name>UI_contrib_trxn_id</name>
237 <fieldName>trxn_id</fieldName>
238 <unique>true</unique>
239 <add>2.1</add>
240 </index>
241 <index>
242 <name>UI_contrib_invoice_id</name>
243 <fieldName>invoice_id</fieldName>
244 <unique>true</unique>
245 <add>2.1</add>
246 </index>
247 <field>
248 <name>contribution_status_id</name>
23faf53d 249 <uniqueName>contribution_recur_contribution_status_id</uniqueName>
c6821d8d 250 <title>Status</title>
6a488035
TO
251 <type>int unsigned</type>
252 <default>1</default>
253 <import>true</import>
254 <add>1.6</add>
f389e500 255 <pseudoconstant>
0dc36ab0 256 <optionGroupName>contribution_recur_status</optionGroupName>
f389e500 257 </pseudoconstant>
c6821d8d
MWMC
258 <html>
259 <type>Select</type>
260 </html>
6a488035
TO
261 </field>
262 <index>
263 <name>index_contribution_status</name>
264 <fieldName>contribution_status_id</fieldName>
265 <add>1.6</add>
266 </index>
6d68a4cb
CW
267 <field>
268 <name>is_test</name>
6a488035
TO
269 <title>Test</title>
270 <type>boolean</type>
271 <default>0</default>
272 <import>true</import>
e15be85b 273 <html>
274 <type>CheckBox</type>
275 </html>
6a488035
TO
276 </field>
277 <field>
278 <name>cycle_day</name>
c6821d8d 279 <title>Cycle Day</title>
6a488035
TO
280 <type>int unsigned</type>
281 <default>1</default>
282 <required>true</required>
283 <comment>Day in the period when the payment should be charged e.g. 1st of month, 15th etc.</comment>
284 <add>1.6</add>
e15be85b 285 <html>
286 <type>Text</type>
287 </html>
6a488035
TO
288 </field>
289 <field>
290 <name>next_sched_contribution</name>
291 <type>datetime</type>
5beb1de0 292 <comment>At Groundspring this was used by the cron job which triggered payments. If we''re not doing that but we know about payments, it might still be useful to store for display to org andor contributors.</comment>
6a488035 293 <add>1.6</add>
797b807e 294 <drop>4.4</drop>
295 </field>
296 <field>
297 <name>next_sched_contribution_date</name>
298 <title>Next Scheduled Contribution Date</title>
299 <type>datetime</type>
300 <comment>Next scheduled date</comment>
301 <add>4.4</add>
0c6c47a5 302 <html>
303 <type>Select Date</type>
9139737b 304 <formatType>activityDate</formatType>
0c6c47a5 305 </html>
74db51d3 306 <uniqueName>contribution_recur_next_sched_contribution_date</uniqueName>
307 <uniqueTitle>Next Scheduled Recurring Contribution</uniqueTitle>
6a488035
TO
308 </field>
309 <field>
310 <name>failure_count</name>
797b807e 311 <title>Number of Failures</title>
6a488035
TO
312 <type>int unsigned</type>
313 <default>0</default>
314 <comment>Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.</comment>
315 <add>1.6</add>
e15be85b 316 <html>
317 <type>Text</type>
318 </html>
6a488035
TO
319 </field>
320 <field>
321 <name>failure_retry_date</name>
322 <type>datetime</type>
797b807e 323 <title>Retry Failed Attempt Date</title>
324 <comment>Date to retry failed attempt</comment>
6a488035 325 <add>1.6</add>
0c6c47a5 326 <html>
327 <type>Select Date</type>
9139737b 328 <formatType>activityDate</formatType>
0c6c47a5 329 </html>
74db51d3 330 <uniqueName>contribution_recur_failure_retry_date</uniqueName>
331 <uniqueTitle>Failed Recurring Contribution Retry Date</uniqueTitle>
6a488035 332 </field>
6d68a4cb 333 <field>
6a488035 334 <name>auto_renew</name>
797b807e 335 <title>Auto Renew</title>
6d68a4cb
CW
336 <type>boolean</type>
337 <required>true</required>
6a488035 338 <default>0</default>
6d68a4cb
CW
339 <comment>Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.</comment>
340 <add>1.6</add>
e15be85b 341 <html>
342 <type>CheckBox</type>
343 </html>
6a488035
TO
344 </field>
345 <field>
346 <name>payment_processor_id</name>
797b807e 347 <title>Payment Processor</title>
23faf53d 348 <uniqueName>contribution_recur_payment_processor_id</uniqueName>
6a488035
TO
349 <type>int unsigned</type>
350 <comment>Foreign key to civicrm_payment_processor.id</comment>
351 <add>3.3</add>
5d24a084
MWMC
352 <pseudoconstant>
353 <table>civicrm_payment_processor</table>
354 <keyColumn>id</keyColumn>
355 <labelColumn>name</labelColumn>
356 </pseudoconstant>
c6821d8d
MWMC
357 <html>
358 <type>Select</type>
359 </html>
6a488035 360 </field>
6d68a4cb
CW
361 <foreignKey>
362 <name>payment_processor_id</name>
363 <table>civicrm_payment_processor</table>
364 <key>id</key>
365 <add>3.3</add>
6a488035
TO
366 <onDelete>SET NULL</onDelete>
367 </foreignKey>
368 <field>
369 <name>contribution_type_id</name>
370 <title>Contribution Type</title>
371 <export>false</export>
372 <type>int unsigned</type>
373 <comment>FK to Contribution Type</comment>
374 <add>4.1</add>
375 <drop>4.3</drop>
376 </field>
377 <foreignKey>
378 <name>contribution_type_id</name>
379 <table>civicrm_contribution_type</table>
380 <key>id</key>
381 <add>4.1</add>
382 <drop>4.3</drop>
383 <onDelete>SET NULL</onDelete>
384 </foreignKey>
385 <field>
386 <name>financial_type_id</name>
387 <title>Financial Type</title>
388 <export>false</export>
389 <type>int unsigned</type>
390 <comment>FK to Financial Type</comment>
391 <add>4.3</add>
f389e500
E
392 <pseudoconstant>
393 <table>civicrm_financial_type</table>
394 <keyColumn>id</keyColumn>
395 <labelColumn>name</labelColumn>
396 </pseudoconstant>
c6821d8d
MWMC
397 <html>
398 <type>Select</type>
399 </html>
6a488035
TO
400 </field>
401 <foreignKey>
402 <name>financial_type_id</name>
403 <table>civicrm_financial_type</table>
404 <key>id</key>
405 <add>4.3</add>
406 <onDelete>SET NULL</onDelete>
407 </foreignKey>
408 <field>
409 <name>payment_instrument_id</name>
536f0e02 410 <title>Payment Method</title>
6a488035
TO
411 <type>int unsigned</type>
412 <comment>FK to Payment Instrument</comment>
6d68a4cb
CW
413 <pseudoconstant>
414 <optionGroupName>payment_instrument</optionGroupName>
415 </pseudoconstant>
614d72ec 416 <html>
e0991796 417 <type>Select</type>
614d72ec 418 </html>
6a488035
TO
419 <add>4.1</add>
420 </field>
421 <index>
5beb1de0 422 <name>UI_contribution_recur_payment_instrument_id</name>
6a488035
TO
423 <fieldName>payment_instrument_id</fieldName>
424 <add>4.1</add>
425 </index>
426 <field>
427 <name>campaign_id</name>
428 <uniqueName>contribution_campaign_id</uniqueName>
429 <type>int unsigned</type>
e1ab2e91 430 <title>Campaign</title>
6a488035
TO
431 <import>true</import>
432 <comment>The campaign for which this contribution has been triggered.</comment>
3e3eacd0
CW
433 <pseudoconstant>
434 <table>civicrm_campaign</table>
435 <keyColumn>id</keyColumn>
436 <labelColumn>title</labelColumn>
3e3eacd0 437 </pseudoconstant>
6a488035 438 <add>4.1</add>
c6821d8d
MWMC
439 <html>
440 <type>Select</type>
441 </html>
6a488035
TO
442 </field>
443 <foreignKey>
444 <name>campaign_id</name>
445 <table>civicrm_campaign</table>
446 <key>id</key>
447 <onDelete>SET NULL</onDelete>
448 </foreignKey>
6d68a4cb
CW
449 <field>
450 <name>is_email_receipt</name>
797b807e 451 <title>Send email Receipt?</title>
6d68a4cb
CW
452 <type>boolean</type>
453 <comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
6a488035 454 <default>1</default>
6d68a4cb 455 <add>4.1</add>
e15be85b 456 <html>
457 <type>CheckBox</type>
458 </html>
6d68a4cb 459 </field>
6a488035 460</table>