Document & Contract Management V1: Core AP / GR / PO
1. Core Principle: Decision-Grade Document Layer
- Goal: We are not building a generic DMS or CLM. We are building a "decision-grade document layer".
- Philosophy: Documents exist solely to justify postings, approvals, accruals, and clearings. Everything else is noise.
- Outcome: A rigorous Document Graph that interlinks evidence for audit-grade financial decisions.
2. Canonical Document Types (V1)
You need exactly these four types, no more.
A) Invoice (Refinement)
- Existing: PDF, extracted structure, line items, matching links.
- New Requirements:
- Immutable Snapshots: Stored state of the invoice at the exact moment of posting/approval.
- Versioning: Handling revised invoices and credit notes (linked to original parent).
- Graph Linkage:
invoice_line ↔ po_line
invoice_line ↔ gr_line
invoice_line ↔ contract_clause
B) Purchase Order (PO) - The Rule Container
- Definition: A PO is not just a document; it is a rule container defining what is allowed.
- Capabilities:
- Structure: Store PO header + line items (structured data).
- Attachment: Original PO document (PDF/Email).
- Versioning: Track changes over time (Change Orders).
- Line-Level Linkage:
PO Line → Invoice Line(s)
PO Line → GR(s)
- Tolerance Metadata:
- Price tolerance
- Quantity tolerance
- Over-delivery rules
- Change order flags
C) Goods Receipt (GR) - The Evidence
- Definition: GR is evidence of fulfillment, not just a quantity field.
- Capabilities:
- Structure: Store GR records.
- Attachment: Delivery notes, service confirmations (scans/PDFs/emails).
- Line-Level Linkage:
GR Line → PO Line
GR Line → Invoice Line(s)
- Time Semantics: Distinguish between Receipt Date vs Posting Date.
- Insight: GR proof is often external to ERP. We must store and link these external artifacts.
D) Supplier Contract (V1 Scope)
- Goal: Extract and persist commercially relevant clauses at line-item decision granularity. Do NOT replace CLM or model full legal text.
- Contract Object:
contract_id
supplier_id
contract_type (framework / rate card / subscription)
effective_start / effective_end
currency
status
- Contract Clauses (Structured & Minimal):
clause_id, contract_id
clause_type: [unit_price, tiered_price, minimum_commitment, billing_frequency, service_scope, termination, indexation]
applies_to: [material_id, service_category, PO_line_type]
price_logic: (Structured formula/value)
tolerance: (Allowable variance)
- In Scope: "Is this invoice allowed under this contract?"
- Out of Scope: Indemnities, liability caps, governing law.
3. The Document Graph (The Moat)
Structure:
Invoice Line ↔ PO Line
PO Line ↔ GR Line(s) ↔ Evidence Documents
Invoice Line ↔ Contract Clause
Enables:
- Approvals (based on rule adherence).
- GR/IR Pre-clearing (automated matching).
- Reconciliation.
- Audit Evidence.
4. System Capabilities (V1)
Storage & Versioning
- Immutable Snapshots: Hashing to prove "this is what was approved".
- Version Links: Clear lineage for Amended POs or Corrected Invoices.
Evidence Bundling
- Requirement: For any financial decision, generate an "Evidence Pack".
- Content: Links + PDFs + Structured Fields.
- State: Frozen at decision time.