Fix slow or failed Period Closing Vouchers ​

A Period Closing Voucher moves the balances of income and expense accounts to a closing account at the end of a year. On a company with a large General Ledger, this work can time out. The setting Use legacy controller for Period Closing Voucher in Accounts Settings decides how ERPNext does the work.

Compare the two controllers ​

Legacy controller (setting selected)Batched controller (setting cleared)
How it runsOne job for the whole voucher. If the site has more than 100,000 General Ledger entries, the job runs in the background with a 30-minute time limit.ERPNext creates a Process Period Closing Voucher document and runs one background job for each date of the period.
ProgressGL Entry Processing Status on the Period Closing Voucher: In Progress, Completed, or Failed.The same status, plus the Status of the Process Period Closing Voucher: Queued, Running, Paused, Completed, or Cancelled.
Time limitFixed.PCV Job Timeout (seconds) in Accounts Settings, 3600 by default, for each job.
Best fitSmall and medium ledgers that close without errors.Large ledgers, or a close that fails with a time-out.

The setting is selected by default.

Switch to the batched controller ​

  1. Check that no Period Closing Voucher is in progress. Its GL Entry Processing Status must be Completed or Failed.
  2. In Accounts Settings, open the Accounts Closing tab.
  3. Clear Use legacy controller for Period Closing Voucher.
  4. Optional: change PCV Job Timeout (seconds) if a single date has a very large number of entries.
  5. Create and submit the Period Closing Voucher.
  6. Open the linked Process Period Closing Voucher to watch the progress.

Before you change a live year-end process, test both controllers on a copy of the site. Compare the closing entries with the approved Profit and Loss statement.

Troubleshooting ​

The voucher stays In Progress or Queued ​

Check that the background workers of the site are running, and look for failed jobs in the Error Log. Do not submit a second Period Closing Voucher until you know whether the first one posted entries.

The closing totals differ from the Profit and Loss report ​

Check that the voucher and the report use the same company, fiscal year, and finance book. Then compare the closing entries with the Profit and Loss report.