Commit | Line | Data |
---|---|---|
6a488035 TO |
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 | </field> | |
78 | <field> | |
79 | <name>financial_account_id</name> | |
80 | <type>int unsigned</type> | |
81 | <comment>FK to civicrm_financial_account</comment> | |
82 | <add>4.3</add> | |
83 | </field> | |
84 | <foreignKey> | |
85 | <name>financial_account_id</name> | |
86 | <table>civicrm_financial_account</table> | |
87 | <key>id</key> | |
88 | <add>4.3</add> | |
89 | </foreignKey> | |
90 | <field> | |
91 | <name>status_id</name> | |
92 | <export>true</export> | |
93 | <type>int unsigned</type> | |
94 | <comment>Payment status: test, paid, part_paid, unpaid (if empty assume unpaid)</comment> | |
95 | <add>4.3</add> | |
96 | </field> | |
97 | <field> | |
98 | <name>entity_table</name> | |
99 | <type>varchar</type> | |
100 | <length>64</length> | |
101 | <comment>The table providing the source of this item such as civicrm_line_item</comment> | |
102 | <add>4.3</add> | |
103 | </field> | |
104 | <field> | |
105 | <name>entity_id</name> | |
106 | <type>int unsigned</type> | |
107 | <comment>The specific source item that is responsible for the creation of this financial_item</comment> | |
108 | <add>4.3</add> | |
109 | </field> | |
71e5aa5c ARW |
110 | <dynamicForeignKey> |
111 | <idColumn>entity_id</idColumn> | |
112 | <typeColumn>entity_table</typeColumn> | |
113 | <add>4.3</add> | |
114 | </dynamicForeignKey> | |
6a488035 TO |
115 | <index> |
116 | <name>UI_id</name> | |
117 | <fieldName>id</fieldName> | |
118 | <unique>true</unique> | |
119 | <add>4.3</add> | |
120 | </index> | |
121 | <index> | |
122 | <name>IX_created_date</name> | |
123 | <fieldName>created_date</fieldName> | |
124 | <add>4.3</add> | |
125 | </index> | |
126 | <index> | |
127 | <name>IX_transaction_date</name> | |
128 | <fieldName>transaction_date</fieldName> | |
129 | <add>4.3</add> | |
130 | </index> | |
131 | <index> | |
132 | <name>IX_entity</name> | |
133 | <fieldName>entity_table</fieldName> | |
134 | <fieldName>entity_id</fieldName> | |
135 | <add>4.3</add> | |
136 | </index> | |
137 | <index> | |
138 | <name>IX_entity</name> | |
139 | <fieldName>entity_table</fieldName> | |
140 | <fieldName>entity_id</fieldName> | |
141 | <add>4.3</add> | |
142 | </index> | |
143 | </table> |