If you enter a future leave date for an employee, you get the following options for when to submit them as a leaver.
In the pay period the leave date falls in
If you select this option, the employee receives their P45 once you've finalised the period that the leave date falls in.
The next time I run payroll
If you select this option, the employee receives a P45 as soon as you next run the payroll, regardless of their leave date.