Public methodology · pharmacy economics
Pharmacy purchasing, stock and margin: the calculation method
Useful analysis starts with a defined scope. This page explains what PharmaPex calculates from imported records, how each result is built and what cannot be concluded from it.
Publisher: ELMARQ · PharmaPex ·
Calculation version : economic-study-4
Lire la méthode en françaisWhich data do you need?
Map CSV columns for sales, purchases, inventory snapshots, supplier terms, credit notes and other inventory movements. Per-pharmacy profiles retain column mappings and flag changed headers. Up to 100,000 rows and 32 MiB are sent in automatic chunks. Select a period and identify product codes and units. Sales can be net of VAT or converted from tax-inclusive prices using each line’s VAT rate, territory and qualification reference. No average basket VAT or category-based tax inference is used. Do not import patient data.
- Sales
- Date, product code, quantity, net selling price excluding VAT and unit cost of goods sold, or complete records for weighted-average reconstruction. Brand, manufacturer, supplier, category and VAT rate where available.
- Purchases and terms
- Dated purchases and net prices excluding VAT; alternative terms for the same product code with supplier, identified contract, validity dates, declared availability and unit fees.
- Inventory
- Date, product code, quantity and unit cost. Last sale, batch and expiry only where known. Turnover requires snapshots at both boundaries of the selected period.
- Other movements
- Losses and receipts outside purchases: date, order, product, signed quantity and reason. Positive receipts require their full cost.
- Direct contribution and operations
- Direct costs by product, date, nature and attribution rule, explicitly not already included in COGS. Observations must cover the selected period exactly: average shelf centimetres, attributed work minutes, observed and available minutes, and declared completeness of direct costs.
- VAT qualifications
- Product, territory, validity dates, rate and documented reference. Consistency checks are not certification of the tax qualification.
- Credit notes
- Reference, date, supplier, amount excluding VAT and expected or recorded status. The comparison does not verify bank settlement.
Formulas and their scope
01Sales and gross trading margin
Sales excluding VAT = Σ (quantity sold × net selling price). Cost of goods sold = Σ (quantity sold × unit cost). Margin = sales − cost of goods sold.
The default is the supplied LGO cost. Explicit weighted-average mode reconstructs costs only when the required records reconcile. An unresolved cost makes total margin unavailable. Complete groups remain readable. The sales margin rate is margin / sales × 100; markup on cost is margin / cost of goods sold × 100. The denominators differ. Operating expenses are not deducted.
02Moving weighted average cost
Average cost = (inventory value before receipt + full acquisition cost of receipt) / (previous quantity + received quantity). Each sale uses the current average cost.
Explicitly selected method. Opening inventory precedes all movements; closing inventory follows them. Identical product units, intra-day order and complete movements are required. Returns reverse the original cost linked within the imported period. Losses remain separate from sales. Quantity discrepancies invalidate the product cost; value and LGO cost differences remain visible. No FIFO batch allocation.
03Inventory value and turnover
Inventory value = Σ (quantity on hand × unit cost). Average inventory = (opening value + closing value) / 2. Turnover in days = average inventory / cost of goods sold × days in period.
Snapshots must match the exact boundary dates and product/batch scope; sold products must be covered. Both period dates count. This average is a two-point approximation, not a daily inventory history.
04Dormancy and holding cost
Dormant stock: last sale more than 90 days before the latest inventory. Holding cost = average inventory × entered annual rate / 100 × days in period / 365.
Records without a last-sale date are outside the dormancy measurement; coverage is shown. Known expiry dates within 90 days are flagged, including overdue dates. The holding rate is your assumption, not an observed cost.
05Three generic shares
Catalogue: generic codes / codes in latest inventory. Purchases: generic purchases excluding VAT / all purchases excluding VAT. Partner: generic purchases from the selected manufacturer / all generic purchases.
Denominators must be known and non-zero. Missing generic status blocks the relevant share; partner share also requires manufacturer data. None of these measures is a prescription substitution rate.
06Supplier terms gap
Positive gap = purchased quantity × (actual net purchase price + actual unit fees − alternative net price − alternative unit fees).
Historical comparison for the same product code: terms valid on the purchase date, availability declared in the file and identified contract. The engine selects the lowest documented alternative cost. Unknown purchase fees exclude the line; provide an explicit zero when no separate fee applies and avoid double counting included fees. This is not therapeutic substitution, an automatic order or a realised saving.
07Credit notes
Sum of expected amounts, kept separate from amounts declared as recorded.
Credit notes are not automatically added to margin because net prices may already include them. An imported record does not prove entitlement to a bonus or actual receipt of funds.
Reference: ANC, PCG 2026, articles 213-34 et 213-35. Reconcile this management calculation with the method used by your pharmacy; no automatic accounting-method change.
Product contribution: from margin to decisions
Compare products, brands, manufacturers, suppliers, categories, VAT and locations over the same period. Direct contribution is not net profit. Missing costs or ambiguous allocation make the affected measure unavailable.
- Net sales and acquisition cost
- Signed quantities × net selling price. Tax-inclusive price / (1 + line VAT rate / 100). Acquisition cost uses net purchase prices plus attributable fees.No average basket VAT or second deduction of an included discount. Credit notes remain separate.
- Direct contribution
- Gross margin − complete, attributable direct costs not already counted.Imported allocation conventions remain visible. Common rent, payroll and overhead are not automatically allocated.
- Two margin rates
- Sales margin rate = margin / sales × 100. Markup on cost = margin / COGS × 100.Strictly positive denominator required. Example: €12 including 20% VAT = €10 net, €7 COGS, €3 margin, 30% sales margin and 42.86% markup.
- Inventory turnover and return
- Turnover = COGS / average inventory at cost. Stock return = margin / average inventory at cost.Period measures, not annualised. Two boundary snapshots approximate average inventory. Under moving-average costing, unreconciled closing values block these contribution ratios.
- Space, work and availability
- Direct contribution / shelf centimetres, or / attributed work hours. Availability = available minutes / observed minutes.Both durations cover the same observation scope. Shrinkage is informative unless separately recorded as a direct cost.
Decision quadrants compare total contribution and turnover using local medians (at least two comparable groups, contribution threshold at least zero) or explicit user thresholds. They guide a review of availability, stock depth, purchasing conditions and assortment. Service role and price positioning remain declared context; associated sales are not inferred. Cost sensitivity varies direct costs by ±20%, holding sales and COGS constant.
Zero sales for an inventory-only product require an explicit declaration that sales are complete for this scope. Unknown sale classifications remain unknown. Stock and direct costs are not prorated across ambiguous brand, VAT or location slices.
VAT: qualification before calculation
French medicine rates depend on their eligibility: the particular 2.1% regime and the 10% medicine regime have distinct conditions. Other product families and territories require their own qualification. The engine reads line rates and optionally checks dated qualifications supplied by the pharmacy; it does not decide legal eligibility. A return linked to a prior sale within the period is checked against that original qualification date, with the same rate and territory.
BOFiP, BOI-TVA-LIQ-40-10, 27/11/2024 · BOFiP, BOI-TVA-LIQ-30-10-60, 14/05/2025
Measure the aisle before changing it
Weekly gross margin per developed meter = period gross margin / sum of shelf lengths in meters / inclusive period days × 7. Developed meters add all measured shelf lengths, including free space. They are not the furniture width on the floor. Product ratios use occupied length and require a stable layout over the period.
Stock coverage is dated available units divided by a positive weekly rate explicitly reviewed for stockouts and seasonality. The layout proposal preserves references, facings and declared locks. It uses measured product dimensions and historical space contribution; it predicts no sales uplift. Before/after comparisons require equal duration, matching assortment and costing, non-overlapping periods and a dated implementation. Promotions, price, season and availability remain confounders.
Photos are private dated records. Product recognition, facing counts and autonomous planograms are not automated. An authorised image catalogue, pilot photos, measured confidence and human review are prerequisites for future image assistance.
Explore the fictional aisle exampleGeneric partner: a documented purchasing review
Imported references identify the generic group, manufacturer, dosage and form, units per pack, source and validity dates. Cross-code comparisons require identical documented presentations and pack sizes, valid terms and explicit fees on both sides. Membership is declared from a source, not independently certified by PharmaPex.
An internal reminder requires an earlier partner purchase, a dated stockout when switching, a later supplier availability confirmation and applicable terms. It is generated on import, not by a live supplier feed. Pharmacist approval requires availability still valid and at most three calendar days old; this freshness threshold is a product rule, not a regulatory requirement. No dispensing or ordering is automated. Follow-up measures the documented partner share in comparable units, not a monetary saving.
BDPM: official downloadable group and presentation files
Download the pilot kit (French, ZIP)Frequently asked questions
Does PharmaPex connect to every pharmacy management system?
No. Configurable column mapping is intended for CSV exports from different systems. Each real format and software version must be checked against representative files. No universal certification or automatic native connection is claimed.
Is a stock catalogue sufficient to calculate gross margin?
No. Gross trading margin requires sales and the cost of goods sold for the same period. A stock catalogue alone cannot establish measured sales revenue.
Are missing values replaced with zero?
No. Unknown fields remain unknown. A result is unavailable if its required inputs are missing. An explicitly provided zero is treated as a value, subject to applicable consistency checks.