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