Merge pull request #15468 from aydun/add_order_reference
[civicrm-core.git] / xml / schema / Financial / EntityFinancialAccount.xml
CommitLineData
3c7d2158 1<?xml version="1.0" encoding="iso-8859-1" ?>
6a488035 2
3c7d2158 3<table>
4 <base>CRM/Financial</base>
5 <class>EntityFinancialAccount</class>
6 <name>civicrm_entity_financial_account</name>
6a488035
TO
7 <add>4.3</add>
8 <comment>Map between an entity and a financial account, where there is a specific relationship between the financial account and the entity, e.g. Income Account for or AR Account for</comment>
3c7d2158 9 <log>true</log>
10 <field>
11 <name>id</name>
f3ea5182 12 <title>Entity Financial Account ID</title>
3c7d2158 13 <type>int unsigned</type>
14 <required>true</required>
15 <comment>ID</comment>
16 <add>4.3</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
6a488035
TO
22 <field>
23 <name>entity_table</name>
f3ea5182 24 <title>Entity Table</title>
6a488035
TO
25 <type>varchar</type>
26 <length>64</length>
3c7d2158 27 <required>true</required>
6a488035
TO
28 <import>true</import>
29 <add>4.3</add>
30 <comment>Links to an entity_table like civicrm_financial_type</comment>
31 </field>
3c7d2158 32 <field>
33 <name>entity_id</name>
f3ea5182 34 <title>Entity ID</title>
3c7d2158 35 <type>int unsigned</type>
36 <required>true</required>
6a488035
TO
37 <add>4.3</add>
38 <comment>Links to an id in the entity_table, such as vid in civicrm_financial_type</comment>
39 </field>
fa6ace1a 40 <dynamicForeignKey>
71e5aa5c
ARW
41 <idColumn>entity_id</idColumn>
42 <typeColumn>entity_table</typeColumn>
43 <add>4.3</add>
44 </dynamicForeignKey>
3c7d2158 45 <field>
46 <name>account_relationship</name>
f3ea5182 47 <title>Account Relationship</title>
3c7d2158 48 <type>int unsigned</type>
6a488035 49 <required>true</required>
3c7d2158 50 <add>4.3</add>
6a488035 51 <comment>FK to a new civicrm_option_value (account_relationship)</comment>
7611ae71
AS
52 <pseudoconstant>
53 <optionGroupName>account_relationship</optionGroupName>
54 </pseudoconstant>
614d72ec 55 <html>
e0991796 56 <type>Select</type>
614d72ec 57 </html>
3c7d2158 58 </field>
6a488035 59 <field>
3c7d2158 60 <name>financial_account_id</name>
61 <type>int unsigned</type>
f3ea5182 62 <title>Financial Account</title>
6a488035 63 <required>true</required>
3c7d2158 64 <add>4.3</add>
6a488035 65 <comment>FK to the financial_account_id</comment>
7611ae71
AS
66 <pseudoconstant>
67 <table>civicrm_financial_account</table>
68 <keyColumn>id</keyColumn>
69 <labelColumn>name</labelColumn>
70 </pseudoconstant>
614d72ec 71 <html>
e0991796 72 <type>Select</type>
614d72ec 73 </html>
6a488035 74 </field>
3c7d2158 75 <foreignKey>
76 <name>financial_account_id</name>
77 <table>civicrm_financial_account</table>
78 <key>id</key>
79 <add>4.3</add>
6a488035
TO
80 <onDelete>RESTRICT</onDelete>
81 </foreignKey>
5b3543ce
JM
82 <index>
83 <name>index_entity_id_entity_table_account_relationship</name>
84 <fieldName>entity_id</fieldName>
85 <fieldName>entity_table</fieldName>
86 <fieldName>account_relationship</fieldName>
87 <unique>true</unique>
88 <add>4.7</add>
89 </index>
6a488035 90</table>