Refactored out of CRM_Core_PseudoConstant: ufGroup(), currencySymbols(). CRM-12464
[civicrm-core.git] / xml / schema / Financial / FinancialTrxn.xml
CommitLineData
6a488035
TO
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 <type>int unsigned</type>
12 <required>true</required>
13 <add>1.3</add>
14 </field>
15 <primaryKey>
16 <name>id</name>
17 <autoincrement>true</autoincrement>
18 </primaryKey>
19 <field>
20 <name>from_account_id</name>
21 <type>int unsigned</type>
22 <comment>FK to financial_account table.</comment>
23 <add>3.2</add>
24 <drop>4.3</drop>
25 </field>
26 <foreignKey>
27 <name>from_account_id</name>
28 <table>civicrm_financial_account</table>
29 <key>id</key>
30 <add>3.2</add>
31 <drop>4.3</drop>
32 </foreignKey>
33 <field>
34 <name>to_account_id</name>
35 <type>int unsigned</type>
36 <comment>FK to financial_account table.</comment>
37 <add>3.2</add>
38 <drop>4.3</drop>
39 </field>
40 <foreignKey>
41 <name>to_account_id</name>
42 <table>civicrm_financial_account</table>
43 <key>id</key>
44 <add>3.2</add>
45 <drop>4.3</drop>
46 </foreignKey>
47 <field>
48 <name>from_financial_account_id</name>
49 <type>int unsigned</type>
50 <comment>FK to financial_account table.</comment>
51 <add>4.3</add>
52 </field>
53 <foreignKey>
54 <name>from_financial_account_id</name>
55 <table>civicrm_financial_account</table>
56 <key>id</key>
57 <add>4.3</add>
58 </foreignKey>
59 <field>
60 <name>to_financial_account_id</name>
61 <type>int unsigned</type>
62 <comment>FK to financial_financial_account table.</comment>
63 <add>4.3</add>
64 </field>
65 <foreignKey>
66 <name>to_financial_account_id</name>
67 <table>civicrm_financial_account</table>
68 <key>id</key>
69 <add>4.3</add>
70 </foreignKey>
71 <field>
72 <name>trxn_date</name>
73 <type>datetime</type>
74 <default>NULL</default>
75 <comment>date transaction occurred</comment>
76 <add>1.3</add>
77 </field>
78 <field>
79 <name>trxn_type</name>
80 <type>enum</type>
81 <values>Debit,Credit</values>
82 <required>true</required>
83 <add>1.3</add>
84 <drop>4.3</drop>
85 </field>
86 <field>
87 <name>total_amount</name>
88 <type>decimal</type>
89 <required>true</required>
90 <comment>amount of transaction</comment>
91 <add>1.3</add>
92 </field>
93 <field>
94 <name>fee_amount</name>
95 <type>decimal</type>
96 <comment>actual processor fee if known - may be 0.</comment>
97 <add>1.3</add>
98 </field>
99 <field>
100 <name>net_amount</name>
101 <type>decimal</type>
102 <comment>actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.</comment>
103 <add>1.3</add>
104 </field>
105 <field>
106 <name>currency</name>
107 <type>varchar</type>
108 <length>3</length>
109 <default>NULL</default>
110 <import>true</import>
111 <headerPattern>/cur(rency)?/i</headerPattern>
112 <dataPattern>/^[A-Z]{3}$/</dataPattern>
113 <comment>3 character string, value from config setting or input via user.</comment>
114 <add>1.3</add>
bd44e0df
AS
115 <pseudoconstant>
116 <table>civicrm_currency</table>
117 <keyColumn>name</keyColumn>
118 <labelColumn>symbol</labelColumn>
119 </pseudoconstant>
6a488035
TO
120 </field>
121 <field>
122 <name>payment_processor</name>
123 <type>varchar</type>
124 <length>64</length>
125 <required>true</required>
126 <comment>derived from Processor setting in civicrm.settings.php.</comment>
127 <add>1.3</add>
128 <drop>4.3</drop>
129 </field>
130 <field>
131 <name>trxn_id</name>
132 <type>varchar</type>
133 <length>255</length>
134 <comment>user-specified unique processor transaction id, bank id + trans id,... depending on payment_method</comment>
135 <add>1.3</add>
136 </field>
137 <field>
138 <name>trxn_result_code</name>
139 <type>varchar</type>
140 <length>255</length>
141 <comment>processor result code</comment>
142 <add>1.3</add>
143 </field>
144 <field>
145 <name>status_id</name>
146 <title>Financial Transaction Status Id</title>
147 <type>int unsigned</type>
148 <import>true</import>
149 <export>true</export>
150 <comment>pseudo FK to civicrm_option_value of financial_item status option_group</comment>
151 <headerPattern>/status/i</headerPattern>
152 <add>4.3</add>
153 </field>
154 <field>
155 <name>payment_processor_id</name>
156 <type>int unsigned</type>
157 <comment>Payment Processor for this financial transaction</comment>
158 <add>4.3</add>
159 </field>
160 <foreignKey>
161 <name>payment_processor_id</name>
162 <table>civicrm_payment_processor</table>
163 <key>id</key>
164 <onDelete>SET NULL</onDelete>
165 <add>4.3</add>
166 </foreignKey>
167 <field>
168 <name>payment_instrument_id</name>
169 <uniqueName>financial_trxn_payment_instrument_id</uniqueName>
170 <title>Payment Instrument</title>
171 <type>int unsigned</type>
172 <comment>FK to payment_instrument option group values</comment>
173 <pseudoconstant>
174 <name>paymentInstrument</name>
175 <optionGroupName>paymentInstrument</optionGroupName>
176 <class>CRM_Contribute_PseudoConstant</class>
177 </pseudoconstant>
178 <add>4.3</add>
179 </field>
180 <index>
181 <name>UI_ftrxn_payment_instrument_id</name>
182 <fieldName>payment_instrument_id</fieldName>
183 <add>4.3</add>
184 </index>
185 <field>
186 <name>check_number</name>
187 <uniqueName>financial_trxn_check_number</uniqueName>
188 <title>Check Number</title>
189 <comment>Check number</comment>
190 <type>varchar</type>
191 <length>255</length>
192 <size>SIX</size>
193 <add>4.3</add>
194 </field>
195 <index>
196 <name>UI_ftrxn_check_number</name>
197 <fieldName>check_number</fieldName>
198 <add>4.3</add>
199 </index>
200</table>
201