Merge pull request #19095 from nishant-bhorodia/Issue#537-owner-notification-email...
[civicrm-core.git] / xml / schema / Financial / FinancialItem.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Financial</base>
5 <class>FinancialItem</class>
6 <name>civicrm_financial_item</name>
7 <add>4.3</add>
8 <comment>Financial data for civicrm_line_item, etc.</comment>
9 <log>true</log>
10 <component>CiviContribute</component>
11 <field>
12 <name>id</name>
13 <type>int unsigned</type>
14 <title>Financial Item ID</title>
15 <length>10</length>
16 <required>true</required>
17 <comment></comment>
18 <add>4.3</add>
19 </field>
20 <primaryKey>
21 <name>id</name>
22 <autoincrement>true</autoincrement>
23 </primaryKey>
24 <field>
25 <name>created_date</name>
26 <type>timestamp</type>
27 <title>Financial Item Created Date</title>
28 <required>true</required>
29 <default>CURRENT_TIMESTAMP</default>
30 <comment>Date and time the item was created</comment>
31 <add>4.3</add>
32 </field>
33 <field>
34 <name>transaction_date</name>
35 <type>datetime</type>
36 <title>Financial Item Transaction Date</title>
37 <required>true</required>
38 <comment>Date and time of the source transaction</comment>
39 <add>4.3</add>
40 </field>
41 <field>
42 <name>contact_id</name>
43 <type>int unsigned</type>
44 <title>Financial Item Contact ID</title>
45 <required>true</required>
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>
60 <title>Financial Item Description</title>
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>
65 <field>
66 <name>amount</name>
67 <title>Amount</title>
68 <type>decimal</type>
69 <default>0</default>
70 <required>true</required>
71 <headerPattern>/unit?.?amoun/i</headerPattern>
72 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
73 <comment>Total amount of this item</comment>
74 <add>4.3</add>
75 </field>
76 <field>
77 <name>currency</name>
78 <export>true</export>
79 <type>varchar</type>
80 <title>Financial Item Currency</title>
81 <length>3</length>
82 <comment>Currency for the amount</comment>
83 <add>4.3</add>
84 <pseudoconstant>
85 <table>civicrm_currency</table>
86 <keyColumn>name</keyColumn>
87 <labelColumn>full_name</labelColumn>
88 <nameColumn>name</nameColumn>
89 <abbrColumn>symbol</abbrColumn>
90 </pseudoconstant>
91 <html>
92 <type>Select</type>
93 </html>
94 </field>
95 <field>
96 <name>financial_account_id</name>
97 <type>int unsigned</type>
98 <title>Financial Account ID</title>
99 <comment>FK to civicrm_financial_account</comment>
100 <add>4.3</add>
101 <pseudoconstant>
102 <table>civicrm_financial_account</table>
103 <keyColumn>id</keyColumn>
104 <labelColumn>name</labelColumn>
105 </pseudoconstant>
106 <html>
107 <type>Select</type>
108 </html>
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>
119 <title>Financial Item Status ID</title>
120 <type>int unsigned</type>
121 <comment>Payment status: test, paid, part_paid, unpaid (if empty assume unpaid)</comment>
122 <add>4.3</add>
123 <pseudoconstant>
124 <optionGroupName>financial_item_status</optionGroupName>
125 </pseudoconstant>
126 <html>
127 <type>Select</type>
128 </html>
129 </field>
130 <field>
131 <name>entity_table</name>
132 <type>varchar</type>
133 <title>Entity Table</title>
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>
140 <title>Entity ID</title>
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>
145 <dynamicForeignKey>
146 <idColumn>entity_id</idColumn>
147 <typeColumn>entity_table</typeColumn>
148 <add>4.3</add>
149 </dynamicForeignKey>
150 <index>
151 <name>UI_id</name>
152 <fieldName>id</fieldName>
153 <unique>true</unique>
154 <add>4.3</add>
155 <drop>4.7</drop>
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>
172 <drop>4.7</drop>
173 </index>
174 <index>
175 <name>index_entity_id_entity_table</name>
176 <fieldName>entity_id</fieldName>
177 <fieldName>entity_table</fieldName>
178 <add>4.7</add>
179 </index>
180 </table>