Skip to content

Payment In

Backlog fieldValue
Story IDAP-FIN-004
EpicFinance
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 cashiers, I want to record, allocate, post, print, and reverse incoming payments so that customer and account balances reflect received funds.

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 state, open period, positive amount, currency/rate, payment method, detail allocations, and the selected Bank or Treasury hub.
  2. Resolve the header debit account from Treasury Account or Bank Account GL. Resolve detail credits from Customer Receivable (customer then category), Vendor Payable (vendor then category), or the explicitly selected Other GL.
  3. Add commission and VAT lines using Payment Method configuration, then delegate the balanced journal to Accounting.
  4. Finance creates the Bank/Treasury transaction and sequence, then delegates eligible customer/asset/opening-balance reconciliation to the owning modules.
  5. Journal, cash subledger, payment availability, reconciliations, credit effects, and Posted status commit together. Unpost reverses them through Sales, Fixed Assets, Accounting, and Finance.

General ledger posting

ComponentDebitCreditAccount rule
ReceiptBank/Treasury GLCustomer Receivable, Vendor Payable, or Other GLParty account customer/vendor then category; other is explicit.
Commission/feeConfigured commission/fee accountBank/Treasury GLOnly when payment method charges apply.
Fee VATConfigured input tax/fee taxBank/Treasury GLOnly when configured taxable commission applies.

Other module and document effects

AreaEffectConditional/no effect
Bank/TreasuryIncreases hub balance and creates linked transaction/sequence.Rollback leaves no hub movement.
Sales/Fixed Assets/openingsReconciles eligible invoice/opening due balances and updates availability.Unallocated receipt remains available; no inventory effect.
Customer/vendor creditUpdates applicable party balance/credit.Other-GL receipt has no party subledger effect.

Core acceptance scenarios

  1. Given a valid Draft receipt with a configured bank/treasury and party accounts, when the cashier clicks Post, then the cash journal, bank/treasury subledger, payment availability, and eligible reconciliations are committed together.
  2. Given a linked invoice/opening/asset balance has changed or its period is closed, when the operation is attempted, then Unpost is rejected without reversing cash.
  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.

Required and conditional data

Draft payment, date/open period, payment hub, amount, currency/rate, at least one allocation/detail, and payment method are required. Treasury is required for Treasury hub; bank account is required for Bank hub. Cheque number is required for cheque methods. Customer/vendor/source balance, tax, commission, reference, and reconciliation amount are conditional.

Account resolution

  • Header debit: Treasury account or Bank Account GL.
  • Customer credit: customer Receivable account, then customer category Receivable.
  • Vendor credit where applicable: vendor Payable account, then vendor category Payable.
  • Other detail: explicitly selected GL account.
  • Commission/VAT: payment-method commission account and tax/VAT account; counterpart adjusts the bank/treasury header.
  • Advance-payment tax requires the configured advance-payment tax account and selected tax account.

Clicking Post

Post validates Draft, hub account, details, party accounts, amount, method-specific data, period, and tax/commission setup. It debits bank/treasury, credits detail accounts, creates bank or treasury transaction records/codes, posts commission/tax lines, automatically reconciles eligible customer amounts against posted invoice balances, updates payment/detail and invoice due balances, marks Posted, and commits once.

Unpost

Unpost requires a Posted payment, open payment and linked reconciliation periods, a reversible posted journal, and intact bank/treasury/reconciliation links. It reverses the journal, removes bank/treasury movements, undoes invoice/opening-balance/asset reconciliations, restores customer/salesperson credit and payment availability, and returns the payment to its allowed unposted state 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/pageComponentModeRoute permission/guardMapping confidenceSource
(module default)PaymentInListComponentList/navigationPermission: AppFinancePermissions.PaymentIn_List; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/finance/src/app/remote-entry/transactions/transactions.module.ts:41
addAddPaymentInComponentAddPermission: AppFinancePermissions.PaymentIn_Add; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/finance/src/app/remote-entry/transactions/transactions.module.ts:52
edit/:idEditPaymentInComponentEditPermission: AppFinancePermissions.PaymentIn_Edit; Guards: PolicyAuthGuard, preventPostedGuardExplicit frontend feature ruleapps/finance/src/app/remote-entry/transactions/transactions.module.ts:63
edit-payment-term/:idEditPaymentTermComponentEditPermission: AppFinancePermissions.PaymentTerms_Edit; Guards: PolicyAuthGuardFeature token matchapps/finance/src/app/remote-entry/finance/finance.module.ts:186
paymentinMainPaymentInComponentList/navigationPermission: AppFinancePermissions.PaymentIn_List; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/finance/src/app/remote-entry/transactions/transactions.module.ts:32
payment-methodMainPaymentMethodComponentList/navigationPermission: AppFinancePermissions.PaymentMethods_List; Guards: PolicyAuthGuardFeature token matchapps/finance/src/app/remote-entry/finance/finance.module.ts:197
view/:idViewPaymentInComponentView/detailPermission: AppFinancePermissions.PaymentIn_View; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/finance/src/app/remote-entry/transactions/transactions.module.ts:75

Observed frontend fields and validation

