commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / 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 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <length>10</length>
14 <required>true</required>
15 <comment></comment>
16 <add>4.3</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22 <field>
23 <name>created_date</name>
24 <type>timestamp</type>
25 <required>true</required>
26 <default>CURRENT_TIMESTAMP</default>
27 <comment>Date and time the item was created</comment>
28 <add>4.3</add>
29 </field>
30 <field>
31 <name>transaction_date</name>
32 <type>datetime</type>
33 <required>true</required>
34 <comment>Date and time of the source transaction</comment>
35 <add>4.3</add>
36 </field>
37 <field>
38 <name>contact_id</name>
39 <type>int unsigned</type>
40 <required>true</required>
41 <export>true</export>
42 <comment>FK to Contact ID of contact the item is from</comment>
43 <add>4.3</add>
44 </field>
45 <foreignKey>
46 <name>contact_id</name>
47 <table>civicrm_contact</table>
48 <key>id</key>
49 <onDelete>CASCADE</onDelete>
50 <add>4.3</add>
51 </foreignKey>
52 <field>
53 <name>description</name>
54 <type>varchar</type>
55 <length>255</length>
56 <comment>Human readable description of this item, to ease display without lookup of source item.</comment>
57 <add>4.3</add>
58 </field>
59 <field>
60 <name>amount</name>
61 <title>Amount</title>
62 <type>decimal</type>
63 <default>0</default>
64 <required>true</required>
65 <headerPattern>/unit?.?amoun/i</headerPattern>
66 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
67 <comment>Total amount of this item</comment>
68 <add>4.3</add>
69 </field>
70 <field>
71 <name>currency</name>
72 <export>true</export>
73 <type>varchar</type>
74 <length>3</length>
75 <comment>Currency for the amount</comment>
76 <add>4.3</add>
77 <pseudoconstant>
78 <table>civicrm_currency</table>
79 <keyColumn>name</keyColumn>
80 <labelColumn>full_name</labelColumn>
81 <nameColumn>numeric_code</nameColumn>
82 </pseudoconstant>
83 <html>
84 <type>Select</type>
85 </html>
86 </field>
87 <field>
88 <name>financial_account_id</name>
89 <type>int unsigned</type>
90 <comment>FK to civicrm_financial_account</comment>
91 <add>4.3</add>
92 <pseudoconstant>
93 <table>civicrm_financial_account</table>
94 <keyColumn>id</keyColumn>
95 <labelColumn>name</labelColumn>
96 </pseudoconstant>
97 <html>
98 <type>Select</type>
99 </html>
100 </field>
101 <foreignKey>
102 <name>financial_account_id</name>
103 <table>civicrm_financial_account</table>
104 <key>id</key>
105 <add>4.3</add>
106 </foreignKey>
107 <field>
108 <name>status_id</name>
109 <export>true</export>
110 <type>int unsigned</type>
111 <comment>Payment status: test, paid, part_paid, unpaid (if empty assume unpaid)</comment>
112 <add>4.3</add>
113 <pseudoconstant>
114 <optionGroupName>financial_item_status</optionGroupName>
115 </pseudoconstant>
116 <html>
117 <type>Select</type>
118 </html>
119 </field>
120 <field>
121 <name>entity_table</name>
122 <type>varchar</type>
123 <length>64</length>
124 <comment>The table providing the source of this item such as civicrm_line_item</comment>
125 <add>4.3</add>
126 </field>
127 <field>
128 <name>entity_id</name>
129 <type>int unsigned</type>
130 <comment>The specific source item that is responsible for the creation of this financial_item</comment>
131 <add>4.3</add>
132 </field>
133 <dynamicForeignKey>
134 <idColumn>entity_id</idColumn>
135 <typeColumn>entity_table</typeColumn>
136 <add>4.3</add>
137 </dynamicForeignKey>
138 <index>
139 <name>UI_id</name>
140 <fieldName>id</fieldName>
141 <unique>true</unique>
142 <add>4.3</add>
143 </index>
144 <index>
145 <name>IX_created_date</name>
146 <fieldName>created_date</fieldName>
147 <add>4.3</add>
148 </index>
149 <index>
150 <name>IX_transaction_date</name>
151 <fieldName>transaction_date</fieldName>
152 <add>4.3</add>
153 </index>
154 <index>
155 <name>IX_entity</name>
156 <fieldName>entity_table</fieldName>
157 <fieldName>entity_id</fieldName>
158 <add>4.3</add>
159 </index>
160 <index>
161 <name>IX_entity</name>
162 <fieldName>entity_table</fieldName>
163 <fieldName>entity_id</fieldName>
164 <add>4.3</add>
165 </index>
166 </table>