---
tags: [reports, hub]
module: Reports
---

# Reports Module — Hub

> Read-only reporting module. Pulls data from Accounting, Sales, Purchases, Products, and Settings to generate financial statements, summaries, tax reports, and the AR aging report. No business-entity CRUD — only data retrieval and export.

## Models
[[[Model]Models]]

## Controllers
[[[Controller]Controllers]]

## Services
[[[Service]FinancialServices]] · [[[Service]SummaryServices]] · [[[Service]CustomerAgingService]] · [[[Service]UtilityServices]]

## Infrastructure
[[[Repo]Repositories]] · [[[Enum]Enums]] · [[[Job]Jobs]] · [[[Command]Commands]] · [[[Routes]Routes]] · [[[DB]DatabaseTables]] · [[[Cross]CrossModuleDependencies]]

---

## Report Catalogue

| ID | Report | Service | Source Data |
|---|---|---|---|
| 1 | Account Statement | AccountStatementService | JournalRecord, AccountingFiscalYearBalance |
| 2 | Account Summary | AccountSummaryIndexingService | JournalRecord, FiscalYear |
| 3 | Income Statement | IncomeStatementService | Account, AccountingCategory |
| 4 | Trial Balance | SaudiTrialBalanceService | AccountingFiscalYearBalance, Account |
| 5 | General Ledger | GeneralLedgerIndexingService | JournalEntry, JournalRecord |
| 6 | Journal Report | JournalReportService | JournalEntry, JournalRecord |
| 7 | Balance Sheet | BalanceSheetService | Account, AccountingCategory |
| 8 | Cash Flow | CashFlowService | Account, AccountingCategory |
| 9 | Taxes Report | NewTaxesReportService | InvoiceDetails, PurchaseBillDetails, JournalRecord |
| 10 | Cost Center | CostCenterIndexingService | Account, CostCenter, JournalRecord |
| 11 | Cash Flow Direct | CashFlowDirectService | Account, CashFlowDirectMainSectionsEnum |
| 12 | Asset Details | AssetReportService | Account (asset type) |
| 14 | Sales Summary | SalesSummaryReportService | Invoice, InvoiceDetails |
| 15 | Purchases Summary | PurchasesSummaryReportService | PurchaseBill, PurchaseBillDetails |
| 16 | Customer Tax Report | TaxReportService | Invoice, JournalRecord |
| 17 | Supplier Tax Report | SupplierTaxReportService | PurchaseBill, JournalRecord |
| 18 | Customer Aging | ReportsAgingCustomerService | ReportCustomerAging (pre-populated cache table) |

---

## Key Patterns

```
Every report:
  Controller → validates (Validator) → checks subscription (SubscriptionReportStatusService)
      → Service::execute() → view / PDF / Excel

Export variants per report:
  GET /report-name          → HTML view (DataTables)
  GET /report-name/export   → PDF download
  GET /report-name/print    → PDF inline
  GET /report-name/export-excel → XLSX download (via ExcelViewExport)
```

## Subscription Gate
`SubscriptionReportStatusService` called in every controller — gates reports by `ReportsPackagesEnum` (STANDARD / ADVANCED / STATISTICAL / E_INVOICING).

## Favorites
Users can pin reports. `ReportFavoriteController` → `Favorite` model (just stores `report_id`).

---

## Related Modules
[[START_HERE]] · [[_Accounting]] · [[_Purchases]] · [[_Products]] · [[_CompanyUser]] · [[_Settings]]
