Skip to content

uid: T-186 title: Match a transaction to an existing Vendor Invoice status: todo area: accounting created: 2026-07-25 updated: 2026-07-25 owner: girafeev1 related: T-178


T-186 β€” Match a bank transaction to an existing Vendor Invoice

Why

From T-178's phase 7, and the natural sibling of the work already shipped there: T-178 phase 1 made a bank transaction matchable to an existing unpaid WOPC. The same affordance is missing for vendor / service invoices, which are the other document a payment can discharge.

What already exists

  • lib/accounting/matching/vendorMatch.server.ts β€” applyVendorLink already links a vendor invoice to a transaction, writing matchedFingerprint into gl.{code}.expenseMetadata and the document via the transaction's root receiptIds (deliberately not gl.receipts, so matchedReceipts stays empty and the display-name resolver picks the vendor_invoice template β€” see the comment at lib/accounting/transactions.ts:1013-1028).
  • The match-plugin architecture (lib/accounting/matchPlugins/) gates a plugin on template.capabilities, with the accountβ†’template mapping settings-driven β€” the same pattern the WOPC plugin uses, and the one to follow here rather than hardcoding.

So the linking primitive exists; what's missing is the operator-facing matching flow equivalent to the unpaid-WOPC picker.

Depends on

T-181 shapes how service invoices arrive in the first place, including the operator-entered auto-match pattern.

Source

Split out of T-178's phase 7 on 2026-07-25 at the owner's request ("Split Phase 7 in T-178"). Phase 7 was a catch-all of three unrelated items; each now stands alone.

Source: Records (Infrastructure) Β· https://claude.ai/code/session_018RDB37kCqfouHdygVXTAtD