Appearance
Asset Sales and Returns
| Backlog field | Value |
|---|---|
| Story ID | AP-FA-006 |
| Epic | Fixed Assets |
| Story type | Business workflow |
| Review status | Draft - business analyst and business owner review required |
| Source evidence | AppsPortal.Apis controller, application command/query handlers, validators, domain entities, and matching MFE workflow where available |
| Last source review | 2026-07-10 |
User story
As asset accountants, I want to record disposals by sale and eligible sales returns so that asset status, proceeds, tax, and gain/loss are accurate.
Posting reference: AppsPortal Posting Ledger explains debit/credit construction. Delegation and Interaction Contracts explains module ownership, delegated commands, linked records, commit boundaries, and reversal propagation.
Acceptance criteria
- Only authorized users can view or execute the feature's actions.
- Required business data, active dependencies, tenant/branch scope, and current document state are validated.
- Invalid requests return actionable validation errors without applying a partial change.
- Search, list, view, print, and export operations use the same authorized business scope.
- Material create, edit, status, approval, posting, reversal, and integration actions are auditable where applicable.
- Financial or stock effects are applied atomically and no more than once.
Posting details
- Sale Post validates Draft/open period/customer/assets/price/tax/payment terms and resolves Receivable through Sales, Asset and Accumulated Depreciation from asset then group, and P/L from asset then group then Fixed Assets settings.
- Delegate the journal to Accounting: debit Customer Receivable, remove asset cost and accumulated depreciation, post gain/loss, and credit output VAT. Create due balances and move assets to sold/waiting-for-return state.
- Return Post validates the source sale and eligible asset state, then builds the opposite commercial, asset, depreciation, P/L, and VAT effects.
- Update original remaining quantities/return status and restore asset lifecycle state.
- Accounting, Sales receivable/balances, asset values/status, and source status commit together.
General ledger posting
| Transaction/component | Debit | Credit | Rule |
|---|---|---|---|
| Asset sale | Customer Receivable and Accumulated Depreciation | Asset GL and Output Tax | Residual difference posts to gain/loss P/L. |
| Loss / gain | Loss P/L | Gain P/L | Only one direction for difference between proceeds and NBV. |
| Sale return | Opposite original accounts | Opposite original accounts | Reverses receivable, tax, asset, depreciation, and gain/loss. |
Other module and document effects
| Area | Effect | Conditional/no effect |
|---|---|---|
| Asset register | Sale moves asset to sold/waiting state; return restores eligible state/value. | No Inventory Stock Out/In. |
| Sales/Finance | Creates customer due balance eligible for Payment In; return reduces it. | Posting alone does not move cash. |
| Source sale | Return updates remaining/status. | Ineligible later lifecycle blocks return. |
Core acceptance scenarios
- Given eligible assets, customer, open period, tax, and resolved asset/depreciation/P&L accounts, when the asset sale is posted, then receivable, asset removal, accumulated depreciation, gain/loss, VAT, balances, and asset state commit together.
- Given the posted sale is validly returned, when the operation is attempted, then all financial/lifecycle effects reverse and source return status updates atomically.
- Given the same Post request is retried after success, when the source is no longer Draft, then no duplicate journal, stock, balance, payment, or lifecycle effect is created.
Account resolution
- Customer receivable follows Sales customer then category.
- Asset account: asset override then asset group.
- Accumulated depreciation: asset override then asset group.
- Profit/Loss: asset override, then group, then Fixed Assets General Settings.
- VAT: selected Tax account.
Sale Post
Requires Draft, open period, eligible assets, customer, price/currency/tax/payment terms, and all accounts. Post debits customer receivable, removes asset cost, removes accumulated depreciation, posts balancing gain/loss, credits VAT, creates due balances from payment terms, moves asset to the sold/waiting-for-return state, links journal, and marks Posted.
Sales Return Post
Requires an eligible posted sale and asset in WaitingForSalesReturn. It credits customer receivable, restores asset cost and accumulated depreciation position, reverses gain/loss and VAT as calculated, updates original invoice remaining quantities and Partially/Fully Returned status, restores the asset state, and commits atomically.
Frontend page coverage
The following UI coverage is sourced from the pulled MFE route configuration. A Module-level supporting artifact mapping is evidence of a reachable screen, but requires BA confirmation that it belongs to this story rather than a more specific feature story.
| Route/page | Component | Mode | Route permission/guard | Mapping confidence | Source |
|---|---|---|---|---|---|
| (module default) | AssetSalesInvoiceReturnMainComponent | List/navigation | Permission: AppFixedAssetsPermissions.AssetsReturnSales_List; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/assets-sales-return-routing.module.ts:12 |
| (module default) | AssetSalesReturnListComponent | List/navigation | Permission: AppFixedAssetsPermissions.AssetsReturnSales_List; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/assets-sales-return-routing.module.ts:20 |
| (module default) | AssetsSalesInvoiceMainComponent | List/navigation | Permission: AppFixedAssetsPermissions.AssetsSalesInvoice_List; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/assets-sales-invoice-routing.module.ts:12 |
| (module default) | ListAssetsSalesInvoiceComponent | List/navigation | Permission: AppFixedAssetsPermissions.AssetsSalesInvoice_List; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/assets-sales-invoice-routing.module.ts:20 |
| add | AddAssetsSalesInvoiceComponent | Add | Permission: AppFixedAssetsPermissions.AssetsSalesInvoice_Add; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/assets-sales-invoice-routing.module.ts:29 |
| add | AssetSalesReturnAddComponent | Add | Permission: AppFixedAssetsPermissions.AssetsReturnSales_Add; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/assets-sales-return-routing.module.ts:30 |
| assets-return-sales-invoice | Lazy-loaded route | List/navigation | No route-level permission/guard found in source window | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/transactions-routing.module.ts:55 |
| assets-sales-invoice | Lazy-loaded route | List/navigation | No route-level permission/guard found in source window | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/transactions-routing.module.ts:34 |
| assets-sales-invoice-report | FixedAssetsSalesReportComponent | Report/print | No route-level permission/guard found in source window | Feature token match | apps/fixedAssets/src/app/remote-entry/reports/reports-routing.module.ts:18 |
| edit/:id | AssetSalesReturnEditComponent | Edit | Permission: AppFixedAssetsPermissions.AssetsReturnSales_Edit; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/assets-sales-return-routing.module.ts:40 |
| edit/:id | EditAssetsSalesInvoiceComponent | Edit | Permission: AppFixedAssetsPermissions.AssetsSalesInvoice_Edit; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/assets-sales-invoice-routing.module.ts:39 |
| sequence | SequenceComponent | Sequence | No route-level permission/guard found in source window | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/assets-sales-invoice-routing.module.ts:59 |
| sequence | SequenceComponent | Sequence | No route-level permission/guard found in source window | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/assets-sales-return-routing.module.ts:60 |
| view/:id | AssetSalesReturnViewComponent | View/detail | Permission: AppFixedAssetsPermissions.AssetsReturnSales_View; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/assets-sales-return-routing.module.ts:50 |
| view/:id | ViewAssetsSalesInvoiceComponent | View/detail | Permission: AppFixedAssetsPermissions.AssetsSalesInvoice_View; Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/assets-sales-invoice-routing.module.ts:49 |
Observed frontend fields and validation
| Component | Control | Observed frontend rule | Component source |
|---|---|---|---|
| AssetsSalesReturnHeaderComponent | assetsSalesInvoiceHeaderId | Required in component validator | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/component/assets-sales-return-header/assets-sales-return-header.component.ts |
| AssetsSalesReturnHeaderComponent | customerId | Required in component validator | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/component/assets-sales-return-header/assets-sales-return-header.component.ts |
| AssetsSalesReturnHeaderComponent | date | Required in component validator | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/component/assets-sales-return-header/assets-sales-return-header.component.ts |
| AssetsSalesReturnHeaderComponent | description | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/component/assets-sales-return-header/assets-sales-return-header.component.ts |
| AssetsSalesReturnHeaderComponent | reference | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/component/assets-sales-return-header/assets-sales-return-header.component.ts |
| FixedAssetsSalesReportComponent | assetsGroupIds | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | assetsIds | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | assetsLocationIds | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | customerIds | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | fromDate | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | Statuses | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | toDate | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| HeaderAssetsSalesInvoiceComponent | assetsSalesInvoiceSelcetedAssets | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/header-assets-sales-invoice/header-assets-sales-invoice.component.ts |
| HeaderAssetsSalesInvoiceComponent | customerId | Required in component validator | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/header-assets-sales-invoice/header-assets-sales-invoice.component.ts |
| HeaderAssetsSalesInvoiceComponent | date | Required in component validator | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/header-assets-sales-invoice/header-assets-sales-invoice.component.ts |
| HeaderAssetsSalesInvoiceComponent | description | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/header-assets-sales-invoice/header-assets-sales-invoice.component.ts |
| HeaderAssetsSalesInvoiceComponent | paymentTermId | Required in component validator | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/header-assets-sales-invoice/header-assets-sales-invoice.component.ts |
| HeaderAssetsSalesInvoiceComponent | reference | Visible control; optional or API-dependent | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/header-assets-sales-invoice/header-assets-sales-invoice.component.ts |
Observed frontend actions
| Component | Click action/handler | Business review requirement | Component source |
|---|---|---|---|
| AssetSalesReturnListComponent | onDelete | Available only in deletable states with Delete permission; identify the record in confirmation, call delete once, remove/refresh the list row on success, and retain the row with the API reason on failure. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/pages/asset-sales-return-list/asset-sales-return-list.component.ts |
| AssetSalesReturnListComponent | onEdit | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/pages/asset-sales-return-list/asset-sales-return-list.component.ts |
| AssetSalesReturnListComponent | onPost | Available only for a postable Draft and Post permission; confirm the document, prevent a second submission, call the posting API, and refresh status, journal/stock links, and row actions. Failure must keep the pre-post state. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/pages/asset-sales-return-list/asset-sales-return-list.component.ts |
| AssetSalesReturnListComponent | onPrintOut | Generate the printout for the selected record and authorized branch/tenant; use posted/current values and surface print, template, ZATCA/ETA, or popup failures without changing transaction state. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/pages/asset-sales-return-list/asset-sales-return-list.component.ts |
| AssetSalesReturnListComponent | onView | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/pages/asset-sales-return-list/asset-sales-return-list.component.ts |
| AssetSalesReturnListComponent | routeToJournalView | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-return/pages/asset-sales-return-list/asset-sales-return-list.component.ts |
| BodyAssetsSalesInvoiceComponent | onDeleteRow | Available only in deletable states with Delete permission; identify the record in confirmation, call delete once, remove/refresh the list row on success, and retain the row with the API reason on failure. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/body-assets-sales-invoice/body-assets-sales-invoice.component.ts |
| BodyAssetsSalesInvoiceComponent | openDialog | Open the item/lookup/tracking dialog with the current warehouse, item, UOM, and remaining quantity context; accepted values must return to the correct line and cancel must not mutate it. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/body-assets-sales-invoice/body-assets-sales-invoice.component.ts |
| FixedAssetsSalesReportComponent | printReport | Generate the printout for the selected record and authorized branch/tenant; use posted/current values and surface print, template, ZATCA/ETA, or popup failures without changing transaction state. | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | routeToAssetView | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | routeToCustomerDef | Document the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler. | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | routeToInvoice | Document the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler. | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | routeToJournalEntryView | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| FixedAssetsSalesReportComponent | viewData | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/fixedAssets/src/app/remote-entry/reports/fixed-assets-sales-report/fixed-assets-sales-report.component.ts |
| HeaderAssetsSalesInvoiceComponent | openDialog | Open the item/lookup/tracking dialog with the current warehouse, item, UOM, and remaining quantity context; accepted values must return to the correct line and cancel must not mutate it. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/components/header-assets-sales-invoice/header-assets-sales-invoice.component.ts |
| ListAssetsSalesInvoiceComponent | onDelete | Available only in deletable states with Delete permission; identify the record in confirmation, call delete once, remove/refresh the list row on success, and retain the row with the API reason on failure. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/pages/list-assets-sales-invoice/list-assets-sales-invoice.component.ts |
| ListAssetsSalesInvoiceComponent | onEdit | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/pages/list-assets-sales-invoice/list-assets-sales-invoice.component.ts |
| ListAssetsSalesInvoiceComponent | onPost | Available only for a postable Draft and Post permission; confirm the document, prevent a second submission, call the posting API, and refresh status, journal/stock links, and row actions. Failure must keep the pre-post state. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/pages/list-assets-sales-invoice/list-assets-sales-invoice.component.ts |
| ListAssetsSalesInvoiceComponent | onView | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/pages/list-assets-sales-invoice/list-assets-sales-invoice.component.ts |
| ListAssetsSalesInvoiceComponent | printout | Generate the printout for the selected record and authorized branch/tenant; use posted/current values and surface print, template, ZATCA/ETA, or popup failures without changing transaction state. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/pages/list-assets-sales-invoice/list-assets-sales-invoice.component.ts |
| ListAssetsSalesInvoiceComponent | routeToJournalView | Open the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data. | apps/fixedAssets/src/app/remote-entry/transactions/assets-sales-invoice/pages/list-assets-sales-invoice/list-assets-sales-invoice.component.ts |
Page-specific frontend acceptance criteria
- (module default) - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: Permission: AppFixedAssetsPermissions.AssetsSalesInvoice_List; Guards: PolicyAuthGuard
- add - Add: Render permitted fields, required indicators, defaults, dependent lookups, validation, Save/Cancel, loading, success, and API-error states. Security observed: Permission: AppFixedAssetsPermissions.AssetsReturnSales_Add; Guards: PolicyAuthGuard
- assets-return-sales-invoice - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: No route-level permission/guard found in source window
- assets-sales-invoice - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: No route-level permission/guard found in source window
- assets-sales-invoice-report - Report/print: Expose documented filters, validation, empty/loading/error states, authorized results, totals, drill-through, print, and export behavior where present. Security observed: No route-level permission/guard found in source window
- edit/:id - Edit: Load the identified record, enforce state/permission field locks, preserve concurrency identity, validate changes, and return without losing filters. Security observed: Permission: AppFixedAssetsPermissions.AssetsSalesInvoice_Edit; Guards: PolicyAuthGuard
- sequence - Sequence: Show current numbering scope and permit only authorized, valid sequence configuration without retroactively renumbering posted documents. Security observed: No route-level permission/guard found in source window
- view/:id - View/detail: Load an authorized immutable/detail representation with status-aware actions, linked records, print/export where exposed, and not-found/forbidden handling. Security observed: Permission: AppFixedAssetsPermissions.AssetsSalesInvoice_View; Guards: PolicyAuthGuard