# run-order-to-cash

Run order-to-cash: confirm a sales order against stock, deliver, invoice and record (partial) payments

- **Space:** erp-public (https://github.com/Tech-Realm/space-erp-public/tree/main/run-order-to-cash)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** stdlib-sqlite; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use erp-public/run-order-to-cash` or MCP `get_pack erp-public/run-order-to-cash`
- **Files:** CHANGELOG.md, code/erp.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

Run order-to-cash: confirm a sales order against stock, deliver, invoice and record (partial) payments

## Goal
Every sale reduces stock once, produces one invoice and is marked paid only when fully paid.

## Steps
1. `so CUSTOMER SKU:QTY:PRICE...` (refused if stock is short).
2. `deliver SO` (stock moves out).
3. `invoice SO` -> total.
4. `pay INV AMOUNT` -> remaining; status partial|paid.

## Edge cases
- Overpayment: remaining goes negative -> refund/credit note.
- Cancel after delivery: return moves + credit note.

## Don'ts
- Don't invoice undelivered orders unless it's a prepayment flow.



---

Canonical URL: https://logicpacks.io/packs/erp-public/run-order-to-cash

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
