📐 The Smart System Pattern

Every screen in Mizan يفكّر
for you.

There's one pattern running through every workflow — scan, classify, post, audit. Learn it once, and the whole app becomes obvious. Below: the pattern, the principles, and live examples you can try right now.

The pattern

Every Mizan workflow — scan, payment match, bank reconciliation, journal posting, ZATCA submission — follows the same five-step shape. Input goes in, a smart default comes out, you confirm or override, we audit it.

📸
Smart scan — receipt to bill
Mobile PWA · /mobile.html · /api/v1/dms/scan + /classify + /quick-add-bill
📷
INPUT
Snap a receipt
🧠
CLASSIFY
Keyword + vendor history + amount + tax
📑
DRAFT
Bill + DMS doc + GL entry
// Real classifier output, Apple MacBook SAR 7,500 receipt:
{
  "type": "asset",
  "glAccountCode": "1620",
  "glAccountName": "Office Equipment",
  "assetCategory": "it",
  "assetUsefulLife": 36,
  "assetDepreciationMethod": "straight_line",
  "isRecurring": false,
  "isTaxDeductible": true,
  "confidence": 1.0,
  "vendorMatch": "existing",
  "suggestedPaymentTermsDays": 30,
  "Matched keywords: macbook | Existing vendor: Apple Inc. (SUP-116046)"
}

// 2 lines posted — NOT 1. Asset cost + recoverable VAT:
Line 1: 1620 Office Equipment  amount=6,375 SAR  (isAsset=true)
Line 2: 1500 VAT Input (Recoverable)  amount=1,125 SAR  (tax line)
🏦
Bank reconciliation — statement line to GL
Banking module · AI JAX-style confidence scoring (Xero-inspired)
📥
INPUT
Bank statement line
🔎
MATCH
Date ±3d, amount, ref, customer
💯
SCORE
0.0-1.0 confidence
// Real matching output:
{
  "matchType": "ai_suggested",
  "confidence": 0.94,
  "matchedInvoice": "INV-2026-0012",
  "matchedCustomer": "Acme Trading LLC",
  "reasoning": "Amount 12,500 = invoice 12,500; date 2 days after due; ref contains INV-0012",
  "alternatives": [{ "invoice": "INV-2026-0011", "confidence": 0.41 }]
}

// 3-way color-coded UI:
   green  ≥ 0.85  → "Looks right, click to confirm"
   amber  0.50-0.85 → "Possible match — verify"
   red    < 0.50  → "No good match — create new"
🏛️
ZATCA Phase 2 e-invoice submission
Tax module · UBL 2.1 XML + ECDSA + SHA-256 hash chain + TLV QR
📄
INPUT
Approved sales invoice
🔐
SIGN
UBL XML + ECDSA secp256k1 + POB hash
📡
SUBMIT
ZATCA sandbox, get clearance
// Real ZATCA flow, INV-2026-0002 (POB-chained to INV-2026-0001):
{
  "xmlHash": "a3f2...c4d9" // SHA-256 of canonicalized UBL 2.1,
  "previousInvoiceHash": "7b1e...8a2f" // POB chain — INV-001's hash,
  "ecdsaSignature": "3045022100...02202b...",
  "qrTLV": [
    "Seller: 300123456700003",
    "VAT: 300123456700003",
    "Timestamp: 2026-07-18T15:30:00Z",
    "Total+ VAT: 8625.00",
    "VAT amount: 1125.00",
    "Hash: a3f2...c4d9",
    "ECDSA: 3045022100...02202b...",
    "Public key: 04a1b2c3...",
    "Cryptographic stamp: 01"
  ],
  "zatcaStatus": "CLEARED",
  "icv": 2
}
Approval engine — BPMN-lite routing
Workflow module · 3 templates (journal, bill, payment) · amount-tiered
📝
SUBMIT
Journal / bill / payment
📏
ROUTE
Amount-based tier + role
🎯
APPROVE
Manager → CFO if > 50K
// Approval rule — auto-selected by amount tier:
{
  "template": "journal_standard",
  "steps": [
    { "step": 1, "role": "accountant",  "sla": "4h" },
    { "step": 2, "role": "manager",     "ifAmountGt": 10000 },
    { "step": 3, "role": "cfo",         "ifAmountGt": 50000 }
  ]
}

