Back to documentation
Inventory

Batch & Expiry Date Tracking (FEFO)

Learn stock-level batch tracking, manufacturing and expiry dates, FEFO auto-allocation, and manual testing steps.

Batch & Expiry Definitions

  • Batch Number: A unique alphanumeric code identifying a specific manufacturing lot of goods (essential for Pharma, FMCG, Foods, and Cosmetics).
  • Manufacturing Date (Mfg Date): The date when the specific batch was produced or packed.
  • Expiry Date (Exp Date): The date after which the product is considered unusable or unsafe for consumption or retail sale.
  • Status Indicators: Active (in validity), Near Expiry (within 30 days of expiry), and Expired (past expiry date).

Stock-Level vs Item-Level Tracking

  • Why not on Item Master: A single item (e.g. Paracetamol 500mg or Organic Milk) can have multiple shipments arriving over months, each with different batch numbers, mfg dates, and expiry dates.
  • Item Master Flags: The Item Master only controls whether batch and expiry tracking is enabled for that item (via enableBatchTracking and enableExpiryTracking checkboxes).
  • Stock-Level Execution: Physical Batch Number, Mfg Date, Expiry Date, and Cost/Sale prices are recorded whenever stock enters the system via Stock In or Purchase Bills.

First Expiry, First Out (FEFO) Flow

  • Stock In / Purchase: Inwarding stock requires Batch No (mandatory) and Expiry Date (if expiry tracking is active). Validations enforce Expiry Date >= today and Expiry Date > Mfg Date.
  • Sales / POS Auto-Allocation: When adding batch-tracked items to an invoice, BillSalt automatically selects the earliest non-expired batch with available stock to prevent waste and dead stock.
  • Manual Batch Override: Cashiers can pick an alternative batch from the dropdown; selecting an expired batch triggers an explicit warning.
  • Invoice Printing: Selected batch numbers and expiry dates appear cleanly on thermal and standard GST invoice printouts.

Step-by-Step Manual Testing Guide

  • Step 1 (Settings): Navigate to Settings > Item Settings. Ensure "Batch Number Tracking" and "Expiry & Mfg Date" are toggled ON, then click Save Settings.
  • Step 2 (Add Product): Go to Items > Add Item. Create "Amoxicillin 500mg", check "Batch Number Tracking" and "Expiry Dates", and save without entering batch dates on the master.
  • Step 3 (Stock In Batch 1): Click "Stock In" on the product. Enter Quantity 50, Batch "BAT-01", Mfg Date 30 days ago, Expiry Date in 60 days. Post Stock In.
  • Step 4 (Stock In Batch 2): Click "Stock In" again. Enter Quantity 30, Batch "BAT-02", Mfg Date 10 days ago, Expiry Date in 15 days. Post Stock In.
  • Step 5 (Verify FEFO in Item Details): Open item details drawer. In "Batches & Expiry (FEFO Order)", observe BAT-02 is listed first (earliest expiry, Near Expiry badge) followed by BAT-01 (Active badge).
  • Step 6 (Sale & Printout): Open Create Sale, add "Amoxicillin 500mg". Notice BAT-02 is auto-selected by FEFO. Save and print invoice; confirm "Batch: BAT-02" and expiry date are printed on the receipt.