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

# [Cross]CrossModuleDependencies

## Connections
[[_Reports]] · [[[Service]FinancialServices]] · [[[Service]SummaryServices]] · [[[Service]CustomerAgingService]] · [[[Service]UtilityServices]] · [[[Job]Jobs]]

Reports is a **read-only consumer** — it owns no accounting data. Everything flows in from other modules.

---

## Accounting Module
| Used | Type | Purpose |
|---|---|---|
| `JournalEntry` | Model | General Ledger, Journal Report — entry-level grouping |
| `JournalRecord` | Model | Account Statement, Account Summary, Cost Center, Taxes Report — line-level data |
| `AccountingFiscalYearBalance` | Model | Trial Balance, Account Statement opening/closing balances |
| `Account` | Model | Balance Sheet, Income Statement, Cash Flow, Cost Center, Asset Details |
| `AccountingCategory` / `AccountingSubCategory` | Models | Balance Sheet, Income Statement section grouping |
| `FiscalYear` | Model | PreparingDataService; all date-range filtering |
| `PaymentTerm` | Model | Used in `PopulateAgingReportForTenantJob` to calculate invoice due dates |
| `JournalEntriesRepository` | Repo | JournalReportAbstract (all journal report services) |
| `JournalRecordsRepository` | Repo | AccountStatementService, CostCenterIndexingService, NewTaxesReportService |
| `AccountingFiscalYearBalanceRepository` | Repo | AccountStatementService, TrialBalanceService, AccountSummaryIndexingService |
| `AccountsRepository` | Repo | TrialBalanceService, BalanceSheetService, IncomeStatementService |
| `FiscalYearsRepository` | Repo | PreparingDataService |
| `RetrievingAccountsService` | Service | TrialBalanceService |
| `RetrievingSubCategoriesWithAccountsService` | Service | AccountStatementService, AccountSummaryIndexingService |
| `RetrievingCurrentFinancialYearService` | Service | PreparingDataService |

---

## Sales Module
| Used | Type | Purpose |
|---|---|---|
| `Invoice` | Model | PopulateAgingReportForTenantJob (source for aging rows); SalesSummaryReportService |
| `InvoiceReturn` | Model | PopulateAgingReportForTenantJob (negative aging rows) |
| `Customer` | Model | ReportCustomerAging.customer_id; CustomerAgingController |
| `InvoicesDetailsRepository` | Repo | NewTaxesReportService (sales VAT amounts); SalesSummaryReportService |

---

## Purchases Module
| Used | Type | Purpose |
|---|---|---|
| `PurchaseBill` | Model | PurchasesSummaryReportService |
| `PurchaseBillsDetailsRepository` | Repo | NewTaxesReportService (purchase VAT amounts) |
| `BillReturnDetailsRepository` | Repo | NewTaxesReportService |
| `ExpensesDetailsRepository` | Repo | NewTaxesReportService |
| `SupplierTaxReportService` | (internal) | Reads PurchaseBill + JournalRecord for supplier VAT report |

---

## Products Module
| Used | Type | Purpose |
|---|---|---|
| `CostCenter` | Model | ReportCustomerAging.cost_center_id; CostCenterIndexingService |
| `RetrievingCostCentersService` | Service | PreparingDataService (cost center dropdown) |

---

## Settings Module
| Used | Type | Purpose |
|---|---|---|
| `Tax` | Model | NewTaxesReportService (tax labels) |
| `TaxesRepository` | Repo | NewTaxesReportService |
| `GeneralSettingsRepository` | Repo | PreparingDataService (company name); export services (logo) |
| `RetrievingTenantCurrencyService` | Service | PreparingDataService, AccountStatementService |

---

## CompanyUser Module
| Used | Type | Purpose |
|---|---|---|
| `User` (auth) | Model | Cost-center permission checks in all services via `auth()->user()` |
| `TenantBaseController` | Base class | All controllers extend this |
| `SendingEmailService` | Service | SendingJournalReportToEmailService |
| `ContentGenerator` | Base class | — (not used in Reports, but neighboring modules reference it) |

---

## Tenant Module
| Used | Type | Purpose |
|---|---|---|
| Subscription package info | — | `AllowableReports` trait reads package to gate reports |

---

## App (Core)
| Used | Type | Purpose |
|---|---|---|
| `UsesTenantConnection` | Trait | Favorite, ReportCustomerAging models |
| `TenantConnectionOnRuntime` | Trait | ReportsAgingCustomerService — switches connection mid-request |
| `PDF` (Snappy) | Library | All PDF export controllers + SendingJournalReportToEmailService |
| `Excel` (Maatwebsite) | Library | All Excel export controllers via ExcelViewExport |
| `ShouldQueue` | Interface | All 3 jobs |
