pub struct ProfitCenter {
pub id: String,
pub name: String,
pub parent_id: Option<String>,
pub company_code: String,
pub responsible_person: Option<String>,
pub category: ProfitCenterCategory,
pub segment_code: Option<String>,
pub level: u8,
pub is_active: bool,
}Expand description
A profit centre node in the organisational profit hierarchy.
Profit centres are arranged in a two-level tree:
- Level 1 (parent): represents a business segment, geographic region,
or major product-line group. These have
parent_id == None. - Level 2 (child): represents a sub-segment, sub-region, or
individual product line. These have
parent_id == Some(...).
Mapping to SAP CEPC: id → PRCTR, name → KTEXT,
responsible_person → VERAK_USER, company_code →
(resolved through controlling area KOKRS), is_active == false
→ LOKKZ (locked) flag.
Fields§
§id: StringUnique profit centre identifier (e.g., “PC-C001-EMEA-DACH”)
name: StringHuman-readable name (e.g., “EMEA / DACH region”)
parent_id: Option<String>Parent profit centre ID for level-2 nodes; None for level-1
segment / region nodes.
company_code: StringCompany code this profit centre belongs to.
responsible_person: Option<String>Employee ID of the manager responsible for this profit centre.
category: ProfitCenterCategoryFunctional category of this profit centre.
segment_code: Option<String>Reporting segment code — used by IFRS 8 / ASC 280 segment
reconciliation. Multiple level-2 profit centres can roll up to
the same segment. None means the profit centre is not
individually reported (e.g., it sits within a larger segment).
level: u8Hierarchy level (1 = top-level segment/region, 2 = sub-unit).
is_active: boolWhether this profit centre is currently active.
Implementations§
Source§impl ProfitCenter
impl ProfitCenter
Sourcepub fn top_level(
id: impl Into<String>,
name: impl Into<String>,
company_code: impl Into<String>,
category: ProfitCenterCategory,
) -> Self
pub fn top_level( id: impl Into<String>, name: impl Into<String>, company_code: impl Into<String>, category: ProfitCenterCategory, ) -> Self
Create a new level-1 (top-level segment / region / product group) profit centre.
Sourcepub fn sub_unit(
id: impl Into<String>,
name: impl Into<String>,
parent_id: impl Into<String>,
company_code: impl Into<String>,
category: ProfitCenterCategory,
) -> Self
pub fn sub_unit( id: impl Into<String>, name: impl Into<String>, parent_id: impl Into<String>, company_code: impl Into<String>, category: ProfitCenterCategory, ) -> Self
Create a new level-2 (sub-unit) profit centre.
Sourcepub fn with_segment(self, segment_code: impl Into<String>) -> Self
pub fn with_segment(self, segment_code: impl Into<String>) -> Self
Attach a segment code (IFRS 8 / ASC 280 reportable segment).
Sourcepub fn with_responsible_person(self, person_id: impl Into<String>) -> Self
pub fn with_responsible_person(self, person_id: impl Into<String>) -> Self
Attach a responsible person.
Trait Implementations§
Source§impl Clone for ProfitCenter
impl Clone for ProfitCenter
Source§fn clone(&self) -> ProfitCenter
fn clone(&self) -> ProfitCenter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more