I think your question inherently comprises two parts. The first part relates to the disbursement of a bonus along with usual terminal benefits to an employee who leaves the job once and for all in the middle of an accounting year for which the bonus is yet to be declared. The second part is about the denial of a bonus to such an employee merely because he leaves the job before the close of the accounting year and bonus declaration.
Computation of Bonus
Computation of bonus, in general, is related to the performance of the establishment during the accounting year; determination of the amount of bonus for each eligible employee, in particular, is based on his total earnings in that accounting year. Therefore, it is not necessary to include the amount of bonus tentatively in the terminal benefits immediately on termination during the middle of the accounting year when it is not computed. Of course, there can be a stipulation in the relieving orders that proportionate bonus would be paid soon after its declaration. Like Jagatkumar and Hardik said, you can't deny a bonus to an employee who is otherwise eligible for it only because of his termination of employment in the middle of the accounting year.
Recovery of Bonus
For the recovery of a bonus due from an employer, please refer to section 21 of the Payment of Bonus Act, 1965, which envisions an individual claim by an employee for the denial of a bonus due to him.