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

【怪兽充电】社保与公积金个人基数的直接获取函数

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: High High
    • 202004
    • Y-易路产品-
    • 薪酬管理
    • 隐藏

      def F_Sb_Fund_Personal_Base(sb_type,code):
      base_salary = individual_dict['ref_MonthlyBaseSalary']
      _logger.info(global_dict['GetInsuranceFundRule'])
      if sb_type == 1:
      social_security_rule_code = individual_dict['ref_hr_employee_social_security_id_code']
      insurance_rule = global_dict['GetInsuranceFundRule'].get(social_security_rule_code, {}).get(code)

      1. 如果不存在的对应的规则,那么返回0
        if not insurance_rule:
        return 0
        else:
        min_base = insurance_rule['min_base'] or 0
        max_base = insurance_rule['max_base'] or 0
        if base_salary and min_base and base_salary <= min_base:
        return min_base
        elif base_salary and max_base and base_salary >= max_base:
        return max_base
        elif base_salary and max_base and min_base and min_base < base_salary < max_base:
        return base_salary
        else:
        return 0
        elif sb_type == 2:
        housing_fund_rule_code = individual_dict['ref_hr_employee_housing_fund_id_code']
        insurance_rule = global_dict['GetInsuranceFundRule'].get(housing_fund_rule_code, {}).get(code)
        if not insurance_rule:
        return 0
        else:
        min_base = insurance_rule['min_base'] or 0
        max_base = insurance_rule['max_base'] or 0
        if base_salary and min_base and base_salary <= min_base:
        return min_base
        elif base_salary and max_base and base_salary >= max_base:
        return max_base
        elif base_salary and max_base and min_base and min_base < base_salary < max_base:
        return base_salary
        else:
        return 0
      显示
      def F_Sb_Fund_Personal_Base(sb_type,code): base_salary = individual_dict ['ref_MonthlyBaseSalary'] _logger.info(global_dict ['GetInsuranceFundRule'] ) if sb_type == 1: social_security_rule_code = individual_dict ['ref_hr_employee_social_security_id_code'] insurance_rule = global_dict ['GetInsuranceFundRule'] .get(social_security_rule_code, {}).get(code) 如果不存在的对应的规则,那么返回0 if not insurance_rule: return 0 else: min_base = insurance_rule ['min_base'] or 0 max_base = insurance_rule ['max_base'] or 0 if base_salary and min_base and base_salary <= min_base: return min_base elif base_salary and max_base and base_salary >= max_base: return max_base elif base_salary and max_base and min_base and min_base < base_salary < max_base: return base_salary else: return 0 elif sb_type == 2: housing_fund_rule_code = individual_dict ['ref_hr_employee_housing_fund_id_code'] insurance_rule = global_dict ['GetInsuranceFundRule'] .get(housing_fund_rule_code, {}).get(code) if not insurance_rule: return 0 else: min_base = insurance_rule ['min_base'] or 0 max_base = insurance_rule ['max_base'] or 0 if base_salary and min_base and base_salary <= min_base: return min_base elif base_salary and max_base and base_salary >= max_base: return max_base elif base_salary and max_base and min_base and min_base < base_salary < max_base: return base_salary else: return 0

      客户场景:员工管理-社保信息页签下,客户会维护员工的社保城市及相应的社保规则,但不会维护社保与公积金个人基数

      需求:根据员工的社保规则和基本工资,自动带出员工的社保公积金个人基数

      实现方法:根据员工对应的社保规则,每个险种的上下限与基本工资做对比,直接带出相应的个人基数
      比如上海-养老金 上限24633 下限4927
      员工基本工资10000 个人基数10000
      员工基本工资4000 个人基数4927
      员工基本工资25000 个人基数24633

            wenqiang.liu 刘文强
            galen.gu 顾惠鑫
            表决:
            0 为这个问题表决

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