If you cannot tell the cost of a laser session to the nearest dirham, you cannot tell its margin, you cannot price it confidently, you cannot reward staff fairly. The BOM (bill of materials), COGS (cost of goods sold), and inventory valuation chain is the spine of clinic margin. Stock decrements as the service is delivered and the COGS journal posts when the invoice is paid, but only if you set it up right. This article walks how.

Where it lives#

  • Catalog → Services → [service] → Materials tab: define the per-service material list. The accounting term for this is the BOM (bill of materials), which the rest of this article uses for short.
  • Catalog → Products: items in stock with cost.
  • Inventory → Stock records: per-batch on-hand and value.
  • Accounting → COGS: cost recognised against revenue.
  • Reports → Margin: per-service margin after COGS.

The BOM, the foundation#

What a BOM is#

A list of materials a service consumes when delivered. Per item: quantity, unit. Example: a hydrafacial consumes 1 booster serum (5 ml), 1 cleansing tip (1 unit), 0.05 ampoule of vitamin C (used across 20 sessions per ampoule).

Per-service BOM design#

  1. Catalog → Services → open the service → Materials tab.
  2. Add line items: pick the product, enter quantity per session, pick unit.
  3. Quantity can be a decimal (use 0.05 ampoule, not "1 every 20 sessions").
  4. Save. The BOM is now bound to the service.

BOM variations#

  • Default BOM per service.
  • Per-line Exact usage: off auto-deducts the planned quantity at session close; on defers the deduction until the operator enters the actual quantity used (controlled drugs, high-value injectables).
  • Per-line Lock qty: the operator can't change the consumed quantity at delivery.
  • Per-line Vendor-billed: the material is supplied and billed by a vendor. No stock is deducted and it's excluded from COGS, but a consumption record is still kept.
  • Pack-size awareness: the system tracks unit-of-consumption vs unit-of-purchase.

When stock decrements, and when COGS posts#

These are two separate events. Keeping them straight is the single most important thing in this article.

  • Stock decrements when the service is delivered. When the booking session is marked Done, each BOM line decrements stock at the consuming branch (Exact-usage lines wait for the actual quantity first). That stock move records the cost of the consumed materials and freezes it onto the invoice line as a cost snapshot.
  • The COGS journal (Dr COGS / Cr Inventory) posts when the invoice is marked Paid, from that frozen cost snapshot on the paid invoice, not at the moment of consumption. Because it posts with the paid invoice, revenue and COGS land in the same period and gross margin per service follows.
  • There is deliberately no consumption-time COGS journal. An earlier version posted COGS at consumption and double-counted billed sessions, so it was removed. Consumption moves stock and freezes cost; the invoice posts COGS.
  • Both steps require inventory accounting to be wired for the branch and warehouse. If it isn't, the stock quantity still changes but the journal step is skipped.

Decimal precision#

  • BOM quantity is stored as an exact decimal (up to six places).
  • Stock on-hand is tracked at the same precision.
  • No silent rounding. A 0.05 ampoule consumption decrements the on-hand by 0.05, exactly. This holds in both Exact-usage and auto modes.
  • This matters because rounding drift over thousands of sessions kills accuracy: a 5% rounding error means inventory is 5% off after a year.

Recording actual usage#

For a material with Exact usage on, stock isn't deducted at submission. The operator enters the actual quantity used at session close, and the deduction (and its cost) post against that actual. This keeps COGS honest for high-value or controlled materials and leaves an audit trail of what was really used. Materials without Exact usage auto-deduct the planned BOM quantity.

Coming soon. A planned-vs-actual tolerance band (save silently within a percentage, require a reason outside it) and an outlier-provider report are on the roadmap. Today there is no tolerance gate or mandatory reason prompt.

Stock valuation method#

The costing engine is set per inventory category, not per warehouse. Open the category (Inventory → Categories → Cost method) and pick one:

  • Standard cost: uses the product's product_cost (the operator-set standard).
  • AVCO (weighted-average): the running weighted-average cost across on-hand priced stock.
  • FIFO: the cost of the oldest-received on-hand batch.
  • By lot / serial: the actual cost of the specific batch consumed.

What is not built is a per-warehouse valuation selector — the method lives on the category, and one product is costed the same way everywhere. If a category has no cost method set, consumption falls back to a simpler legacy rule:

  • If the stock record has a supply_price from its most recent receipt, that price is used.
  • Otherwise the product's product_cost is used.
  • If neither is set, cost is zero.

Valuation layers are written for every stock move (receipt, consumption, adjustment, disposal, count), so FIFO and AVCO compute from real layer data. Set supply_price per receipt so categories still on the fallback keep an honest snapshot.

Accounting wiring, when journals fire#

