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

费用报销-费用子类型汇总:增加最后审批日期

XMLWord打印

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

      更改sql如下:
      select
      c.id as x_id,
      b.sequence as x_sequence,
      c.name as x_employee_name,
      b.start_date as x_start_date,
      h.name as x_name,
      b.end_date as x_end_date,
      d.name as x_product_category_name,
      e.name as x_sub_category_name,
      f.name as x_project_name,
      g.cost_center as x_expense_center,
      b.state as x_state,
      max(i.approve_date) x_latest_approve_date,
      sum(a.unit_amount) as x_unit_amount
      from hr_expense_line a
      left join hr_expense_expense b on b.id=a.expense_id
      left join hr_employee c on c.id=b.employee_id
      left join product_expense d on d.id=a.product_category_id
      left join product_expense e on a.product_id=e.id
      left join project_project f on b.project_id = f.id
      left join cost_center g on b.employee_cost_center = g.id
      left join hr_expense_category h on b.expense_type=h.id
      left join approve_notify i
      on b.id = i.record_id
      where b.state='done' and i.model='hr.expense.expense'
      group by x_id,x_name,x_product_category_name,x_sub_category_name,x_project_name,x_expense_center,x_state,x_sequence,x_employee_name,x_start_date,x_end_date
      order by x_start_date desc

      显示
      更改sql如下: select c.id as x_id, b.sequence as x_sequence, c.name as x_employee_name, b.start_date as x_start_date, h.name as x_name, b.end_date as x_end_date, d.name as x_product_category_name, e.name as x_sub_category_name, f.name as x_project_name, g.cost_center as x_expense_center, b.state as x_state, max(i.approve_date) x_latest_approve_date, sum(a.unit_amount) as x_unit_amount from hr_expense_line a left join hr_expense_expense b on b.id=a.expense_id left join hr_employee c on c.id=b.employee_id left join product_expense d on d.id=a.product_category_id left join product_expense e on a.product_id=e.id left join project_project f on b.project_id = f.id left join cost_center g on b.employee_cost_center = g.id left join hr_expense_category h on b.expense_type=h.id left join approve_notify i on b.id = i.record_id where b.state='done' and i.model='hr.expense.expense' group by x_id,x_name,x_product_category_name,x_sub_category_name,x_project_name,x_expense_center,x_state,x_sequence,x_employee_name,x_start_date,x_end_date order by x_start_date desc

      原SQL如下:
      select
      c.id as x_id,
      b.sequence as x_sequence,
      c.name as x_employee_name,
      b.start_date as x_start_date,
      h.name as x_name,
      b.end_date as x_end_date,
      d.name as x_product_category_name,
      e.name as x_sub_category_name,
      f.name as x_project_name,
      g.cost_center as x_expense_center,
      b.state as x_state,
      sum(a.unit_amount) as x_unit_amount
      from hr_expense_line a
      left join hr_expense_expense b on b.id=a.expense_id
      left join hr_employee c on c.id=b.employee_id
      left join product_expense d on d.id=a.product_category_id
      left join product_expense e on a.product_id=e.id
      left join project_project f on b.project_id = f.id
      left join cost_center g on b.employee_cost_center = g.id
      left join hr_expense_category h on b.expense_type=h.id where b.state='done'
      group by x_id,x_name,x_product_category_name,x_sub_category_name,x_project_name,x_expense_center,x_state,x_sequence,x_employee_name,x_start_date,x_end_date order by x_start_date desc

            grant.yang 杨光磊
            qiany 钱颖
            表决:
            0 为这个问题表决

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