Skip to content

KB-352 — Accounting Traceability

Version: 1.0
Status: Approved
Author: BLACK ERP Engineering
Category: Technical Accounting Certification


Purpose

This document describes the complete accounting traceability of ADempiere.

Its objective is to explain how a business transaction becomes an accounting entry, following the entire execution path from the business document through the Accounting Engine until the accounting information is permanently stored inside FACT_ACCT and later consumed by financial reports.

Unlike KB-212, which explains the Accounting Engine architecture, this document focuses on traceability, allowing consultants and developers to understand exactly where accounting information is generated, persisted and later consumed.


End-to-End Accounting Traceability

Every accounting transaction follows exactly the same lifecycle.

Business Process

        │

        ▼

Business Document

        │

        ▼

Document Engine

        │

        ▼

Doc_*

        │

        ▼

createFacts()

        │

        ▼

Fact

        │

        ▼

FactLine

        │

        ▼

FACT_ACCT

        │

        ▼

Accounting Information Window

        │

        ▼

General Ledger

        │

        ▼

Trial Balance

        │

        ▼

Financial Statements

This flow represents the complete accounting lifecycle inside ADempiere.


Stage 1 — Business Document

Everything begins with an operational document.

Examples:

  • Purchase Invoice
  • Sales Invoice
  • Material Receipt
  • Customer Shipment
  • Payment
  • Allocation
  • Journal Entry
  • Inventory Adjustment

At this stage, no accounting has yet been generated.


Stage 2 — Document Engine

When the document is completed, the Document Engine determines whether the document is account-controlled.

If accounting is required, the engine invokes the appropriate accounting class.

Examples:

Business Document Accounting Class
Purchase Invoice Doc_Invoice
Sales Invoice Doc_Invoice
Payment Doc_Payment
Allocation Doc_AllocationHdr
Material Receipt Doc_InOut

Stage 3 — createFacts()

Every accounting class implements the createFacts() method.

This method contains the accounting rules for the document.

Responsibilities include:

  • Resolve accounts
  • Calculate debit amounts
  • Calculate credit amounts
  • Determine accounting dimensions
  • Build Fact objects

At this point, accounting still exists only in memory.


Stage 4 — Fact

The Fact object represents a complete accounting entry.

One Fact corresponds to one accounting document.

Example:

Purchase Invoice

Fact

    │

    ├── FactLine

    ├── FactLine

    └── FactLine

Stage 5 — FactLine

Each FactLine represents a single accounting movement.

Typical information stored in a FactLine includes:

  • Account
  • Debit
  • Credit
  • Product
  • Business Partner
  • Project
  • Organization

FactLines still exist only in memory.


Stage 6 — FACT_ACCT

After all FactLines are created, the Posting Engine persists them into FACT_ACCT.

At this moment, accounting becomes permanent.

Every FactLine becomes one row inside FACT_ACCT.

FactLine

↓

FACT_ACCT Row

This is the point where accounting officially exists inside the ERP.


Stage 7 — Accounting Information

The Accounting Information window does not calculate accounting.

Instead, it queries FACT_ACCT and displays previously stored accounting entries.

Therefore:

Accounting Information

=

FACT_ACCT

No accounting logic is executed when opening this window.


Stage 8 — Financial Reports

Financial reports also consume FACT_ACCT.

Examples include:

  • General Ledger
  • Trial Balance
  • Balance Sheet
  • Income Statement

All reports originate from the same accounting repository.


Purchase Example

Purchase Invoice

Doc_Invoice

createFacts()

FACT_ACCT

Accounting Information

General Ledger

Trial Balance


Sales Example

Sales Invoice

Doc_Invoice

createFacts()

FACT_ACCT

Accounting Information

Financial Statements


Payment Example

Payment

Doc_Payment

createFacts()

FACT_ACCT

Bank Reports


Allocation Example

Allocation

Doc_AllocationHdr

createFacts()

FACT_ACCT

VAT Reclassification


Technical Traceability

During BLACK ERP certification the following path was successfully validated.

Purchase Invoice

119.001 VAT Pending Payment

FACT_ACCT

Payment Allocation

118.001 VAT Paid

Exactly the same validation was performed for Sales.

Customer Invoice

209.001 VAT Not Collected

FACT_ACCT

Allocation

208.001 VAT Collected

This confirms that VAT Cash Basis accounting is not only visible in the ERP interface but also permanently stored inside FACT_ACCT.


Traceability Matrix

Layer Evidence
Business Process Purchase / Sales Cycle
Business Document Invoice / Payment / Allocation
Accounting Class Doc_*
Accounting Engine createFacts()
Memory Objects Fact / FactLine
Database FACT_ACCT
ERP Window Accounting Information
Financial Reports GL / Trial Balance / Financial Statements

Relationship with Other KB Documents

KB Description
KB-212 Accounting Engine Architecture
KB-350 Technical Accounting Certification Framework
KB-351 FACT_ACCT Anatomy
KB-353 SQL Validation Guide
KB-354 Cash Basis VAT Validation
KB-355 Accounting Audit Procedures

Conclusion

Accounting traceability provides complete visibility over the lifecycle of every accounting transaction generated by ADempiere.

Understanding this execution path enables consultants, developers and auditors to identify accounting issues, validate postings and demonstrate accounting integrity from the originating business document to the final financial reports.