Skip to content

Accounts Payable Document Flow

AP invoices are vendor bills with approval and payment lifecycle enforced on the ApInvoice aggregate. Status names match UI chips and filters.

Hub: Target Document Flow. Overview: Accounts Payable.

#Statuses

Status Meaning
Draft Editable bill
PendingApproval Submitted for approval
Approved Approved; open for payment
PartiallyPaid Payments applied; balance remains
Paid Fully paid
Rejected Approval rejected
Cancelled Cancelled (not paid)

Match status (separate): NotMatched, Matched, MatchException, MatchOverridden. Unresolved match exception can block approval.

#Lifecycle

AP Invoice — approval path

flowchart TB
  Start((Create)) --> Draft[Draft]
  Draft -->|Submit| PendingApproval[PendingApproval]
  PendingApproval -->|Approve| Approved[Approved]
  PendingApproval -->|Reject| Rejected[Rejected]

  class Start egkStart
  class Draft egkDraft
  class PendingApproval egkActive
  class Approved egkSuccess
  class Rejected egkError

AP Invoice — payment and cancel

flowchart TB
  Approved[Approved] -->|Apply payment| PartiallyPaid[PartiallyPaid]
  PartiallyPaid -->|Full payment| Paid[Paid]
  Approved -->|Full payment| Paid

  Draft[Draft] -->|Cancel| Cancelled[Cancelled]
  PendingApproval[PendingApproval] -->|Cancel| Cancelled
  Rejected[Rejected] -->|Cancel| Cancelled

  class Approved,Paid egkSuccess
  class PartiallyPaid egkWarn
  class Draft egkDraft
  class PendingApproval egkActive
  class Rejected egkError
  class Cancelled egkTerminal
Actions — enabled when
Action Enabled when (domain) Disabled / blocked when
Create / Edit Draft or Rejected (update path) Locked after approval/payment paths
Submit DraftPendingApproval Already submitted
Approve PendingApproval Match exception unresolved; wrong status
Reject PendingApprovalRejected Not pending
Cancel Invoice Not Paid Paid throws CannotCancelPaidInvoice; Approved / PartiallyPaid require debit-note path per domain
Apply payment Approved, PartiallyPaid, or Paid context Invoice not approved for payment

Actions menu — enabled by status

flowchart TB
  A[Actions] --> B{Status}
  B -->|Draft| C[Submit / Edit / Cancel]
  B -->|PendingApproval| D[Approve / Reject / Cancel]
  B -->|Approved / PartiallyPaid| E[Pay]
  B -->|Paid| F[Payment history]
  B -->|Rejected| G[Edit / resubmit]
  B -->|Cancelled| H[Read-only]

  class A egkActive
  class B egkDecision
  class C,D,G egkDraft
  class E egkSuccess
  class F egkSuccess
  class H egkTerminal
  • Purchasing Document flow timeline links GRN/PO into AP.
  • Payments: ApPaymentDraft, Posted, Voided, Refunded.
  • Debit notes / prepayments: Draft/Applied/Cancelled, Open/Applied/Cancelled.

#Post-action sync

After Submit / Approve / Reject / Cancel / payment:

  1. API updates aggregate status.
  2. Grid reloads.
  3. Status chips refresh.
  4. Actions menu re-evaluates from the new status.

Failures leave previous status and menu intact.

#Scenarios

Scenario Result
Successful approve Approved
Reject Rejected
Cancel unpaid draft/pending Cancelled
Cancel paid Domain error — not allowed
Partial payment PartiallyPaid
Full payment Paid

Reconnecting to the server…

Please wait, or reload the page.