[fix] Payment days calculation in salary slip
This commit is contained in:
parent
a5cf8a86c1
commit
533aba02c5
@ -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){
|
cur_frm.cscript.leave_without_pay = function(doc,dt,dn){
|
||||||
if (doc.employee && doc.fiscal_year && doc.month) {
|
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];
|
var doc = locals[dt][dn];
|
||||||
cur_frm.refresh();
|
cur_frm.refresh();
|
||||||
calculate_all(doc, dt, dn);
|
calculate_all(doc, dt, dn);
|
||||||
|
|||||||
@ -90,14 +90,14 @@ class SalarySlip(TransactionBase):
|
|||||||
start_date = joining_date
|
start_date = joining_date
|
||||||
elif joining_date > month['month_end_date']:
|
elif joining_date > month['month_end_date']:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
end_date = month['month_end_date']
|
||||||
if relieving_date:
|
if relieving_date:
|
||||||
if relieving_date > start_date and relieving_date < month['month_end_date']:
|
if relieving_date > start_date and relieving_date < month['month_end_date']:
|
||||||
end_date = relieving_date
|
end_date = relieving_date
|
||||||
elif relieving_date < month['month_start_date']:
|
elif relieving_date < month['month_start_date']:
|
||||||
frappe.throw(_("Employee relieved on {0} must be set as 'Left'").format(relieving_date))
|
frappe.throw(_("Employee relieved on {0} must be set as 'Left'")
|
||||||
else:
|
.format(relieving_date))
|
||||||
end_date = month['month_end_date']
|
|
||||||
|
|
||||||
payment_days = date_diff(end_date, start_date) + 1
|
payment_days = date_diff(end_date, start_date) + 1
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user