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

伯曼机械-员工社保信息中社保/公积金起缴月需要根据入职日期自动带出;编辑离职信息时社保/公积金截止月需要根据“确认离职日期”自动带出

XMLWord打印

    • B-伯曼机械-Y2019131
    • STD
    • 人力资源等
    • 隐藏

      第一点员工管理的配置自定义关联变更规则:

      values = kwargs.setdefault('values', {})
      # 入职日期
      hiredate = values.get('hiredate')
      # 员工分组
      employee_group_rep = values.get('employee_group_rep')
      # 社保公积金默认值
      social_security_start_month, housing_fund_start_month = '', ''
      if isinstance(employee_group_rep, int):
          employee_group_rep = env['hr.employee.group'].search([('id', '=', employee_group_rep)])
      if hiredate:
          if isinstance(hiredate, str):
              hiredate = toolkits.datetime.datetime.strptime(hiredate, '%Y-%m-%d')
          # housing_fund_start_month 公积金起缴月、social_security_start_month 社保起缴月
          if employee_group_rep.code == 'G001':
              if hiredate.day > 15:
                  social_security_start_month = toolkits.datetime.datetime(hiredate.year + (hiredate.month == 12), hiredate.month == 12 or hiredate.month +1 , 1).date()
                  housing_fund_start_month = social_security_start_month
              else:
                  social_security_start_month = hiredate.replace(day=1)
                  housing_fund_start_month = hiredate.replace(day=1)
          elif employee_group_rep.code == 'G002':
              social_security_start_month = hiredate.replace(day=1)
              housing_fund_start_month = hiredate.replace(day=1)
      
          if social_security_start_month:
              result.update({'social_security_start_month': social_security_start_month})
          if housing_fund_start_month:
              result.update({'housing_fund_start_month': housing_fund_start_month})
      

      第二点的社保公积金截止日是代码里写的onchange,配置不能修改它。暂时不能做

      显示
      第一点员工管理的配置自定义关联变更规则: values = kwargs.setdefault( 'values' , {}) # 入职日期 hiredate = values.get( 'hiredate' ) # 员工分组 employee_group_rep = values.get( 'employee_group_rep' ) # 社保公积金默认值 social_security_start_month, housing_fund_start_month = '', ' ' if isinstance(employee_group_rep, int ): employee_group_rep = env[ 'hr.employee.group' ].search([( 'id' , '=' , employee_group_rep)]) if hiredate: if isinstance(hiredate, str): hiredate = toolkits.datetime.datetime.strptime(hiredate, '%Y-%m-%d' ) # housing_fund_start_month 公积金起缴月、social_security_start_month 社保起缴月 if employee_group_rep.code == 'G001' : if hiredate.day > 15: social_security_start_month = toolkits.datetime.datetime(hiredate.year + (hiredate.month == 12), hiredate.month == 12 or hiredate.month +1 , 1).date() housing_fund_start_month = social_security_start_month else : social_security_start_month = hiredate.replace(day=1) housing_fund_start_month = hiredate.replace(day=1) elif employee_group_rep.code == 'G002' : social_security_start_month = hiredate.replace(day=1) housing_fund_start_month = hiredate.replace(day=1) if social_security_start_month: result.update({ 'social_security_start_month' : social_security_start_month}) if housing_fund_start_month: result.update({ 'housing_fund_start_month' : housing_fund_start_month}) 第二点的社保公积金截止日是代码里写的onchange,配置不能修改它。暂时不能做

      ①【员工管理】【社保信息】,“社保起缴月”、“公积金起缴月”根据【雇佣信息】中的“入职日期”与“用工类型”自动带出,逻辑:
      a.“用工类型”编号为“G001”,“入职日期”早于15日(含),社保/公积金起缴月为入职日期当月1号,晚于15日为入职日期次月1号;
      b.“用工类型”编号为“G002”,社保/公积金起缴月为入职当月1号。



      ②编辑离职信息时“社保截止月、“公积金截止月”根据“确认离职日期”自动带出,逻辑:
      a.“用工类型”编号为“G001”,“确认离职日期”晚于15日(含),社保/公积金截止月为确认离职日期当月1号,早于15日为确认离职日期次月1号;
      b.“用工类型”编号为“G002”,社保/公积金截止月为离职当月1号。

        1. 入职日期.png
          78 kB
          汪静宇
        2. 社保公积金截止日.png
          110 kB
          汪静宇
        3. 社保起缴月公积金起缴月.png
          77 kB
          汪静宇
        4. 用工类型01.png
          79 kB
          汪静宇
        5. 用工类型02.png
          63 kB
          汪静宇

            ling.chen 陈灵娟
            eva.wang 汪静宇
            表决:
            0 为这个问题表决

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

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