Stock valuation and negative stock

Updated 30 Oct 2026

ERPUltra values stock using the moving weighted average method, kept separately for each item in each warehouse. Every movement updates the books at the same time. Your stock report and your Stock in Hand account always agree.

How the moving average works

When stock comes in, for example from a purchase, opening stock or a positive count adjustment, the average cost is recalculated:

new average = (value on hand + value received) ÷ (quantity on hand + quantity received)

When stock goes out, for example on a sales invoice, it leaves at the current average cost. The average does not change. Taking the last unit takes exactly the value remaining.

Example

Movement Qty Unit cost On hand Value Average
Opening stock 10 ₹100 10 ₹1,000 ₹100
Purchase 10 ₹130 20 ₹2,300 ₹115
Sale 5 ₹115 15 ₹1,725 ₹115

What gets posted

  • A sales invoice posts the cost of goods sold (Dr COGS, Cr Stock in Hand) at the average cost.
  • A credit note for returned goods, or a voided invoice, brings the units back at the cost they went out at.
  • A transfer moves the same value out of one warehouse and into another.
  • A stock count posts differences to Stock Adjustment.

Stock value on the Overview, and in Reports → Stock valuation, use these figures.

Backdated movements are refused

A stock movement cannot be dated before the latest movement of that item in that warehouse. For example, if an item was sold on 10 October, you cannot record a purchase for it dated 8 October in the same warehouse. ERPUltra says:

"Item already has movements after date in warehouse. Date this on or after date."

This keeps every past cost correct without recalculating history. Enter purchases and receipts promptly to avoid this.

Negative stock

By default, stock cannot go below zero. If an invoice or transfer needs more than is on hand, ERPUltra stops it with a message such as "Only 3 of Basmati rice 5 kg in Main warehouse."

Fix it by recording the missing purchase or goods receipt first, or by correcting stock with a stock count.

Businesses that allow negative stock

Some types of business are set up to allow negative stock, because their stock is not always entered before a sale:

  • Restaurant, café and cloud kitchen
  • Professional services and consultancy
  • IT, software and digital agency
  • Transport and logistics
  • Salon, spa and fitness
  • Hotel and guest house
  • Contractor and construction services

This setting comes from the Type of business chosen for the company. See Choose a type of business.

Related