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

Subledgers

SyntheticData generates subsidiary ledger records for Accounts Receivable (AR), Accounts Payable (AP), Fixed Assets (FA), and Inventory, with automatic GL reconciliation and document flow linking.

Overview

Subledger generators produce detailed records that reconcile back to GL control accounts:

SubledgerControl AccountRecord TypesOutput Files
AR1100 (AR Control)Open items, aging, receipts, credit memos, dunningar_open_items.csv, ar_aging.csv
AP2000 (AP Control)Open items, aging, payment scheduling, debit memosap_open_items.csv, ap_aging.csv
FA1600+ (Asset accounts)Register, depreciation, acquisitions, disposalsfa_register.csv, fa_depreciation.csv
Inventory1300 (Inventory)Positions, movements (22 types), valuationinventory_positions.csv, inventory_movements.csv

Configuration

subledger:
  enabled: true
  ar:
    enabled: true
    aging_buckets: [30, 60, 90, 120]    # Days
    dunning_levels: 3
    credit_memo_rate: 0.05               # 5% of invoices get credit memos
  ap:
    enabled: true
    aging_buckets: [30, 60, 90, 120]
    early_payment_discount_rate: 0.02
    payment_scheduling: true
  fa:
    enabled: true
    depreciation_methods:
      - straight_line
      - declining_balance
      - sum_of_years_digits
    disposal_rate: 0.03                  # 3% of assets disposed per year
  inventory:
    enabled: true
    valuation_method: standard_cost      # standard_cost, moving_average, fifo, lifo
    cycle_count_frequency: monthly

Accounts Receivable (AR)

Record Types

The AR subledger generates:

  • Open Items: Outstanding customer invoices with aging classification
  • Receipts: Customer payments applied to invoices (full, partial, on-account)
  • Credit Memos: Credits issued for returns, disputes, or pricing adjustments
  • Aging Reports: Aged balances by customer and aging bucket
  • Dunning Notices: Automated collection notices at configurable levels

Open Item Fields

FieldDescription
customer_idCustomer reference
invoice_numberDocument number
invoice_dateIssue date
due_datePayment due date
original_amountInvoice total
open_amountRemaining balance
currencyInvoice currency
payment_termsNet 30, Net 60, etc.
aging_bucket0-30, 31-60, 61-90, 91-120, 120+
dunning_levelCurrent dunning level (0-3)
last_dunning_dateDate of last dunning notice
dispute_flagWhether item is disputed

Aging Buckets

Default aging buckets classify receivables by days past due:

BucketRangeTypical %
Current0-30 days65-75%
31-6031-60 days12-18%
61-9061-90 days5-8%
91-12091-120 days2-4%
120+Over 120 days1-3%

Dunning Process

Dunning generates progressively urgent collection notices:

LevelDays OverdueAction
00-30No action (within terms)
131-60Friendly reminder
261-90Formal notice
390+Final demand / collections

Document Flow Integration

AR open items are created from O2C customer invoices:

Sales Order → Delivery → Customer Invoice → AR Open Item → Customer Receipt
                                                 │
                                                 └→ Dunning Notice (if overdue)

Accounts Payable (AP)

Record Types

The AP subledger generates:

  • Open Items: Outstanding vendor invoices with aging and payment scheduling
  • Payments: Vendor payment runs (check, wire, ACH)
  • Debit Memos: Deductions for quality issues, returns, pricing errors
  • Aging Reports: Aged payables by vendor
  • Payment Scheduling: Planned payments considering cash flow and discounts

Open Item Fields

FieldDescription
vendor_idVendor reference
invoice_numberVendor invoice number
invoice_dateInvoice receipt date
due_datePayment due date
baseline_dateDate for terms calculation
original_amountInvoice total
open_amountRemaining balance
currencyInvoice currency
payment_terms2/10 Net 30, etc.
discount_dateDiscount deadline
discount_amountAvailable discount
payment_blockBlock code (if blocked)
three_way_match_statusMatched / Variance / Blocked

Early Payment Discounts

The AP generator models cash discount optimization:

Payment Terms: 2/10 Net 30
  → Pay within 10 days: 2% discount
  → Pay by day 30: full amount
  → Past day 30: overdue

early_payment_discount_rate: 0.02   # Take 2% discount when offered

Payment Scheduling

When enabled, the AP generator creates a payment schedule that optimizes:

  • Discount capture: Prioritize invoices with expiring discounts
  • Cash flow: Spread payments across the period
  • Vendor priority: Pay critical vendors first

Document Flow Integration

AP open items are created from P2P vendor invoices:

Purchase Order → Goods Receipt → Vendor Invoice → Three-Way Match → AP Open Item → Payment
                                                                          │
                                                                          └→ Debit Memo (if variance)

Fixed Assets (FA)

Record Types

The FA subledger generates:

  • Asset Register: Master record for each fixed asset
  • Depreciation Schedule: Monthly depreciation entries per asset
  • Acquisitions: New asset additions (from PO or direct capitalization)
  • Disposals: Asset retirements, sales, scrapping
  • Transfers: Inter-company or inter-department transfers
  • Impairment: Write-downs when fair value drops below book value

Asset Register Fields

FieldDescription
asset_idUnique identifier
descriptionAsset name/description
asset_classBuildings, Equipment, Vehicles, IT, Furniture
acquisition_datePurchase/capitalization date
acquisition_costOriginal cost
useful_life_yearsDepreciable life
salvage_valueResidual value
depreciation_methodMethod used
accumulated_depreciationTotal depreciation to date
net_book_valueCurrent carrying value
disposal_dateDate retired (if applicable)
disposal_proceedsSale price (if sold)
disposal_gain_lossGain or loss on disposal

