Expense-to-Pay Workflow
Metadata
| Field | Value |
|---|---|
| Phase | Phase 3: Aesthetic |
| FWCR Category | Expense-to-Pay |
| Owner | Product Team |
| Status | Planned |
| Last Updated | May 2026 |
Overview
This workflow handles employee expense submissions, multi-tier approval routing, AI-powered invoice capture, and payment execution. It covers the full P2P cycle from expense creation to cash outflow.
Goal: Achieve >65% FWCR for Expense-to-Pay by end of Phase 3.
Actors
| Role | Description |
|---|---|
| Employee | Submits expense reports with receipts |
| Manager | Approves expenses based on policy |
| Finance | Reviews and processes payments |
| System | Routes approvals, posts entries, executes payments |
| AI | Extracts data from receipts, validates against policy |
| Approver | CFO or delegated authority for high-value expenses |
Preconditions
- Employee master exists with department and cost center
- Expense policy configured (limits, categories, approval thresholds)
- Bank account configured for payment runs
- SADAD integration configured for vendor payments
- AI OCR service configured for receipt processing
Postconditions
- Expense approved and posted to GL
- Payment instruction created
- Bank transaction reconciled
- Audit trail captured
- Employee notified of payment
User Flow
Happy Path
┌─────────────────────────────────────────────────────────────────────────────┐
│ EXPENSE-TO-PAY WORKFLOW │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ [Employee] │
│ │ │
│ ▼ │
│ 1. Submit Expense Report │
│ │ │
│ ▼ │
│ 2. Attach Receipt(s) ──▶ [AI OCR Processing] │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ AI OCR │ │
│ │ • Vendor name extracted │ │
│ │ • Amount extracted │ │
│ │ • VAT number verified │ │
│ │ • Date normalized │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ 3. AI Drafts Purchase Invoice from Receipt │
│ │ │
│ ▼ │
│ 4. Employee Reviews & Submits │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ APPROVAL ROUTING │ │
│ │ ┌─────────────────────────────────────────────┐ │ │
│ │ │ Amount < SAR 1,000 ──▶ Manager approval │ │ │
│ │ │ Amount < SAR 10,000 ──▶ Dept Head │ │ │
│ │ │ Amount >= SAR 10,000 ──▶ CFO │ │ │
│ │ └─────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ 5. Approver Reviews & Approves │
│ │ │
│ ▼ │
│ 6. System Posts Journal Entry │
│ │ │
│ ▼ │
│ 7. Payment Run Generated │
│ │ │
│ ▼ │
│ 8. Bank Payment Executed │
│ │ │
│ ▼ │
│ 9. Bank Reconciliation │
│ │ │
│ ▼ │
│ 10. COMPLETE │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Step-by-Step
| Step | Actor | Action | System Response |
|---|---|---|---|
| 1 | Employee | Creates expense report | Initializes with employee, dept, date |
| 2 | Employee | Uploads receipt images/PDFs | AI OCR begins processing |
| 3 | AI | Extracts vendor, amount, date, VAT | Auto-populates expense fields |
| 4 | Employee | Reviews AI extraction, corrects if needed | Shows confidence scores |
| 5 | Employee | Assigns expense category | Validates against policy |
| 6 | Employee | Submits expense report | Triggers approval routing |
| 7 | System | Routes to appropriate approver | Sends notification |
| 8 | Approver | Reviews expense details | Shows policy compliance status |
| 9 | Approver | Approves or rejects | Feedback captured for rejections |
| 10 | System | Posts to expense account | Creates journal entry |
| 11 | Finance | Includes in payment run | Batch payment file generated |
| 12 | System | Executes bank payment | SADAD file or direct transfer |
| 13 | System | Auto-reconciles on bank feed | Marks expense as paid |
Expense Categories & Policies
| Category | Limit | Approval Threshold | Reimbursement |
|---|---|---|---|
| Travel | As per policy | > SAR 500 | Within 30 days |
| Meals | SAR 150/day | > SAR 300 | Within 30 days |
| Office Supplies | SAR 500/month | > SAR 200 | Monthly batch |
| Client Entertainment | SAR 1,000/event | > SAR 500 | Within 30 days |
| Training | Actual cost | > SAR 1,000 | On approval |
| Equipment | Actual cost | > SAR 500 | On approval |
Error Scenarios
| Scenario | Handling |
|---|---|
| OCR fails to extract data | Prompt user to enter manually, flag for review |
| Receipt exceeds policy limit | Show warning, require justification or escalation |
| Missing receipt for > SAR 100 | Reject with policy citation |
| Duplicate expense detected | Highlight similar expenses, require confirmation |
| Approval timeout (>48h) | Auto-escalate to next level |
| Budget exceeded for category | Block submission, notify manager |
Approval Matrix
| Amount Range | Approver | SLA |
|---|---|---|
| SAR 0 - 1,000 | Direct Manager | 24 hours |
| SAR 1,001 - 5,000 | Department Head | 24 hours |
| SAR 5,001 - 10,000 | Finance Manager | 48 hours |
| SAR 10,001 - 50,000 | CFO | 72 hours |
| SAR 50,000+ | CEO | 5 business days |
Acceptance Criteria
| # | Criteria | Test Scenario |
|---|---|---|
| 1 | AI OCR extracts >95% of receipt data | Given 100 receipts, When processed, Then >95 accurate |
| 2 | Approval routing follows matrix | Given expense >threshold, When submitted, Then routed correctly |
| 3 | Payment executes within 3 days of approval | Given approved expense, When in batch, Then paid within 3 days |
| 4 | GL entry matches receipt amount | Given approved expense, When posted, Then debits match |
| 5 | Bank reconciliation auto-matches | Given payment executed, When bank feed received, Then auto-reconciled |
| 6 | Audit trail complete | Given any action, When logged, Then includes user, time, IP |
Compliance Requirements
| Requirement | Implementation |
|---|---|
| PDPL | Receipt images stored with access controls, retention policy |
| VAT | Input VAT extracted and validated against vendor registration |
| Audit | Immutable log of all approvals, changes, payments |
| Expense Policy | Configurable rules, violations flagged |
| SADAD | Payment file format per SAMA requirements |
Technical Notes
| Component | Implementation |
|---|---|
| Frontend | Mobile-first expense form, receipt camera capture |
| API Gateway | Request validation, policy engine |
| ERPNext | Expense Claim, Payment Entry, Journal Entry |
| Custom App | bayancore_erp for AI OCR integration, approval routing |
| AI | GPT-4o Vision for receipt extraction, local model for privacy |
| OCR | Local model on OCI for Arabic/English receipts |
| Banking | SADAD integration via middleware |
Metrics
| Metric | Target | Measurement |
|---|---|---|
| FWCR: Expense-to-Pay | >65% | (Approved without rework) / (Total submitted) |
| Approval Cycle Time | under 4 hours | Submission to approval |
| AI OCR Accuracy | >95% | Correct extractions / Total receipts |
| Payment Cycle Time | under 3 days | Approval to bank payment |
| Exception Rate | under 10% | Expenses requiring manual intervention |
Dependencies
| Dependency | Status | Notes |
|---|---|---|
| ERPNext Expense module | Ready | Built-in |
| AI OCR service | Planned | Requires training on Arabic receipts |
| SADAD integration | Planned | Phase 3 deliverable |
| Mobile app | Planned | Phase 3 deliverable |
| Approval workflow engine | Planned | Built-in to ERPNext |
| Bank feed integration | Planned | OCI Banking API |
Related Documents
| Document | Link |
|---|---|
| OS Blueprint | ../os-blueprint |
| PO-to-Payment Workflow | ./03-po-to-payment |
| AI Architecture | ../../04-ai-features/rag-architecture |
| Technical Spec | ../../05-technical-spec/sad |
| Phase 3 Release | ../../08-release/phase-3-aesthetic |
Document Status
Status: ✅ PLANNED Last Updated: May 2026 Next Review: Pre-Phase 3 kickoff