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