Commit | Line | Data |
---|---|---|
3c7d2158 | 1 | <?xml version="1.0" encoding="iso-8859-1" ?> |
6a488035 | 2 | |
3c7d2158 | 3 | <table> |
4 | <base>CRM/Financial</base> | |
5 | <class>FinancialItem</class> | |
6 | <name>civicrm_financial_item</name> | |
7 | <add>4.3</add> | |
6a488035 | 8 | <comment>Financial data for civicrm_line_item, etc.</comment> |
3c7d2158 | 9 | <log>true</log> |
d31fb4e3 | 10 | <component>CiviContribute</component> |
3c7d2158 | 11 | <field> |
12 | <name>id</name> | |
6a488035 | 13 | <type>int unsigned</type> |
e117e295 | 14 | <title>Financial Item ID</title> |
6a488035 | 15 | <length>10</length> |
3c7d2158 | 16 | <required>true</required> |
17 | <comment></comment> | |
0481e12c A |
18 | <html> |
19 | <type>Number</type> | |
20 | </html> | |
6a488035 | 21 | <add>4.3</add> |
3c7d2158 | 22 | </field> |
23 | <primaryKey> | |
24 | <name>id</name> | |
25 | <autoincrement>true</autoincrement> | |
26 | </primaryKey> | |
6a488035 TO |
27 | <field> |
28 | <name>created_date</name> | |
29 | <type>timestamp</type> | |
e117e295 | 30 | <title>Financial Item Created Date</title> |
3c7d2158 | 31 | <required>true</required> |
32 | <default>CURRENT_TIMESTAMP</default> | |
6a488035 TO |
33 | <comment>Date and time the item was created</comment> |
34 | <add>4.3</add> | |
3c7d2158 | 35 | </field> |
6a488035 TO |
36 | <field> |
37 | <name>transaction_date</name> | |
38 | <type>datetime</type> | |
e117e295 | 39 | <title>Financial Item Transaction Date</title> |
3c7d2158 | 40 | <required>true</required> |
6a488035 TO |
41 | <comment>Date and time of the source transaction</comment> |
42 | <add>4.3</add> | |
3c7d2158 | 43 | </field> |
6a488035 TO |
44 | <field> |
45 | <name>contact_id</name> | |
46 | <type>int unsigned</type> | |
047c5009 | 47 | <title>Contact ID</title> |
3c7d2158 | 48 | <required>true</required> |
6a488035 TO |
49 | <export>true</export> |
50 | <comment>FK to Contact ID of contact the item is from</comment> | |
57e94608 | 51 | <html> |
047c5009 | 52 | <label>Contact</label> |
57e94608 | 53 | </html> |
6a488035 TO |
54 | <add>4.3</add> |
55 | </field> | |
56 | <foreignKey> | |
57 | <name>contact_id</name> | |
58 | <table>civicrm_contact</table> | |
59 | <key>id</key> | |
60 | <onDelete>CASCADE</onDelete> | |
61 | <add>4.3</add> | |
62 | </foreignKey> | |
63 | <field> | |
64 | <name>description</name> | |
65 | <type>varchar</type> | |
e117e295 | 66 | <title>Financial Item Description</title> |
6a488035 TO |
67 | <length>255</length> |
68 | <comment>Human readable description of this item, to ease display without lookup of source item.</comment> | |
69 | <add>4.3</add> | |
70 | </field> | |
3c7d2158 | 71 | <field> |
72 | <name>amount</name> | |
6a488035 TO |
73 | <title>Amount</title> |
74 | <type>decimal</type> | |
75 | <default>0</default> | |
3c7d2158 | 76 | <required>true</required> |
6a488035 TO |
77 | <headerPattern>/unit?.?amoun/i</headerPattern> |
78 | <dataPattern>/^\d+(\.\d{2})?$/</dataPattern> | |
3c7d2158 | 79 | <comment>Total amount of this item</comment> |
80 | <add>4.3</add> | |
6a488035 | 81 | </field> |
3c7d2158 | 82 | <field> |
6a488035 TO |
83 | <name>currency</name> |
84 | <export>true</export> | |
85 | <type>varchar</type> | |
e117e295 | 86 | <title>Financial Item Currency</title> |
6a488035 TO |
87 | <length>3</length> |
88 | <comment>Currency for the amount</comment> | |
89 | <add>4.3</add> | |
bd44e0df AS |
90 | <pseudoconstant> |
91 | <table>civicrm_currency</table> | |
92 | <keyColumn>name</keyColumn> | |
a38a89fc | 93 | <labelColumn>full_name</labelColumn> |
c3de5c5a | 94 | <nameColumn>name</nameColumn> |
a8fdb24e | 95 | <abbrColumn>symbol</abbrColumn> |
bd44e0df | 96 | </pseudoconstant> |
614d72ec | 97 | <html> |
e0991796 | 98 | <type>Select</type> |
614d72ec | 99 | </html> |
6a488035 TO |
100 | </field> |
101 | <field> | |
102 | <name>financial_account_id</name> | |
103 | <type>int unsigned</type> | |
e117e295 | 104 | <title>Financial Account ID</title> |
6a488035 TO |
105 | <comment>FK to civicrm_financial_account</comment> |
106 | <add>4.3</add> | |
7611ae71 AS |
107 | <pseudoconstant> |
108 | <table>civicrm_financial_account</table> | |
109 | <keyColumn>id</keyColumn> | |
110 | <labelColumn>name</labelColumn> | |
111 | </pseudoconstant> | |
614d72ec | 112 | <html> |
e0991796 | 113 | <type>Select</type> |
57e94608 | 114 | <label>Financial Account</label> |
614d72ec | 115 | </html> |
6a488035 TO |
116 | </field> |
117 | <foreignKey> | |
118 | <name>financial_account_id</name> | |
119 | <table>civicrm_financial_account</table> | |
120 | <key>id</key> | |
121 | <add>4.3</add> | |
122 | </foreignKey> | |
123 | <field> | |
124 | <name>status_id</name> | |
125 | <export>true</export> | |
e117e295 | 126 | <title>Financial Item Status ID</title> |
6a488035 TO |
127 | <type>int unsigned</type> |
128 | <comment>Payment status: test, paid, part_paid, unpaid (if empty assume unpaid)</comment> | |
129 | <add>4.3</add> | |
7611ae71 AS |
130 | <pseudoconstant> |
131 | <optionGroupName>financial_item_status</optionGroupName> | |
132 | </pseudoconstant> | |
614d72ec | 133 | <html> |
e0991796 | 134 | <type>Select</type> |
614d72ec | 135 | </html> |
6a488035 TO |
136 | </field> |
137 | <field> | |
138 | <name>entity_table</name> | |
139 | <type>varchar</type> | |
e117e295 | 140 | <title>Entity Table</title> |
6a488035 | 141 | <length>64</length> |
6844be64 MD |
142 | <pseudoconstant> |
143 | <callback>CRM_Financial_BAO_FinancialItem::entityTables</callback> | |
144 | </pseudoconstant> | |
145 | <comment>May contain civicrm_line_item, civicrm_financial_trxn etc</comment> | |
6a488035 TO |
146 | <add>4.3</add> |
147 | </field> | |
148 | <field> | |
149 | <name>entity_id</name> | |
e117e295 | 150 | <title>Entity ID</title> |
6a488035 TO |
151 | <type>int unsigned</type> |
152 | <comment>The specific source item that is responsible for the creation of this financial_item</comment> | |
153 | <add>4.3</add> | |
154 | </field> | |
71e5aa5c ARW |
155 | <dynamicForeignKey> |
156 | <idColumn>entity_id</idColumn> | |
157 | <typeColumn>entity_table</typeColumn> | |
158 | <add>4.3</add> | |
159 | </dynamicForeignKey> | |
6a488035 TO |
160 | <index> |
161 | <name>UI_id</name> | |
162 | <fieldName>id</fieldName> | |
163 | <unique>true</unique> | |
164 | <add>4.3</add> | |
2179c899 | 165 | <drop>4.7</drop> |
6a488035 TO |
166 | </index> |
167 | <index> | |
168 | <name>IX_created_date</name> | |
169 | <fieldName>created_date</fieldName> | |
170 | <add>4.3</add> | |
171 | </index> | |
172 | <index> | |
173 | <name>IX_transaction_date</name> | |
174 | <fieldName>transaction_date</fieldName> | |
175 | <add>4.3</add> | |
176 | </index> | |
177 | <index> | |
178 | <name>IX_entity</name> | |
179 | <fieldName>entity_table</fieldName> | |
180 | <fieldName>entity_id</fieldName> | |
181 | <add>4.3</add> | |
2179c899 | 182 | <drop>4.7</drop> |
6a488035 TO |
183 | </index> |
184 | <index> | |
2179c899 | 185 | <name>index_entity_id_entity_table</name> |
6a488035 | 186 | <fieldName>entity_id</fieldName> |
2179c899 | 187 | <fieldName>entity_table</fieldName> |
188 | <add>4.7</add> | |
6a488035 TO |
189 | </index> |
190 | </table> |