Merge branch 'master' of https://github.com/rollox/civicrm-core into CRM-18317
[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>
797b807e 10 <title>Recurring Contribution ID</title>
6a488035
TO
11 <type>int unsigned</type>
12 <required>true</required>
13 <comment>Contribution Recur ID</comment>
14 <add>1.6</add>
15 </field>
16 <primaryKey>
17 <name>id</name>
18 <autoincrement>true</autoincrement>
19 </primaryKey>
20 <field>
21 <name>contact_id</name>
797b807e 22 <title>Contact ID</title>
6a488035
TO
23 <type>int unsigned</type>
24 <required>true</required>
25 <comment>Foreign key to civicrm_contact.id .</comment>
26 <add>1.6</add>
27 </field>
28 <foreignKey>
29 <name>contact_id</name>
30 <table>civicrm_contact</table>
31 <key>id</key>
32 <add>1.6</add>
33 <onDelete>CASCADE</onDelete>
34 </foreignKey>
35 <field>
36 <name>amount</name>
797b807e 37 <title>Amount</title>
6a488035
TO
38 <type>decimal</type>
39 <required>true</required>
40 <comment>Amount to be contributed or charged each recurrence.</comment>
41 <add>1.6</add>
0c6c47a5 42 <html>
43 <type>Text</type>
44 </html>
6a488035
TO
45 </field>
46 <field>
47 <name>currency</name>
797b807e 48 <title>Currency</title>
6a488035
TO
49 <type>varchar</type>
50 <length>3</length>
51 <default>NULL</default>
52 <comment>3 character string, value from config setting or input via user.</comment>
53 <add>3.2</add>
bd44e0df
AS
54 <pseudoconstant>
55 <table>civicrm_currency</table>
56 <keyColumn>name</keyColumn>
a38a89fc
CW
57 <labelColumn>full_name</labelColumn>
58 <nameColumn>numeric_code</nameColumn>
bd44e0df 59 </pseudoconstant>
614d72ec 60 <html>
e0991796 61 <type>Select</type>
614d72ec 62 </html>
6a488035
TO
63 </field>
64 <field>
65 <name>frequency_unit</name>
797b807e 66 <title>Frequency Unit</title>
dc73c80d 67 <type>varchar</type>
68 <length>8</length>
6a488035
TO
69 <default>'month'</default>
70 <comment>Time units for recurrence of payment.</comment>
f80ce889 71 <pseudoconstant>
72 <optionGroupName>recur_frequency_units</optionGroupName>
73 <keyColumn>name</keyColumn>
74 </pseudoconstant>
6a488035 75 <add>1.6</add>
614d72ec 76 <html>
77 <type>Select</type>
78 </html>
6a488035
TO
79 </field>
80 <field>
81 <name>frequency_interval</name>
797b807e 82 <title>Interval (number of units)</title>
6a488035
TO
83 <type>int unsigned</type>
84 <required>true</required>
85 <comment>Number of time units for recurrence of payment.</comment>
86 <add>1.6</add>
0c6c47a5 87 <html>
88 <type>Text</type>
89 </html>
6a488035
TO
90 </field>
91 <field>
92 <name>installments</name>
797b807e 93 <title>Number of Installments</title>
6a488035
TO
94 <type>int unsigned</type>
95 <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>
96 <add>1.6</add>
0c6c47a5 97 <html>
98 <type>Text</type>
99 </html>
6a488035
TO
100 </field>
101 <field>
102 <name>start_date</name>
797b807e 103 <title>Recurring Contribution Started Date</title>
6a488035
TO
104 <type>datetime</type>
105 <required>true</required>
106 <comment>The date the first scheduled recurring contribution occurs.</comment>
107 <add>1.6</add>
0c6c47a5 108 <html>
109 <type>Select Date</type>
110 </html>
6a488035
TO
111 </field>
112 <field>
113 <name>create_date</name>
797b807e 114 <title>Recurring Contribution Created Date</title>
6a488035
TO
115 <type>datetime</type>
116 <required>true</required>
117 <comment>When this recurring contribution record was created.</comment>
118 <add>1.6</add>
0c6c47a5 119 <html>
120 <type>Select Date</type>
121 </html>
6a488035
TO
122 </field>
123 <field>
124 <name>modified_date</name>
797b807e 125 <title>Recurring Contribution Modified Date</title>
6a488035
TO
126 <type>datetime</type>
127 <comment>Last updated date for this record. mostly the last time a payment was received</comment>
128 <add>1.6</add>
0c6c47a5 129 <html>
130 <type>Select Date</type>
131 </html>
6a488035
TO
132 </field>
133 <field>
134 <name>cancel_date</name>
797b807e 135 <title>Recurring Contribution Cancel Date</title>
6a488035
TO
136 <type>datetime</type>
137 <comment>Date this recurring contribution was cancelled by contributor- if we can get access to it</comment>
138 <add>1.6</add>
0c6c47a5 139 <html>
140 <type>Select Date</type>
141 </html>
6a488035
TO
142 </field>
143 <field>
144 <name>end_date</name>
797b807e 145 <title>Recurring Contribution End Date</title>
6a488035
TO
146 <type>datetime</type>
147 <comment>Date this recurring contribution finished successfully</comment>
148 <add>1.6</add>
0c6c47a5 149 <html>
150 <type>Select Date</type>
151 </html>
6a488035 152 </field>
6d68a4cb 153 <field>
6a488035 154 <name>processor_id</name>
799e1e59 155 <title>Processor ID</title>
6d68a4cb 156 <type>varchar</type>
6a488035 157 <length>255</length>
6d68a4cb
CW
158 <comment>Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??</comment>
159 <add>1.6</add>
160 </field>
011293bb
RT
161 <field>
162 <name>payment_token_id</name>
163 <title>Payment Token ID</title>
164 <type>int unsigned</type>
165 <comment>Optionally used to store a link to a payment token used for this recurring contribution.</comment>
166 <add>4.6</add>
167 </field>
168 <foreignKey>
169 <name>payment_token_id</name>
170 <table>civicrm_payment_token</table>
171 <key>id</key>
172 <add>4.6</add>
173 <onDelete>SET NULL</onDelete>
174 </foreignKey>
6d68a4cb
CW
175 <field>
176 <name>trxn_id</name>
6a488035 177 <title>Transaction ID</title>
6d68a4cb
CW
178 <type>varchar</type>
179 <length>255</length>
6a488035 180 <comment>unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method</comment>
6d68a4cb
CW
181 <add>1.6</add>
182 </field>
183 <field>
184 <name>invoice_id</name>
6a488035 185 <title>Invoice ID</title>
6d68a4cb
CW
186 <type>varchar</type>
187 <length>255</length>
6a488035 188 <comment>unique invoice id, system generated or passed in</comment>
6d68a4cb
CW
189 <add>1.6</add>
190 </field>
6a488035
TO
191 <index>
192 <name>UI_contrib_trxn_id</name>
193 <fieldName>trxn_id</fieldName>
194 <unique>true</unique>
195 <add>2.1</add>
196 </index>
197 <index>
198 <name>UI_contrib_invoice_id</name>
199 <fieldName>invoice_id</fieldName>
200 <unique>true</unique>
201 <add>2.1</add>
202 </index>
203 <field>
204 <name>contribution_status_id</name>
205 <title>Recurring Contribution Status</title>
206 <type>int unsigned</type>
207 <default>1</default>
208 <import>true</import>
209 <add>1.6</add>
f389e500
E
210 <pseudoconstant>
211 <optionGroupName>contribution_status</optionGroupName>
212 </pseudoconstant>
6a488035
TO
213 </field>
214 <index>
215 <name>index_contribution_status</name>
216 <fieldName>contribution_status_id</fieldName>
217 <add>1.6</add>
218 </index>
6d68a4cb
CW
219 <field>
220 <name>is_test</name>
6a488035
TO
221 <title>Test</title>
222 <type>boolean</type>
223 <default>0</default>
224 <import>true</import>
225 </field>
226 <field>
227 <name>cycle_day</name>
797b807e 228 <title>Number of Cycle Day</title>
6a488035
TO
229 <type>int unsigned</type>
230 <default>1</default>
231 <required>true</required>
232 <comment>Day in the period when the payment should be charged e.g. 1st of month, 15th etc.</comment>
233 <add>1.6</add>
234 </field>
235 <field>
236 <name>next_sched_contribution</name>
237 <type>datetime</type>
5beb1de0 238 <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 239 <add>1.6</add>
797b807e 240 <drop>4.4</drop>
241 </field>
242 <field>
243 <name>next_sched_contribution_date</name>
244 <title>Next Scheduled Contribution Date</title>
245 <type>datetime</type>
246 <comment>Next scheduled date</comment>
247 <add>4.4</add>
0c6c47a5 248 <html>
249 <type>Select Date</type>
250 </html>
6a488035
TO
251 </field>
252 <field>
253 <name>failure_count</name>
797b807e 254 <title>Number of Failures</title>
6a488035
TO
255 <type>int unsigned</type>
256 <default>0</default>
257 <comment>Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.</comment>
258 <add>1.6</add>
259 </field>
260 <field>
261 <name>failure_retry_date</name>
262 <type>datetime</type>
797b807e 263 <title>Retry Failed Attempt Date</title>
264 <comment>Date to retry failed attempt</comment>
6a488035 265 <add>1.6</add>
0c6c47a5 266 <html>
267 <type>Select Date</type>
268 </html>
6a488035 269 </field>
6d68a4cb 270 <field>
6a488035 271 <name>auto_renew</name>
797b807e 272 <title>Auto Renew</title>
6d68a4cb
CW
273 <type>boolean</type>
274 <required>true</required>
6a488035 275 <default>0</default>
6d68a4cb
CW
276 <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>
277 <add>1.6</add>
6a488035
TO
278 </field>
279 <field>
280 <name>payment_processor_id</name>
797b807e 281 <title>Payment Processor</title>
6a488035
TO
282 <type>int unsigned</type>
283 <comment>Foreign key to civicrm_payment_processor.id</comment>
284 <add>3.3</add>
285 </field>
6d68a4cb
CW
286 <foreignKey>
287 <name>payment_processor_id</name>
288 <table>civicrm_payment_processor</table>
289 <key>id</key>
290 <add>3.3</add>
6a488035
TO
291 <onDelete>SET NULL</onDelete>
292 </foreignKey>
293 <field>
294 <name>contribution_type_id</name>
295 <title>Contribution Type</title>
296 <export>false</export>
297 <type>int unsigned</type>
298 <comment>FK to Contribution Type</comment>
299 <add>4.1</add>
300 <drop>4.3</drop>
301 </field>
302 <foreignKey>
303 <name>contribution_type_id</name>
304 <table>civicrm_contribution_type</table>
305 <key>id</key>
306 <add>4.1</add>
307 <drop>4.3</drop>
308 <onDelete>SET NULL</onDelete>
309 </foreignKey>
310 <field>
311 <name>financial_type_id</name>
312 <title>Financial Type</title>
313 <export>false</export>
314 <type>int unsigned</type>
315 <comment>FK to Financial Type</comment>
316 <add>4.3</add>
f389e500
E
317 <pseudoconstant>
318 <table>civicrm_financial_type</table>
319 <keyColumn>id</keyColumn>
320 <labelColumn>name</labelColumn>
321 </pseudoconstant>
6a488035
TO
322 </field>
323 <foreignKey>
324 <name>financial_type_id</name>
325 <table>civicrm_financial_type</table>
326 <key>id</key>
327 <add>4.3</add>
328 <onDelete>SET NULL</onDelete>
329 </foreignKey>
330 <field>
331 <name>payment_instrument_id</name>
536f0e02 332 <title>Payment Method</title>
6a488035
TO
333 <type>int unsigned</type>
334 <comment>FK to Payment Instrument</comment>
6d68a4cb
CW
335 <pseudoconstant>
336 <optionGroupName>payment_instrument</optionGroupName>
337 </pseudoconstant>
614d72ec 338 <html>
e0991796 339 <type>Select</type>
614d72ec 340 </html>
6a488035
TO
341 <add>4.1</add>
342 </field>
343 <index>
5beb1de0 344 <name>UI_contribution_recur_payment_instrument_id</name>
6a488035
TO
345 <fieldName>payment_instrument_id</fieldName>
346 <add>4.1</add>
347 </index>
348 <field>
349 <name>campaign_id</name>
350 <uniqueName>contribution_campaign_id</uniqueName>
351 <type>int unsigned</type>
e1ab2e91 352 <title>Campaign</title>
6a488035
TO
353 <import>true</import>
354 <comment>The campaign for which this contribution has been triggered.</comment>
3e3eacd0
CW
355 <pseudoconstant>
356 <table>civicrm_campaign</table>
357 <keyColumn>id</keyColumn>
358 <labelColumn>title</labelColumn>
3e3eacd0 359 </pseudoconstant>
6a488035
TO
360 <add>4.1</add>
361 </field>
362 <foreignKey>
363 <name>campaign_id</name>
364 <table>civicrm_campaign</table>
365 <key>id</key>
366 <onDelete>SET NULL</onDelete>
367 </foreignKey>
6d68a4cb
CW
368 <field>
369 <name>is_email_receipt</name>
797b807e 370 <title>Send email Receipt?</title>
6d68a4cb
CW
371 <type>boolean</type>
372 <comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
6a488035 373 <default>1</default>
6d68a4cb
CW
374 <add>4.1</add>
375 </field>
6a488035 376</table>