d2b4b29c50ac9d03c032b0bc9878842c217808b8
[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_account_id</name>
22 <type>int unsigned</type>
23 <comment>FK to financial_account table.</comment>
24 <add>3.2</add>
25 <drop>4.3</drop>
26 </field>
27 <foreignKey>
28 <name>from_account_id</name>
29 <table>civicrm_financial_account</table>
30 <key>id</key>
31 <add>3.2</add>
32 <drop>4.3</drop>
33 </foreignKey>
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>
39 <drop>4.3</drop>
40 </field>
41 <foreignKey>
42 <name>to_account_id</name>
43 <table>civicrm_financial_account</table>
44 <key>id</key>
45 <add>3.2</add>
46 <drop>4.3</drop>
47 </foreignKey>
48 <field>
49 <name>from_financial_account_id</name>
50 <type>int unsigned</type>
51 <title>Financial Transaction From Account</title>
52 <comment>FK to financial_account table.</comment>
53 <add>4.3</add>
54 <pseudoconstant>
55 <table>civicrm_financial_account</table>
56 <keyColumn>id</keyColumn>
57 <labelColumn>name</labelColumn>
58 </pseudoconstant>
59 <html>
60 <type>Select</type>
61 </html>
62 </field>
63 <foreignKey>
64 <name>from_financial_account_id</name>
65 <table>civicrm_financial_account</table>
66 <key>id</key>
67 <add>4.3</add>
68 </foreignKey>
69 <field>
70 <name>to_financial_account_id</name>
71 <title>Financial Transaction To Account</title>
72 <type>int unsigned</type>
73 <comment>FK to financial_financial_account table.</comment>
74 <add>4.3</add>
75 <pseudoconstant>
76 <table>civicrm_financial_account</table>
77 <keyColumn>id</keyColumn>
78 <labelColumn>name</labelColumn>
79 </pseudoconstant>
80 <html>
81 <type>Select</type>
82 </html>
83 </field>
84 <foreignKey>
85 <name>to_financial_account_id</name>
86 <table>civicrm_financial_account</table>
87 <key>id</key>
88 <add>4.3</add>
89 </foreignKey>
90 <field>
91 <name>trxn_date</name>
92 <title>Financial Transaction Date</title>
93 <type>datetime</type>
94 <default>NULL</default>
95 <comment>date transaction occurred</comment>
96 <add>1.3</add>
97 <html>
98 <type>Select Date</type>
99 <formatType>activityDateTime</formatType>
100 </html>
101 </field>
102 <field>
103 <name>trxn_type</name>
104 <title>Financial Transaction Type</title>
105 <type>enum</type>
106 <values>Debit,Credit</values>
107 <required>true</required>
108 <add>1.3</add>
109 <drop>4.3</drop>
110 </field>
111 <field>
112 <name>total_amount</name>
113 <title>Financial Total Amount</title>
114 <type>decimal</type>
115 <required>true</required>
116 <comment>amount of transaction</comment>
117 <add>1.3</add>
118 </field>
119 <field>
120 <name>fee_amount</name>
121 <title>Financial Fee Amount</title>
122 <type>decimal</type>
123 <comment>actual processor fee if known - may be 0.</comment>
124 <add>1.3</add>
125 </field>
126 <field>
127 <name>net_amount</name>
128 <title>Financial Net Amount</title>
129 <type>decimal</type>
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>
131 <add>1.3</add>
132 </field>
133 <field>
134 <name>currency</name>
135 <title>Financial Currency</title>
136 <type>varchar</type>
137 <length>3</length>
138 <default>NULL</default>
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>
144 <pseudoconstant>
145 <table>civicrm_currency</table>
146 <keyColumn>name</keyColumn>
147 <labelColumn>full_name</labelColumn>
148 <nameColumn>name</nameColumn>
149 </pseudoconstant>
150 <html>
151 <type>Select</type>
152 </html>
153 </field>
154 <field>
155 <name>is_payment</name>
156 <title>Is Payment?</title>
157 <type>boolean</type>
158 <default>0</default>
159 <import>true</import>
160 <comment>Is this entry either a payment or a reversal of a payment?</comment>
161 <add>4.7</add>
162 </field>
163 <field>
164 <name>payment_processor</name>
165 <type>varchar</type>
166 <length>64</length>
167 <required>true</required>
168 <comment>derived from Processor setting in civicrm.settings.php.</comment>
169 <add>1.3</add>
170 <drop>4.3</drop>
171 </field>
172 <field>
173 <name>trxn_id</name>
174 <title>Transaction ID</title>
175 <type>varchar</type>
176 <length>255</length>
177 <comment>Transaction id supplied by external processor. This may not be unique.</comment>
178 <add>1.3</add>
179 </field>
180 <index>
181 <name>UI_ftrxn_trxn_id</name>
182 <fieldName>trxn_id</fieldName>
183 <add>4.7</add>
184 </index>
185 <field>
186 <name>trxn_result_code</name>
187 <title>Transaction Result Code</title>
188 <type>varchar</type>
189 <length>255</length>
190 <comment>processor result code</comment>
191 <add>1.3</add>
192 </field>
193 <field>
194 <name>status_id</name>
195 <title>Financial Transaction Status Id</title>
196 <type>int unsigned</type>
197 <import>true</import>
198 <export>true</export>
199 <pseudoconstant>
200 <optionGroupName>contribution_status</optionGroupName>
201 </pseudoconstant>
202 <comment>pseudo FK to civicrm_option_value of contribution_status_id option_group</comment>
203 <headerPattern>/status/i</headerPattern>
204 <add>4.3</add>
205 </field>
206 <field>
207 <name>payment_processor_id</name>
208 <title>Payment Processor</title>
209 <type>int unsigned</type>
210 <comment>Payment Processor for this financial transaction</comment>
211 <add>4.3</add>
212 </field>
213 <foreignKey>
214 <name>payment_processor_id</name>
215 <table>civicrm_payment_processor</table>
216 <key>id</key>
217 <onDelete>SET NULL</onDelete>
218 <add>4.3</add>
219 </foreignKey>
220 <field>
221 <name>payment_instrument_id</name>
222 <uniqueName>financial_trxn_payment_instrument_id</uniqueName>
223 <title>Payment Method</title>
224 <type>int unsigned</type>
225 <comment>FK to payment_instrument option group values</comment>
226 <pseudoconstant>
227 <optionGroupName>payment_instrument</optionGroupName>
228 </pseudoconstant>
229 <html>
230 <type>Select</type>
231 </html>
232 <add>4.3</add>
233 </field>
234 <index>
235 <name>UI_ftrxn_payment_instrument_id</name>
236 <fieldName>payment_instrument_id</fieldName>
237 <add>4.3</add>
238 </index>
239 <field>
240 <name>card_type_id</name>
241 <uniqueName>financial_trxn_card_type_id</uniqueName>
242 <title>Card Type ID</title>
243 <type>int unsigned</type>
244 <comment>FK to accept_creditcard option group values</comment>
245 <pseudoconstant>
246 <optionGroupName>accept_creditcard</optionGroupName>
247 </pseudoconstant>
248 <html>
249 <type>Select</type>
250 </html>
251 <add>4.7</add>
252 </field>
253 <field>
254 <name>check_number</name>
255 <uniqueName>financial_trxn_check_number</uniqueName>
256 <title>Check Number</title>
257 <comment>Check number</comment>
258 <type>varchar</type>
259 <length>255</length>
260 <html>
261 <type>Text</type>
262 <size>6</size>
263 </html>
264 <add>4.3</add>
265 </field>
266 <index>
267 <name>UI_ftrxn_check_number</name>
268 <fieldName>check_number</fieldName>
269 <add>4.3</add>
270 </index>
271 <field>
272 <name>pan_truncation</name>
273 <uniqueName>financial_trxn_pan_truncation</uniqueName>
274 <title>Pan Truncation</title>
275 <type>varchar</type>
276 <length>4</length>
277 <html>
278 <type>Text</type>
279 <size>4</size>
280 </html>
281 <comment>Last 4 digits of credit card</comment>
282 <add>4.7</add>
283 </field>
284 </table>