# Procure to pay: from "we need it" to paid

> A process map exported from forks.world (https://forks.world). Author: Brian. Source: https://forks.world/p/cmv0ieg7m005ejw06ks5c75z1
> It describes who does what, in what order, and with which technology. Read the plain-language sections first; the JSON at the end is the exact, complete data.

## Summary

- 12 steps across 1 layer
- Persona: Requester, Procurement, Receiving, Accounts payable, Vendor

## How to read this file

- A process is made of **layers**. The main layer is the top level; any step of kind `subprocess` opens a detail layer with its own lanes and steps.
- **Lanes** are either persona (people/roles) or technology (systems). Each step belongs to one lane; `using` lists tools a person uses for that step.
- Step kinds: `start`, `task`, `decision` (its arrows carry the answer as a label), `subprocess`, `end`.

## Procure to pay: from "we need it" to paid

Lanes:
- Requester: person / role (id `req`)
- Procurement: person / role (id `proc`)
- Receiving: person / role (id `wh`)
- Accounts payable: person / role (id `ap`)
- Vendor: person / role (id `vend`)

Steps, in the order they run:

1. **Needs something** [start; Requester; id `p1`]
   - then Get it approved and ordered
2. **Get it approved and ordered** [subprocess; Procurement; id `p2`], links to the published process "Buy something: purchase order approval" (https://forks.world/p/cmv0iecep004ajw06243yz9os; full text at https://forks.world/api/public/cmv0iecep004ajw06243yz9os/export)
   - then Ships the goods
3. **Ships the goods** [task; Vendor; id `p3`]
   - then Receive and inspect
4. **Receive and inspect** [task; Receiving; id `p4`]
   - then Matches the order?
5. **Matches the order?** [decision; Receiving; id `p5`]
   - if "Yes" go to Sends an invoice; if "No" go to Reject, or request a correction
6. **Sends an invoice** [task; Vendor; id `p6`]
   - then Three-way match: order, receipt, invoice
7. **Three-way match: order, receipt, invoice** [task; Accounts payable; id `p7`]
   - then Do all three agree?
8. **Do all three agree?** [decision; Accounts payable; id `p8`]
   - if "Yes" go to Schedule payment on the agreed terms; if "No" go to Query the vendor and fix the difference
9. **Schedule payment on the agreed terms** [task; Accounts payable; id `p9`]
   - then Gets paid
10. **Gets paid** [end; Vendor; id `p10`]
11. **Query the vendor and fix the difference** [task; Accounts payable; id `p8a`]
   - then Three-way match: order, receipt, invoice
12. **Reject, or request a correction** [task; Receiving; id `p5a`]
   - then Ships the goods

```mermaid
flowchart LR
  subgraph l_req["Requester"]
    n_p1(["Needs something"])
  end
  subgraph l_proc["Procurement"]
    n_p2[["Get it approved and ordered"]]
  end
  subgraph l_wh["Receiving"]
    n_p4["Receive and inspect"]
    n_p5{"Matches the order?"}
    n_p5a["Reject, or request a correction"]
  end
  subgraph l_ap["Accounts payable"]
    n_p7["Three-way match: order, receipt, invoice"]
    n_p8{"Do all three agree?"}
    n_p8a["Query the vendor and fix the difference"]
    n_p9["Schedule payment on the agreed terms"]
  end
  subgraph l_vend["Vendor"]
    n_p3["Ships the goods"]
    n_p6["Sends an invoice"]
    n_p10(["Gets paid"])
  end
  n_p1 --> n_p2
  n_p2 --> n_p3
  n_p3 --> n_p4
  n_p4 --> n_p5
  n_p5 -->|"Yes"| n_p6
  n_p5 -->|"No"| n_p5a
  n_p5a --> n_p3
  n_p6 --> n_p7
  n_p7 --> n_p8
  n_p8 -->|"Yes"| n_p9
  n_p8 -->|"No"| n_p8a
  n_p8a --> n_p7
  n_p9 --> n_p10
```

## Full data (JSON)

```json
{
  "title": "Procure to pay: from \"we need it\" to paid",
  "maps": {
    "m_root": {
      "id": "m_root",
      "lanes": [
        {
          "id": "req",
          "name": "Requester",
          "type": "person"
        },
        {
          "id": "proc",
          "name": "Procurement",
          "type": "person"
        },
        {
          "id": "wh",
          "name": "Receiving",
          "type": "person"
        },
        {
          "id": "ap",
          "name": "Accounts payable",
          "type": "person"
        },
        {
          "id": "vend",
          "name": "Vendor",
          "type": "person"
        }
      ],
      "steps": [
        {
          "id": "p1",
          "kind": "start",
          "lane": "req",
          "next": [
            {
              "to": "p2"
            }
          ],
          "uses": [],
          "label": "Needs something"
        },
        {
          "id": "p2",
          "kind": "subprocess",
          "lane": "proc",
          "link": {
            "id": "cmv0iecep004ajw06243yz9os",
            "scope": "public",
            "title": "Buy something: purchase order approval"
          },
          "next": [
            {
              "to": "p3"
            }
          ],
          "uses": [],
          "label": "Get it approved and ordered"
        },
        {
          "id": "p3",
          "kind": "task",
          "lane": "vend",
          "next": [
            {
              "to": "p4"
            }
          ],
          "uses": [],
          "label": "Ships the goods"
        },
        {
          "id": "p4",
          "kind": "task",
          "lane": "wh",
          "next": [
            {
              "to": "p5"
            }
          ],
          "uses": [],
          "label": "Receive and inspect"
        },
        {
          "id": "p5",
          "kind": "decision",
          "lane": "wh",
          "next": [
            {
              "to": "p6",
              "label": "Yes"
            },
            {
              "to": "p5a",
              "label": "No"
            }
          ],
          "uses": [],
          "label": "Matches the order?"
        },
        {
          "id": "p5a",
          "kind": "task",
          "lane": "wh",
          "next": [
            {
              "to": "p3"
            }
          ],
          "uses": [],
          "label": "Reject, or request a correction"
        },
        {
          "id": "p6",
          "kind": "task",
          "lane": "vend",
          "next": [
            {
              "to": "p7"
            }
          ],
          "uses": [],
          "label": "Sends an invoice"
        },
        {
          "id": "p7",
          "kind": "task",
          "lane": "ap",
          "next": [
            {
              "to": "p8"
            }
          ],
          "uses": [],
          "label": "Three-way match: order, receipt, invoice"
        },
        {
          "id": "p8",
          "kind": "decision",
          "lane": "ap",
          "next": [
            {
              "to": "p9",
              "label": "Yes"
            },
            {
              "to": "p8a",
              "label": "No"
            }
          ],
          "uses": [],
          "label": "Do all three agree?"
        },
        {
          "id": "p8a",
          "kind": "task",
          "lane": "ap",
          "next": [
            {
              "to": "p7"
            }
          ],
          "uses": [],
          "label": "Query the vendor and fix the difference"
        },
        {
          "id": "p9",
          "kind": "task",
          "lane": "ap",
          "next": [
            {
              "to": "p10"
            }
          ],
          "uses": [],
          "label": "Schedule payment on the agreed terms"
        },
        {
          "id": "p10",
          "kind": "end",
          "lane": "vend",
          "next": [],
          "uses": [],
          "label": "Gets paid"
        }
      ],
      "title": "Procure to pay: from \"we need it\" to paid",
      "parent": null
    }
  }
}
```
