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