Merge pull request #4462 from nabinhait/sal_slip_fix

[fix] Payment days calculation in salary slip
This commit is contained in:
Nabin Hait 2015-12-10 14:23:31 +05:30
commit 12425e22a6
2 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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