---
tags: [accounting, cross-module]
module: Accounting
---

# CrossModuleDependencies

## Connections
[[_Accounting]] · [[[Model]Account]] · [[[Model]JournalEntry]] · [[[Model]JournalRecord]] · [[[Model]Asset]] · [[[Service]JournalEntryServices]] · [[[Service]IntegrationSyncServices]] · [[[Repo]Repositories]]

> The Accounting module depends on the following external modules. It never modifies their models directly — it reads via their Repositories or Services.

---

## Sales Module
**Namespace**: `Modules\Sales\`
| Used | Type | Purpose |
|---|---|---|
| `Customer` | Model | Linked to [[[Model]JournalRecord]] (customer_id) and AccountCustomer pivot |
| `Invoice` | Model | hasOne from [[[Model]JournalEntry]] |
| `InvoiceReturn` | Model | hasOne from [[[Model]JournalEntry]] |
| `CustomerPaymentReceipt` | Model | hasOne from [[[Model]JournalEntry]] |
| `CustomersRepository` | Repository | Used by `UpdateRecordCustomerSupplierBalance` trait to update customer balance |
| `RetrievingActiveCustomersService` | Service | Dropdown data for journal entry forms |
| `CustomerResource` | Resource | API response formatting |
| `InvoiceResource` | Resource | API response formatting |
| `InvoiceTaxesStatusEnum` | Enum | Tax status on invoice sync |

---

## Purchases Module
**Namespace**: `Modules\Purchases\`
| Used | Type | Purpose |
|---|---|---|
| `Supplier` | Model | Linked to [[[Model]JournalRecord]] (supplier_id), [[[Model]Asset]] (supplier_id), AccountSupplier pivot |
| `PurchaseBill` | Model | hasOne from [[[Model]JournalEntry]] |
| `BillReturn` | Model | hasOne from [[[Model]JournalEntry]] |
| `Expense` | Model | hasOne from [[[Model]JournalEntry]] |
| `SupplierPaymentReceipt` | Model | hasOne from [[[Model]JournalEntry]] |
| `SuppliersRepository` | Repository | Used by `UpdateRecordCustomerSupplierBalance` trait |
| `RetrievingActiveSuppliersService` | Service | Dropdown data |
| `SupplierResource` | Resource | API response formatting |

---

## Products Module
**Namespace**: `Modules\Products\`
| Used | Type | Purpose |
|---|---|---|
| [[Products/[Model]CostCenter\|[Model]CostCenter]] | Model | Linked to [[[Model]JournalRecord]], [[[Model]Asset]], SingleRecordJournalEntry |
| `CostCenterIntegration` | Model | Maps integration cost centers to local ones |
| [[Products/[Repo]Repositories\|[Repo]Repositories]] `ProductsRepository` | Repo | Product lookups during order sync |
| [[Products/[Repo]Repositories\|[Repo]Repositories]] `CostCentersRepository` | Repo | Cost center lookups |
| [[Products/[Repo]Repositories\|[Repo]Repositories]] `CostCenterIntegrationsRepository` | Repo | Integration cost center mapping |
| [[Products/[Repo]Repositories\|[Repo]Repositories]] `UnitsRepository` | Repo | Unit lookups |
| [[Products/[Service]CostCenterServices\|[Service]CostCenterServices]] `RetrievingCostCentersService` | Service | Dropdown data |
| [[Products/[Controller]ApiControllers\|[Controller]ApiControllers]] `CostCenterResource` | Resource | API response formatting |
| [[Products/[Enum]Enums\|[Enum]Enums]] `ProductTypeEnum` | Enum | Product type during Foodics sync |

---

## HR Module
**Namespace**: `Modules\HR\`
| Used | Type | Purpose |
|---|---|---|
| `PayrollEntry` | Model | hasOne from [[[Model]JournalEntry]] — payroll JEs link back to payroll entries |
| `EmployeesRepository` | Repository | Employee lookups during payroll sync |
| `PayrollEntriesRepository` | Repository | Payroll entry lookups |

---

## Settings Module
**Namespace**: `Modules\Settings\`
| Used | Type | Purpose |
|---|---|---|
| [[Settings/[Model]FiscalYear\|[Model]FiscalYear]] | Model | [[[Model]JournalEntry]] belongs to FiscalYear; [[[Model]Account]] fiscal year balances |
| [[Settings/[Model]Tax\|[Model]Tax]] | Model | [[[Model]JournalRecord]] tax_id, [[[Model]Asset]] tax_id, AssetCapitalization tax_id |
| [[Settings/[Model]CustomField\|[Model]Feature]] | Model | Feature flag checks |
| [[Settings/[Model]FormDesign\|[Model]FormDesign]] | Model | PDF print layout configuration |
| [[Settings/[Repo]Repositories\|[Repo]Repositories]] `FiscalYearsRepository` | Repo | Current fiscal year lookups |
| [[Settings/[Repo]Repositories\|[Repo]Repositories]] `TaxesRepository` | Repo | Tax rate lookups |
| [[Settings/[Repo]Repositories\|[Repo]Repositories]] `GeneralSettingsRepository` | Repo | Company settings (currency, etc.) |
| [[Settings/[Service]FiscalYearServices\|[Service]FiscalYearServices]] `RetrievingCurrentFinancialYearService` | Service | Used in every JE creation flow |
| [[Settings/[Service]SettingsServices\|[Service]SettingsServices]] `RetrievingTenantCurrencyService` | Service | Currency lookups |
| [[Settings/[Service]TaxServices\|[Service]TaxServices]] `RetrievingAllTaxesService` | Service | Tax dropdown |
| [[Settings/[Controller]ApiControllers\|[Controller]ApiControllers]] `FiscalYearResource` / `TaxResource` | Resource | API formatting |
| [[Settings/[Enum]Enums\|[Enum]Enums]] `FeaturesEnum` | Enum | Feature flag keys |
| [[Settings/[Enum]Enums\|[Enum]Enums]] `InventorySystemEnum` | Enum | Inventory system type |
| [[Settings/[Enum]Enums\|[Enum]Enums]] `CustomFieldsEnum` | Enum | Custom field module identifiers |

---

## CompanyUser Module
**Namespace**: `Modules\CompanyUser\`
| Used | Type | Purpose |
|---|---|---|
| [[[Model]User]] | Model | `created_by` on most models |
| [[[Model]RecurringEntity]] | Model | `HasRecurringEntity` trait on [[[Model]JournalEntry]] |
| `CompanyUsersRepository` | Repository | User lookups |
| [[[Service]RecurringServices]] `HandleRecurringExternalIssues` | Service | Called from [[[Observer]Observers#AccountObserver]] on account status change |
| `NotificationsEnum` | Enum | Notification type keys |
| `RolesEnum` | Enum | Permission role keys |
| `SyncOrdersFilterEnum` | Enum | Order sync filter options |
| `UserResource` | Resource | API formatting |
| Sync segment Jobs | Jobs | `SyncSalesOrderSegmentJob`, `SyncSalesReturnSegmentJob`, `SyncPurchasesSegmentJob`, `SyncPurchasesReturnSegmentJob` — dispatched by [[[Service]IntegrationSyncServices]] |

---

## Tenant Module
**Namespace**: `Modules\Tenant\`
| Used | Type | Purpose |
|---|---|---|
| `ActiveSubscription` | Model | Subscription plan checks |
| `Website` | Model | Tenant website/subdomain data |
| `CompaniesInfoRepository` | Repository | Tenant company info |
| `SubscriptionsRepository` | Repository | Subscription plan lookups |
| `RetrievingTenantBySubdomainService` | Service | Used in async [[[Job]Jobs]] to re-establish tenant context |
| `FeatureNameEnum` | Enum | Subscription feature keys |
| `PackagesFeaturesEnum` | Enum | Package feature flags |
| `FeatureSubscriptionLimitByKeyForManualJournalEntryRule` | Validation Rule | Limits JE count by subscription tier |

---

## Inventory Module
**Namespace**: `Modules\Inventory\`
| Used | Type | Purpose |
|---|---|---|
| [[Inventory/[Model]Warehouse\|[Model]Warehouse]] | Model | Warehouse auto-creates linked Account via `AutoStoringAccountOfWarehouseService` |
| [[Inventory/[Service]WarehouseServices\|[Service]WarehouseServices]] | Service | Calls into Accounting to create warehouse account |

---

## Attachments Module
**Namespace**: `Modules\Attachments\`
| Used | Type | Purpose |
|---|---|---|
| [[[Model]GeneralAttachment]] | Model | Generic file attachments (shared service) |
| [[[Service]AttachmentServices]] `AttachingFileToModelService` | Service | Handles file upload + linking to any model |

---

## VomPay Module
**Namespace**: `Modules\VomPay\`
| Used | Type | Purpose |
|---|---|---|
| `VomPayInvoiceRepository` | Repository | Payment invoice lookups for sync |
| `VomPaySettingRepository` | Repository | VomPay account configuration |
