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 moreSource§impl Debug for ProfitCenter
impl Debug for ProfitCenter
Source§impl<'de> Deserialize<'de> for ProfitCenter
impl<'de> Deserialize<'de> for ProfitCenter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProfitCenter
impl RefUnwindSafe for ProfitCenter
impl Send for ProfitCenter
impl Sync for ProfitCenter
impl Unpin for ProfitCenter
impl UnsafeUnpin for ProfitCenter
impl UnwindSafe for ProfitCenter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.