fix(patch): skip leave ledger entry creation for denied leaves (#19579)
This commit is contained in:
parent
fc3b924d4d
commit
d69d0e3046
@ -19,8 +19,10 @@ def get_denied_leave_application_list():
|
|||||||
return frappe.db.sql_list(''' Select name from `tabLeave Application` where status <> 'Approved' ''')
|
return frappe.db.sql_list(''' Select name from `tabLeave Application` where status <> 'Approved' ''')
|
||||||
|
|
||||||
def delete_denied_leaves_from_leave_ledger_entry(leave_application_list):
|
def delete_denied_leaves_from_leave_ledger_entry(leave_application_list):
|
||||||
frappe.db.sql(''' Delete
|
if leave_application_list:
|
||||||
FROM `tabLeave Ledger Entry`
|
frappe.db.sql(''' Delete
|
||||||
WHERE
|
FROM `tabLeave Ledger Entry`
|
||||||
transaction_type = 'Leave Application'
|
WHERE
|
||||||
AND transaction_name in {0} '''.format(tuple(leave_application_list))) #nosec
|
transaction_type = 'Leave Application'
|
||||||
|
AND transaction_name in (%s) ''' % (', '.join(['%s'] * len(leave_application_list))), #nosec
|
||||||
|
tuple(leave_application_list))
|
Loading…
x
Reference in New Issue
Block a user