asset_dispose
Books a fixed asset sale, scrap, donation, or write-off in one atomic transaction, posting any gain or loss and marking the asset disposed.
Instructions
Dispose an active or fully_depreciated fixed asset (H06): the TERMINAL financial event (sale, scrap, donation, write-off, retirement). In ONE atomic transaction it (a) posts ONE balanced GL journal via A02 (source=asset_disposal) clearing the asset cost (Cr) and its accumulated depreciation (Dr), recognising the proceeds (Dr the proceedsAccountId) and the resulting book gain (Cr) or loss (Dr) on the gainLossAccountId; (b) writes ONE append-only asset_transaction (type=disposal, deltaCostRappen = -cost, deltaAccumDeprRappen = -accumulated, proceedsRappen, gainLossRappen) naming that journal; and (c) moves the asset to status=disposed, forces net_book_value_rappen to 0 and stamps disposed_at / disposal_proceeds_rappen (cost and accumulated stay for historical reporting). The gain/loss SIGN is proceedsRappen minus net book value: proceeds above NBV credit the gain account, below NBV debit the loss account, exactly equal writes no gain/loss line. A scrap (proceedsRappen = 0) writes no proceeds line and needs no proceedsAccountId. After success the asset is permanently excluded from every future depreciation run (H03/H04 status filter) and asset_update refuses it with asset_terminal. Refused with not_found (foreign asset, §H-TENANT), asset_already_disposed (a second dispose: first wins, second is refused), asset_archived, asset_not_acquired (a draft has no cost basis), invalid_proceeds, invalid_gain_loss_account, invalid_proceeds_account, or period_locked (disposalDate in a hard-locked A03 period). A wrong disposal is corrected by reversing the journal (A02) plus a compensating asset_transaction, never an un-dispose. Idempotent on idempotencyKey: a replay returns the original {asset, transaction, journalEntry, gainLossRappen} and posts no second journal, appends no second transaction and re-flips no status. CONSEQUENCE: Books the asset's sale or write-off with its gain or loss and takes it out of the register. If it is wrong, you reverse the disposal and the asset is back in the register.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | ||
| reason | No | ||
| assetId | Yes | ||
| workspaceId | Yes | ||
| disposalDate | Yes | ||
| idempotencyKey | Yes | ||
| proceedsRappen | Yes | ||
| counterpartyName | No | ||
| gainLossAccountId | Yes | ||
| proceedsAccountId | No |