Skip to content

Latest commit

 

History

History
147 lines (120 loc) · 7.92 KB

File metadata and controls

147 lines (120 loc) · 7.92 KB

Non-PO Invoice Processing Flow

Main Flow — OCR JSON Ingestion through Oracle Submission

flowchart TD
    %% ── Entry Points ──────────────────────────────────────────
    OCR["OCR Service Delivers JSON<br/>(FR-ING-001)<br/>Supplier, Invoice #, Date,<br/>Amount, Line Items, Confidence Scores"]
    PRF["Payment Request Form<br/>(FR-PR-001–011)<br/>~100/month: Refunds,<br/>Sponsorships, Donations"]
    MANUAL["Manual Invoice Creation<br/>(AP Admin Only — Tiffany+)<br/>Source = 'Manual'"]

    %% ── Classification & Early Checks ──────────────────────────
    CLASSIFY{"Classify Invoice<br/>(FR-CLS-001)<br/>PO Reference Found?"}
    ERS{"ERS Supplier Check<br/>(FR-CLS-004)"}
    VALIDATE["Validation<br/>(FR-ING-002/003)<br/>JSON Completeness &<br/>Confidence Score Check"]
    DUPCHECK{"Duplicate Detection<br/>(FR-ING-005)<br/>Advisory — Oracle<br/>is Authoritative"}

    %% ── Rules Engine & Coding ──────────────────────────────────
    RULES["Rules Engine<br/>(FR-RE-001–006)<br/>Coding Defaults per<br/>Supplier / Category / Legal Entity<br/>(FR-RE-008)"]
    GLCODE["GL Coding<br/>Defaults from Rules Engine<br/>or Manual Coding<br/>Split-Coding Supported (FR-RE-010)"]
    GLVALIDATE{"GL Cross-Validation<br/>(FR-GL-001)<br/>Real-Time Oracle API"}

    %% ── Owner Identification ───────────────────────────────────
    OWNER{"Owner Identification<br/>Attention / CC / POC<br/>Signals from Invoice"}

    %% ── Exception & Kickout Queues ─────────────────────────────
    EXCEPTION["OCR Kickout /<br/>Exception Queue<br/>AP Admin & Super Users<br/>Correct Data"]
    MISSING_OWNER["Missing Owner Queue<br/>AP Admin Assigns Owner"]
    ESCALATE["Escalate to<br/>Daniel Santos<br/>(After 3 Days)"]

    %% ── Contractor Path ────────────────────────────────────────
    CONTRACTOR{"Contractor<br/>Payment?<br/>(FR-RE-011–014)"}
    CONTRACTOR_Q["Contractor Queue<br/>Requires: GL + AE Code<br/>+ Claim # + Approving Mgr<br/>Unique Coding per Invoice"]

    %% ── Approval Workflow (APP-OWNED) ──────────────────────────
    APPROVAL["Primary Approval Workflow<br/>(App-Owned — NOT Oracle AME)<br/>Serial Approval Chain<br/>DOA Enforcement"]
    APPROVE_DECISION{"Approver Action"}
    PARK["Parked<br/>(Non-Terminal)"]
    REQ_INFO["Request Info<br/>Returns to Submitter"]

    %% ── Oracle Integration ─────────────────────────────────────
    SUBMIT["Submit to Oracle<br/>Interface Tables<br/>(FR-INT-002/010)"]
    ORACLE_IMPORT{"Oracle Import<br/>Validation"}
    ORACLE_PROC["Oracle Processes<br/>Payment Scheduling<br/>& GL Posting"]

    %% ── Terminal States ────────────────────────────────────────
    APPROVED(["APPROVED<br/>(Terminal)"])
    CANCELLED(["CANCELLED<br/>(Terminal)"])
    PAID(["PAID<br/>(Terminal — Oracle)"])
    PO_PATH(["PO Path<br/>(Separate Flow)"])
    ERS_REJECT(["Rejected<br/>ERS Supplier"])
    DUP_FLAG["Duplicate Suspected<br/>(Flagged — Advisory)"]

    %% ── Main Flow Connections ──────────────────────────────────
    OCR --> CLASSIFY
    CLASSIFY -- "No PO Reference" --> ERS
    CLASSIFY -- "PO Reference Found" --> PO_PATH

    ERS -- "Not ERS" --> VALIDATE
    ERS -- "ERS Supplier" --> ERS_REJECT

    VALIDATE --> DUPCHECK
    DUPCHECK -- "No Duplicate" --> RULES
    DUPCHECK -- "Potential Duplicate" --> DUP_FLAG
    DUP_FLAG -.-> RULES

    RULES --> GLCODE
    GLCODE --> GLVALIDATE

    GLVALIDATE -- "Valid" --> CONTRACTOR
    GLVALIDATE -- "Invalid GL" --> EXCEPTION

    CONTRACTOR -- "No" --> OWNER
    CONTRACTOR -- "Yes" --> CONTRACTOR_Q
    CONTRACTOR_Q --> APPROVAL

    OWNER -- "Owner Found" --> APPROVAL
    OWNER -- "Owner Unknown" --> MISSING_OWNER
    MISSING_OWNER -- "Assigned" --> APPROVAL
    MISSING_OWNER -- "3 Days Unassigned" --> ESCALATE
    ESCALATE --> MISSING_OWNER

    %% ── Exception Handling ─────────────────────────────────────
    VALIDATE -- "Low Confidence /<br/>Missing Fields" --> EXCEPTION
    EXCEPTION -- "Corrected /<br/>Overridden<br/>(FR-EX-012/013)" --> APPROVAL

    %% ── Approval Actions ───────────────────────────────────────
    APPROVAL --> APPROVE_DECISION
    APPROVE_DECISION -- "Approve<br/>(All Levels Complete)" --> SUBMIT
    APPROVE_DECISION -- "Cancel" --> CANCELLED
    APPROVE_DECISION -- "Park" --> PARK
    APPROVE_DECISION -- "Request Info" --> REQ_INFO
    PARK -.-> APPROVAL
    REQ_INFO -.-> APPROVAL

    %% ── Oracle Submission ──────────────────────────────────────
    SUBMIT --> ORACLE_IMPORT
    ORACLE_IMPORT -- "Accepted" --> APPROVED
    ORACLE_IMPORT -- "Rejected<br/>(Invalid Supplier/Site/<br/>Account, Duplicate)" --> EXCEPTION
    APPROVED --> ORACLE_PROC
    ORACLE_PROC --> PAID

    %% ── Alternate Entry Points ─────────────────────────────────
    PRF -- "Approved via App<br/>(Pre-Submission Approval)" --> SUBMIT
    MANUAL --> VALIDATE

    %% ── Styling ────────────────────────────────────────────────
    classDef terminal fill:#2d6a4f,stroke:#1b4332,color:#fff
    classDef exception fill:#e63946,stroke:#a4161a,color:#fff
    classDef queue fill:#f4a261,stroke:#e76f51,color:#000
    classDef decision fill:#457b9d,stroke:#1d3557,color:#fff
    classDef process fill:#a8dadc,stroke:#457b9d,color:#000
    classDef entry fill:#6a4c93,stroke:#4a306d,color:#fff
    classDef oracle fill:#264653,stroke:#1d3557,color:#fff

    class APPROVED,CANCELLED,PAID terminal
    class ERS_REJECT,EXCEPTION exception
    class MISSING_OWNER,CONTRACTOR_Q,DUP_FLAG queue
    class CLASSIFY,ERS,DUPCHECK,GLVALIDATE,OWNER,CONTRACTOR,APPROVE_DECISION,ORACLE_IMPORT decision
    class VALIDATE,RULES,GLCODE,APPROVAL,SUBMIT process
    class OCR,PRF,MANUAL entry
    class ORACLE_PROC,PO_PATH oracle
    class PARK,REQ_INFO queue
    class ESCALATE exception
Loading

Legend

Color Meaning
Purple Entry Points (OCR JSON, Payment Request Form, Manual Creation)
Light Blue Processing Steps
Blue Decision Points
Orange Queues (Exception, Missing Owner, Contractor, Parked)
Red Exceptions & Escalations
Green Terminal States (Approved, Cancelled, Paid)
Dark Teal Oracle-Owned Processing

Key Design Notes

  • App-Owned Approvals: The primary approval workflow is owned by this application, NOT Oracle AME. Serial approval chain with DOA (Delegation of Authority) enforcement.
  • Three Sub-Workflows: Missing Owner Queue, OCR Kickout/Exception Queue, Primary Approval Workflow.
  • Terminal States: Only Approved and Cancelled are terminal. Parked is non-terminal (resumes later).
  • Oracle is Authoritative for duplicate detection — app-side check is advisory only.
  • Corrections re-enter approval from designated starting approver (FR-EX-012/013), not from the beginning.
  • Payment Request Form has its own pre-submission approval within the app, then auto-creates a non-PO invoice in Oracle upon final approval.
  • OOO Handling: Higher-level approvers can pull invoices from their reports' queues.