From 533aba02c5fddb754020fad8514cdcc3ae688cd1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 10 Dec 2015 10:50:35 +0530 Subject: [PATCH] [fix] Payment days calculation in salary slip --- erpnext/hr/doctype/salary_slip/salary_slip.js | 2 +- erpnext/hr/doctype/salary_slip/salary_slip.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js index 9ed5c764f2..f2e5a9ed68 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -32,7 +32,7 @@ cur_frm.cscript.month = cur_frm.cscript.employee = cur_frm.cscript.fiscal_year; cur_frm.cscript.leave_without_pay = function(doc,dt,dn){ if (doc.employee && doc.fiscal_year && doc.month) { - return $c_obj(doc, 'get_leave_details',doc.leave_without_pay,function(r, rt) { + return $c_obj(doc, 'get_leave_details', {"lwp": doc.leave_without_pay}, function(r, rt) { var doc = locals[dt][dn]; cur_frm.refresh(); calculate_all(doc, dt, dn); diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 818c95e324..671fbb888a 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -90,14 +90,14 @@ class SalarySlip(TransactionBase): start_date = joining_date elif joining_date > month['month_end_date']: return - + + end_date = month['month_end_date'] if relieving_date: if relieving_date > start_date and relieving_date < month['month_end_date']: end_date = relieving_date elif relieving_date < month['month_start_date']: - frappe.throw(_("Employee relieved on {0} must be set as 'Left'").format(relieving_date)) - else: - end_date = month['month_end_date'] + frappe.throw(_("Employee relieved on {0} must be set as 'Left'") + .format(relieving_date)) payment_days = date_diff(end_date, start_date) + 1