Merge pull request #21648 from eileenmcnaughton/email_task
[civicrm-core.git] / xml / schema / Financial / FinancialTrxn.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Financial</base>
5 <class>FinancialTrxn</class>
6 <name>civicrm_financial_trxn</name>
7 <add>1.3</add>
8 <log>true</log>
9 <component>CiviContribute</component>
10 <field>
11 <name>id</name>
12 <title>Financial Transaction ID</title>
13 <type>int unsigned</type>
14 <required>true</required>
15 <html>
16 <type>Number</type>
17 </html>
18 <add>1.3</add>
19 </field>
20 <primaryKey>
21 <name>id</name>
22 <autoincrement>true</autoincrement>
23 </primaryKey>
24 <field>
25 <name>from_financial_account_id</name>
26 <type>int unsigned</type>
27 <title>From Account ID</title>
28 <comment>FK to financial_account table.</comment>
29 <add>4.3</add>
30 <pseudoconstant>
31 <table>civicrm_financial_account</table>
32 <keyColumn>id</keyColumn>
33 <labelColumn>name</labelColumn>
34 </pseudoconstant>
35 <html>
36 <type>Select</type>
37 <label>From Account</label>
38 </html>
39 </field>
40 <foreignKey>
41 <name>from_financial_account_id</name>
42 <table>civicrm_financial_account</table>
43 <key>id</key>
44 <add>4.3</add>
45 </foreignKey>
46 <field>
47 <name>to_financial_account_id</name>
48 <title>To Account ID</title>
49 <type>int unsigned</type>
50 <comment>FK to financial_financial_account table.</comment>
51 <add>4.3</add>
52 <pseudoconstant>
53 <table>civicrm_financial_account</table>
54 <keyColumn>id</keyColumn>
55 <labelColumn>name</labelColumn>
56 </pseudoconstant>
57 <html>
58 <type>Select</type>
59 <label>To Account</label>
60 </html>
61 </field>
62 <foreignKey>
63 <name>to_financial_account_id</name>
64 <table>civicrm_financial_account</table>
65 <key>id</key>
66 <add>4.3</add>
67 </foreignKey>
68 <field>
69 <name>trxn_date</name>
70 <title>Financial Transaction Date</title>
71 <type>datetime</type>
72 <default>NULL</default>
73 <comment>date transaction occurred</comment>
74 <add>1.3</add>
75 <html>
76 <type>Select Date</type>
77 <formatType>activityDateTime</formatType>
78 </html>
79 </field>
80 <field>
81 <name>total_amount</name>
82 <title>Financial Total Amount</title>
83 <type>decimal</type>
84 <required>true</required>
85 <comment>amount of transaction</comment>
86 <add>1.3</add>
87 </field>
88 <field>
89 <name>fee_amount</name>
90 <title>Financial Fee Amount</title>
91 <type>decimal</type>
92 <comment>actual processor fee if known - may be 0.</comment>
93 <add>1.3</add>
94 </field>
95 <field>
96 <name>net_amount</name>
97 <title>Financial Net Amount</title>
98 <type>decimal</type>
99 <comment>actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.</comment>
100 <add>1.3</add>
101 </field>
102 <field>
103 <name>currency</name>
104 <title>Financial Currency</title>
105 <type>varchar</type>
106 <length>3</length>
107 <default>NULL</default>
108 <import>true</import>
109 <headerPattern>/cur(rency)?/i</headerPattern>
110 <dataPattern>/^[A-Z]{3}$/</dataPattern>
111 <comment>3 character string, value from config setting or input via user.</comment>
112 <add>1.3</add>
113 <pseudoconstant>
114 <table>civicrm_currency</table>
115 <keyColumn>name</keyColumn>
116 <labelColumn>full_name</labelColumn>
117 <nameColumn>name</nameColumn>
118 <abbrColumn>symbol</abbrColumn>
119 </pseudoconstant>
120 <html>
121 <type>Select</type>
122 </html>
123 </field>
124 <field>
125 <name>is_payment</name>
126 <title>Is Payment?</title>
127 <type>boolean</type>
128 <default>0</default>
129 <import>true</import>
130 <comment>Is this entry either a payment or a reversal of a payment?</comment>
131 <add>4.7</add>
132 </field>
133 <field>
134 <name>trxn_id</name>
135 <title>Transaction ID</title>
136 <type>varchar</type>
137 <length>255</length>
138 <comment>Transaction id supplied by external processor. This may not be unique.</comment>
139 <html>
140 <type>Text</type>
141 <size>10</size>
142 </html>
143 <add>1.3</add>
144 </field>
145 <index>
146 <name>UI_ftrxn_trxn_id</name>
147 <fieldName>trxn_id</fieldName>
148 <add>4.7</add>
149 </index>
150 <field>
151 <name>trxn_result_code</name>
152 <title>Transaction Result Code</title>
153 <type>varchar</type>
154 <length>255</length>
155 <comment>processor result code</comment>
156 <add>1.3</add>
157 </field>
158 <field>
159 <name>status_id</name>
160 <title>Financial Transaction Status ID</title>
161 <type>int unsigned</type>
162 <import>true</import>
163 <export>true</export>
164 <pseudoconstant>
165 <optionGroupName>contribution_status</optionGroupName>
166 </pseudoconstant>
167 <comment>pseudo FK to civicrm_option_value of contribution_status_id option_group</comment>
168 <headerPattern>/status/i</headerPattern>
169 <add>4.3</add>
170 </field>
171 <field>
172 <name>payment_processor_id</name>
173 <title>Payment Processor ID</title>
174 <type>int unsigned</type>
175 <comment>Payment Processor for this financial transaction</comment>
176 <pseudoconstant>
177 <table>civicrm_payment_processor</table>
178 <keyColumn>id</keyColumn>
179 <labelColumn>name</labelColumn>
180 </pseudoconstant>
181 <html>
182 <type>Select</type>
183 <label>Payment Processor</label>
184 </html>
185 <add>4.3</add>
186 </field>
187 <foreignKey>
188 <name>payment_processor_id</name>
189 <table>civicrm_payment_processor</table>
190 <key>id</key>
191 <onDelete>SET NULL</onDelete>
192 <add>4.3</add>
193 </foreignKey>
194 <field>
195 <name>payment_instrument_id</name>
196 <uniqueName>financial_trxn_payment_instrument_id</uniqueName>
197 <title>Payment Method</title>
198 <type>int unsigned</type>
199 <comment>FK to payment_instrument option group values</comment>
200 <pseudoconstant>
201 <optionGroupName>payment_instrument</optionGroupName>
202 </pseudoconstant>
203 <html>
204 <type>Select</type>
205 </html>
206 <add>4.3</add>
207 </field>
208 <index>
209 <name>UI_ftrxn_payment_instrument_id</name>
210 <fieldName>payment_instrument_id</fieldName>
211 <add>4.3</add>
212 </index>
213 <field>
214 <name>card_type_id</name>
215 <uniqueName>financial_trxn_card_type_id</uniqueName>
216 <title>Card Type ID</title>
217 <type>int unsigned</type>
218 <comment>FK to accept_creditcard option group values</comment>
219 <pseudoconstant>
220 <optionGroupName>accept_creditcard</optionGroupName>
221 </pseudoconstant>
222 <html>
223 <type>Select</type>
224 </html>
225 <add>4.7</add>
226 </field>
227 <field>
228 <name>check_number</name>
229 <uniqueName>financial_trxn_check_number</uniqueName>
230 <title>Check Number</title>
231 <comment>Check number</comment>
232 <type>varchar</type>
233 <length>255</length>
234 <html>
235 <type>Text</type>
236 <size>6</size>
237 </html>
238 <add>4.3</add>
239 </field>
240 <index>
241 <name>UI_ftrxn_check_number</name>
242 <fieldName>check_number</fieldName>
243 <add>4.3</add>
244 </index>
245 <field>
246 <name>pan_truncation</name>
247 <uniqueName>financial_trxn_pan_truncation</uniqueName>
248 <title>PAN Truncation</title>
249 <type>varchar</type>
250 <length>4</length>
251 <html>
252 <type>Text</type>
253 <size>4</size>
254 </html>
255 <comment>Last 4 digits of credit card</comment>
256 <add>4.7</add>
257 </field>
258 <field>
259 <name>order_reference</name>
260 <uniqueName>financial_trxn_order_reference</uniqueName>
261 <title>Order Reference</title>
262 <type>varchar</type>
263 <length>255</length>
264 <html>
265 <type>Text</type>
266 <size>25</size>
267 </html>
268 <comment>Payment Processor external order reference</comment>
269 <add>5.20</add>
270 </field>
271 </table>