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

声网_考勤数据回溯公式编写

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202101
    • S-上海声网-Y202006202
    • 薪酬管理
    • 隐藏

      预计算函数:F_getOvertimeSalary
      引用公式:F_get_overtime_salary
      代码分别如下:
      result = {}
      current_period = payslip_run_record.payroll_period
      current_month = current_period.name
      employee_ids = payslip_run_record.employee_ids.ids

      for employee_id in employee_ids:
      attendance_datas = env['x_dataeleave'].search([('x_employee_id2','=',employee_id),('x_paymonth','=',str(current_month))])
      salary = 0.0
      for attendance_data in attendance_datas:
      start_date = attendance_data.x_startdate[0:10]
      if datetime.datetime.strptime(start_date, '%Y-%m-%d').month==current_month%100 and datetime.datetime.strptime(start_date, '%Y-%m-%d').year==current_month//100:
      continue
      else:
      the_employee = attendance_data.x_employee_id2
      for payroll_archive in the_employee.payroll_archive_ids:
      if payroll_archive.code=='contract_bs':
      if not payroll_archive.expired_date:
      if start_date>=payroll_archive.effective_date:
      contract_bs=payroll_archive.amount
      salary += float(contract_bs)/float(21.75)/8*attendance_data.x_durationperiod*2
      else:
      if payroll_archive.effective_date<=start_date<=payroll_archive.expired_date:
      contract_bs=payroll_archive.amount
      salary += float(contract_bs)/float(21.75)/8*attendance_data.x_durationperiod*2
      result[the_employee.id] = salary
      ========================================
      def F_get_overtime_salary():
      employee_id = individual_dict['ref_employee_id']
      value_dic = global_dict.get('F_getOvertimeSalary', {})
      result = value_dic.get(employee_id)
      return result

      显示
      预计算函数:F_getOvertimeSalary 引用公式:F_get_overtime_salary 代码分别如下: result = {} current_period = payslip_run_record.payroll_period current_month = current_period.name employee_ids = payslip_run_record.employee_ids.ids for employee_id in employee_ids: attendance_datas = env ['x_dataeleave'] .search( [('x_employee_id2','=',employee_id),('x_paymonth','=',str(current_month))] ) salary = 0.0 for attendance_data in attendance_datas: start_date = attendance_data.x_startdate [0:10] if datetime.datetime.strptime(start_date, '%Y-%m-%d').month==current_month%100 and datetime.datetime.strptime(start_date, '%Y-%m-%d').year==current_month//100: continue else: the_employee = attendance_data.x_employee_id2 for payroll_archive in the_employee.payroll_archive_ids: if payroll_archive.code=='contract_bs': if not payroll_archive.expired_date: if start_date>=payroll_archive.effective_date: contract_bs=payroll_archive.amount salary += float(contract_bs)/float(21.75)/8*attendance_data.x_durationperiod*2 else: if payroll_archive.effective_date<=start_date<=payroll_archive.expired_date: contract_bs=payroll_archive.amount salary += float(contract_bs)/float(21.75)/8*attendance_data.x_durationperiod*2 result [the_employee.id] = salary ======================================== def F_get_overtime_salary(): employee_id = individual_dict ['ref_employee_id'] value_dic = global_dict.get('F_getOvertimeSalary', {}) result = value_dic.get(employee_id) return result

      客户名: 声网
      客户站点: https://agoratest.peoplus.cn

      需求: 针对考勤开始时间 早于薪资期间开始日期的情况,求考勤月的 回溯数据(周末加班工资-非当月)
      薪资项: 平时加班费-非当月(C001_2)
      = (取薪资档案项中加班月份的基本工资 / 21.75 / 8*周末加班小时数*2)

      具体描述和举例参考附件

            grant.yang 杨光磊
            scarlett.zhang 张芳
            表决:
            0 为这个问题表决

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