---
tags: [hr, cross-module]
module: HR
---

# CrossModuleDependencies

## Connections
[[_HR]] · [[[Model]PayrollEntry]] · [[[Model]Employee]] · [[[Service]PayrollServices]] · [[[Service]EmployeeServices]]

> Summary view — each HR file already links directly to its dependencies. This file maps the full picture.

---

## Accounting Module

| Used | File | Purpose |
|---|---|---|
| `Account` model | [[[Model]Account]] | [[[Model]Employee]] `cost_account_id` + [[[Model]PayrollEntry]] `payment_account_id` |
| `JournalEntry` model | [[[Model]JournalEntry]] | [[[Model]PayrollEntry]] `journal_entry_id` — created on each payroll run |
| `CreatingNewJournalEntryService` | [[[Service]JournalEntryServices]] | Called by [[[Service]PayrollServices]] to generate the payroll JE |
| `DeletingJournalEntryService` | [[[Service]JournalEntryServices]] | Called on payroll update/delete |
| `RetrievingExpensesMainCategoryAccountsService` | [[[Service]AccountServices]] | Loads cost account options for employee form |
| `RetrievingLastCodeService` | [[[Service]JournalEntryServices]] | JE code generation during payroll store |
| `AccountsRepository` | [[Accounting/[Repo]Repositories]] | Account lookups |
| `TransactionTypesEnum` | [[Accounting/[Enum]Enums]] | Debit/credit type on JE records |
| Middleware | [[Accounting/[Middleware]Middleware]] | `check-manual-entry-locking` on payroll store/update/destroy |

---

## Settings Module

| Used | File | Purpose |
|---|---|---|
| `FiscalYear` model | [[[Model]FiscalYear]] | [[[Model]PayrollEntry]] `year_id` FK |
| `FiscalYearsRepository` | [[Settings/[Repo]Repositories]] | Current fiscal year lookup |
| `RetrievingCurrentFinancialYearService` | [[[Service]FiscalYearServices]] | Used by [[[Service]PayrollServices]] |

---

## CompanyUser Module

| Used | File | Purpose |
|---|---|---|
| `User` model | [[[Model]User]] | [[[Model]PayrollEntry]] `created_by` + PayrollEntryDetail `created_by` |

---

## Tenant Module

| Used | Purpose |
|---|---|
| `Audit` model | `RetrievingEmployeeDetailsService` reads audit logs for employee history |
