Download the PHP package azaharizaman/nexus-financial-statements without Composer
On this page you can find all versions of the php package azaharizaman/nexus-financial-statements. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download azaharizaman/nexus-financial-statements
More information about azaharizaman/nexus-financial-statements
Files in azaharizaman/nexus-financial-statements
Package nexus-financial-statements
Short Description Financial statement structures, templates, and validation for GAAP/IFRS compliance
License MIT
Informations about the package nexus-financial-statements
Nexus\FinancialStatements
Framework-Agnostic Financial Statement Generation Engine
Overview
Nexus\FinancialStatements is a pure PHP package that provides the core engine for generating, validating, and formatting financial statements. It supports multiple compliance frameworks (GAAP, IFRS, local standards) and produces Balance Sheets, Income Statements, Cash Flow Statements, Statements of Changes in Equity, and Notes to Financial Statements.
This package is framework-agnostic and contains no database access, no HTTP controllers, and no framework-specific code. Consuming applications provide data through injected interfaces.
Installation
Package Responsibilities
| Responsibility | Description |
|---|---|
| Statement Generation | Build complete financial statements from account balances |
| Multi-Framework Compliance | Support GAAP, IFRS, and custom compliance layouts |
| Section Organization | Group accounts into proper statement sections (Assets, Liabilities, etc.) |
| Validation | Ensure statements balance and meet compliance requirements |
| Export Adapters | Define contracts for PDF, Excel, HTML export (implementations in adapters) |
Key Concepts
Statement Types Supported
- Balance Sheet (Statement of Financial Position)
- Income Statement (Profit & Loss)
- Cash Flow Statement (Direct & Indirect methods)
- Statement of Changes in Equity
- Notes to Financial Statements
- Trial Balance
Compliance Frameworks
The package supports multiple compliance frameworks through layout templates:
- GAAP (US Generally Accepted Accounting Principles)
- IFRS (International Financial Reporting Standards)
- Custom (Tenant-defined layouts)
Architecture
Contracts (Interfaces)
Core Interfaces
FinancialStatementInterface
Base interface for all financial statement entities.
StatementBuilderInterface
Builds financial statements from raw account data.
StatementTemplateInterface
Defines the structure and layout of a statement type.
StatementValidatorInterface
Validates statement integrity and compliance.
ComplianceTemplateInterface
Provides compliance-specific formatting rules.
StatementDataProviderInterface
Contract for consuming applications to provide account data.
StatementExportAdapterInterface
Contract for export implementations (PDF, Excel, etc.).
Entities
BalanceSheet
Represents a Statement of Financial Position.
- Assets = Liabilities + Equity (must balance)
- Supports current/non-current classification
- Comparative period support
IncomeStatement
Represents a Profit & Loss statement.
- Revenue - Expenses = Net Income
- Supports single-step and multi-step formats
- Gross profit calculation
CashFlowStatement
Represents a Statement of Cash Flows.
- Operating, Investing, Financing activities
- Supports Direct and Indirect methods
- Beginning + Net Change = Ending Cash
StatementOfChangesInEquity
Tracks equity movements over a period.
- Opening equity balances
- Comprehensive income
- Dividends and distributions
- Share transactions
NotesToFinancialStatements
Supplementary disclosures and accounting policies.
TrialBalance
Pre-statement verification of account balances.
- Debits must equal Credits
- Used for period-end verification
StatementSection
Groups related line items within a statement.
- Section name and order
- Subtotal calculations
- Nested sub-sections support
Value Objects
LineItem
AccountBalance
StatementMetadata
StatementPeriod
ComplianceStandard
Enums
StatementType
StatementFormat
AccountCategory
CashFlowMethod
ComplianceFramework
Services
StatementValidator
Validates statement integrity:
- Balance Sheet: Assets = Liabilities + Equity
- Trial Balance: Debits = Credits
- Cash Flow: Beginning + Changes = Ending
SectionGrouper
Groups account balances into statement sections based on account categories and template definitions.
ComplianceChecker
Verifies statements meet compliance framework requirements:
- Required sections present
- Required disclosures included
- Proper account classifications
Layouts
Pre-built compliance layouts:
GaapBalanceSheetLayout- US GAAP balance sheet formatGaapIncomeStatementLayout- US GAAP income statement formatIfrsBalanceSheetLayout- IFRS balance sheet formatIfrsIncomeStatementLayout- IFRS income statement format
Exceptions
| Exception | When Thrown |
|---|---|
StatementImbalanceException |
Balance sheet doesn't balance (A ≠ L + E) |
InvalidLineItemException |
Line item data is invalid |
InvalidSectionException |
Section configuration is invalid |
TemplateNotFoundException |
Requested compliance template not found |
Usage Example
Integration with Other Packages
| Package | Integration |
|---|---|
Nexus\Finance |
Provides account balances via StatementDataProviderInterface |
Nexus\Period |
Provides period information |
Nexus\AccountPeriodClose |
Triggers statement generation on period close |
Nexus\Export |
Implements StatementExportAdapterInterface |
Nexus\AuditLogger |
Logs statement generation events |
Related Documentation
- ARCHITECTURE.md - Overall system architecture
- CODING_GUIDELINES.md - Coding standards
- Nexus Packages Reference - All available packages
License
MIT License - See LICENSE for details.