Skip to main content

Overview

Companies represent legal entities within an organization. Each company has its own:
  • Functional currency (primary operating currency)
  • Chart of accounts (accounts are company-specific)
  • Fiscal year end (defines fiscal periods)
  • Jurisdiction (country of incorporation/operation)
Companies are the primary scope for accounting operations. Journal entries, accounts, and fiscal periods are all scoped to a company.

Company Data Model

packages/core/src/company/Company.ts
export class Company extends Schema.Class<Company>("Company")({
  id: CompanyId,
  organizationId: OrganizationId,
  name: Schema.NonEmptyTrimmedString,
  legalName: Schema.NonEmptyTrimmedString,
  jurisdiction: JurisdictionCode,
  functionalCurrency: CurrencyCode,
  reportingCurrency: CurrencyCode,
  fiscalYearEnd: FiscalYearEnd,
  isActive: Schema.Boolean,
  // ... additional fields
})

Core Properties

id
CompanyId (UUID)
required
Unique identifier for the company
organizationId
OrganizationId
required
Reference to parent organization
name
string
required
Display name of the company (e.g., “Acme Corp”)
Legal registered name (e.g., “Acme Corporation, Inc.”)
jurisdiction
JurisdictionCode
required
Country of incorporation (ISO 3166-1 alpha-2 code like “US”, “GB”, “DE”)
functionalCurrency
CurrencyCode
required
Primary operating currency per ASC 830 (ISO 4217 code)
reportingCurrency
CurrencyCode
required
Currency used for financial statements (often same as functional currency)
fiscalYearEnd
FiscalYearEnd
required
Fiscal year end date (month and day)
isActive
boolean
required
Whether the company is currently active

Optional Properties

taxId
string
Tax identification number (EIN, VAT number, etc.)
incorporationDate
LocalDate
Date when the company was legally incorporated
registrationNumber
string
Company registration number for the jurisdiction
registeredAddress
Address
Official legal address where the company is registered
industryCode
string
NAICS or SIC industry classification code
companyType
CompanyType
Legal structure (Corporation, LLC, Partnership, etc.)
incorporationJurisdiction
JurisdictionCode
Jurisdiction where incorporated (if different from operating jurisdiction)
retainedEarningsAccountId
AccountId
Account for posting net income during year-end close

Company Types

Companies can have different legal structures:
packages/core/src/company/CompanyType.ts
export const CompanyType = Schema.Literal(
  "Corporation",
  "LLC",
  "Partnership",
  "SoleProprietorship",
  "NonProfit",
  "Cooperative",
  "Branch",
  "Other"
)
C-Corp, S-Corp, or public company with shareholders

Fiscal Year End

The fiscal year end defines when the company’s fiscal year closes:
packages/core/src/company/Company.ts
export class FiscalYearEnd extends Schema.Class<FiscalYearEnd>("FiscalYearEnd")({
  month: Schema.Number.pipe(Schema.int(), Schema.between(1, 12)),
  day: Schema.Number.pipe(Schema.int(), Schema.between(1, 31))
})

Common Fiscal Year Ends

const CALENDAR_YEAR_END = FiscalYearEnd.make({ month: 12, day: 31 })
Most common for US companies. Fiscal year = calendar year.
const FISCAL_YEAR_END_MARCH = FiscalYearEnd.make({ month: 3, day: 31 })
Common in UK, India, Japan. Aligns with government fiscal year.
const FISCAL_YEAR_END_JUNE = FiscalYearEnd.make({ month: 6, day: 30 })
Common for educational institutions and governments in US, Australia.
const FISCAL_YEAR_END_SEPTEMBER = FiscalYearEnd.make({ month: 9, day: 30 })
US federal government fiscal year.

Display Format

const fye = FiscalYearEnd.make({ month: 12, day: 31 })

fye.isCalendarYearEnd  // true
fye.toDisplayString()  // "December 31"

Functional vs Reporting Currency

