ERP for Trading and Distribution: The Margin Is in the Shipment, Not the Invoice
· 12 min read · Faceela
The container has been at the terminal for eleven days. Four of those were free, three were the consultant's approval on a document, two were a holiday, and two nobody can account for. The demurrage invoice will arrive next month from the line, and by then the goods will have been sold — most of them to one customer, at a price agreed before the vessel sailed, against a margin someone calculated from the supplier invoice and the freight quotation.
That margin was wrong the moment the container stopped moving. It will stay wrong, because the demurrage will post to a general freight account in a later period, where it will be one line among forty and attributable to nothing.
This is the defining characteristic of a trading business. The gross margin on the invoice is not the gross margin on the deal, the difference is not small, and it is only knowable if the system treats the shipment — not the invoice, not the month, not the product — as the thing that costs money.
What the invoice does not know
A manufacturer's cost problem is conversion: material, labour, machine, scrap. A trader has no conversion. Every dirham between the purchase price and the selling price is the cost of moving goods across a border and holding them until somebody buys them, and it arrives in fragments, from different parties, on different dates, long after the transaction that caused it.
| Cost element | Who invoices it | When it typically arrives | Sensible allocation basis |
|---|---|---|---|
| Goods | The supplier | With or before shipment | Directly, per line |
| Ocean or air freight | Forwarder or line | Around shipment | Volume or weight, whichever the rate was built on |
| Insurance | Insurer or forwarder | Around shipment | Value |
| Customs duty | Paid at clearance | At clearance | Value, per tariff line — never spread evenly |
| Clearance and handling | Clearing agent | Days to weeks after | Per shipment, or per container |
| Inland transport | Transporter | Weeks after | Weight or volume |
| Demurrage and detention | Shipping line | Weeks to months after | The shipment that incurred it, in full |
| Inspection, testing, certification | Third party or authority | Variable, often late | The affected lines only |
| Bank charges on the LC | The bank | Across the LC lifecycle | The shipment financed |
| Storage before sale | Warehouse or free zone operator | Monthly, in arrears | The goods still sitting there |
Three things in that table cause most of the trouble.
The allocation basis is not one basis. Freight was quoted per cubic metre or per kilogram, so allocating it by value distorts every line in a mixed container — the heavy cheap item is under-costed and the light expensive one is over-costed, which quietly makes your worst products look like your best. Duty is per tariff line and rates differ by line, so spreading it evenly across a mixed shipment is simply wrong. Insurance genuinely does follow value. A system that offers one allocation method for all landed cost is not modelling the problem.
The timing is the second issue. Most of the costs in that table land after the goods, and a meaningful share land after the goods are sold. That means every landed cost model has to be an estimate-then-correct model, not a wait-and-see one, because waiting means having no cost at all during the period when the goods are actually being priced and sold.
And demurrage and detention deserve their own treatment rather than a general freight account. They are two different charges — one for the container sitting at the terminal past its free days, the other for the container out of the terminal past its free time — and both are almost always caused by something specific: a document that was late, an approval that was not chased, a delivery address that was not ready, an inspection nobody booked. Posted to a shipment, they are a management report about the clearing process. Posted to a freight account, they are weather.
The estimate, and the true-up
At the point of receipt, the goods are valued at the supplier cost plus an estimate of every other element, using standard rates per route, per container type, per supplier. That estimate becomes the item cost immediately, so the sales team is quoting off something defensible rather than off the supplier invoice alone.
As the real invoices arrive, each is matched to its shipment and the difference is posted. If the goods are still in stock, the difference adjusts the stock value. If they have already been sold — which for a fast-moving trader is most of them — the difference has to go to cost of sales in the current period, because there is nothing left to revalue.
That second case is the one everyone forgets to design. If the system cannot post a late cost against goods already sold and still attribute it to the originating shipment, every late-arriving cost becomes an unattributable overhead and the margin report becomes a report about the shipments that happened to have tidy paperwork.
Two disciplines make the pattern honest. The estimate rates must be reviewed against actuals — a route where the estimate is consistently 20 per cent light flatters every deal on it. And there must be a closing point: a shipment is declared cost-complete after a defined period, after which further cost is a period expense and the shipment margin stops moving. Without that, no shipment is ever final.
Margin by shipment, not by invoice
The reporting object in most accounting systems is the invoice, and for a trader that is the wrong grain. A single shipment routinely becomes many invoices, across weeks, at different prices, to different customers, some through a mainland entity and some out of a free zone. A single invoice can contain lines from three shipments landed at three different costs. Any margin report built on invoices alone is averaging across those differences, which means it can tell you the business made money and cannot tell you which decisions made it.
The questions a trader actually needs answered are shipment-shaped. What did this container earn, all in, after everything landed? Which supplier's shipments consistently cost more to clear than the quotation implied? What did the eleven days at the terminal cost, and on how many shipments this quarter did that happen? Was the deal that looked like 14 per cent still 14 per cent after the rebate we did not receive and the storage we did pay?
None of those can be answered by a product-level average cost, which is what most systems default to. They require the shipment to exist as a costing object that survives the goods being split, sold, transferred between entities and partly returned. When you are testing products, this is the specific thing to test — not whether landed cost exists as a feature, but whether the shipment identity survives to the margin report. Regulated distributors feel this most sharply, because the cost of a shipment is not known until three invoices from three parties have arrived and the goods have often moved to another entity in the meantime.
Back-to-back orders
A back-to-back deal — the purchase raised against a specific customer order, the goods often shipped directly from supplier to customer without touching your warehouse — is the highest-margin, lowest-risk transaction a trader does, and it is the one most systems handle worst.
The problems are specific. The goods may never be in a location you control, so any process assuming a receipt into a warehouse and a pick from it is fiction. Ownership passes according to the Incoterm, which decides when the goods are on your balance sheet, and that belongs on the transaction rather than in the trade file. The customer may take delivery before the supplier invoice arrives, so the sale posts with no cost against it unless a purchase accrual is raised deliberately. And the deal has to hold together as one chain: this sales order, this purchase order, this shipment, this margin.
Where a trader does a lot of this, the single most valuable configuration decision is that the purchase order is linked to the sales order at creation, not matched afterwards by a person with a spreadsheet. Matching afterwards works until volume rises, and then it stops, and nobody notices it has stopped for a quarter.
Consignment, in both directions
Consignment is two different problems that share a name, and a trading system has to model both.
Your stock at their site. Goods in a customer's or an agent's warehouse that remain yours until consumed or sold. They are your inventory, they are not in your building, and they need a location representing that customer so they appear in stock, in valuation and in an ageing report. The risk is not theft; it is age. Consignment stock that has sat fourteen months at a customer who is not reordering is an unrecognised write-off, and without an ageing report nobody is looking at it.
Their stock at your site. Supplier consignment, where you hold goods and are invoiced only on consumption. Physically in your racks, not your inventory, not on your balance sheet. If it is received as ordinary stock, your assets include somebody else's goods and your cost of sales is wrong. If it is not received at all, nobody knows how much is there.
Both cases come down to the same structural point: custody and ownership are different attributes and a system that conflates them will be wrong in one direction or the other. It is the same failure that produces material at a subcontractor that appears in stock but not in the yard, and it is solved the same way — by modelling every place goods can be, including the ones you do not own.
The rebate that arrives in November
For a distributor with a principal, supplier rebates are frequently not a rounding item on the margin. They are the margin.
The forms vary: a flat percentage on purchases, a volume tier that applies retrospectively once a target is passed, a marketing contribution, price protection when the principal drops the list price on stock you already hold, and credit notes for damaged or expired goods that get argued about for a quarter. What they have in common is that they are earned during the period the goods are sold and settled long afterwards.
If a rebate is only recognised when the credit note arrives, then the period in which the goods were sold shows an understated margin and the period in which the note lands shows a windfall that has nothing to do with that month's trading. Both numbers are wrong, and the second one is dangerous because it looks like performance.
The design that works accrues the rebate at the point of sale — or of purchase, depending on how the agreement is written — per supplier, per product group, at the rate specified. The accrual sits as a receivable and clears when the credit note arrives, with the difference visible. That difference is the report worth having: which principals settle at the agreed rate, which settle short, and how long each takes.
Tiered rebates need one extra piece: the system has to know the running position against the target. A distributor who cannot see that they are 4 per cent below a threshold with six weeks of the period left is unable to act on the most controllable margin in the business.
Currency, and the window nobody measures
The dirham's peg to the US dollar removes exposure on dollar-denominated purchases and removes it on nothing else. Everything sourced in euro, yen, sterling, renminbi or rupee carries a real position, and the size of it is set by the gap between the moment the price is committed and the moment the currency is paid.
That window is longer than most people assume. A letter of credit opened in March against a shipment loading in May, arriving in June, sold across June and July and settled in August, has a commercial exposure running the full length of that sequence. The purchase is committed at one rate, the payment happens at another, and the selling price was set somewhere in the middle on an assumption.
What a system has to do about it is unglamorous. Record the transaction in its original currency, keep the rate at which it was booked, revalue open payables and receivables at period end, and separate realised differences from unrealised ones so that a rate movement on an open position is not confused with a loss actually taken. What it should also do — and rarely does without being asked — is make the exposure visible while it is still open: total open commitments by currency, with the rate assumed in the pricing. That is a one-screen report and it turns an accounting adjustment into a commercial decision.
The parts that are specific to here
Free zone and mainland is a structural decision, not a tax setting. Whether stock sits in a designated zone, whether a movement to the mainland is an import, and which entity owns the goods at each point, determines the transactions the system must generate — and it is decided when the entity and location structure is designed, which is months before anybody looks at a VAT report. The trade-offs between free zone and mainland structures are worth settling before configuration rather than during it.
Customs data has to come from the item master. Tariff classification, country of origin and the description used on the declaration belong on the product record, because they will be needed on every shipment for the life of that item. Held instead in the clearing agent's files, they are re-established from scratch each time and they drift.
Re-export changes the arithmetic. Goods brought in and shipped out again have a different duty treatment from goods sold locally, and the decision about which route a consignment takes is sometimes made after arrival. A system that fixes the treatment at the point of receipt cannot represent that, and someone ends up correcting it with journals.
E-invoicing is coming on a published timetable. For a trader it is mostly a data completeness question rather than a process change, since the invoice is already a structured document — the risk sits in customer master records and item descriptions that were good enough for a PDF and are not good enough for a transmitted document. The dates and thresholds are set out in the UAE e-invoicing timetable and what it requires.
What to make a vendor show you
Feature lists say yes to all of this. Transactions do not. Take one real shipment and run it in the demonstration.
Receive a mixed container of three products with different tariff rates and different weights. Allocate freight by weight, duty per line and insurance by value, and show the resulting unit costs. Sell 60 per cent of it. Then post a demurrage invoice and a clearing invoice that arrive afterwards, and show where the cost lands for the goods already sold and for the goods still in stock. Produce the margin for that shipment, all in.
Then link one purchase order to one sales order as a back-to-back with direct delivery, and show the margin without the goods ever entering a warehouse. Put stock at a customer's site on consignment and produce an ageing report of it. Accrue a tiered supplier rebate and show the running position against the target. Finally, open a payable in euro, revalue it at period end, settle it at a different rate, and show realised and unrealised separately.
If all of that works on one afternoon with your own numbers, the product can model your business. If any of it requires a spreadsheet or a consultant's promise, you have found the boundary — and it is much better to find it now than in month seven.
A shorter version of the same test is whether your organisation is ready to answer the questions the exercise raises about its own data; the readiness assessment covers that ground. If the answer is that the shipment costing is the whole reason for the project, that is exactly the sort of scope worth defining precisely before anyone quotes, which is what the first stage of an ERP implementation is for.
