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