Functional currency and reporting currency are distinct concepts per ASC 830:

Functional Currency

The currency of the primary economic environment in which the entity operates:
  • Currency in which company generates revenue
  • Currency in which company incurs expenses
  • Currency of financing and investing activities
Functional currency cannot be changed after initial setup. It reflects the economic reality of the company’s operations.

Reporting Currency

The currency used for presenting financial statements:
  • May differ from functional currency
  • Used for consolidated group reporting
  • Translation adjustments recorded in equity (OCI)
1

Same Currency Scenario

US subsidiary with USD functional currency and USD reporting currencyNo translation needed - amounts recorded directly
2

Different Currency Scenario

UK subsidiary with GBP functional currency and USD reporting currencyTranslation required - use current rate method (ASC 830)

Creating a Company

UI Workflow

The company creation form includes multiple sections:
  • Company Name (required)
  • Legal Name (required)
  • Jurisdiction (required, searchable dropdown)
  • Tax ID (optional)
  • Incorporation Date (optional)
  • Registration Number (optional)

Form Component

packages/web/src/components/forms/CompanyForm.tsx
export function CompanyForm({
  currencies,          // Currency options
  jurisdictions,       // Jurisdiction options
  onSubmit,            // Submit handler
  onCancel,            // Cancel handler
  defaultCurrency      // Default from organization
}: CompanyFormProps)
Auto-Fill Features:
  • When jurisdiction is selected, functional currency auto-fills from jurisdiction’s default
  • Reporting currency defaults to same as functional currency
  • Fiscal year end defaults to December 31

API Request

const { data, error } = await api.POST('/api/v1/companies', {
  body: {
    organizationId,
    name: "Acme UK Ltd",
    legalName: "Acme UK Limited",
    jurisdiction: "GB",
    taxId: "GB123456789",
    functionalCurrency: "GBP",
    reportingCurrency: "USD",
    fiscalYearEnd: { month: 3, day: 31 },
    companyType: "LLC"
  }
})

Company Hierarchies

Accountability supports complex company structures through consolidation groups rather than parent-child relationships on companies themselves.
This design allows:
  • Multiple consolidation scenarios for the same company
  • Different ownership percentages in different contexts
  • Flexible consolidation methods (full, equity, cost, VIE)
See the Consolidation documentation for details on defining parent-subsidiary relationships.

Retained Earnings Account

The retainedEarningsAccountId field specifies where net income is posted during year-end close:
company.retainedEarningsAccountId  // Option<AccountId>
company.hasRetainedEarningsAccount // boolean getter
1

Automatic Configuration

When applying a Chart of Accounts template, the retained earnings account is automatically identified by the isRetainedEarnings flag
2

Manual Configuration

Can be manually set in company settings to point to any Equity account with category “RetainedEarnings”
3

Year-End Close

During year-end close, all Revenue and Expense accounts are closed to the retained earnings account

Best Practices

Use the currency that best reflects the company’s economic environment:Correct: UK subsidiary operates primarily in UK → GBPIncorrect: UK subsidiary operates in UK but parent is in US → Don’t use USD as functional currency just because parent uses USDReporting currency can be USD for consolidation purposes.
Consider:
  • Industry norms: Retail often uses January 31 (post-holiday season)
  • Tax year alignment: Match jurisdiction’s tax year for simpler compliance
  • Seasonal business cycles: End fiscal year after busy season for accurate results

Technical Details

Helper Methods

packages/core/src/company/Company.ts
const company = Company.make({ /* ... */ })

// Check if functional and reporting currencies match
company.hasSameFunctionalAndReportingCurrency  // boolean

// Check if retained earnings account is configured
company.hasRetainedEarningsAccount  // boolean

Type Guards

import { isCompany, isCompanyId, isCompanyType } from "@accountability/core/company"

if (isCompany(value)) {
  // value is Company
}

if (isCompanyType("Corporation")) {
  // valid company type
}

Build docs developers (and LLMs) love