Run PO ↔ Invoice ↔ Payment 3-way matching for supplier reconciliation. Use when asked to match invoices, run 3-way matching, or reconcile supplier accounts.
Run 3-way matching (Purchase Order ↔ Supplier Invoice ↔ Payment) for supplier reconciliation.
cd /Users/jacques/DevFolder/sage_v2
source .venv/bin/activate
export SAGE_PROJECT_ROOT="$(pwd)" PYTHONPATH="$(pwd):$PYTHONPATH"
# List available matching endpoints
curl -s http://localhost:49000/api/v1/matching/ | python3 -m json.tool
# Run matching for a specific supplier
curl -s "http://localhost:49000/api/v1/matching/supplier/$(python3 -c 'import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))' 'SUPPLIER_NAME')" | python3 -m json.tool
from backend.core.matching.three_way_engine import ThreeWayMatchingEngine
# Engine matches PO lines to invoice lines to payment records
backend/core/matching/tolerance.py)backend/core/matching/three_way_engine.py — main enginebackend/core/matching/models.py — Invoice, Payment, POLine dataclassesbackend/core/matching/strategies/ — matching strategiesbackend/core/matching/reporter.py — discrepancy reportingbackend/core/matching/audit.py — audit trailPresent matching results as a table with columns: Supplier, Invoice#, PO#, Amount, Payment, Status (matched/unmatched/discrepancy).