mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-15 08:17:15 +00:00
[fix] update_salary_slip.py
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import frappe
|
||||
from erpnext.hr.doctype.process_payroll.process_payroll import get_month_details
|
||||
from frappe import cint
|
||||
|
||||
def execute():
|
||||
frappe.reload_doctype('Salary Slip')
|
||||
@@ -12,7 +13,7 @@ def execute():
|
||||
(end_date is null or end_date = '') and docstatus != 2""", as_dict=True)
|
||||
|
||||
for salary_slip in salary_slips:
|
||||
get_start_end_date = get_month_details(salary_slip.fiscal_year, salary_slip.month + 1)
|
||||
get_start_end_date = get_month_details(salary_slip.fiscal_year, cint(salary_slip.month) + 1)
|
||||
start_date = get_start_end_date['month_start_date']
|
||||
end_date = get_start_end_date['month_end_date']
|
||||
frappe.db.sql("""update `tabSalary Slip` set start_date = %s, end_date = %s where name = %s""",
|
||||
|
||||
Reference in New Issue
Block a user