hi
- User
hi
- Assistant
Hello! How can I assist you today? 😊
- User
def check_missing_records(timesheet_tool_name): """ Check if there are employees without Timesheets or Additional Salaries incomplete in timesheet_tool_details. """ missing_records = False
# Retrieval of staff details from the schedule_tool_details timesheet_tool_details = frappe.db.get_all( "Timesheet Tool Details", filters={"parent": timesheet_tool_name}, fields=["employee", "hour", "over_time_h", "over_time_n", "deduction"] ) for detail in timesheet_tool_details: employee = detail.get("employee") hour = detail.get("hour") over_time_h = detail.get("over_time_h") over_time_n = detail.get("over_time_n") deduction = detail.get("deduction") # Check the missing timesheet records. if hour and hour > 0: timesheet_exists = frappe.db.exists( "Timesheet", {"employee": employee, "timesheet_tool": timesheet_tool_name} ) if not timesheet_exists: missing_records = True continue # Verification of missing records of Additional Salary additional_salary_filters = [ (over_time_h, "Overtime H", ">", 0), (over_time_n, "Overtime N", ">", 0), (deduction, "Deduction", ">", 0) ] for value, salary_component, operator, target in additional_salary_filters: if value and eval(f"value {operator} target"): # A dynamic assessment of the condition additional_salary_exists = frappe.db.exists( "Additional Salary", { "employee": employee, "timesheet_tool": timesheet_tool_name, "salary_component": salary_component } ) if not additional_salary_exists: missing_records = True continue - Assistant
- User
اشرح لي الدالة
- Assistant
- User
Verification of missing records of Additional Salary
additional_salary_filters = [ (over_time_h, "Overtime H", ">", 0), (over_time_n, "Overtime N", ">", 0), (deduction, "Deduction", ">", 0) ] for value, salary_component, operator, target in additional_salary_filters: if value and eval(f"value {operator} target"): # A dynamic assessment of the condition additional_salary_exists = frappe.db.exists( "Additional Salary", { "employee": employee, "timesheet_tool": timesheet_tool_name, "salary_component": salary_component } ) if not additional_salary_exists: missing_records = True continue - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.