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

【jsjd】薪资项 累计减除费用调整

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202105
    • J-晶盛机电-Y2019038
    • jsjd
    • 基础通用功能
    • 隐藏

      增加一个应用公式代码:
      def get_ytd_tax_exemption_amount_m1(work_type=0):
      result = 0
      employee_id = individual_dict['ref_employee_id']

      current_taxagent = global_dict['F_ALLEmployeeCurrentTaxAgent'].get(employee_id, {})
      current_tax_month = current_taxagent.get('current_tax_month', '')
      current_withholding_agent = current_taxagent.get('current_withholding_agent', 0)
      current_period = 0
      if not current_tax_month:
      return 0

      current_agent_relationship = global_dict['F_ALLEmployeeCurrentAgentRelationship'].get((employee_id, current_withholding_agent), {})

      hire_date = current_agent_relationship.get('hire_date') or individual_dict['ref_hire_date']
      departure_time = current_agent_relationship.get('departure_time')
      is_reduction = current_agent_relationship.get('is_reduction', False)

      current_year = datetime.datetime.strptime(current_tax_month, "%Y-%m").year
      current_month = datetime.datetime.strptime(current_tax_month, "%Y-%m").month

      compare_date = 0

      if current_agent_relationship and hire_date and departure_time and departure_time >= str(current_year) + '-01-01':
      first_diff_date = min(current_tax_month, departure_time[:7])
      first_diff_year = datetime.datetime.strptime(first_diff_date, "%Y-%m").year
      first_diff_month = datetime.datetime.strptime(first_diff_date, "%Y-%m").month

      second_diff_date = max(hire_date[:7], str(current_year) + '-01')
      second_diff_year = datetime.datetime.strptime(second_diff_date, "%Y-%m").year
      second_diff_month = datetime.datetime.strptime(second_diff_date, "%Y-%m").month

      compare_date = abs((first_diff_year - second_diff_year) * 12 + (first_diff_month - second_diff_month)) + 1

      if not departure_time and hire_date:
      second_diff_date = max(hire_date[:7], str(current_year) + '-01')
      second_diff_year = datetime.datetime.strptime(second_diff_date, "%Y-%m").year
      second_diff_month = datetime.datetime.strptime(second_diff_date, "%Y-%m").month

      compare_date = abs((current_year - second_diff_year) * 12 + (current_month - second_diff_month)) + 1

      if work_type == 1 and current_agent_relationship and current_tax_month:
      first_diff_date = current_tax_month
      first_diff_month = datetime.datetime.strptime(first_diff_date, "%Y-%m").month

      compare_date = first_diff_month

      1. 根据持续成功同事要求对再当前期间对应年分入职的员工compare_date-1
        period_name = int(global_dict['ref_payroll_period_name'])
        if datetime.datetime.strptime(hire_date,'%Y-%m-%d').year==period_name//100:
        compare_date-=1
      2. ==============
        result = compare_date * 5000
        if is_reduction:
        result = 60000
        return result
      显示
      增加一个应用公式代码: def get_ytd_tax_exemption_amount_m1(work_type=0): result = 0 employee_id = individual_dict ['ref_employee_id'] current_taxagent = global_dict ['F_ALLEmployeeCurrentTaxAgent'] .get(employee_id, {}) current_tax_month = current_taxagent.get('current_tax_month', '') current_withholding_agent = current_taxagent.get('current_withholding_agent', 0) current_period = 0 if not current_tax_month: return 0 current_agent_relationship = global_dict ['F_ALLEmployeeCurrentAgentRelationship'] .get((employee_id, current_withholding_agent), {}) hire_date = current_agent_relationship.get('hire_date') or individual_dict ['ref_hire_date'] departure_time = current_agent_relationship.get('departure_time') is_reduction = current_agent_relationship.get('is_reduction', False) current_year = datetime.datetime.strptime(current_tax_month, "%Y-%m").year current_month = datetime.datetime.strptime(current_tax_month, "%Y-%m").month compare_date = 0 if current_agent_relationship and hire_date and departure_time and departure_time >= str(current_year) + '-01-01': first_diff_date = min(current_tax_month, departure_time [:7] ) first_diff_year = datetime.datetime.strptime(first_diff_date, "%Y-%m").year first_diff_month = datetime.datetime.strptime(first_diff_date, "%Y-%m").month second_diff_date = max(hire_date [:7] , str(current_year) + '-01') second_diff_year = datetime.datetime.strptime(second_diff_date, "%Y-%m").year second_diff_month = datetime.datetime.strptime(second_diff_date, "%Y-%m").month compare_date = abs((first_diff_year - second_diff_year) * 12 + (first_diff_month - second_diff_month)) + 1 if not departure_time and hire_date: second_diff_date = max(hire_date [:7] , str(current_year) + '-01') second_diff_year = datetime.datetime.strptime(second_diff_date, "%Y-%m").year second_diff_month = datetime.datetime.strptime(second_diff_date, "%Y-%m").month compare_date = abs((current_year - second_diff_year) * 12 + (current_month - second_diff_month)) + 1 if work_type == 1 and current_agent_relationship and current_tax_month: first_diff_date = current_tax_month first_diff_month = datetime.datetime.strptime(first_diff_date, "%Y-%m").month compare_date = first_diff_month 根据持续成功同事要求对再当前期间对应年分入职的员工compare_date-1 period_name = int(global_dict ['ref_payroll_period_name'] ) if datetime.datetime.strptime(hire_date,'%Y-%m-%d').year==period_name//100: compare_date-=1 ============== result = compare_date * 5000 if is_reduction: result = 60000 return result

      客户是下发薪,即5月算4月薪资。
      举例,如果员工今年3月入职,4月算薪时,按照系统标准公式累计减除费用算出来的累计减除费用是5000*2
      但是客户希望当年入职员工的累计减除费用指计算1个月的即上述例子中应该是5000。
      如果会是上一年度入职的员工,系统按照该公式计算累计减除费用就OK
      烦请支持调整公式,即判断员工是否当年入职,如果是,累计减除费用应该少算1个月

            grant.yang 杨光磊
            cherry.zhen 甄瑞辰
            表决:
            0 为这个问题表决

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