Compensatory Leave Request - fix
This commit is contained in:
parent
b848c51592
commit
ead858b4de
@ -23,9 +23,8 @@ class CompensatoryLeaveRequest(Document):
|
|||||||
date_difference = date_diff(self.work_end_date, self.work_from_date) + 1
|
date_difference = date_diff(self.work_end_date, self.work_from_date) + 1
|
||||||
leave_period = get_leave_period(self.work_from_date, self.work_end_date, company)
|
leave_period = get_leave_period(self.work_from_date, self.work_end_date, company)
|
||||||
if leave_period:
|
if leave_period:
|
||||||
leave_allocation_name = self.exists_allocation_for_period(leave_period)
|
leave_allocation = self.exists_allocation_for_period(leave_period)
|
||||||
if leave_allocation_name:
|
if leave_allocation:
|
||||||
leave_allocation = frappe.get_doc("Leave Allocation", leave_allocation_name)
|
|
||||||
new_leaves_allocated = leave_allocation.new_leaves_allocated
|
new_leaves_allocated = leave_allocation.new_leaves_allocated
|
||||||
leave_allocation.new_leaves_allocated += date_difference
|
leave_allocation.new_leaves_allocated += date_difference
|
||||||
leave_allocation.submit()
|
leave_allocation.submit()
|
||||||
@ -51,7 +50,7 @@ class CompensatoryLeaveRequest(Document):
|
|||||||
}, as_dict=1)
|
}, as_dict=1)
|
||||||
|
|
||||||
if leave_allocation:
|
if leave_allocation:
|
||||||
return leave_allocation[0].name
|
return frappe.get_doc("Leave Allocation", leave_allocation[0].name)
|
||||||
else:
|
else:
|
||||||
False
|
False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user