From 6c17f012ba6ef4490b7eafc6aef3859f8fce4675 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 10 Jul 2013 12:28:56 +0530 Subject: [PATCH] [minor][hr] validation added: salary slip can not be made if employee left before this month --- hr/doctype/salary_slip/salary_slip.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hr/doctype/salary_slip/salary_slip.py b/hr/doctype/salary_slip/salary_slip.py index e3e43e471d..7e8b6a1724 100644 --- a/hr/doctype/salary_slip/salary_slip.py +++ b/hr/doctype/salary_slip/salary_slip.py @@ -92,7 +92,9 @@ class DocType(TransactionBase): if getdate(emp['relieving_date']) > m['month_start_date'] and getdate(emp['relieving_date']) < m['month_end_date']: payment_days = getdate(emp['relieving_date']).day elif getdate(emp['relieving_date']) < m['month_start_date']: - payment_days = 0 + webnotes.msgprint(_("Relieving Date of employee is ") + cstr(emp['relieving_date'] + + _(". Please set status of the employee as 'Left'")), raise_exception=1) + if emp['date_of_joining']: if getdate(emp['date_of_joining']) > m['month_start_date'] and getdate(emp['date_of_joining']) < m['month_end_date']: