Merge pull request #18868 from sunilpawar/logging_date
[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 <pseudoconstant>
171 <table>civicrm_payment_processor</table>
172 <keyColumn>id</keyColumn>
173 <labelColumn>name</labelColumn>
174 </pseudoconstant>
175 <html>
176 <type>Select</type>
177 </html>
178 <add>4.3</add>
179 </field>
180 <foreignKey>
181 <name>payment_processor_id</name>
182 <table>civicrm_payment_processor</table>
183 <key>id</key>
184 <onDelete>SET NULL</onDelete>
185 <add>4.3</add>
186 </foreignKey>
187 <field>
188 <name>payment_instrument_id</name>
189 <uniqueName>financial_trxn_payment_instrument_id</uniqueName>
190 <title>Payment Method</title>
191 <type>int unsigned</type>
192 <comment>FK to payment_instrument option group values</comment>
193 <pseudoconstant>
194 <optionGroupName>payment_instrument</optionGroupName>
195 </pseudoconstant>
196 <html>
197 <type>Select</type>
198 </html>
199 <add>4.3</add>
200 </field>
201 <index>
202 <name>UI_ftrxn_payment_instrument_id</name>
203 <fieldName>payment_instrument_id</fieldName>
204 <add>4.3</add>
205 </index>
206 <field>
207 <name>card_type_id</name>
208 <uniqueName>financial_trxn_card_type_id</uniqueName>
209 <title>Card Type ID</title>
210 <type>int unsigned</type>
211 <comment>FK to accept_creditcard option group values</comment>
212 <pseudoconstant>
213 <optionGroupName>accept_creditcard</optionGroupName>
214 </pseudoconstant>
215 <html>
216 <type>Select</type>
217 </html>
218 <add>4.7</add>
219 </field>
220 <field>
221 <name>check_number</name>
222 <uniqueName>financial_trxn_check_number</uniqueName>
223 <title>Check Number</title>
224 <comment>Check number</comment>
225 <type>varchar</type>
226 <length>255</length>
227 <html>
228 <type>Text</type>
229 <size>6</size>
230 </html>
231 <add>4.3</add>
232 </field>
233 <index>
234 <name>UI_ftrxn_check_number</name>
235 <fieldName>check_number</fieldName>
236 <add>4.3</add>
237 </index>
238 <field>
239 <name>pan_truncation</name>
240 <uniqueName>financial_trxn_pan_truncation</uniqueName>
241 <title>PAN Truncation</title>
242 <type>varchar</type>
243 <length>4</length>
244 <html>
245 <type>Text</type>
246 <size>4</size>
247 </html>
248 <comment>Last 4 digits of credit card</comment>
249 <add>4.7</add>
250 </field>
251 <field>
252 <name>order_reference</name>
253 <uniqueName>financial_trxn_order_reference</uniqueName>
254 <title>Order Reference</title>
255 <type>varchar</type>
256 <length>255</length>
257 <html>
258 <type>Text</type>
259 <size>25</size>
260 </html>
261 <comment>Payment Processor external order reference</comment>
262 <add>5.20</add>
263 </field>
264 </table>