From 783bd89413b2fc7fa3572ef123fddafc17f3b531 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Sun, 12 May 2019 21:59:36 +0530 Subject: [PATCH] feat: handle cancellation workflow for leave application --- erpnext/hr/doctype/leave_application/leave_application.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 61f617806f..76a3af7ae9 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -350,12 +350,12 @@ class LeaveApplication(Document): pass def create_leave_ledger_entry(self, submit=True): - args = dict( - leaves=self.total_leave_days * -1 if submit else 1, + args = frappe._dict( + leaves=self.total_leave_days, to_date=self.to_date, is_carry_forward=0 ) - create_leave_ledger_entry(self, args) + create_leave_ledger_entry(self, args, submit) @frappe.whitelist() def get_number_of_leave_days(employee, leave_type, from_date, to_date, half_day = None, half_day_date = None):