Negative stock + incoming transaction: why Average Rate instead of Incoming Rate?

Trying to understand the design decision behind using Average Rate for purchase/incoming transactions when stock goes negative, rather than the Incoming Rate.

Context

We have a multi-entity setup and one of our subsidiaries occasionally hits negative stock due to sequencing issues between inter-company transactions. When this happens, ERPNext falls back to Average Rate for valuation, and this creates GL entries that don’t reflect the actual cost at which the stock was received.

The confusion

I understand why negative stock is problematic for valuation — the system can’t reliably determine cost when stock doesn’t exist yet. FIFO and Moving Average both break down conceptually when quantity goes below zero. But here’s what I don’t get: for an incoming transaction specifically (Purchase Receipt, Stock Entry with type Receipt, etc.), we do know the rate. The supplier invoice or PO has the rate. It’s not unknown. So why not use the Incoming Rate from that transaction for the GL entry, rather than falling back to Average Rate (which could be stale, zero, or completely unrelated)?

### What we observed When stock is negative and a Purchase Receipt comes in: - The Stock Ledger Entry uses Average Rate, not the actual incoming rate - This causes the GL to post at a rate different from what’s on the Purchase Receipt - Results in valuation differences that need manual correction

### My question Was this an intentional design decision? If so, what’s the rationale — is it to keep the valuation method consistent across all SLEs for a given item, even at the cost of accuracy on individual transactions? Or is this a known limitation that’s been deprioritized? Would also appreciate if anyone has a workaround short of disabling negative stock entirely (which isn’t always operationally feasible).

I am not exactly sure of the answer but I can try.

When stock goes negative, ERPNext correctly uses the average rate, why? Because it doesn’t know the rate the stock came in, because the stock never came in, hence “negative stock”, so it guesses using the average rate.

Consider this scenario, item is sitting at -10 qty with -1000 as the stock value. If we use the incoming rate of the Purchase Receipt while stock is negative, lets say you “in” 5 qty at 300 each. Your total stock balance value becomes -1000 + 1500 = 500. This means that you have qty of -5 with a balance of positive 500. How can negative balance qty have positive stock value?

Going into negative stock and thinking valuation will stay normal is like bringing a dead horse onto his feet.

Negative stock create chaos and keeping it not to happen, add some factious qty into store which is more easy to handle and reconcile by running stock recon periodically.