Merge pull request #19014 from eileenmcnaughton/cancel
[civicrm-core.git] / xml / schema / Price / LineItem.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Price</base>
5 <class>LineItem</class>
6 <name>civicrm_line_item</name>
7 <add>1.7</add>
8 <log>true</log>
d31fb4e3 9 <component>CiviContribute</component>
6a488035
TO
10 <field>
11 <name>id</name>
32ac94e8 12 <title>Line Item ID</title>
6a488035
TO
13 <type>int unsigned</type>
14 <required>true</required>
15 <comment>Line Item</comment>
16 <add>1.7</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22 <field>
23 <name>entity_table</name>
32ac94e8 24 <title>Line Item Entity Type</title>
6a488035
TO
25 <type>varchar</type>
26 <length>64</length>
27 <required>true</required>
28 <comment>table which has the transaction</comment>
29 <add>1.7</add>
30 </field>
31 <field>
32 <name>entity_id</name>
32ac94e8 33 <title>Line Item Entity</title>
6a488035
TO
34 <type>int unsigned</type>
35 <required>true</required>
36 <comment>entry in table</comment>
37 <add>1.7</add>
38 </field>
71e5aa5c
ARW
39 <dynamicForeignKey>
40 <idColumn>entity_id</idColumn>
41 <typeColumn>entity_table</typeColumn>
42 <add>1.7</add>
43 </dynamicForeignKey>
a7886853
E
44 <field>
45 <name>contribution_id</name>
32ac94e8 46 <title>Line Item Contribution</title>
a7886853
E
47 <type>int unsigned</type>
48 <comment>FK to civicrm_contribution</comment>
49 <add>4.5</add>
50 </field>
51 <foreignKey>
52 <name>contribution_id</name>
53 <table>civicrm_contribution</table>
54 <key>id</key>
55 <onDelete>SET NULL</onDelete>
56 </foreignKey>
6a488035
TO
57 <field>
58 <name>price_field_id</name>
32ac94e8 59 <title>Line Item Price Field</title>
6a488035
TO
60 <type>int unsigned</type>
61 <comment>FK to civicrm_price_field</comment>
8e17d9d3 62 <pseudoconstant>
63 <table>civicrm_price_field</table>
64 <keyColumn>id</keyColumn>
65 <nameColumn>name</nameColumn>
66 <labelColumn>label</labelColumn>
67 </pseudoconstant>
6a488035
TO
68 <!-- changed to not required in 4.3 in order to change ON DELETE CASCADE FK constraint to SET NULL -->
69 <add>1.7</add>
70 </field>
71 <foreignKey>
72 <name>price_field_id</name>
73 <table>civicrm_price_field</table>
74 <key>id</key>
75 <onDelete>SET NULL</onDelete>
76 </foreignKey>
6a488035
TO
77 <field>
78 <name>label</name>
32ac94e8 79 <title>Line Item Label</title>
6a488035
TO
80 <type>varchar</type>
81 <length>255</length>
82 <default>NULL</default>
83 <!-- changed to not required in 4.2.3 -->
84 <comment>descriptive label for item - from price_field_value.label</comment>
85 <add>1.7</add>
614d72ec 86 <html>
87 <type>Text</type>
88 </html>
6a488035
TO
89 </field>
90 <field>
91 <name>qty</name>
32ac94e8 92 <title>Line Item Quantity</title>
4728de9f 93 <type>decimal</type>
6a488035
TO
94 <required>true</required>
95 <comment>How many items ordered</comment>
96 <add>1.7</add>
614d72ec 97 <html>
98 <type>Text</type>
99 </html>
6a488035
TO
100 </field>
101 <field>
102 <name>unit_price</name>
103 <type>decimal</type>
104 <required>true</required>
105 <comment>price of each item</comment>
106 <add>1.7</add>
614d72ec 107 <html>
108 <type>Text</type>
109 </html>
6a488035
TO
110 </field>
111 <field>
112 <name>line_total</name>
32ac94e8 113 <title>Line Item Total</title>
6a488035
TO
114 <type>decimal</type>
115 <required>true</required>
116 <comment>qty * unit_price</comment>
117 <add>1.7</add>
118 </field>
119 <field>
120 <name>participant_count</name>
32ac94e8 121 <title>Line Item Participant Count</title>
6a488035
TO
122 <type>int unsigned</type>
123 <default>NULL</default>
32ac94e8 124 <comment>Participant count for field</comment>
5435b737
EM
125 <html>
126 <type>Text</type>
32ac94e8 127 </html>
6a488035 128 <add>3.2</add>
6cc0b7bd 129
6a488035
TO
130 </field>
131 <index>
132 <name>index_entity</name>
133 <fieldName>entity_table</fieldName>
134 <fieldName>entity_id</fieldName>
135 <add>1.7</add>
136 </index>
137 <index>
138 <name>UI_line_item_value</name>
139 <fieldName>entity_table</fieldName>
140 <fieldName>entity_id</fieldName>
265f68c1 141 <fieldName>contribution_id</fieldName>
6a488035
TO
142 <fieldName>price_field_value_id</fieldName>
143 <fieldName>price_field_id</fieldName>
144 <unique>true</unique>
145 <add>3.3</add>
d3c618dd
DG
146 <change>4.5</change>
147 <!-- Add contribution_id to unique index in 4.5 -->
6a488035
TO
148 </index>
149 <field>
150 <name>price_field_value_id</name>
32ac94e8 151 <title>Line Item Option</title>
6a488035
TO
152 <type>int unsigned</type>
153 <default>NULL</default>
154 <comment>FK to civicrm_price_field_value</comment>
8e17d9d3 155 <pseudoconstant>
156 <table>civicrm_price_field_value</table>
157 <keyColumn>id</keyColumn>
158 <nameColumn>name</nameColumn>
159 <labelColumn>label</labelColumn>
160 </pseudoconstant>
6a488035
TO
161 <add>3.3</add>
162 </field>
163 <foreignKey>
164 <name>price_field_value_id</name>
165 <table>civicrm_price_field_value</table>
166 <key>id</key>
167 <onDelete>SET NULL</onDelete>
168 </foreignKey>
6f3f0f22 169 <field>
170 <name>financial_type_id</name>
8e17d9d3 171 <title>Financial Type ID</title>
6f3f0f22 172 <type>int unsigned</type>
6a488035 173 <default>NULL</default>
6cc0b7bd
EM
174 <pseudoconstant>
175 <table>civicrm_financial_type</table>
176 <keyColumn>id</keyColumn>
177 <labelColumn>name</labelColumn>
178 </pseudoconstant>
6a488035 179 <comment>FK to Financial Type.</comment>
6f3f0f22 180 <add>4.3</add>
614d72ec 181 <html>
182 <type>Select</type>
8e17d9d3 183 <label>Financial Type</label>
614d72ec 184 </html>
6f3f0f22 185 </field>
186 <foreignKey>
187 <name>financial_type_id</name>
188 <table>civicrm_financial_type</table>
189 <key>id</key>
6a488035
TO
190 <onDelete>SET NULL</onDelete>
191 <add>4.3</add>
6f3f0f22 192 </foreignKey>
193 <field>
5afce5ad 194 <name>non_deductible_amount</name>
195 <title>Non-deductible Amount</title>
6f3f0f22 196 <type>decimal</type>
6a488035 197 <default>0.0</default>
5afce5ad 198 <headerPattern>/non?.?deduct/i</headerPattern>
6a488035 199 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
6f3f0f22 200 <required>true</required>
5afce5ad 201 <comment>Portion of total amount which is NOT tax deductible.</comment>
202 <add>4.7</add>
614d72ec 203 <html>
204 <type>Text</type>
205 </html>
6f3f0f22 206 </field>
d91b8b33 207 <field>
208 <name>tax_amount</name>
115fa278 209 <title>Tax Amount</title>
d91b8b33 210 <type>decimal</type>
211 <import>true</import>
212 <headerPattern>/tax(.?am(ou)?nt)?/i</headerPattern>
213 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
214 <comment>tax of each item</comment>
115fa278 215 <add>4.6</add>
d91b8b33 216 <html>
217 <type>Text</type>
218 </html>
219 </field>
6a488035
TO
220</table>
221