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

获取某薪资组某薪资项上一个月的值

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202101
    • T-途虎-Y2019110
    • tuhu
    • 基础通用功能
    • 隐藏

      两个薪资函数,名称:获取某薪资组某薪资项的值们,Get ALL Other Payroll Group Item Values
      代码分别如下(中间等号分割):
      def get_other_payroll_group_item_values(payroll_group_code, payitem_code):
      employee_id = individual_dict['ref_employee_id']
      key = (employee_id, payroll_group_code, payitem_code)
      value_list = global_dict.get('F_ALLOtherPayrollGroupItemValues', {}).get(key, [])
      if not value_list:
      return 0

      result = value_list[-1]

      return result
      ================================

      result = {}
      other_payroll_group_parameter_dict = {}
      current_period = payslip_run_record.payroll_period
      current_month = current_period.name
      current_month = datetime.datetime.strptime(str(current_month)+'01','%Y%m%d')-relativedelta.relativedelta(months=1)
      pay_month = int(current_month.strftime('%Y%m'))

      employee_ids = payslip_run_record.employee_ids.ids

      hr_payslip_parameters = preFuncParameterDict.get('get_other_payroll_group_item_values', [])

      1. '获取某薪资组某薪资项的值'的参数
        for hr_payslip_parameter in hr_payslip_parameters:
        parameters = eval(hr_payslip_parameter['func_args'])
        for parameter in parameters:
        if isinstance(parameter, tuple):
        other_payroll_group_parameter_dict.setdefault(tuple([eval(i) for i in parameter]), None)
        else:
        other_payroll_group_parameter_dict.setdefault((eval(parameter),), None)

      payroll_group_code_payitem_dict = {}
      for args in other_payroll_group_parameter_dict.keys():
      if len(args) != 2:
      continue
      else:
      payroll_group_code = args[0]
      payitem_code = args[1]

      if payroll_group_code not in payroll_group_code_payitem_dict:
      payroll_group_code_payitem_dict[payroll_group_code] = []

      if payitem_code not in payroll_group_code_payitem_dict[payroll_group_code]:
      payroll_group_code_payitem_dict[payroll_group_code].append(payitem_code)

      result = env['hr.payslip.run'].get_group_period_batch_result_data(payroll_group_code_payitem_dict, pay_month, employee_ids, payslip_run_record.id)

      显示
      两个薪资函数,名称:获取某薪资组某薪资项的值们,Get ALL Other Payroll Group Item Values 代码分别如下(中间等号分割): def get_other_payroll_group_item_values(payroll_group_code, payitem_code): employee_id = individual_dict ['ref_employee_id'] key = (employee_id, payroll_group_code, payitem_code) value_list = global_dict.get('F_ALLOtherPayrollGroupItemValues', {}).get(key, []) if not value_list: return 0 result = value_list [-1] return result ================================ result = {} other_payroll_group_parameter_dict = {} current_period = payslip_run_record.payroll_period current_month = current_period.name current_month = datetime.datetime.strptime(str(current_month)+'01','%Y%m%d')-relativedelta.relativedelta(months=1) pay_month = int(current_month.strftime('%Y%m')) employee_ids = payslip_run_record.employee_ids.ids hr_payslip_parameters = preFuncParameterDict.get('get_other_payroll_group_item_values', []) '获取某薪资组某薪资项的值'的参数 for hr_payslip_parameter in hr_payslip_parameters: parameters = eval(hr_payslip_parameter ['func_args'] ) for parameter in parameters: if isinstance(parameter, tuple): other_payroll_group_parameter_dict.setdefault(tuple( [eval(i) for i in parameter] ), None) else: other_payroll_group_parameter_dict.setdefault((eval(parameter),), None) payroll_group_code_payitem_dict = {} for args in other_payroll_group_parameter_dict.keys(): if len(args) != 2: continue else: payroll_group_code = args [0] payitem_code = args [1] if payroll_group_code not in payroll_group_code_payitem_dict: payroll_group_code_payitem_dict [payroll_group_code] = [] if payitem_code not in payroll_group_code_payitem_dict [payroll_group_code] : payroll_group_code_payitem_dict [payroll_group_code] .append(payitem_code) result = env ['hr.payslip.run'] .get_group_period_batch_result_data(payroll_group_code_payitem_dict, pay_month, employee_ids, payslip_run_record.id)

      当前薪资函数【获取某薪资组某薪资项上的值】只可获取当月的,希望设置一个薪资函数获取上个月的

            grant.yang 杨光磊
            liuxz 刘襄周
            表决:
            0 为这个问题表决

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