| 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 | </field> |
| 98 | <field> |
| 99 | <name>trxn_type</name> |
| 100 | <title>Financial Transaction Type</title> |
| 101 | <type>enum</type> |
| 102 | <values>Debit,Credit</values> |
| 103 | <required>true</required> |
| 104 | <add>1.3</add> |
| 105 | <drop>4.3</drop> |
| 106 | </field> |
| 107 | <field> |
| 108 | <name>total_amount</name> |
| 109 | <title>Financial Total Amount</title> |
| 110 | <type>decimal</type> |
| 111 | <required>true</required> |
| 112 | <comment>amount of transaction</comment> |
| 113 | <add>1.3</add> |
| 114 | </field> |
| 115 | <field> |
| 116 | <name>fee_amount</name> |
| 117 | <title>Financial Fee Amount</title> |
| 118 | <type>decimal</type> |
| 119 | <comment>actual processor fee if known - may be 0.</comment> |
| 120 | <add>1.3</add> |
| 121 | </field> |
| 122 | <field> |
| 123 | <name>net_amount</name> |
| 124 | <title>Financial Net Amount</title> |
| 125 | <type>decimal</type> |
| 126 | <comment>actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.</comment> |
| 127 | <add>1.3</add> |
| 128 | </field> |
| 129 | <field> |
| 130 | <name>currency</name> |
| 131 | <title>Financial Currency</title> |
| 132 | <type>varchar</type> |
| 133 | <length>3</length> |
| 134 | <default>NULL</default> |
| 135 | <import>true</import> |
| 136 | <headerPattern>/cur(rency)?/i</headerPattern> |
| 137 | <dataPattern>/^[A-Z]{3}$/</dataPattern> |
| 138 | <comment>3 character string, value from config setting or input via user.</comment> |
| 139 | <add>1.3</add> |
| 140 | <pseudoconstant> |
| 141 | <table>civicrm_currency</table> |
| 142 | <keyColumn>name</keyColumn> |
| 143 | <labelColumn>full_name</labelColumn> |
| 144 | <nameColumn>numeric_code</nameColumn> |
| 145 | </pseudoconstant> |
| 146 | <html> |
| 147 | <type>Select</type> |
| 148 | </html> |
| 149 | </field> |
| 150 | <field> |
| 151 | <name>payment_processor</name> |
| 152 | <type>varchar</type> |
| 153 | <length>64</length> |
| 154 | <required>true</required> |
| 155 | <comment>derived from Processor setting in civicrm.settings.php.</comment> |
| 156 | <add>1.3</add> |
| 157 | <drop>4.3</drop> |
| 158 | </field> |
| 159 | <field> |
| 160 | <name>trxn_id</name> |
| 161 | <title>Transaction ID</title> |
| 162 | <type>varchar</type> |
| 163 | <length>255</length> |
| 164 | <comment>user-specified unique processor transaction id, bank id + trans id,... depending on payment_method</comment> |
| 165 | <add>1.3</add> |
| 166 | </field> |
| 167 | <field> |
| 168 | <name>trxn_result_code</name> |
| 169 | <title>Transaction result Code</title> |
| 170 | <type>varchar</type> |
| 171 | <length>255</length> |
| 172 | <comment>processor result code</comment> |
| 173 | <add>1.3</add> |
| 174 | </field> |
| 175 | <field> |
| 176 | <name>status_id</name> |
| 177 | <title>Financial Transaction Status Id</title> |
| 178 | <type>int unsigned</type> |
| 179 | <import>true</import> |
| 180 | <export>true</export> |
| 181 | <comment>pseudo FK to civicrm_option_value of financial_item status option_group</comment> |
| 182 | <headerPattern>/status/i</headerPattern> |
| 183 | <add>4.3</add> |
| 184 | </field> |
| 185 | <field> |
| 186 | <name>payment_processor_id</name> |
| 187 | <title>Payment Processor</title> |
| 188 | <type>int unsigned</type> |
| 189 | <comment>Payment Processor for this financial transaction</comment> |
| 190 | <add>4.3</add> |
| 191 | </field> |
| 192 | <foreignKey> |
| 193 | <name>payment_processor_id</name> |
| 194 | <table>civicrm_payment_processor</table> |
| 195 | <key>id</key> |
| 196 | <onDelete>SET NULL</onDelete> |
| 197 | <add>4.3</add> |
| 198 | </foreignKey> |
| 199 | <field> |
| 200 | <name>payment_instrument_id</name> |
| 201 | <uniqueName>financial_trxn_payment_instrument_id</uniqueName> |
| 202 | <title>Payment Method</title> |
| 203 | <type>int unsigned</type> |
| 204 | <comment>FK to payment_instrument option group values</comment> |
| 205 | <pseudoconstant> |
| 206 | <optionGroupName>payment_instrument</optionGroupName> |
| 207 | </pseudoconstant> |
| 208 | <html> |
| 209 | <type>Select</type> |
| 210 | </html> |
| 211 | <add>4.3</add> |
| 212 | </field> |
| 213 | <index> |
| 214 | <name>UI_ftrxn_payment_instrument_id</name> |
| 215 | <fieldName>payment_instrument_id</fieldName> |
| 216 | <add>4.3</add> |
| 217 | </index> |
| 218 | <field> |
| 219 | <name>check_number</name> |
| 220 | <uniqueName>financial_trxn_check_number</uniqueName> |
| 221 | <title>Check Number</title> |
| 222 | <comment>Check number</comment> |
| 223 | <type>varchar</type> |
| 224 | <length>255</length> |
| 225 | <html> |
| 226 | <type>Text</type> |
| 227 | <size>6</size> |
| 228 | </html> |
| 229 | <add>4.3</add> |
| 230 | </field> |
| 231 | <index> |
| 232 | <name>UI_ftrxn_check_number</name> |
| 233 | <fieldName>check_number</fieldName> |
| 234 | <add>4.3</add> |
| 235 | </index> |
| 236 | </table> |