Costing in Pharmaceuticals - hmislk/hmis GitHub Wiki
Scope & Availability
The costing workflow applies to Direct Purchase and GRN when Manage Costing = true.
Key Data Entry Rules
Unit consistency. Free quantities use the same unit as received quantities. If you receive in packs, record free in packs. If you receive in units, record free in units. Discount rate. Enter as amount per unit, not a percentage or total. Example: Purchase rate 1,500; Discount rate 100 β Net rate per unit 1,400.
Definitions (Line Level)
Receiving Qty = paid quantity received. Free Qty = bonus units received. Line Gross Total = Receiving Qty Γ Purchase Rate. Line Discount Value = Receiving Qty Γ Discount Rate. Line Net Total = Line Gross Total β Line Discount Value. Total Units (sellable) = Receiving Qty + Free Qty. Potential Revenue = Total Units Γ Retail Rate.
User-entered line values are never altered by bill-level calculations.
Bill-Level Allocations
Bill Discount: distributed proportionally to lines by Line Net Total share. Bill Taxes/Expenses: only items Considered for Costing are added to cost and distributed proportionally. Items Not Considered for Costing are excluded from cost (no impact on mark-up).
Costing Computation (Order of Operations)
- Compute each lineβs Line Net Total.
- Allocate Bill Discount to lines (proportional to Line Net Total).
- Add allocated Considered for Costing taxes/expenses to lines.
- Per line, compute:
- COGS (line) = Line Net Total β Allocated Bill Discount + Allocated Considered Expenses/Taxes.
- Cost per unit = COGS (line) Γ· Total Units.
- Mark-up on cost (%) = [(Potential Revenue β COGS (line)) Γ· COGS (line)] Γ 100.
Worked Example (from GRN)
Crestor 10 mg Tablet Line Net Total: 14,000 Allocated Bill Discount: 1,266.97 β interim cost 12,733.03 Allocated Transport (Considered): 316.74 β COGS (line) 13,049.77 Total Units: 11; Potential Revenue: 11 Γ 1,800 = 19,800 Gross Profit: 19,800 β 13,049.77 = 6,750.23 Mark-up on cost: 6,750.23 Γ· 13,049.77 = 51.7%
Azee 500 mg Tablet Line Net Total: 8,100 Allocated Bill Discount: 733.03 β interim cost 7,366.97 Allocated Transport (Considered): 183.26 β COGS (line) 7,550.23 Total Units: 33; Potential Revenue: 33 Γ 500 = 16,500 Gross Profit: 16,500 β 7,550.23 = 8,949.77 Mark-up on cost: 8,949.77 Γ· 7,550.23 = 118.5%
Bill Summary (Example)
Gross Total (sum of line nets): 22,100.00 Bill Discount: β2,000.00 Bill Expenses (Considered for Costing): +500.00 Bill Taxes (Considered for Costing): as applicable Net Total (COGS, bill): 20,600.00 Bill Expenses (Not Considered for Costing): e.g., 1,500.00 (no impact on mark-up) Sale Value (Potential Revenue): 36,300.00
Cross-check: Sum of line gross profit equals Sale Value β Net Total (COGS, bill).
Display Convention (System)
Primary metric: Mark-up on cost (%). Show alongside Net Revenue, COGS, and Gross Profit per line and for the bill. Round UI to two decimals; keep higher precision in calculations.
Notes & Validation
Keep units consistent for paid and free quantities. Allocate only amounts flagged Considered for Costing. Do not back-calculate or overwrite user-entered line rates. Ensure the grid refreshes after bill-level edits so line mark-ups reflect allocations.
References
- [International Financial Reporting Standards (IFRS)](https://github.com/hmislk/hmis/wiki/International-Financial-Reporting-Standards-%28IFRS%29)
- [Mark-up on Cost](https://github.com/hmislk/hmis/wiki/Mark%E2%80%90up-on-Cost)
[π View full-size image](https://github.com/user-attachments/assets/9db5ea28-1d54-435d-9bff-b011900eee42)
β [Back](https://github.com/hmislk/hmis/wiki/Pharmaceutical-Logistics)