Fixed Assets — Data model
3 tables · auto-generated from migrations-v2/*.sql — do not edit by hand.
ER diagram
%%{init: {"theme":"base","themeVariables":{"darkMode":true,"background":"#1e1e1e","primaryColor":"#2d2d30","primaryBorderColor":"#569cd6","primaryTextColor":"#d4d4d4","lineColor":"#6796c6","secondaryColor":"#3a3d41","secondaryBorderColor":"#dcdcaa","secondaryTextColor":"#d4d4d4","tertiaryColor":"#252526","tertiaryBorderColor":"#569cd6","noteBkgColor":"#3a3d41","noteTextColor":"#dcdcaa","clusterBkg":"#252526","clusterBorder":"#569cd6","titleColor":"#569cd6","attributeBackgroundColorOdd":"#252526","attributeBackgroundColorEven":"#2d2d30"},"er":{"useMaxWidth":false}}}%%
erDiagram
FIXED_ASSET {
integer id PK
text company_id FK
integer kernel_document_id FK
integer kernel_journal_entry_id FK
text code
text name
text category
numeric cost
}
FIXED_ASSET_DEPRECIATION {
integer id PK
text company_id FK
integer asset_id FK
integer kernel_document_id FK
integer kernel_journal_entry_id FK
text period_code
text posting_date
numeric amount
}
FIXED_ASSET_DISPOSAL {
integer id PK
text company_id FK
integer asset_id FK
integer kernel_document_id FK
integer kernel_journal_entry_id FK
text disposal_date
numeric proceeds
numeric book_value
}
FIXED_ASSET ||--o{ FIXED_ASSET_DEPRECIATION : asset
FIXED_ASSET ||--o{ FIXED_ASSET_DISPOSAL : asset
Cross-module references
FIXED_ASSET.company_id → COMPANY (core)
FIXED_ASSET.kernel_document_id → DOCUMENT (core)
FIXED_ASSET.kernel_journal_entry_id → JOURNAL_ENTRY (core)
FIXED_ASSET_DEPRECIATION.company_id → COMPANY (core)
FIXED_ASSET_DEPRECIATION.kernel_document_id → DOCUMENT (core)
FIXED_ASSET_DEPRECIATION.kernel_journal_entry_id → JOURNAL_ENTRY (core)
FIXED_ASSET_DISPOSAL.company_id → COMPANY (core)
FIXED_ASSET_DISPOSAL.kernel_document_id → DOCUMENT (core)
FIXED_ASSET_DISPOSAL.kernel_journal_entry_id → JOURNAL_ENTRY (core)
Data dictionary
erp_fixed_asset · 21 cols
| column |
type |
key |
references |
| id |
integer |
PK |
|
| company_id |
text |
FK |
erp_company |
| code |
text |
|
|
| name |
text |
|
|
| category |
text |
|
|
| cost |
numeric |
|
|
| salvage_value |
numeric |
|
|
| acquire_date |
text |
|
|
| useful_life_months |
integer |
|
|
| method |
text |
|
|
| asset_account |
text |
|
|
| accumulated_depreciation_account |
text |
|
|
| depreciation_expense_account |
text |
|
|
| accumulated_depreciation |
numeric |
|
|
| status |
text |
|
|
| kernel_document_id |
integer |
FK |
erp_document |
| kernel_journal_entry_id |
integer |
FK |
erp_journal_entry |
| idempotency_key |
text |
|
|
| payload |
text |
|
|
| created_by |
text |
|
|
| created_at |
integer |
|
|
erp_fixed_asset_depreciation · 12 cols
| column |
type |
key |
references |
| id |
integer |
PK |
|
| company_id |
text |
FK |
erp_company |
| asset_id |
integer |
FK |
erp_fixed_asset |
| period_code |
text |
|
|
| posting_date |
text |
|
|
| amount |
numeric |
|
|
| accumulated_after |
numeric |
|
|
| kernel_document_id |
integer |
FK |
erp_document |
| kernel_journal_entry_id |
integer |
FK |
erp_journal_entry |
| idempotency_key |
text |
|
|
| created_by |
text |
|
|
| created_at |
integer |
|
|
erp_fixed_asset_disposal · 12 cols
| column |
type |
key |
references |
| id |
integer |
PK |
|
| company_id |
text |
FK |
erp_company |
| asset_id |
integer |
FK |
erp_fixed_asset |
| disposal_date |
text |
|
|
| proceeds |
numeric |
|
|
| book_value |
numeric |
|
|
| gain_loss |
numeric |
|
|
| kernel_document_id |
integer |
FK |
erp_document |
| kernel_journal_entry_id |
integer |
FK |
erp_journal_entry |
| idempotency_key |
text |
|
|
| created_by |
text |
|
|
| created_at |
integer |
|
|