Skip to content

Purchase Invoices

Backlog fieldValue
Story IDAP-PUR-003
EpicPurchase
Story typeBusiness workflow
Review statusDraft - business analyst and business owner review required
Source evidenceAppsPortal.Apis controller, application command/query handlers, validators, domain entities, and matching MFE workflow where available
Last source review2026-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

  1. Only authorized users can view or execute the feature's actions.
  2. Required business data, active dependencies, tenant/branch scope, and current document state are validated.
  3. Invalid requests return actionable validation errors without applying a partial change.
  4. Search, list, view, print, and export operations use the same authorized business scope.
  5. Material create, edit, status, approval, posting, reversal, and integration actions are auditable where applicable.
  6. Financial or stock effects are applied atomically and no more than once.

Posting details

  1. Validate Draft, open period, vendor, currency/rate, lines, source order quantities, taxes, payment terms, warehouses/UOM/tracking, and Landed Cost allocation.
  2. 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.
  3. 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.
  4. 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.
  5. 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

ComponentDebitCreditAccount/condition
Storable itemGoods in TransitVendor PayableGIT from Inventory settings; payable vendor then category.
Service itemExpenseVendor PayableExpense item then category; cost center item then category.
Recoverable taxInput TaxVendor PayableTax then Tax Group.
Inventory receiptWarehouse GLGoods in TransitDelegated Stock In at received cost plus capitalized landed cost.

Other module and document effects

AreaEffectConditional/no effect
InventoryStorable lines create Stock In, layers, tracking, valuation, WMA/LPC.Service lines do not change stock.
Landed CostAllocations increase eligible item valuation and return posting groups.No effect when no landed-cost lines exist.
Vendor/FinanceCreates payable and payment-term due schedule.No cash movement until Payment Out.
Purchase OrderReduces remaining quantity and updates fulfillment status.Standalone invoice affects no order.

Core acceptance scenarios

  1. 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.
  2. 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.
  3. 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

  1. Vendor payable: vendor accounting Payable, then vendor category Payable, otherwise Post fails.
  2. Service expense: service item Expense account, then item category Expense account, otherwise Post fails; cost center resolves item then category.
  3. Inventory receipt: Inventory Settings Goods in Transit is used by the purchase journal/linked Stock In and Warehouse GL holds inventory.
  4. VAT: tax account, then tax-group account where supported; missing both fails.
  5. 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/pageComponentModeRoute permission/guardMapping confidenceSource
purchase-invoiceLazy-loaded routeList/navigationGuards: PolicyAuthGuardExplicit frontend feature ruleapps/purchase/src/app/remote-entry/purchase-transactions/purchase-transactions.module.ts:32

Observed frontend fields and validation

ComponentControlObserved frontend ruleComponent source
--No reactive formControlName controls were found for the routed components; review template-driven/shared child components.Route sources above

Observed frontend actions

ComponentClick action/handlerBusiness review requirementComponent source
--No direct (click) handler was found; review shared toolbar/table commands and form submission bindings.Route sources above

Page-specific frontend acceptance criteria

  1. 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

Internal Documentation — Microtec