This is a personal, non-commercial side project I put together to learn — not a product or service, and not connected to any company I work with.
Post #11 asked a simple question: if payment order isn't really decided by due date, what else is doing the deciding — and can a rule capture it? Below is a small prototype that answers that with sample data.
The script doesn't decide who's important. It just writes down, in one place, the same signals someone was already weighing invoice by invoice — a due date, a discount window, a flag for a critical vendor.
The sample data
Eight open invoices, each with a due date, an amount, whether a discount applies, and whether the vendor is flagged as critical. Two of them move ahead of an older invoice once those signals are counted.
| ID | Vendor | Amount | Due in | Discount | Critical | Rank | Status |
|---|---|---|---|---|---|---|---|
| INV-03 | Freight Carrier | €8,750 | 1 day | 2%/10 | No | 1 | |
| INV-07 | Utility Provider | €1,850 | 2 days | — | No | 2 | |
| INV-01 | Packaging Supplier | €12,400 | 3 days | — | No | 3 | |
| INV-06 | Marketing Agency | €5,100 | 4 days | — | No | 4 | |
| INV-05 | Contract Manufacturer | €41,000 | 6 days | — | Yes | 5 | |
| INV-02 | Core SaaS Platform | €3,200 | 9 days | — | Yes | 6 | |
| INV-08 | Legal Services | €9,300 | 11 days | — | No | 7 | |
| INV-04 | Office Supplies | €640 | 14 days | — | No | 8 |
How it works
Try it yourself
1 — Clone the repository
2 — Add your own invoices (optional)
3 — Run it
4 — Read the output
What it's built from
Data source
A plain CSV of open invoices — no ERP connection, no live banking access, nothing beyond sample data.
Calculation
Standard Python, no external dependencies — a days-to-due calculation and two flag checks.
Configurable signals
Which flags count as "critical" and the discount threshold are command-line arguments, not hardcoded.
Read-only by design
The script only reads and reports. It doesn't schedule or send a single payment on its own.
What's in the repository
The same personal, non-commercial repository as the earlier demos in this series:
- invoice_priority_agent.py — the full script used above
- data/open_invoices.csv — the sample data shown in this walkthrough
- The Idle Cash Agent from Post #10, the FX Monitoring Agent from Post #9, and the Invoice Agent from Post #3
Follow the series
Post #12 moves to the other side of that same ledger: money owed to the company, and why some collection reminders get paid within days while others get ignored for months.
Subscribe free