You can set the calendar day when the billing period is locked from purchase invoice settings:
When it is set, the date of invoice entry is checked and the system indicates if the purchase invoices does not belong to the set billing period:
How to set the billing lock date?