Why does a Purchase Receipt or Invoice post COGS or rate variance entries
Example
You order 10 HDMI cables at 100 each. You receive all 10 at 100 on 3 November. On 5 November you sell 6. On 10 November, the supplier bills 80 each, so the invoice is 800, not 1,000.
With Set Landed Cost Based on Purchase Invoice Rate off, the entries are:
| Document | Account | Debit | Credit |
|---|---|---|---|
| Purchase Receipt (3 Nov) | Stock In Hand | 1,000 | |
| Stock Received But Not Billed | 1,000 | ||
| Delivery Note (5 Nov) | Cost of Goods Sold | 600 | |
| Stock In Hand | 600 | ||
| Purchase Invoice (10 Nov) | Stock Received But Not Billed | 800 | |
| Creditors | 800 |
Stock Received But Not Billed keeps a credit of 200. The 4 cables in stock stay at 400, and the 6 sold cost 600.
With Set Landed Cost Based on Purchase Invoice Rate on, ERPNext revalues the receipt at 80 and reposts every later entry:
| Document | Account | Debit | Credit |
|---|---|---|---|
| Purchase Receipt (3 Nov) | Stock In Hand | 800 | |
| Stock Received But Not Billed | 800 | ||
| Delivery Note (5 Nov) | Cost of Goods Sold | 480 | |
| Stock In Hand | 480 | ||
| Purchase Invoice (10 Nov) | Stock Received But Not Billed | 800 | |
| Creditors | 800 |
Stock Received But Not Billed is clear. The 4 cables in stock are worth 320. The Delivery Note's Cost of Goods Sold changed from 600 to 480 because 6 of the cables were sold before the invoice came.

How it works
Stock Received But Not Billed (SRBNB) is a temporary account. The Purchase Receipt credits it with the value of the goods received. The Purchase Invoice debits it with the billed amount. When both are the same, it clears to zero.
When the invoice rate is different, there are three ways ERPNext handles the difference:
- Set Landed Cost Based on Purchase Invoice Rate is off. The invoice only clears what it bills. The difference stays in SRBNB, and the stock keeps the receipt rate.
- Set Landed Cost Based on Purchase Invoice Rate is on. The invoice changes the valuation rate of the receipt. A Repost Item Valuation then recalculates every later entry of that item. Stock that is still in the warehouse takes the new rate. Stock that was already sold or consumed changes the Cost of Goods Sold (or the expense account) of the document that issued it.
- The item uses the Standard Cost valuation method. Stock is always valued at the standard rate. The difference between the purchase price and the standard rate goes to the Purchase Price Variance account.
You can turn on Set Landed Cost Based on Purchase Invoice Rate only when Maintain Same Rate Throughout the Purchase Cycle is off. Both are in Buying Settings.
Cost of Goods Sold on the Purchase Receipt itself
ERPNext also checks that the stock value of a Purchase Receipt matches its accounting value. If they are different after a change, it books the gap to Cost of Goods Sold on the Purchase Receipt. For example, if the receipt was billed at 80 but its stock was not revalued, the receipt gets a credit of 200 to Cost of Goods Sold.
This happens when the repost did not run, or ran after Set Landed Cost Based on Purchase Invoice Rate was turned off.
How to find what posted the entry
- Open the document with the unexpected entry. Click View → Accounting Ledger to see its GL entries.
- Open Stock → Reports → Stock Ledger. Filter by the Item and the dates from the receipt to today. Check the Incoming Rate of the receipt and the Value Change of each later entry.
- Go to Stock → Repost Item Valuation. Check that the entry for the item, created by the invoice, has the status Completed. If it is Queued or Failed, the revaluation did not finish.
- Open the General Ledger report for the Stock Received But Not Billed account. A balance for a receipt that is fully billed is the difference that was not moved.
What you can do
- To value stock at the invoice rate: in Buying Settings, turn off Maintain Same Rate Throughout the Purchase Cycle, then turn on Set Landed Cost Based on Purchase Invoice Rate. Do this before you make the invoices it should apply to.
- If a repost is Queued or Failed: fix the error it shows, then click Restart on the Repost Item Valuation.
- To clear a balance left in Stock Received But Not Billed: make a Journal Entry that moves the difference from Stock Received But Not Billed to the account your accountant chooses, for example Stock Adjustment.
- To keep stock at a fixed cost and see price differences in one account: use the Standard Cost valuation method with a Purchase Price Variance account. See Standard Valuation Rate.
- To change a rate that was posted wrong: cancel and amend the Purchase Invoice with the correct rate, or use a Landed Cost Voucher to add a missing cost to the receipt.