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