Merge pull request #21082 from colemanw/fixSearchKitPermissions
[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>datetime</type>
147 <default>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. may be processor id, bank id + trans id, or account number + check number... depending on payment_method</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 <import>true</import>
287 <html>
288 <type>CheckBox</type>
289 </html>
290 </field>
291 <field>
292 <name>cycle_day</name>
293 <title>Cycle Day</title>
294 <type>int unsigned</type>
295 <default>1</default>
296 <required>true</required>
297 <comment>Day in the period when the payment should be charged e.g. 1st of month, 15th etc.</comment>
298 <add>1.6</add>
299 <html>
300 <type>Text</type>
301 </html>
302 </field>
303 <field>
304 <name>next_sched_contribution_date</name>
305 <title>Next Scheduled Contribution Date</title>
306 <type>datetime</type>
307 <comment>Next scheduled date</comment>
308 <add>4.4</add>
309 <html>
310 <type>Select Date</type>
311 <formatType>activityDate</formatType>
312 </html>
313 <uniqueName>contribution_recur_next_sched_contribution_date</uniqueName>
314 <uniqueTitle>Next Scheduled Recurring Contribution</uniqueTitle>
315 </field>
316 <field>
317 <name>failure_count</name>
318 <title>Number of Failures</title>
319 <type>int unsigned</type>
320 <default>0</default>
321 <comment>Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.</comment>
322 <add>1.6</add>
323 <html>
324 <type>Text</type>
325 </html>
326 </field>
327 <field>
328 <name>failure_retry_date</name>
329 <type>datetime</type>
330 <title>Retry Failed Attempt Date</title>
331 <comment>Date to retry failed attempt</comment>
332 <add>1.6</add>
333 <html>
334 <type>Select Date</type>
335 <formatType>activityDate</formatType>
336 </html>
337 <uniqueName>contribution_recur_failure_retry_date</uniqueName>
338 <uniqueTitle>Failed Recurring Contribution Retry Date</uniqueTitle>
339 </field>
340 <field>
341 <name>auto_renew</name>
342 <title>Auto Renew</title>
343 <type>boolean</type>
344 <required>true</required>
345 <default>0</default>
346 <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>
347 <add>1.6</add>
348 <html>
349 <type>CheckBox</type>
350 </html>
351 </field>
352 <field>
353 <name>payment_processor_id</name>
354 <title>Payment Processor ID</title>
355 <uniqueName>contribution_recur_payment_processor_id</uniqueName>
356 <type>int unsigned</type>
357 <comment>Foreign key to civicrm_payment_processor.id</comment>
358 <add>3.3</add>
359 <pseudoconstant>
360 <table>civicrm_payment_processor</table>
361 <keyColumn>id</keyColumn>
362 <labelColumn>name</labelColumn>
363 </pseudoconstant>
364 <html>
365 <type>Select</type>
366 <label>Payment Processor</label>
367 </html>
368 </field>
369 <foreignKey>
370 <name>payment_processor_id</name>
371 <table>civicrm_payment_processor</table>
372 <key>id</key>
373 <add>3.3</add>
374 <onDelete>SET NULL</onDelete>
375 </foreignKey>
376 <field>
377 <name>financial_type_id</name>
378 <title>Financial Type ID</title>
379 <export>false</export>
380 <type>int unsigned</type>
381 <comment>FK to Financial Type</comment>
382 <add>4.3</add>
383 <pseudoconstant>
384 <table>civicrm_financial_type</table>
385 <keyColumn>id</keyColumn>
386 <labelColumn>name</labelColumn>
387 </pseudoconstant>
388 <html>
389 <type>Select</type>
390 <label>Financial Type</label>
391 </html>
392 </field>
393 <foreignKey>
394 <name>financial_type_id</name>
395 <table>civicrm_financial_type</table>
396 <key>id</key>
397 <add>4.3</add>
398 <onDelete>SET NULL</onDelete>
399 </foreignKey>
400 <field>
401 <name>payment_instrument_id</name>
402 <title>Payment Method</title>
403 <type>int unsigned</type>
404 <comment>FK to Payment Instrument</comment>
405 <pseudoconstant>
406 <optionGroupName>payment_instrument</optionGroupName>
407 </pseudoconstant>
408 <html>
409 <type>Select</type>
410 </html>
411 <add>4.1</add>
412 </field>
413 <index>
414 <name>UI_contribution_recur_payment_instrument_id</name>
415 <fieldName>payment_instrument_id</fieldName>
416 <add>4.1</add>
417 </index>
418 <field>
419 <name>campaign_id</name>
420 <component>CiviCampaign</component>
421 <uniqueName>contribution_campaign_id</uniqueName>
422 <type>int unsigned</type>
423 <title>Campaign ID</title>
424 <import>true</import>
425 <comment>The campaign for which this contribution has been triggered.</comment>
426 <add>4.1</add>
427 <html>
428 <type>EntityRef</type>
429 <label>Campaign</label>
430 </html>
431 </field>
432 <foreignKey>
433 <name>campaign_id</name>
434 <table>civicrm_campaign</table>
435 <key>id</key>
436 <onDelete>SET NULL</onDelete>
437 </foreignKey>
438 <field>
439 <name>is_email_receipt</name>
440 <title>Send email Receipt?</title>
441 <type>boolean</type>
442 <comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
443 <default>1</default>
444 <add>4.1</add>
445 <html>
446 <type>CheckBox</type>
447 </html>
448 </field>
449 </table>