// Why this matters — a SAR 3,000 phone bill posts in 4h.
   A SAR 75,000 asset purchase needs 3 sign-offs and goes to CFO.
   No config, no script — the engine reads the rule and routes.

The seven principles

Every smart feature in Mizan follows these rules. If we break one, the feature goes back to the drawing board.

1
Smart defaults, not surprises
The system picks the most likely answer and shows it. The user can change it in one click. We never auto-post without confirmation.
2
Show your work
Every smart action exposes its reasoning. "Why did the classifier pick 1620?" → "Matched keyword 'macbook' + vendor history." No black boxes.
3
Confidence scoring
Every match is 0.0-1.0. UI shows green/amber/red. Below 0.5 we ask the user, not assume.
4
User can always override
Override is a first-class action, not a hidden escape hatch. We log the override and learn from it.
5
Multi-signal beats single-source
Keyword + vendor history + amount + tax code + project. Never trust one signal alone — that's how Apple MacBook gets booked as "VAT Input".
6
Local rules beat AI hallucinations
Saudi tax rules, ZATCA fields, GOSI rates — all hardcoded from regulations. AI is for fuzzy things (vendor name match, invoice line description), not for compliance math.
7
Audit by default
Every smart action writes to the audit chain — what was suggested, who overrode it, why. Auditor can replay the entire decision history.

Where it shows up

Twenty smart workflows across the system, each following the same pattern.

Workflow Input Smart action Override?
📸 Smart scan Receipt photo Classify as expense / asset / inventory ✓ 1 click
🏦 Bank recon Statement line Match to open invoice w/ confidence ✓ alternatives
📨 AR Payment match Bank receipt Auto-apply to oldest open invoice ✓ pick another
🏛️ ZATCA submission Approved invoice Build UBL 2.1 XML, sign, submit ✗ hard fail
✅ Approval routing Journal / bill / payment Tier-based BPMN route ✗ rule-driven
🔁 Recurring bills Date trigger Auto-draft from template ✓ pre-approve
⚠ Duplicate detection New invoice Flag if amount+date+vendor match ✓ confirm dup
💸 WHT calc Foreign payment 5% WHT on management fees ✓ override rate
📊 VAT return Period close Output - input + reverse charge ✗ rule-driven
🏢 Intercompany Bill between entities Auto-eliminate on consolidation ✓ pick rule
📦 Inventory reorder Stock level Suggest PO when below min ✓ confirm
🔍 Period close Month-end trigger Reconcile, accrue, generate TB ✓ step by step
📅 EOSB accrual Payroll run Saudi tiered formula on basic+housing ✗ Labour Law
🛡️ GOSI calc Salary 25.5% employer / 10% employee (Saudi) ✓ override
🏗️ Nitaqat band Headcount mix Calculate Saudisation % and band ✓ read-only
💱 FX translation Foreign invoice SAMA rate at transaction date ✓ manual rate
📈 Budget alerts Posted expense Email if category > 90% of budget ✓ adjust budget
🔐 RBAC User action 6 roles × 31 permissions check ✓ request grant
📨 Vendor 360 New vendor bill Pre-fill payment terms, WHT, GL ✓ edit all
📊 Smart suggestions User on dashboard "3 bills pending approval, 1 bank match > 0.85" ✓ 1-click action

Try one right now

Hit the live API. Type a vendor, an amount, a description — see the classification in real time.

Live smart-classify

POST /api/v1/dms/demo/scan-and-classify — real backend, no auth required for demo.

Smart means: less typing, more closing.

Open the app, install the mobile PWA, and try the workflow that fits your day.

Open Mizan →