What a dimension is
A dimension has a name and an entity type that determines its values. Dimensions are scoped by company group. A posted journal line can contain at most one value for each dimension. The full set of entity types (dimensionEntityTypes in apps/erp/app/modules/accounting/accounting.models.ts): CostCenter, Custom, Customer, CustomerType, Department, Employee, FixedAssetClass, Item, ItemPostingGroup, Location, Process, Project, ScrapReason, Supplier, SupplierType, WorkCenter.
A dimension carries two flags: active (an inactive dimension stops being attached to new postings) and required. Names are unique per company group.
How a value lands on a journal line
Each tag on a journal line is a pair of a dimension and a value id. That value id is deliberately polymorphic — for aCustom dimension it is the id of one of the dimension’s values; for an entity-type dimension it is the entity row’s own id (a location, a customer, a cost center). The reference target depends on the dimension’s entity type and is resolved in application code. A line holds at most one value per dimension.
Operational posting resolves dimensions automatically:
- It loads every active dimension for the company group into a map keyed by entity type.
- As it builds each journal line, it already knows the source facts — the customer, the item, the item posting group, the location, the cost center behind that line.
- For each of those facts, if an active dimension exists for that entity type, it attaches a tag pointing the value at that entity’s id No dimension defined for an axis means no tag on that axis — defining the dimension is what turns tagging on.
Location dimension is not entered on each shipment. After the dimension is defined, shipment, receipt, invoice, and inventory postings attach the location already present on the source document. Other posting functions use the same pattern.
Cost centers
A cost center is a named organizational unit for grouping cost — a plant, a line, a service team. Cost centers form a hierarchy: each one may name aparentCostCenterId, so you can roll child centers up into a parent. Each carries an owner (ownerId, a user) responsible for it.
Cost centers play two roles:
- A standalone tree (scoped by company) you assign to purchase lines and other records to attribute spend to the responsible unit.
- A dimension axis. Define a dimension with
entityType: "CostCenter"and postings begin tagging their journal lines with the cost center the source document carries — exactly like any other entity-type dimension. That’s how cost-center-level P&L reporting works: the cost center is a tag on the line, resolved from the document at posting time.
Using dimensions in reports
Reports built from journal lines can group or filter by dimension value, such as COGS by location, expense by department, or revenue by customer. This keeps the chart of accounts compact: post to one COGS account and segment it with theLocation dimension.
Because dimension slicing reads posted journal lines, it’s only meaningful once a period’s postings are final. See period close for how a month’s balances get snapshotted.