Stock closing
Store a company's stock balances up to a date with a Stock Closing Entry, and keep that period from changing.
A Stock Closing Entry writes a company's stock balances up to a To Date into Stock Closing Balance records. Each balance is one item in one warehouse, or one batch or inventory dimension value of it, with its quantity, value and the FIFO queue of its receipts. Later closings start from these balances instead of the whole ledger.
Close a period
Stock Closing Entry > New. Pick the Company and the To Date. To Date cannot be in the future.
Save. From Date becomes the day after the company's last submitted entry, or the date of its first Stock Ledger Entry.
Finish any pending Repost Item Valuations up to To Date. Submit is refused while one is pending.
Submit. Status goes Queued, In Progress, then Completed as a chain of background jobs writes the balances. A node that dies loses only the chunk it was on.
A range that overlaps another submitted entry is refused.
After closing
| Event | Result |
|---|---|
| A stock posting dated on or before To Date | The entry becomes Outdated |
| The ledger moves while the jobs run | The entry ends Outdated instead of Completed |
| A Period Closing Voucher closes that date | Postings on or before it are refused |
erp.stock_closing_entry.regenerate_closing_balance | Deletes a submitted entry's balances and queues the jobs again. Refused once a Period Closing Voucher closes it or a later entry builds on it |
Cancel deletes the entry's balances. It is refused while a later submitted entry exists, or while a Period Closing Voucher closes To Date or after.
Example
Acme Traders closes stock on 2026-03-31. The first entry covers 2025-04-01 (the first posting) to 2026-03-31 and completes. A back-dated receipt for 2026-03-30 is then entered, and the entry turns Outdated. Regenerate it, and it runs again with the receipt included. Once the accountant submits a Period Closing Voucher for the year, the same back-dated receipt is refused.
| Status | Meaning |
|---|---|
| Draft | Saved, not submitted |
| Queued, In Progress | Jobs are writing balances |
| Completed | Balances match the ledger |
| Outdated | The ledger moved on or before To Date since |
| Failed | The job stopped with an error |
| Cancelled | Cancelled, balances deleted |