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