Appearance
Purchase Invoices
| Backlog field | Value |
|---|---|
| Story ID | AP-PUR-003 |
| Epic | Purchase |
| 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 accounts-payable users, I want to record, validate, post, print, and export supplier invoices so that stock, tax, payables, and accounting are updated correctly.
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
- Validate Draft, open period, vendor, currency/rate, lines, source order quantities, taxes, payment terms, warehouses/UOM/tracking, and Landed Cost allocation.
- Resolve Vendor Payable from vendor then vendor category; service Expense from item then category; service Cost Center from item then category; stock clearing from Inventory Goods in Transit; tax from Tax then Tax Group.
- Purchase builds and delegates the commercial journal to Accounting: debit Goods in Transit for storable value, debit service/landed expenses and input VAT, credit applicable landed vendors and the invoice vendor payable.
- Delegate Landed Cost and posted Stock In to Inventory. Inventory increases stock, applies tracking/UOM conversion and allocated cost, recalculates valuation, and returns Stock In/journal IDs.
- Create vendor due balances, update source order fulfillment, store links, mark Posted, and commit Purchase, Inventory, Landed Cost, Accounting, and payable effects together.
General ledger posting
| Component | Debit | Credit | Account/condition |
|---|---|---|---|
| Storable item | Goods in Transit | Vendor Payable | GIT from Inventory settings; payable vendor then category. |
| Service item | Expense | Vendor Payable | Expense item then category; cost center item then category. |
| Recoverable tax | Input Tax | Vendor Payable | Tax then Tax Group. |
| Inventory receipt | Warehouse GL | Goods in Transit | Delegated Stock In at received cost plus capitalized landed cost. |
Other module and document effects
| Area | Effect | Conditional/no effect |
|---|---|---|
| Inventory | Storable lines create Stock In, layers, tracking, valuation, WMA/LPC. | Service lines do not change stock. |
| Landed Cost | Allocations increase eligible item valuation and return posting groups. | No effect when no landed-cost lines exist. |
| Vendor/Finance | Creates payable and payment-term due schedule. | No cash movement until Payment Out. |
| Purchase Order | Reduces remaining quantity and updates fulfillment status. | Standalone invoice affects no order. |
Core acceptance scenarios
- Given a Draft invoice with valid vendor, lines, period, accounts, tax, stock setup, and allocations, when the accounts-payable user clicks Post, then purchase journal, landed cost, Stock In, vendor due balances, source quantities, and Posted status commit together.
- Given service expense, payable, tax, transit, warehouse, tracking, or stock delegate validation fails, when the operation is attempted, then the invoice remains Draft and none of the delegated effects commit.
- 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.
Prerequisites and required data
Draft invoice, vendor, invoice/date/sequence, open period, currency/rate, payment terms where used, and at least one item/service line are required. Storable lines require warehouse, UOM, quantity, cost, and tracking/expiry when configured. Tax, discount, landed cost, reference, and notes are conditional/optional.
Account resolution
- Vendor payable: vendor accounting Payable, then vendor category Payable, otherwise Post fails.
- Service expense: service item Expense account, then item category Expense account, otherwise Post fails; cost center resolves item then category.
- Inventory receipt: Inventory Settings Goods in Transit is used by the purchase journal/linked Stock In and Warehouse GL holds inventory.
- VAT: tax account, then tax-group account where supported; missing both fails.
- Landed cost: service expense item then category; vendor payable then vendor category; VAT from tax; allocated amounts increase inventory cost.
Clicking Post
Post validates Draft state, period, accounts, taxes, source/order quantities, Inventory readiness, warehouse/UOM/tracking, and landed-cost allocation. It creates the purchase journal, posts linked Stock In for non-service items, applies landed cost, creates vendor due balances from payment terms, stores links, marks Posted, and commits atomically.
Journal intent: debit Goods in Transit for storable value, debit service expenses/cost centers, debit applicable input VAT/landed-cost values, and credit vendor payable for the balanced total. Linked Stock In then debits Warehouse GL and credits the appropriate transit/expense counterpart.
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 |
|---|---|---|---|---|---|
| purchase-invoice | Lazy-loaded route | List/navigation | Guards: PolicyAuthGuard | Explicit frontend feature rule | apps/purchase/src/app/remote-entry/purchase-transactions/purchase-transactions.module.ts:32 |
Observed frontend fields and validation
| Component | Control | Observed frontend rule | Component source |
|---|---|---|---|
| - | - | No reactive formControlName controls were found for the routed components; review template-driven/shared child components. | Route sources above |
Observed frontend actions
| Component | Click action/handler | Business review requirement | Component source |
|---|---|---|---|
| - | - | No direct (click) handler was found; review shared toolbar/table commands and form submission bindings. | Route sources above |
Page-specific frontend acceptance criteria
- purchase-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: Guards: PolicyAuthGuard