Appearance
Sales and Commission Reports
| Backlog field | Value |
|---|---|
| Story ID | AP-SAL-008 |
| Epic | Sales |
| Story type | Report |
| 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 sales managers, I want to review invoice, item profitability, target, and commission results so that sales performance and incentives can be validated.
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.
Business rules
Required
Date/period and authorized sales scope are required.
Optional or conditional
Invoice/item/customer/salesperson/team/status, profitability, target, and branch filters are optional.
Action behavior
Reports are read-only and use posted/reconciled data according to each metric definition.
Blocking rule or downstream effect
Commission/target totals must expose inclusion, return, tax, discount, and payment rules.
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 |
|---|---|---|---|---|---|
| salesman-target&commission-report | CommissionSummaryReportComponent | Report/print | No route-level permission/guard found in source window | Feature token match | apps/sales/src/app/remote-entry/reports/reports.module.ts:76 |
Observed frontend fields and validation
| Component | Control | Observed frontend rule | Component source |
|---|---|---|---|
| CommissionSummaryReportComponent | FromDate | Visible control; optional or API-dependent | apps/sales/src/app/remote-entry/reports/pages/commission-summary-report/commission-summary-report.component.ts |
| CommissionSummaryReportComponent | SalesManIds | Visible control; optional or API-dependent | apps/sales/src/app/remote-entry/reports/pages/commission-summary-report/commission-summary-report.component.ts |
| CommissionSummaryReportComponent | ToDate | Visible control; optional or API-dependent | apps/sales/src/app/remote-entry/reports/pages/commission-summary-report/commission-summary-report.component.ts |
Observed frontend actions
| Component | Click action/handler | Business review requirement | Component source |
|---|---|---|---|
| CommissionSummaryReportComponent | onPrint | 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/sales/src/app/remote-entry/reports/pages/commission-summary-report/commission-summary-report.component.ts |
| CommissionSummaryReportComponent | onVeiw | 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/sales/src/app/remote-entry/reports/pages/commission-summary-report/commission-summary-report.component.ts |
| CommissionSummaryReportComponent | 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/sales/src/app/remote-entry/reports/pages/commission-summary-report/commission-summary-report.component.ts |
Page-specific frontend acceptance criteria
- salesman-target&commission-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