Depreciation Methods

MethodDescriptionUse Case
StraightLineEqual amounts each periodDefault, most common
DecliningBalance { rate }Fixed percentage of remaining balanceAccelerated (tax)
SumOfYearsDigitsDecreasing fractions of depreciable baseAccelerated
UnitsOfProduction { total_units }Based on usage/outputManufacturing equipment
NoneNo depreciationLand, construction in progress

Depreciation Journal Entries

Each period, the FA generator creates depreciation entries:

DebitCreditAmount
Depreciation Expense (6xxx)Accumulated Depreciation (1650)Period depreciation

Disposal Accounting

When an asset is disposed:

ScenarioDebitCredit
Sale at gainCash, Accum DeprAsset Cost, Gain on Disposal
Sale at lossCash, Accum Depr, Loss on DisposalAsset Cost
ScrappingAccum Depr, Loss on DisposalAsset Cost

Inventory

Record Types

The Inventory subledger generates:

  • Positions: Current stock levels by material, plant, and storage location
  • Movements: 22 movement types covering receipts, issues, transfers, and adjustments
  • Valuation: Inventory value calculated using configurable valuation methods

Position Fields

FieldDescription
material_idMaterial reference
plantPlant/warehouse code
storage_locationStorage location within plant
quantityUnits on hand
unit_of_measureUOM
unit_costPer-unit cost
total_valueExtended value
valuation_methodStandardCost, MovingAverage, FIFO, LIFO
stock_statusUnrestricted, QualityInspection, Blocked
last_movement_dateDate of last stock change

Movement Types (22 types)

CategoryMovement TypeDescription
Goods ReceiptGoodsReceiptPOReceipt against purchase order
GoodsReceiptProductionReceipt from production order
GoodsReceiptOtherReceipt without reference
GoodsReceiptGeneric goods receipt
ReturnsReturnToVendorReturn materials to vendor
Goods IssueGoodsIssueSalesIssue for sales order / delivery
GoodsIssueProductionIssue to production order
GoodsIssueCostCenterIssue to cost center (consumption)
GoodsIssueScrappingScrap disposal
GoodsIssueGeneric goods issue
ScrapAlias for scrapping
TransfersTransferPlantBetween plants
TransferStorageLocationBetween storage locations
TransferInInbound transfer
TransferOutOutbound transfer
TransferToInspectionMove to quality inspection
TransferFromInspectionRelease from quality inspection
AdjustmentsPhysicalInventoryPhysical count difference
InventoryAdjustmentInPositive adjustment
InventoryAdjustmentOutNegative adjustment
InitialStockInitial stock entry
ReversalsReversalGoodsReceiptReverse a goods receipt
ReversalGoodsIssueReverse a goods issue

Valuation Methods

MethodDescriptionUse Case
StandardCostFixed cost per unit, variances posted separatelyManufacturing
MovingAverageWeighted average of all receiptsGeneral purpose
FIFOFirst-in, first-out costingPerishable goods
LIFOLast-in, first-out costingTax optimization (where permitted)

Cycle Counting (v0.6.0)

The cycle_count_frequency setting controls how often physical inventory counts are performed. Cycle counting generates PhysicalInventory movement records that reconcile book quantities against counted quantities:

subledger:
  inventory:
    enabled: true
    cycle_count_frequency: monthly     # monthly, quarterly, annual
FrequencyBehavior
monthlyEach storage location counted once per month on a rolling basis
quarterlyFull count once per quarter, with high-value items counted monthly
annualSingle year-end wall-to-wall count

Cycle count differences generate adjustment entries (InventoryAdjustmentIn or InventoryAdjustmentOut) and are flagged in the quality labels output for audit trail analysis.

Quality Inspection (v0.6.0)

Inventory positions can be placed in quality inspection status via TransferToInspection movements. This models the inspection hold process common in manufacturing and pharmaceutical industries:

Goods Receipt → Transfer to Inspection → QC Hold → Transfer from Inspection → Unrestricted Use
                                                 └→ Scrap (if rejected)

The rate of items routed through inspection depends on the material type and vendor scorecard grades (when source_to_pay is enabled). Materials from vendors with grade C or lower are routed through inspection at a higher rate.

Inventory Journal Entries

MovementDebitCredit
Goods Receipt (PO)InventoryGR/IR Clearing
Goods Issue (Sales)COGSInventory
Goods Issue (Production)WIPInventory
ScrapScrap ExpenseInventory
Physical Count (surplus)InventoryInventory Adjustment
Physical Count (shortage)Inventory AdjustmentInventory

GL Reconciliation

The subledger generators ensure that subledger balances reconcile to GL control accounts:

GL Control Account Balance = Σ Subledger Open Items

AR Control (1100) = Σ AR Open Items
AP Control (2000) = Σ AP Open Items
Inventory  (1300) = Σ Inventory Position Values
FA Gross   (1600) = Σ FA Acquisition Costs
Accum Depr (1650) = Σ FA Accumulated Depreciation

Reconciliation is validated by the datasynth-eval coherence module and any differences are flagged as potential data quality issues.

Output Files

FileContent
subledgers/ar_open_items.csvAR outstanding invoices
subledgers/ar_aging.csvAR aging analysis
subledgers/ap_open_items.csvAP outstanding invoices
subledgers/ap_aging.csvAP aging analysis
subledgers/fa_register.csvFixed asset master records
subledgers/fa_depreciation.csvDepreciation schedule entries
subledgers/inventory_positions.csvCurrent stock positions
subledgers/inventory_movements.csvStock movement history

See Also