Close stock balances with a Stock Closing Entry
A Stock Closing Entry saves the closing stock quantity and stock value at the end of a period. ERPNext stores these balances by item, warehouse, batch, and inventory dimension.
INFO
In versions before v16, this document was called Closing Stock Balance.
Why stock reports need closing balances
The Stock Balance report shows Opening Stock, In, Out, and Balance (Opening Stock + In − Out). To find the opening stock, ERPNext reads every stock ledger entry before the From Date. Without an item or warehouse filter, on a site with many stock ledger entries, this is slow.
Stock reports such as Stock Balance and Batch-Wise Balance History use the saved closing balances as their opening stock. They then read only the entries after the last Stock Closing Entry, so they run much faster.
Stock Closing Entry and period closing
A Stock Closing Entry also closes the stock side of a financial period:
- In a company with perpetual inventory and stock transactions, you must have a completed Stock Closing Entry before you submit a Period Closing Voucher.
- ERPNext does not repost stock valuation for dates up to the To Date of a Stock Closing Entry.
Prerequisites
- All stock transactions of the period are entered and correct.
- All reposts for the period are completed. Check the Repost Item Valuation list.
TIP
Create a Stock Closing Entry for each period after you close and audit it, for example after the financial year ends. Then the opening stock of every later report comes from the saved balances.
Create a Stock Closing Entry
- Open the Stock Closing Entry list and select Add Stock Closing Entry.
- Select the Company.
- Enter the To Date, the last day of the period. A period can be a month, half a month, or a year.
- Save the document. ERPNext sets the From Date:
- For the first Stock Closing Entry of the company, the date of its first stock transaction.
- Otherwise, the day after the To Date of the last Stock Closing Entry.
- Submit the document. ERPNext calculates the closing balances in the background.
The Status moves from Queued to In Progress to Completed. If it becomes Failed, select Generate Stock Closing Entry to run it again.
Regenerate the closing balances
If you create or change stock transactions in the period after the Stock Closing Entry is completed, the saved balances are outdated. Open the Stock Closing Entry and select Regenerate Stock Closing Entry.
You cannot regenerate a Stock Closing Entry whose period has a submitted Period Closing Voucher.
Cancel a Stock Closing Entry
Cancel the Stock Closing Entries from the newest to the oldest. Each one builds on the balances of the one before it. ERPNext deletes the saved balances when you cancel.
Troubleshooting
"Stock Closing Entry ... already exists for the selected date range"
Cause: a submitted Stock Closing Entry of the same company covers part of the dates.
Fix: set a To Date after the To Date of the existing entry.
"To Date must be after ..., the To Date of the last Stock Closing Entry ..."
Cause: the To Date is on or before the To Date of the last Stock Closing Entry.
Fix: enter a later To Date.
"Cannot cancel Stock Closing Entry ... because the later Stock Closing Entry ... is built on it"
Cause: a later Stock Closing Entry exists.
Fix: cancel the later Stock Closing Entry first.
"Stock Closing Entry ... belongs to a closed accounting period. Cancel the Period Closing Voucher ... first."
Cause: a submitted Period Closing Voucher covers the To Date.
Fix: cancel the Period Closing Voucher first, if you must change the period.
"Create a Stock Closing Entry for the entire company with To Date as ... before submitting the Period Closing Voucher"
Cause: you tried to submit a Period Closing Voucher, and no Stock Closing Entry has the same end date.
Fix: create and submit a Stock Closing Entry with that To Date. Wait until its Status is Completed, then submit the Period Closing Voucher.
"Stock transactions were created or modified after the Stock Closing Entry ... was generated"
Cause: stock transactions changed after the Stock Closing Entry was completed.
Fix: select Regenerate Stock Closing Entry, wait until it completes, then submit the Period Closing Voucher.