Add new field on the wizard to define accounting period lock date (Menu Accounting > Accounting > Period Lock date)
This new field is company dependent.
Define a new method to be called from planified action (CRON) in order to post accounting entries in background.