Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Period Close Engine

Generate period-end accounting processes.

Overview

The period close engine simulates:

  • Monthly close (accruals, depreciation)
  • Quarterly close (IC elimination, translation)
  • Annual close (closing entries, retained earnings)

Configuration

period_close:
  enabled: true

  monthly:
    accruals: true
    depreciation: true
    reconciliation: true

  quarterly:
    intercompany_elimination: true
    currency_translation: true

  annual:
    closing_entries: true
    retained_earnings: true

Monthly Close

Accruals

Generate reversing accrual entries:

period_close:
  monthly:
    accruals:
      enabled: true
      auto_reverse: true             # Reverse next period

      categories:
        expense_accrual: 0.4
        revenue_accrual: 0.2
        payroll_accrual: 0.3
        other: 0.1

Expense Accrual:

Period 1 (accrue):
    Dr Expense                     10,000
        Cr Accrued Liabilities     10,000

Period 2 (reverse):
    Dr Accrued Liabilities         10,000
        Cr Expense                 10,000

Depreciation

Calculate and post monthly depreciation:

period_close:
  monthly:
    depreciation:
      enabled: true
      run_date: last_day            # When in period

      methods:
        straight_line: 0.7
        declining_balance: 0.2
        units_of_production: 0.1

Depreciation Entry:

    Dr Depreciation Expense          5,000
        Cr Accumulated Depreciation  5,000

Subledger Reconciliation

Verify subledger-to-GL control accounts:

period_close:
  monthly:
    reconciliation:
      enabled: true

      checks:
        - subledger: ar
          control_account: "1100"
        - subledger: ap
          control_account: "2000"
        - subledger: inventory
          control_account: "1200"

Reconciliation Report:

SubledgerControl AccountSubledger BalanceGL BalanceDifference
AR1100500,000500,0000
AP2000(300,000)(300,000)0

Quarterly Close

IC Elimination

Generate consolidation eliminations:

period_close:
  quarterly:
    intercompany_elimination:
      enabled: true

      types:
        - revenue_expense            # Eliminate IC sales
        - unrealized_profit          # Eliminate IC inventory profit
        - receivable_payable         # Eliminate IC balances
        - dividends                  # Eliminate IC dividends

See Intercompany Processing for details.

Currency Translation

Translate foreign subsidiary balances:

period_close:
  quarterly:
    currency_translation:
      enabled: true
      method: current_rate           # current_rate, temporal

      rate_mapping:
        assets: closing_rate
        liabilities: closing_rate
        equity: historical_rate
        revenue: average_rate
        expense: average_rate

      cta_account: "3500"            # CTA equity account

Translation Entry (CTA):

If foreign currency strengthened:
    Dr Foreign Subsidiary Investment  10,000
        Cr CTA (Other Comprehensive)  10,000

Annual Close

Closing Entries

Close temporary accounts to retained earnings:

period_close:
  annual:
    closing_entries:
      enabled: true
      close_revenue: true
      close_expense: true
      income_summary_account: "3900"

Closing Sequence:

1. Close Revenue:
    Dr Revenue accounts (all)      1,000,000
        Cr Income Summary          1,000,000

2. Close Expenses:
    Dr Income Summary                800,000
        Cr Expense accounts (all)    800,000

3. Close Income Summary:
    Dr Income Summary                200,000
        Cr Retained Earnings         200,000

Retained Earnings

Update retained earnings:

period_close:
  annual:
    retained_earnings:
      enabled: true
      account: "3100"
      dividend_account: "3150"

Year-End Adjustments

Additional adjusting entries:

period_close:
  annual:
    adjustments:
      - type: bad_debt_provision
        rate: 0.02                   # 2% of AR

      - type: inventory_reserve
        rate: 0.01                   # 1% of inventory

      - type: bonus_accrual
        rate: 0.10                   # 10% of salary expense

Financial Statements (v0.6.0)

The period close engine can now generate full financial statement sets from the adjusted trial balance. This is controlled by the financial_reporting configuration section.

Balance Sheet

Generates a statement of financial position with current/non-current asset and liability classifications:

Assets                              Liabilities & Equity
├── Current Assets                  ├── Current Liabilities
│   ├── Cash & Equivalents          │   ├── Accounts Payable
│   ├── Accounts Receivable         │   ├── Accrued Liabilities
│   └── Inventory                   │   └── Current Debt
├── Non-Current Assets              ├── Non-Current Liabilities
│   ├── Fixed Assets (net)          │   └── Long-Term Debt
│   └── Intangibles                 └── Equity
Total Assets = Total L + E              ├── Common Stock
                                        └── Retained Earnings