ComponentControlObserved frontend ruleComponent source
AddPaymentInComponentamountRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentbankAccountIdVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentdescriptionVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentglAccountIdConditionally required/validated in componentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentIsAmountIncludesVatVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentIsCustomerAdvancedPaymentConditionally required/validated in componentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentnotesVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentpaidByVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentpaidByDetailsIdRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentpaymentHubRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentpaymentHubDetailIdRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentPaymentInDateVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentpaymentMethodIdRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentrateRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentTaxIdConditionally required/validated in componentapps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
EditPaymentInComponentamountVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentbankAccountIdVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentdescriptionVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentglAccountIdConditionally required/validated in componentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentIsAmountIncludesVatVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentIsCustomerAdvancedPaymentConditionally required/validated in componentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentnotesVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentpaidByVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentpaidByDetailsIdRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentpaymentHubDetailIdRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentpaymentInDateVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentpaymentMethodIdRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentrateRequired in component validatorapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentTaxIdConditionally required/validated in componentapps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
ViewPaymentInComponentIsAmountIncludesVatVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/view-payment-in/view-payment-in.component.ts
ViewPaymentInComponentIsCustomerAdvancedPaymentVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/view-payment-in/view-payment-in.component.ts
ViewPaymentInComponentTaxIdVisible control; optional or API-dependentapps/finance/src/app/remote-entry/transactions/pages/paymentin/view-payment-in/view-payment-in.component.ts

Observed frontend actions

ComponentClick action/handlerBusiness review requirementComponent source
AddPaymentInComponentaddNewRowAdd one initialized detail row without changing existing rows; apply defaults and line validators, preserve stable row identity, and exclude incomplete rows from Save/Post.apps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentcancelLeave or close without persisting; warn when the current form has unsaved changes and restore the prior list/filter context.apps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentdeleteLineAvailable 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/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponenthandleButtonClickDocument the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler.apps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentopenCostPopupDocument the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler.apps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentopenDialogSearchOpen 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/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
AddPaymentInComponentsaveValidate the concrete form and line collection, prevent duplicate submission, persist once, show API field/business errors in context, and navigate/refresh only after success.apps/finance/src/app/remote-entry/transactions/pages/paymentin/add-payment-in/add-payment-in.component.ts
EditPaymentInComponentaddNewRowAdd one initialized detail row without changing existing rows; apply defaults and line validators, preserve stable row identity, and exclude incomplete rows from Save/Post.apps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentcancelLeave or close without persisting; warn when the current form has unsaved changes and restore the prior list/filter context.apps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponenthandleButtonClickDocument the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler.apps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentonDeleteAvailable 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/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentopenCostPopupDocument the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler.apps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentopenDialogSearchOpen 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/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
EditPaymentInComponentsaveValidate the concrete form and line collection, prevent duplicate submission, persist once, show API field/business errors in context, and navigate/refresh only after success.apps/finance/src/app/remote-entry/transactions/pages/paymentin/edit-payment-in/edit-payment-in.component.ts
PaymentInListComponentonDeleteAvailable 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/finance/src/app/remote-entry/transactions/pages/paymentin/payment-in-list/payment-in-list.component.ts
PaymentInListComponentonEditOpen 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/finance/src/app/remote-entry/transactions/pages/paymentin/payment-in-list/payment-in-list.component.ts
PaymentInListComponentonPostAvailable 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/finance/src/app/remote-entry/transactions/pages/paymentin/payment-in-list/payment-in-list.component.ts
PaymentInListComponentonUnPostAvailable 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/finance/src/app/remote-entry/transactions/pages/paymentin/payment-in-list/payment-in-list.component.ts
PaymentInListComponentonViewOpen 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/finance/src/app/remote-entry/transactions/pages/paymentin/payment-in-list/payment-in-list.component.ts
PaymentInListComponentprintoutGenerate 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/finance/src/app/remote-entry/transactions/pages/paymentin/payment-in-list/payment-in-list.component.ts
PaymentInListComponentrouteToJournalViewOpen 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/finance/src/app/remote-entry/transactions/pages/paymentin/payment-in-list/payment-in-list.component.ts
ViewPaymentInComponenthandleButtonClickDocument the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler.apps/finance/src/app/remote-entry/transactions/pages/paymentin/view-payment-in/view-payment-in.component.ts
ViewPaymentInComponentopenCostPopupDocument the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler.apps/finance/src/app/remote-entry/transactions/pages/paymentin/view-payment-in/view-payment-in.component.ts
ViewPaymentInComponentrouteToJournalViewOpen 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/finance/src/app/remote-entry/transactions/pages/paymentin/view-payment-in/view-payment-in.component.ts

Page-specific frontend acceptance criteria

  1. (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: AppFinancePermissions.PaymentIn_List; Guards: PolicyAuthGuard
  2. add - Add: Render permitted fields, required indicators, defaults, dependent lookups, validation, Save/Cancel, loading, success, and API-error states. Security observed: Permission: AppFinancePermissions.PaymentIn_Add; Guards: PolicyAuthGuard
  3. 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: AppFinancePermissions.PaymentIn_Edit; Guards: PolicyAuthGuard, preventPostedGuard
  4. edit-payment-term/:id - Edit: Load the identified record, enforce state/permission field locks, preserve concurrency identity, validate changes, and return without losing filters. Security observed: Permission: AppFinancePermissions.PaymentTerms_Edit; Guards: PolicyAuthGuard
  5. paymentin - 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: AppFinancePermissions.PaymentIn_List; Guards: PolicyAuthGuard
  6. payment-method - 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: AppFinancePermissions.PaymentMethods_List; Guards: PolicyAuthGuard
  7. 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: AppFinancePermissions.PaymentIn_View; Guards: PolicyAuthGuard

Internal Documentation — Microtec