Cash flow in distribution: how to control working capital with AI
Why a profitable company can run out of money: how to control working capital and cash flow in distribution with AI.
Gastón Kehyaian
COO
The owner of a food distributor showed me his income statement with pride: he had just come off a record year in revenue and the margin closed well. Then he lowered his voice and told me what was really keeping him awake: at the end of the month he did not have enough to pay his suppliers. Profitable on the balance sheet, choking at the bank. That contradiction — making money on paper and not having it in the account — is one of the most common and most dangerous traps in distribution.
The explanation is almost always in the same place: working capital. The company's money is not lost, it is trapped. Part of it sleeps in inventory, part of it is lent to customers who have not paid yet, and across from that sit the suppliers who do have to be paid. When that triangle goes out of balance, a prosperous company can enter financial stress without having lost a single customer.
The problem is that in most distribution SMEs the triangle is managed with a spreadsheet and a lot of intuition. Today's cash is watched, not the cash three weeks out. And by the time the shortfall appears, it is too late to react with any room to manoeuvre.
In this article you will see how that triangle of inventory, collections and supplier payments is formed, what a layer of AI on top of your ERP does to anticipate cash gaps, a real case of a distributor that stopped living on the edge, and the concrete steps for starting to control it.
1. The problem: profitable on paper, no money in the bank
1.1 The difference between profit and cash
Profit is an accounting opinion; cash is a fact. You can invoice a sale and record it as revenue this month, but if the customer pays in 60 days, that money does not exist yet. Meanwhile, the goods you sold have already been paid for, or will be paid for before you collect. That gap between what you show as profit and what you have available is where cash flow problems live.
1.2 The working capital triangle
In distribution, working capital plays out on three fronts that move together:
- Inventory. Every product in the warehouse is idle money. Too much stock is frozen cash; too little stock is a lost sale.
- Receivables. What customers owe you is your money in somebody else's hands. The longer they take to pay, the more you are financing their business.
- Payables. What you owe suppliers. It is the one lever that, used well, plays in your favour over time.
The balance between the three determines how much money you need tied up for the wheel to turn.
1.3 The hidden cost of not anticipating
When you do not see the cash gap coming, you solve it with the most expensive resources: bank overdraft, emergency factoring, or worse, you pay suppliers late and lose early-payment discounts and negotiating power. The hidden cost is not only the interest; it is that the company starts making financial decisions defensively, putting out fires instead of planning.
2. What a financial cockpit with AI is
2.1 From today's snapshot to the film of the coming weeks
Most tools show you the snapshot: how much money there is today. A financial cockpit with AI shows you the film: how your cash will evolve over the coming weeks if everything continues as it has been. It crosses what you are going to collect (based on each customer's real payment behaviour, not the invoice's theoretical date) with what you have to pay and with how inventory is going to move.
2.2 The signals it crosses
The AI layer, connected to your ERP, continuously reads:
- The real payment behaviour of each customer, not the agreed terms. Some customers agree to 30 days and pay in 50.
- Supplier due dates and early-payment discount opportunities.
- Inventory turnover by category, to detect where cash is freezing up.
With that it builds a living cash projection, which updates itself as movements come in.
2.3 AI on top of your ERP, replacing nothing
None of this requires changing systems. The ERP already has the invoices, the payments and the stock. What is missing is a layer that reads them together and projects forward. That is nBlock's logic: the intelligence goes on top of your ERP, without touching the transactional core.
3. A real case: the distributor that stopped living on the edge
3.1 Before
A wholesale distributor of electrical materials, with around 3,000 SKUs and 18 reps, was invoicing well but living in permanent financial tension. Every month-end was an anxious negotiation with suppliers and with the bank. Cash was projected in a spreadsheet that a single administrator updated by hand, and that was almost always out of date.
3.2 A phased implementation
- Visibility (month 1). The AI layer was connected to the ERP and an 8- and 12-week cash projection was built, using each customer's real payment behaviour.
- Focused collections (month 2). The projection was crossed with collections prioritization, attacking first the accounts that moved the cash flow needle most. Coordinating with automated collections with AI was key here.
- Aligned purchasing (month 3). Projected cash was connected to purchase planning, so payments were not committed in weeks where cash was already tight.
3.3 After
Within a few months, month-ends stopped being an emergency. The company started seeing cash gaps three to five weeks ahead, which allowed it to negotiate terms instead of asking for overdrafts. Use of the bank overdraft fell noticeably and they recovered early-payment discounts they used to let go. There was no more money; it was better managed over time.
4. Step-by-step implementation
4.1 Get the collections data in order
The first step is having each customer's real payment behaviour clean. Not the theoretical terms, but how many days they actually take. Without that data, any projection is fiction.
4.2 Build the cash projection
With expected collections, supplier due dates and inventory movement, the 8- and 12-week projection is assembled. AI updates it on its own with every ERP movement.
4.3 Connect the three corners of the triangle
Real control arrives when collections, purchasing and inventory are looked at together. A purchasing decision changes the cash position three weeks later; so does a customer falling behind. Crossing this with per-customer profitability analysis helps you understand which customers finance the operation and which strain it.
4.4 Define alerts and thresholds
Finally, alerts get configured: tell me when projected cash drops below a certain floor, when a large customer falls behind, or when an important due date lands in a thin week. The goal is to react with time, not with a fright.
5. ROI and measurable benefits
5.1 The metrics that move
The indicators worth tracking:
- Days of cash (how many days of operation you cover with the money available).
- Cash conversion cycle (days of inventory plus days of receivables minus days of payables).
- Use of emergency financing (overdraft, expensive factoring).
- Early-payment discounts captured versus lost.
5.2 The typical return
The return does not come from selling more, but from needing less money trapped to sustain the same business. Freeing up working capital, even by a moderate percentage, usually equals several months of financing you stop paying for. And anticipating gaps turns panic decisions into negotiated ones.
5.3 The benefit that is not measured in money
There is a return that is hard to quantify but real: sleeping soundly. When leadership can see the cash position of the coming weeks, it stops governing the company from today's balance. That changes the quality of every decision, not just the financial ones.
6. Common mistakes in managing working capital
6.1 Confusing cash with profitability
The root mistake is looking at the income statement to understand financial health. Profitability tells you whether the business makes money over time; cash tells you whether you can pay tomorrow. They are two different questions, and a company can answer yes to the first and no to the second. Managing working capital is, above all, stopping the habit of using profit as if it were cash.
6.2 Projecting with the theoretical payment date
Many cash projections use the agreed terms (30, 60, 90 days) as if customers paid punctually. They do not. The customer who agreed to 30 pays in 50, and if you project with 30, your real cash will be worse than the paper version every month. A useful projection uses real payment behaviour, not theoretical terms. That is one of the first corrections an AI layer contributes.
6.3 Buying well and collecting badly, or the other way round
Working capital is a triangle, and optimizing one corner alone unbalances the rest. Negotiating long terms with suppliers is useless if you simultaneously let collections stretch out. Buying very tight so as not to tie up cash can generate stockouts that cost sales. Real control arrives when you look at inventory, collections and payments as one system, not three separate tasks.
6.4 Reacting rather than anticipating
The most expensive mistake is operating from today's balance. By the time the shortfall appears, it is too late to negotiate and only the expensive options remain (overdraft, emergency factoring). Anticipating the gap with weeks of notice turns an emergency into a negotiation, and that shift in timing is half the value of projecting cash.
Ready to see the cash of the coming weeks, not just today's?
A profitable company that runs out of money does not have a sales problem: it has a working capital problem nobody is watching in advance. Controlling the triangle of inventory, collections and supplier payments with a layer of AI on top of your ERP is the difference between planning and firefighting.
Want to see how it works in practice? Book a demo and we will show you how to project your cash flow from the data you already have in your ERP.
Written by
Gastón Kehyaian
COO
Over 20 years of executive experience in management, finance and digital transformation. MBA, MND, specialist in digital transformation.
Ready to turn on your first block?
We will show you where the hidden value is in your operation, on your own ERP. No strings attached.
Book a demo →



