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

Pro-员工证明中的占位符取值

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202012
    • Y-易路产品-
    • 基础通用功能
    • 隐藏

      四个占位符代码分别如下:
      result = ''
      if record.employee_id.person_id.education_ids:
      for education_id in record.employee_id.person_id.education_ids:
      if education_id.is_highest_education:
      result = education_id.educational_background.name
      ================================
      result = ''
      if record.employee_id.person_id.per_national_ids:
      for per_national_id in record.employee_id.person_id.per_national_ids:
      if per_national_id.is_primary:
      result = per_national_id.national_id

      ================================
      the_amount=0
      if record.employee_id.payroll_archive_ids:
      the_date = '1900-01-01'
      for archive in record.employee_id.payroll_archive_ids:
      if the_date<=archive.effective_date.strftime('%Y-%m-%d') and archive.payroll_item_id.code=='PA001':
      the_date=archive.effective_date.strftime('%Y-%m-%d')
      the_amount = archive.amount*12
      result = the_amount

      ================================
      result = record.employee_id.hire_date.strftime('%Y年%m月%d日') if record.employee_id.hire_date else ''

      ================================
      result = record.employee_id.termination_date.strftime('%Y年%m月%d日') if record.employee_id.termination_date else ''

      显示
      四个占位符代码分别如下: result = '' if record.employee_id.person_id.education_ids: for education_id in record.employee_id.person_id.education_ids: if education_id.is_highest_education: result = education_id.educational_background.name ================================ result = '' if record.employee_id.person_id.per_national_ids: for per_national_id in record.employee_id.person_id.per_national_ids: if per_national_id.is_primary: result = per_national_id.national_id ================================ the_amount=0 if record.employee_id.payroll_archive_ids: the_date = '1900-01-01' for archive in record.employee_id.payroll_archive_ids: if the_date<=archive.effective_date.strftime('%Y-%m-%d') and archive.payroll_item_id.code=='PA001': the_date=archive.effective_date.strftime('%Y-%m-%d') the_amount = archive.amount*12 result = the_amount ================================ result = record.employee_id.hire_date.strftime('%Y年%m月%d日') if record.employee_id.hire_date else '' ================================ result = record.employee_id.termination_date.strftime('%Y年%m月%d日') if record.employee_id.termination_date else ''

      需求:
      1、目前系统中的证件信息和学历薪资均为一对多模型,在写占位符时需取主要证件的证件号码和最高学历的学历名称

      2、收入证明中需要取员工身上的薪资档案项金额(取最新记录的基本工资金额)

      3、将获取过来的入职日期和离职日期转换成XXXX年XX月XX日的格式

            grant.yang 杨光磊
            zhangpp 张萍萍
            表决:
            0 为这个问题表决

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