Leave Balance on a specific date

Suppose an employees gets a Compensatory Off allocated on 2nd of July(for example).
Available Compensatory Off Balance= 1

The employee again gets a new Comp Off on 8th.
New Comp Off Balance = 2

The employee was absent on 4th and 6th.

On 9th, The employee creates a Leave Application for 4th of July because he was absent that day.
Comp Off Balance after the deduction= 1

But if the employee tries to apply a leave application for 6th now, the system should restrict since the balance on 6th is 0.

How can I get leave balance of an employee on a specific date?


Can anyone kindly suggest anything for this?

Is this kind of implementation possible?

Hi, Employee Leave balance information can be obtained from the Employee Leave Balance report. You can filter our information for different dates.

If you want to restrict the Employee from taking leaves more than the ones allocated (negative leave balance), ensure that the Allow Negative Balance checkbox for that particular Leave Type is checked as shown.

Hope this helps.


Thanks for your response.

But in the case that I have mentioned, the employee leave balance is 1 when he is applying for the leave of 6th July (on 9th). But still the system should restrict, since the balance was added on 8th. For 6th, the balance is 0 not 1.


I want to restrict employees from applying backdated Compensatory Off leaves if they did not had sufficient comp off balance on that specific dates mentioned in the leave application.

Hi @teamcodez i think you have to use code to create a validation for this functionality .

1 Like

Is there any existing function to get such kind of leave balance (as mentioned in the case) in erpnext?

@teamcodez Although I am not a totally certain, I do not think there is a function to get an employee’s leave balance at a certain date