Inventory journals post only when both of these are configured for the branch plus warehouse plus product:

  • A general journal exists on the branch (Accounting → Journals).
  • The inventory asset account plus adjustment / disposal account are resolvable from warehouse or product or business-level fallback.

If either is missing, the stock move still completes (qty changes correctly) but the journal step is silently skipped. The accounting_required flag in the validator decides which moves attempt the post. To confirm a tenant is fully wired, open Settings → Inventory → Accounting accounts and verify each warehouse has its three accounts mapped.

COGS on the income statement#

  • Debit: COGS (an expense account).
  • Credit: inventory asset.
  • The asset on the balance sheet reduces, the expense on the income statement increases, both on the same line at the same moment.
  • Gross margin = revenue − COGS.

Services without BOM#

  • Consultations, talk therapy, planning sessions: no consumable.
  • BOM is empty, COGS is zero, margin is revenue minus the clinician's time cost (allocated separately).
  • Allocating time cost is optional but recommended for high-margin-rate analysis.

Quick-sale products#

  • A skincare cream sold at the desk (no session).
  • Stock decrements when the invoice is marked Paid, for lines whose delivery mode is "on paid" (other modes defer to delivery or session-done).
  • One unit leaves stock at its cost; margin = sell price − cost.

Stock counting and reconciliation#

Cycle counts#

  • Weekly or monthly, count a subset (high-velocity items every week, slow-movers every month).
  • System pre-fills expected on-hand.
  • Counter enters actual.
  • Variance auto-creates an adjustment with reason (missing, found, miscount).
  • Owner approves adjustments above threshold.

Full physical inventory#

  • Annually or quarterly.
  • Count everything.
  • Big variance opens an investigation: leakage, breakage, miscount, theft.
  • Adjustment lands on the income statement as inventory write-off.

Expiry handling#

  • Batches carry expiry dates.
  • Near-expiry batches raise expiry alerts (default 30 days, then a tighter critical window).
  • Consumption defaults to earliest expiry within the branch (FEFO); an explicit workflow strategy or the product inventory category can select FIFO or LIFO instead.
  • Expired stock is blocked from the service-consumption path, but it is not auto-removed from on-hand. Clear it with a manual disposal; the write-off posts then.
  • See the dedicated Expiry, FEFO, recall guide for the full behaviour.

Reports that matter#

  • Per-service margin: revenue, COGS, gross margin, gross margin %.
  • Per-provider material efficiency: planned vs actual consumption per service.
  • Outlier provider: persistent over-use flagged.
  • Stock turn: how many times the inventory turned over in the period.
  • Days of supply: at current burn rate, how many days until stock-out.
  • Shrinkage rate: variance from cycle counts and full inventory.
  • Expiry write-off rate: % of inventory lost to expiry.
  • Service profitability rank: which services pull margin, which lose money.

KPIs and what they mean#

  • Gross margin per service > 60% (aesthetic), > 70% (clinical) is healthy.
  • Stock turn > 6 per year suggests efficient capital use.
  • Shrinkage < 1% is normal, > 3% is concerning, > 5% is investigation territory.
  • Expiry write-off < 2% of consumption is normal, > 5% suggests over-ordering.
  • Provider material variance < 10% is normal practice, > 25% is outlier.

Common mistakes#

  • No BOM: COGS is zero, gross margin reads 100%, owner thinks the clinic is more profitable than it is, sets pricing too low.
  • BOM with whole-unit precision when it should be decimal: a single ampoule for 20 sessions is recorded as 1 every 20 by guess, not 0.05 per session by accuracy.
  • Not turning on Exact usage for high-value materials: the planned quantity auto-deducts and real over-use stays invisible.
  • Not running cycle counts: variance accumulates, balance sheet drifts, write-off at year-end is huge.
  • Switching a category's cost method back and forth: pick one method per category and stick with it, or period-over-period margins stop being comparable.
  • Treating COGS as a manual journal at month-end: COGS already posts automatically when each invoice is marked Paid, so a manual month-end entry double-counts.
  • Excluding quick-sale products from BOM: products sold without COGS, margin lies for retail.
  • Setting the reorder minimum by gut: stockouts and excess. Base the minimum on recent consumption and lead time (it's a manual threshold today, not auto-computed).

How BOM / COGS connects to the rest of the system#

  • Catalog: BOM lives on the service definition.
  • Inventory: GRN sets cost, BOM consumes stock.
  • Service report: triggers consumption.
  • Accounting: COGS lands on the income statement.
  • Reports: margin per service, per provider, per branch.
  • Commissions: post-COGS margin can drive variable rates.
  • Vendors and purchases: cost on the PO feeds inventory value.
  • Pharmacy: dispense consumption mirrors BOM consumption.