LE:法人實體(LEGAL ENTITY)sql
OU:業務實體(OPERATING UNIT)架構
LEDGER:分類帳(LEDGER),即11i裏賬套(SOB)的概念oracle
LE、OU 是組織架構,Ledger和SLA是財務架構,SLA是把OU中的交易分錄到不一樣的Ledger上的一種方式。ide
在定義ledger的時候能夠爲一個ledger分配多個LE,一個LE也能夠有多個ledger(一個主分類帳,多個輔助分類帳),因此,理論上存在LE和Ledger多對多的關係。spa
GL_LEDGERS ip
分類帳定義get
GL_LEDGER_RELATIONSHIPS it
分類帳間關係io
GL_LEDGER_CONFIGURATIONS class
主分類帳
GL_LEDGER_CONFIG_DETAILS
主分類帳配置明細信息,含LE、輔助分類帳等設置
XLE_ENTITY_PROFILES
LE信息
GL_LEGAL_ENTITIES_BSVS
LE與公司段值集
OU與LE/ledger對應關係:
OU信息視圖中有默認業務實體及分類帳信息,即 HR_OPERATING_UNITS 中的 DEFAULT_LEGAL_CONTEXT_ID 和 SET_OF_BOOKS_ID:
HR_OPERATING_UNITS.DEFAULT_LEGAL_CONTEXT_ID = XLE_ENTITY_PROFILES.LEGAL_ENTITY_ID
HR_OPERATING_UNITS.SET_OF_BOOKS_ID = GL_LEDGERS.LEDGER_ID
LE與ledger對應關係:
關於LE與ledger的對應關係,oracle給出了一個視圖:GL_LEDGER_LE_V,關聯關係能夠在這個視圖裏找到
CREATE OR REPLACE VIEW GL_LEDGER_LE_V AS SELECT Lg.Ledger_Id, Lg.Name Ledger_Name, Lg.Short_Name Ledger_Short_Name, Cfgdet.Object_Id Legal_Entity_Id, Le.Name Legal_Entity_Name, Reg.Location_Id Location_Id, Hrloctl.Location_Code Location_Code, Hrloctl.Description Location_Description, Lg.Ledger_Category_Code, Lg.Currency_Code, Lg.Chart_Of_Accounts_Id, Lg.Period_Set_Name, Lg.Accounted_Period_Type, Lg.Sla_Accounting_Method_Code, Lg.Sla_Accounting_Method_Type, Lg.Bal_Seg_Value_Option_Code, Lg.Bal_Seg_Column_Name, Lg.Bal_Seg_Value_Set_Id, Cfg.Acctg_Environment_Code, Cfg.Configuration_Id, Rs.Primary_Ledger_Id, Rs.Relationship_Enabled_Flag FROM Gl_Ledger_Config_Details Primdet, Gl_Ledgers Lg, Gl_Ledger_Relationships Rs, Gl_Ledger_Configurations Cfg, Gl_Ledger_Config_Details Cfgdet, Xle_Entity_Profiles Le, Xle_Registrations Reg, Hr_Locations_All_Tl Hrloctl WHERE Rs.Application_Id = 101 AND ((Rs.Target_Ledger_Category_Code = 'SECONDARY' AND Rs.Relationship_Type_Code <> 'NONE') OR (Rs.Target_Ledger_Category_Code = 'PRIMARY' AND Rs.Relationship_Type_Code = 'NONE') OR (Rs.Target_Ledger_Category_Code = 'ALC' AND Rs.Relationship_Type_Code IN ('JOURNAL', 'SUBLEDGER'))) AND Lg.Ledger_Id = Rs.Target_Ledger_Id AND Lg.Ledger_Category_Code = Rs.Target_Ledger_Category_Code AND Nvl(Lg.Complete_Flag, 'Y') = 'Y' AND Primdet.Object_Id = Rs.Primary_Ledger_Id AND Primdet.Object_Type_Code = 'PRIMARY' AND Primdet.Setup_Step_Code = 'NONE' AND Cfg.Configuration_Id = Primdet.Configuration_Id AND Cfgdet.Configuration_Id(+) = Cfg.Configuration_Id AND Cfgdet.Object_Type_Code(+) = 'LEGAL_ENTITY' AND Le.Legal_Entity_Id(+) = Cfgdet.Object_Id AND Reg.Source_Id(+) = Cfgdet.Object_Id AND Reg.Source_Table(+) = 'XLE_ENTITY_PROFILES' AND Reg.Identifying_Flag(+) = 'Y' AND Hrloctl.Location_Id(+) = Reg.Location_Id AND Hrloctl.Language(+) = Userenv('LANG');