webnotes/erpnext — pull request #299 by mayur-patel (2013-03-05 05:33:20+00:00)
Title: Allow user to add leave application which may results in negative balance.

Rushabh,
Could I please request you to review the changes that I have made in order to support negative leave balance. Below is one of the reason, why we need to have this support in Leave Application functionality.

Currently the way system work is that in order to apply for a leave you need to have sufficient balance for that leave type. So for example, if I want to apply for a sick leave, I need to have sufficient sick leave allocated to me. This may not work for UK as there is no defined number of sick leaves one can take during a fiscal year. If we start to allocate this in the system, it may encourage people to take sick leave (like in Australian companies, people fake sickies to use their remaining sick leaves).

The changes that I have made is very simple, I have commented the bit where it raise exception. So this way the system will warn the user about negative leave balance but will continue with saving the form.

Do other customers of ERPNext will be okay with this changes? if not, how do we make this configurable so it doesn't affect them. One option is to have a flag in Leave Type table to set if negative leave balance should be allow for that leave type.

Look forward to your reply.

Mayur