上传的图像用于项目: 'CST技术支持'
  1. CST技术支持
  2. SLAL2-4273

【STD-TMF-eBay】自定义加班函数与自定义假期获取函数

XMLWord打印

    • T-TMF-eBay-
    • STD
    • 基础通用功能
    • 隐藏

      添加两个薪资函数调用方法为result = F_get_overtime_hours('2021-10'):

      预计算:F_overtime_detail_custom

      employeeIds = employee_snapshot_dict.keys()
      payroll_period_id = payslip_run_record.payroll_period.id
      payroll_group_code = payslip_run_record.payroll_group_id.code
      data_type = 'overtime'

      1. type_list = set()
      2. hr_payslip_parameters = preFuncParameterDict.get('F_overtime_payment', [])
      3. # 获得薪资项累计的参数
      4. for hr_payslip_parameter in hr_payslip_parameters:
      5. parameters = eval(hr_payslip_parameter['func_args'])
      6. for parameter in parameters:
      7. if isinstance(parameter, tuple) and parameter:
      8. type_list.add(eval(parameter[0]))
        type_list=set(['OTTYPE74821345','OTTYPE12958432','OTTYPE68391546'])
        result = env['attendance.submit.original.data'].get_submit_original_data(data_type, employeeIds, list(type_list), payroll_group_code, payroll_period_id)

      引用:
      def F_get_overtime_hours(year_month):
      employee_id = individual_dict['ref_employee_id']
      type_list=set(['OTTYPE74821345','OTTYPE12958432','OTTYPE68391546'])
      result = 0
      for overtime_type in type_list:
      overtime_records = global_dict['F_overtime_detail'].get(employee_id, {}).get(overtime_type, []) # [

      {'date': 'x', 'duration': 1.0}

      ]
      for item in overtime_records:
      if year_month==item['date'][0:7]:
      result += item['duration']

      显示
      添加两个薪资函数调用方法为result = F_get_overtime_hours('2021-10'): 预计算:F_overtime_detail_custom employeeIds = employee_snapshot_dict.keys() payroll_period_id = payslip_run_record.payroll_period.id payroll_group_code = payslip_run_record.payroll_group_id.code data_type = 'overtime' type_list = set() hr_payslip_parameters = preFuncParameterDict.get('F_overtime_payment', []) # 获得薪资项累计的参数 for hr_payslip_parameter in hr_payslip_parameters: parameters = eval(hr_payslip_parameter ['func_args'] ) for parameter in parameters: if isinstance(parameter, tuple) and parameter: type_list.add(eval(parameter [0] )) type_list=set( ['OTTYPE74821345','OTTYPE12958432','OTTYPE68391546'] ) result = env ['attendance.submit.original.data'] .get_submit_original_data(data_type, employeeIds, list(type_list), payroll_group_code, payroll_period_id) 引用: def F_get_overtime_hours(year_month): employee_id = individual_dict ['ref_employee_id'] type_list=set( ['OTTYPE74821345','OTTYPE12958432','OTTYPE68391546'] ) result = 0 for overtime_type in type_list: overtime_records = global_dict ['F_overtime_detail'] .get(employee_id, {}).get(overtime_type, []) # [ {'date': 'x', 'duration': 1.0} ] for item in overtime_records: if year_month==item ['date'] [0:7] : result += item ['duration']

      在获取提交考勤、休假、加班数据时,根据加班/休假日期所在的月份,分别获取1月-12月份的加班/休假数据
      例如:5月份考勤数据提交时,有4月份工作日加班1小时,3月份工作日加班3小时,可以直接自定义函数获取到5月份工作日加班小时数、4月份工作日加班小时数、3月份工作日加班小时数

            grant.yang 杨光磊
            lugx 卢桂香
            表决:
            0 为这个问题表决

              创建日期:
              已更新:
              已解决:

                预估时间:
                初始预估 - 尚未指定
                尚未指定
                剩余:
                剩余的估算 - 0小时
                0小时
                实际工作时间:
                耗费时间 - 4小时
                4小时