<commit_before>import frappe
from erpnext.hr.doctype.process_payroll.process_payroll import get_month_details

def execute():
	salary_slips = frappe.db.sql("""select fiscal_year, month, name from `tabSalary Slip` 
				where (month is not null and month != '') 
				and (fiscal_year is not null and fiscal_year != '') and
				(start_date is null  or start_date = '') and 
				(end_date is null  or end_date = '') and docstatus != 2""", as_dict=1)

	for salary_slip in salary_slips:
		get_start_end_date = get_month_details(salary_slip.fiscal_year, salary_slip.month)
		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""",
		(start_date, end_date, salary_slip.name))<commit_msg>Salary Slip Patch Fixed<commit_after>import frappe
from erpnext.hr.doctype.process_payroll.process_payroll import get_month_details

def execute():
	ss_columns = frappe.db.get_table_columns("Salary Slip")
	if "fiscal_year" not in ss_columns or "month" not in ss_columns:
		return
		
	salary_slips = frappe.db.sql("""select fiscal_year, month, name from `tabSalary Slip` 
				where (month is not null and month != '') 
				and (fiscal_year is not null and fiscal_year != '') and
				(start_date is null  or start_date = '') and 
				(end_date is null  or end_date = '') and docstatus != 2""", as_dict=1)

	for salary_slip in salary_slips:
		get_start_end_date = get_month_details(salary_slip.fiscal_year, salary_slip.month)
		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""",
		(start_date, end_date, salary_slip.name))
{'fraction_non_alphanumeric': 0.11055276381909548, 'fraction_numerical': 0.002233389168062535, 'mean_word_length': 5.136986301369863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4881586', 'n_tokens_mistral': 696, 'n_tokens_neox': 657, 'n_words': 158}