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