Income Statement

Generates a multi-step income statement:

Revenue
- Cost of Goods Sold
= Gross Profit
- Operating Expenses
= Operating Income
+/- Other Income/Expense
= Income Before Tax
- Income Tax
= Net Income

Cash Flow Statement

Generates an indirect-method cash flow statement with three categories:

financial_reporting:
  generate_cash_flow: true

Categories:

  • Operating: Net income + non-cash adjustments + working capital changes
  • Investing: Capital expenditures, asset disposals
  • Financing: Debt proceeds/repayments, equity transactions, dividends

Statement of Changes in Equity

Tracks equity movements across the period:

  • Opening retained earnings
  • Net income for the period
  • Dividends declared
  • Other comprehensive income (CTA, unrealized gains)
  • Closing retained earnings

Management KPIs

When financial_reporting.management_kpis is enabled, computes financial ratios:

  • Liquidity: Current ratio, quick ratio, cash ratio
  • Profitability: Gross margin, operating margin, net margin, ROA, ROE
  • Efficiency: Inventory turnover, AR turnover, AP turnover, days sales outstanding
  • Leverage: Debt-to-equity, debt-to-assets, interest coverage

Budgets

When financial_reporting.budgets is enabled, generates budget records with variance analysis:

financial_reporting:
  budgets:
    enabled: true
    variance_threshold: 0.10    # Flag variances > 10%

Produces budget vs. actual comparisons by account and period, with favorable/unfavorable variance flags.

Output Files

trial_balances/YYYY_MM.csv

FieldDescription
account_numberGL account
account_nameAccount description
opening_balancePeriod start
period_debitsTotal debits
period_creditsTotal credits
closing_balancePeriod end

accruals.csv

FieldDescription
accrual_idUnique ID
accrual_typeCategory
periodAccrual period
amountAccrual amount
reversal_periodWhen reversed
entry_idRelated JE ID

depreciation.csv

FieldDescription
asset_idFixed asset
periodDepreciation period
methodDepreciation method
depreciation_amountPeriod expense
accumulated_totalRunning total
net_book_valueRemaining value

closing_entries.csv

FieldDescription
entry_idClosing entry ID
entry_typeRevenue, expense, summary
accountAccount closed
amountClosing amount
fiscal_yearYear closed

financial_statements.csv (v0.6.0)

FieldDescription
statement_idUnique statement identifier
statement_typebalance_sheet, income_statement, cash_flow, changes_in_equity
company_codeCompany code
period_endStatement date
basisus_gaap, ifrs, statutory
line_codeLine item code
labelDisplay label
sectionStatement section
amountCurrent period amount
amount_priorPrior period amount

bank_reconciliations.csv (v0.6.0)

FieldDescription
reconciliation_idUnique reconciliation ID
company_codeCompany code
bank_accountBank account identifier
period_startReconciliation period start
period_endReconciliation period end
opening_balanceOpening bank balance
closing_balanceClosing bank balance
statusin_progress, completed, completed_with_exceptions

management_kpis.csv (v0.6.0)

FieldDescription
company_codeCompany code
periodReporting period
kpi_nameRatio name (e.g., current_ratio, gross_margin)
kpi_valueComputed ratio value
categoryliquidity, profitability, efficiency, leverage

Close Schedule

Month 1-11:
├── Accruals
├── Depreciation
└── Reconciliation

Month 3, 6, 9:
├── IC Elimination
└── Currency Translation

Month 12:
├── All monthly tasks
├── All quarterly tasks
├── Year-end adjustments
└── Closing entries

Example Configuration

Full Close Cycle

global:
  start_date: 2024-01-01
  period_months: 12

period_close:
  enabled: true

  monthly:
    accruals:
      enabled: true
      auto_reverse: true
    depreciation:
      enabled: true
    reconciliation:
      enabled: true

  quarterly:
    intercompany_elimination:
      enabled: true
    currency_translation:
      enabled: true

  annual:
    closing_entries:
      enabled: true
    retained_earnings:
      enabled: true
    adjustments:
      - type: bad_debt_provision
        rate: 0.02

See Also