---
tags: [settings, cross-module]
module: Settings
---

# CrossModuleDependencies

## Connections
[[_Settings]] · [[[Model]Tax]] · [[[Model]FiscalYear]] · [[[Model]OtherFee]] · [[[Service]FiscalYearServices]] · [[[Service]TaxServices]] · [[[Service]OtherFeesServices]] · [[[Enum]Enums]]

> Settings is a **provider** module. Almost every other module imports FROM Settings. Settings also imports FROM them for cascade cleanup on fiscal year deletion.

---

## Accounting Module
| Used | Type | Purpose |
|---|---|---|
| [[[Model]Account]] | Model | Tax.account_id; OtherFee.account_id; OtherFeesDetail.account_id |
| `AccountFiscalYearBalance` | Model | FiscalYear.accountFiscalYearBalances hasMany |
| [[[Model]JournalEntry]] | Model | FiscalYear.journalEntries hasMany |
| [[[Model]EasyEntry]] | Model | FiscalYear.easyEntries hasMany |
| `AccountsRepository` | Repo | Account dropdowns for tax/other-fee forms |
| `AccountingFiscalYearBalanceRepository` | Repo | Balance recalc on year close |
| `JournalEntriesRepository` | Repo | Cascade on fiscal year delete |
| `EasyEntriesRepository` | Repo | Cascade on fiscal year delete |
| `AssetCapitalizationsRepository` / `AssetsRepository` / etc. | Repos | Cascade cleanup |
| `UpdatingCurrentFiscalYearAccountsBalancesService` | Service | Balance sync on year update |
| `RetrievingSubCategoriesWithActiveAccountsService` | Service | Account dropdown for taxes/fees |
| `AccountingSubCategoriesEnum` / `AccountsEnum` / `EntryTransactionTypesEnum` | Enums | Account type classification |

---

## Sales Module
| Used | Type | Purpose |
|---|---|---|
| `Invoice` / `InvoiceReturn` / `CustomerPaymentReceipt` | Model | FiscalYear hasMany + cascade delete |
| `Customer` | Model | ZATCA compliance checks |
| `InvoicesRepository` / `InvoiceReturnsRepository` / etc. | Repos | Cascade on fiscal year delete |
| `EstimatesRepository` / `ProformaInvoicesRepository` | Repos | Cascade on fiscal year delete |
| `DeletingInvoiceWithEntriesService` | Service | Cascade on fiscal year delete |
| `CheckCustomerIsZatcaCompliantService` | Service | ZATCA online invoicing check |
| `NotifyFailedRecurringInvoiceService` | Service | Notify on recurring failure |
| `InvoiceTaxesStatusEnum` / `InvoiceTypesEnum` | Enums | Tax + invoice type config |
| Zatca enums: `TaxCodesEnum`, `TaxTypeEnum`, `CertificateInvoiceTypesEnum` | Enums | ZATCA compliance |

---

## Purchases Module
| Used | Type | Purpose |
|---|---|---|
| `PurchaseBill` / `BillReturn` / `Expense` / `SupplierPaymentReceipt` | Model | FiscalYear hasMany + cascade delete |
| `PurchaseBillsRepository` / `BillReturnRepository` / `ExpensesRepository` etc. | Repos | Cascade on fiscal year delete |
| `DeletingPurchaseBillWithEntriesService` / `DeletingExpenseWithEntriesService` etc. | Services | Cascade on fiscal year delete |

---

## HR Module
| Used | Type | Purpose |
|---|---|---|
| [[HR/[Model]PayrollEntry\|[Model]PayrollEntry]] | Model | FiscalYear.payrollEntries hasMany |
| [[HR/[Repo]Repositories\|[Repo]Repositories]] `PayrollEntriesRepository` | Repo | Cascade on fiscal year delete |
| [[HR/[Service]PayrollServices\|[Service]PayrollServices]] `DeletingPayrollEntryService` | Service | Cascade on fiscal year delete |

---

## Inventory Module
| Used | Type | Purpose |
|---|---|---|
| [[Inventory/[Repo]Repositories\|[Repo]Repositories]] `RequisitionRepository` | Repo | FormTypesEnum::REQUISITIONS form design lookup |

---

## Products Module
| Used | Type | Purpose |
|---|---|---|
| [[Products/[Model]Product\|[Model]Product]] | Model | Product dropdown on tax form |
| [[Products/[Service]ProductServices\|[Service]ProductServices]] `ClearProductNegativeQuantitiesService` | Service | Called by Feature model when NEGATIVE_INVENTORY toggled off |
| [[Products/[Repo]Repositories\|[Repo]Repositories]] `ProductsRepository` | Repo | Product lookups |

---

## CompanyUser Module
| Used | Type | Purpose |
|---|---|---|
| [[[Model]User]] | Model | AccountingSettings.added_by |
| `RecurringEntity` / `RecurringEntityLog` | Model | Recurring entity context |
| `HandleRecurringExternalIssues` | Service | Recurring cleanup on settings change |
| `ScreensEnum` | Enum | Navigation screen keys |

---

## Tenant Module
| Used | Type | Purpose |
|---|---|---|
| `ActiveSubscription` | Model | Feature + form design tier checks |
| `CompanyInfo` | Model | Company metadata |
| `CompaniesInfoRepository` / `CompanyConfigurationsRepository` / `HostnameRepository` | Repos | Tenant config lookups |
| `RetrievingTenantBySubdomainService` | Service | Tenant context in async jobs |
| `CompanyConfigKeysEnum` / `PackagesFeaturesEnum` / `RestrictedOnlineInvoicingCountriesEnum` | Enums | Config + tier keys |

---

## App (Core)
| Used | Type | Purpose |
|---|---|---|
| `TenantBaseController` | Base class | All web controllers |
| `BaseRepository` | Base class | All repositories |
| `AuditableTrait` | Trait | All models |
| `UsesTenantConnection` | Trait | All models |
| `HasTranslatableFields` | Trait | name_ar/en on models |
