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

# Asset

## Connections
[[_Accounting]] · [[[Model]JournalEntry]] · [[[Model]Account]] · [[[Repo]Repositories]] · [[[Observer]Observers]] · [[[Controller]AssetController]] · [[[Service]AssetServices]] · [[[Command]Commands]] · [[[DB]DatabaseTables]] · [[[Cross]CrossModuleDependencies]]

## Source
```
Modules/Accounting/Models/Asset.php
Modules/Accounting/Models/AssetDepreciation.php
Modules/Accounting/Models/AssetCapitalization.php
Modules/Accounting/Models/AssetSell.php
Modules/Accounting/Models/AssetParameter.php
Modules/Accounting/Models/AssetAttachment.php
Modules/Accounting/Models/AssetCapitalizationAttachment.php
```

## Responsibilities
- Tracks fixed assets from acquisition through depreciation, capitalization improvements, and final sale
- Each lifecycle event (depreciation, capitalization, sell) creates a linked [[[Model]JournalEntry]]
- Two depreciation methods: **Straight-Line** and **Declining Balance** — configured via `AssetParameter`
- `AssetCapitalization` records additional costs/improvements to an asset
- `AssetSell` records the disposal with profit/loss calculation

## Key Relationships

| Relation | Type | Target |
|---|---|---|
| mainAccount | belongsTo | [[[Model]Account]] |
| buyingAccount | belongsTo | [[[Model]Account]] |
| depreciationAccount | belongsTo | [[[Model]Account]] |
| journalEntry | belongsTo | [[[Model]JournalEntry]] (purchase JE) |
| depreciations | hasMany | AssetDepreciation → [[[Model]JournalEntry]] |
| capitalizations | hasMany | AssetCapitalization → [[[Model]JournalEntry]] |
| sell | hasOne | AssetSell → [[[Model]JournalEntry]] |
| parameters | hasMany | AssetParameter |
| attachments | hasMany | AssetAttachment |
| supplier | belongsTo | [[[Cross]CrossModuleDependencies#Purchases]] Supplier |
| costCenter | belongsTo | [[[Cross]CrossModuleDependencies#Products]] CostCenter |
| tax | belongsTo | [[[Cross]CrossModuleDependencies#Settings]] Tax |

## Lifecycle Flow
```
AssetController::store → CreatingAssetService → Asset created + JournalEntry (purchase)
AssetDepreciationController::store → CreatingAssetDepreciateService → AssetDepreciation + JournalEntry
AssetCapitalizationController::store → CreatingAssetCapitalizeService → AssetCapitalization + JournalEntry
AssetSellController::store → CreatingAssetSellingService → AssetSell + JournalEntry
Commands::DepreciateAssetsCommand → DepreciateAssetsAutomaticallyService (scheduled)
```

## Traits
`AuditableTrait` · `FormatDateAndTimeTrait` · `SoftDeletes` · `UsesTenantConnection`

## Package Restriction
`RestrictAssetsToUnlimitedPackage` [[[Middleware]Middleware]] — asset creation requires an unlimited subscription plan
