</>CodeWithKarani

ERPNext for Distribution: Stock, Branches and Margins Under Control

Karani GeoffreyKarani Geoffrey7 min read

Distribution is a business of small margins and large volumes, which means it is a business where small errors are expensive. Two percent of stock unaccounted for, a discount structure nobody controls, a branch that sells at the wrong price, a debtor who quietly went sixty days past due - each is minor on its own and collectively they are your entire profit.

Most Kenyan distributors and wholesalers run on some combination of an accounting package, branch spreadsheets, a WhatsApp group for orders and a stock count that takes a weekend and still does not agree. It works until you add a branch or a product line, and then it does not.

This article covers how ERPNext for distribution and wholesale puts stock, branches and margins back under control, and what to watch out for on the way.

What distribution actually needs from an ERP

Distributors need fewer features than manufacturers but they need them to be exactly right, at speed, across locations. The core requirements are:

  • Real-time stock by warehouse and branch, visible to sales before they promise anything
  • Controlled pricing - price lists by customer group, region, channel and volume, with rules rather than discretion
  • Credit control that actually blocks, not a report someone reads later
  • Accurate gross margin per item, customer, branch and rep, including landed cost
  • Fast order to dispatch, because the customer is comparing you to the competitor who answered first
  • Inter-branch transfers that are visible in transit and reconciled on receipt
  • Batch and expiry tracking where product has a shelf life
  • Receivables discipline - ageing, statements, reminders, follow-up

Stock: the thing everything else depends on

If your stock ledger is wrong, nothing built on top of it is worth reading. Getting it right in ERPNext comes down to a handful of decisions.

Design your warehouse tree deliberately

Warehouses in ERPNext are hierarchical, and the structure you choose determines what you can report on. A workable pattern for a multi-branch distributor:

  • Company, then branch, then function - Main Store, Sales Floor, Damaged, Goods in Transit, Returns
  • A separate transit warehouse so inter-branch stock is never invisible while on the road
  • A quarantine or damaged warehouse so bad stock is excluded from availability but still on the books

Businesses that dump everything into one "Stores" warehouse lose the ability to answer the only question that matters at branch level: what do we have here, right now?

Value your opening stock properly

Loading opening quantities without valuation is the single most damaging shortcut in a distribution implementation. Every margin report from that day forward is fiction, and correcting it later means restating months of accounts. Spend the extra week at go-live.

Use landed cost if you import

Freight, duty, clearing and transport belong in the item's valuation, not in a general expense account. Without landed cost, imported lines look far more profitable than they are, and you will price them accordingly. ERPNext's Landed Cost Voucher applies these charges back onto the purchase receipt, item by item.

Count cyclically, not annually

An annual stock take that shuts the business for two days finds problems eleven months too late. Cycle counting - a few high-value or fast-moving items every week, reconciled immediately - finds the leak while the trail is still warm. ERPNext's stock reconciliation handles this cleanly, and the discipline matters more than the tooling.

Track batches and expiry where relevant

For FMCG, agrochemicals, pharma and anything perishable, batch tracking with expiry is not optional. It lets you sell first-expiry-first-out, quantify what is about to become worthless, and target a recall instead of pulling everything.

Branches: visibility without chaos

Multi-branch is where distributors usually outgrow their existing system. ERPNext handles it, provided three things are configured properly.

Permissions by branch

A Nakuru sales clerk should see Nakuru stock and Nakuru customers. Regional managers see their region. Directors see everything. ERPNext's user permissions and role design make this straightforward, but it must be designed at implementation, not patched on after someone finds they can view group margins.

Inter-branch transfers with a transit warehouse

Material Transfer through a Goods in Transit warehouse means dispatched stock leaves the sending branch immediately but only enters the receiving branch on confirmed receipt. Discrepancies surface at the point of receipt, with a document trail, rather than at year end as an unexplained variance.

Branch-level profit and loss

Cost centres or dimensions per branch let you see which locations actually contribute. Most distributors are surprised by this report the first time they see it. One branch is usually carrying another, and until it is measured, the subsidy continues indefinitely.

Margins: pricing that is controlled, not negotiated

In wholesale, price discipline is margin. ERPNext gives you the tools to move pricing from personal discretion to policy.

ToolWhat it controls
Price ListsDifferent prices by customer group, channel, region or currency
Pricing RulesVolume breaks, promotional discounts, item or group specific rules with validity dates
Promotional SchemesBuy-x-get-y and tiered offers without manual line editing
Maximum discount per itemA hard ceiling on what any user can give away
Approval workflowAnything beyond the ceiling requires a named approver
Credit limit and ageing blockOrders stopped at entry for customers over limit or overdue

The credit limit block deserves particular attention. Nearly every distributor we meet has a receivables problem, and nearly every one is trying to solve it with reports and phone calls. Blocking order entry at the point of sale changes behaviour in a week, because the conversation happens before the goods leave rather than sixty days after.

Debt collection is a system design problem long before it is a collections problem. The cheapest debtor to manage is the one you never allowed to over-extend.

Know your true margin

Gross margin per item is only meaningful when valuation includes landed cost and when returns, damages and rebates are recorded against the right line. Once that is true, the reports that change decisions become available: margin by customer, by rep, by branch, by item group, and the list of lines you are selling below cost. Most distributors have a few, and nobody knew.

What it costs to get distribution ERP wrong

  • Unvalued opening stock - margins wrong indefinitely
  • No landed cost - imported lines priced on a fantasy cost base
  • Everything in one warehouse - no branch accountability, no meaningful stock control
  • Open permissions - every clerk sees group margins, and eventually a competitor does too
  • Credit limits as a report - receivables grow while everyone agrees they are a problem
  • Discounts by discretion - margin erodes quietly, one sale at a time
  • Transfers without transit - stock disappears between branches with nobody accountable

How to start

  1. Clean the item master. One code per product, correct UOMs and conversion factors, sensible item groups. This is the work that makes everything else possible.
  2. Design the warehouse tree with branch and function separation, including transit and damaged.
  3. Value your opening stock properly, item by item.
  4. Set price lists and pricing rules to match your actual commercial policy, then enforce the ceilings.
  5. Turn on credit limits with real numbers and a real approver.
  6. Go live branch by branch, not all at once.
  7. Then extend to a sales rep mobile app, M-Pesa collection, WhatsApp order confirmation and statements, and dashboards for management.

Do the extensions in that order. Automation and analytics multiply whatever your data quality already is, which is a benefit when the base is clean and a serious problem when it is not. We wrote about that trap in don't get pressured into buying AI before your business is ready.

Talk to us about distribution on ERPNext

Upeosoft Limited is a Nairobi-based ERPNext consultancy extended with custom engineering, mobile apps, integrations and AI automation. Retail and distribution is one of our core industries, alongside manufacturing, automotive, real estate, waste management, security services, professional services and lending, with over 200 systems delivered.

If your stock never quite agrees, your branches are opaque and your receivables keep growing, those are the same problem wearing three different faces. Tell us how you are set up and we will show you what the fix looks like.

  • Email: consult@upeosoft.com
  • Phone: 0116 888 777
  • Web: upeosoft.com
#ERPNext#Distribution#Wholesale#Inventory#Kenya#Upeosoft
Keep reading

Related articles