## 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) 1. Compute each line’s **Line Net Total**. 2. Allocate **Bill Discount** to lines (proportional to Line Net Total). 3. Add allocated **Considered for Costing** taxes/expenses to lines. 4. 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-(IFRS))* [Mark-up on Cost](https://github.com/hmislk/hmis/wiki/Mark%E2%80%90up-on-Cost) ![GRN Costing Explained](https://github.com/user-attachments/assets/9db5ea28-1d54-435d-9bff-b011900eee42) [[🔍 View full-size image](https://github.com/user-attachments/assets/9db5ea28-1d54-435d-9bff-b011900eee42)](https://github.com/user-attachments/assets/9db5ea28-1d54-435d-9bff-b011900eee42) — [Back](https://github.com/hmislk/hmis/wiki/Pharmaceutical-Logistics)