Merge pull request #19069 from eileenmcnaughton/test
[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 <add>1.3</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>true</autoincrement>
20 </primaryKey>
21 <field>
22 <name>from_financial_account_id</name>
23 <type>int unsigned</type>
24 <title>Financial Transaction From Account</title>
25 <comment>FK to financial_account table.</comment>
26 <add>4.3</add>
27 <pseudoconstant>
28 <table>civicrm_financial_account</table>
29 <keyColumn>id</keyColumn>
30 <labelColumn>name</labelColumn>
31 </pseudoconstant>
32 <html>
33 <type>Select</type>
34 </html>
35 </field>
36 <foreignKey>
37 <name>from_financial_account_id</name>
38 <table>civicrm_financial_account</table>
39 <key>id</key>
40 <add>4.3</add>
41 </foreignKey>
42 <field>
43 <name>to_financial_account_id</name>
44 <title>Financial Transaction To Account</title>
45 <type>int unsigned</type>
46 <comment>FK to financial_financial_account table.</comment>
47 <add>4.3</add>
48 <pseudoconstant>
49 <table>civicrm_financial_account</table>
50 <keyColumn>id</keyColumn>
51 <labelColumn>name</labelColumn>
52 </pseudoconstant>
53 <html>
54 <type>Select</type>
55 </html>
56 </field>
57 <foreignKey>
58 <name>to_financial_account_id</name>
59 <table>civicrm_financial_account</table>
60 <key>id</key>
61 <add>4.3</add>
62 </foreignKey>
63 <field>
64 <name>trxn_date</name>
65 <title>Financial Transaction Date</title>
66 <type>datetime</type>
67 <default>NULL</default>
68 <comment>date transaction occurred</comment>
69 <add>1.3</add>
70 <html>
71 <type>Select Date</type>
72 <formatType>activityDateTime</formatType>
73 </html>
74 </field>
75 <field>
76 <name>total_amount</name>
77 <title>Financial Total Amount</title>
78 <type>decimal</type>
79 <required>true</required>
80 <comment>amount of transaction</comment>
81 <add>1.3</add>
82 </field>
83 <field>
84 <name>fee_amount</name>
85 <title>Financial Fee Amount</title>
86 <type>decimal</type>
87 <comment>actual processor fee if known - may be 0.</comment>
88 <add>1.3</add>
89 </field>
90 <field>
91 <name>net_amount</name>
92 <title>Financial Net Amount</title>
93 <type>decimal</type>
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>
95 <add>1.3</add>
96 </field>
97 <field>
98 <name>currency</name>
99 <title>Financial Currency</title>
100 <type>varchar</type>
101 <length>3</length>
102 <default>NULL</default>
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>
108 <pseudoconstant>
109 <table>civicrm_currency</table>
110 <keyColumn>name</keyColumn>
111 <labelColumn>full_name</labelColumn>
112 <nameColumn>name</nameColumn>
113 <abbrColumn>symbol</abbrColumn>
114 </pseudoconstant>
115 <html>
116 <type>Select</type>
117 </html>
118 </field>
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>
128 <field>
129 <name>trxn_id</name>
130 <title>Transaction ID</title>
131 <type>varchar</type>
132 <length>255</length>
133 <comment>Transaction id supplied by external processor. This may not be unique.</comment>
134 <html>
135 <type>Text</type>
136 <size>10</size>
137 </html>
138 <add>1.3</add>
139 </field>
140 <index>
141 <name>UI_ftrxn_trxn_id</name>
142 <fieldName>trxn_id</fieldName>
143 <add>4.7</add>
144 </index>
145 <field>
146 <name>trxn_result_code</name>
147 <title>Transaction Result Code</title>
148 <type>varchar</type>
149 <length>255</length>
150 <comment>processor result code</comment>
151 <add>1.3</add>
152 </field>
153 <field>
154 <name>status_id</name>
155 <title>Financial Transaction Status Id</title>
156 <type>int unsigned</type>
157 <import>true</import>
158 <export>true</export>
159 <pseudoconstant>
160 <optionGroupName>contribution_status</optionGroupName>
161 </pseudoconstant>
162 <comment>pseudo FK to civicrm_option_value of contribution_status_id option_group</comment>
163 <headerPattern>/status/i</headerPattern>
164 <add>4.3</add>
165 </field>
166 <field>
167 <name>payment_processor_id</name>
168 <title>Payment Processor</title>
169 <type>int unsigned</type>
170 <comment>Payment Processor for this financial transaction</comment>
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>
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>
185 <onDelete>SET NULL</onDelete>
186 <add>4.3</add>
187 </foreignKey>
188 <field>
189 <name>payment_instrument_id</name>
190 <uniqueName>financial_trxn_payment_instrument_id</uniqueName>
191 <title>Payment Method</title>
192 <type>int unsigned</type>
193 <comment>FK to payment_instrument option group values</comment>
194 <pseudoconstant>
195 <optionGroupName>payment_instrument</optionGroupName>
196 </pseudoconstant>
197 <html>
198 <type>Select</type>
199 </html>
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>
207 <field>
208 <name>card_type_id</name>
209 <uniqueName>financial_trxn_card_type_id</uniqueName>
210 <title>Card Type ID</title>
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>
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>
228 <html>
229 <type>Text</type>
230 <size>6</size>
231 </html>
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>
239 <field>
240 <name>pan_truncation</name>
241 <uniqueName>financial_trxn_pan_truncation</uniqueName>
242 <title>PAN Truncation</title>
243 <type>varchar</type>
244 <length>4</length>
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>
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>
265 </table>