Distribution & Logistics Flow
Selling through distributors and selling off the back of a van are not the same as selling from a warehouse, and neither is shipping the result. This flow covers both halves: getting product into the channel, and getting it to the door.
Apps involved
- Distribution — distributors, price lists, van sales, commissions
- Logistics — shipments, routes, carriers, returns
- Inventory — the stock behind all of it
- Sales — orders and invoices
Part 1 — Distribution
Distributor management
A distributor is more than a customer record. Each one carries its own price list (with a discount percentage per line), its own credit limit, and its own commission arrangement. The price list travels with every order placed for that distributor, so a rep in the field cannot accidentally sell at the wrong price.
Credit control
Each distributor has a credit limit, and the credit dashboard shows who is at or over it.
Today this is visibility, not a hard block: exceeding the limit does not by itself stop a distribution order from being created. The automatic block exists on the sales order side, and only when the customer credit-limit check is switched on.
Van sales
Field reps run a session per day. The session is what makes the day reconcilable.
Open the session (morning)
The rep opens a session for the day, recording the vehicle, the route territory and themselves.
Load the van
List the products and quantities going onto the van. Stock leaves the warehouse at this moment — the van is treated as its own stock location, so what is on the van is never invisible.
Sell on the route
Each stop records the customer, products, quantities and payment method — cash, transfer, or on account. Distributor pricing applies automatically.
Close the session (evening)
The rep declares the stock still on the van and the cash collected. The system checks the basic identity: loaded = sold + remaining.
Reconcile
Cash collected is compared with revenue recorded. If everything matches, the session closes as reconciled. If it does not, the session is flagged for review rather than quietly closed.
A session that does not balance is not an error to be suppressed — it is the whole reason the session exists. It stays flagged until a person resolves it.
Returns and credit notes
Product coming back from the channel — damaged, expired, unsold — is recorded as a return, restocked where appropriate, and settled with a debit or credit note against the distributor’s account rather than an informal adjustment.
Commissions
Commission is calculated from actual settled sales, per the arrangement on each distributor or rep, and reviewed before it is paid out.
Part 2 — Logistics
Shipments
A shipment groups what physically travels together. It carries the carrier, tracking reference, cost, and the delivery notes it covers — so one shipment can serve several orders without losing the link back to each.
Delivery routes
Stops are grouped into routes for a driver and a day, in the order you set. Route progress updates as stops are completed, which is what makes “where is my order” answerable without a phone call.
Route sequence is manual — there is no automatic route optimiser for delivery routes today. (Field Service has its own optimiser for technician job routing; it is a different feature and does not apply here.)
Carrier integration
A shipment records its carrier and tracking reference, and tracking updates can be ingested through a webhook.
XBuddy ships working API clients for GHN, GHTK, ViettelPost and J&T Express, but they are not yet wired into the shipment flow — on a shipment, the carrier is a text field. Booking a consignment with those carriers from inside a shipment is not available today.
Returns (RMA)
Inbound returns get their own authorisation and inspection step before restocking, so returned goods do not re-enter sellable stock without someone looking at them.
Status Reference
| Object | States |
|---|---|
| Van session | open → closed → reconciled (or flagged for reconciliation) |
| Shipment | draft → dispatched → in transit → delivered (or exception) |
| Route | planned → in progress → completed |
| Return / RMA | requested → authorised → received → inspected → restocked / scrapped |
Integration Points
| Module | What happens |
|---|---|
| Inventory | Van loading and unloading are stock movements; returns restock |
| Sales | Route sales create orders and invoices under distributor pricing |
| Finance | Cash collected reconciles to revenue; commissions and credit notes post through |
| Accounting | Stock movement and revenue reach the ledger like any other sale |
Related pages
- ERP Flow — the order-to-cash chain these orders join
- Operations Pack Flow — the inventory mechanics underneath