|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
WORKFLOW_APPROVED_FLAG 为W表示该报销单被撤回。
-
- select a.WORKFLOW_APPROVED_FLAG,
- a.expense_status_code,
- a.EXPENSE_CURRENT_APPROVER_ID,
- a.created_by,
-
- g.segment1,
- a.invoice_num,
- c.last_name,
- a.creation_date,
- replace(a.description, ',', ',') description,
- (select cc.last_name
- from hr_employees cc, per_assignments_f dd
- where cc.employee_id = dd.PERSON_ID
- and cc.employee_id = a.expense_current_approver_id
- and (sysdate between dd.EFFECTIVE_START_DATE and
- dd.EFFECTIVE_END_DATE)
-
- ) current_approver_name,
-
- b.item_description,
- g.segment1 || '.' || g.segment2 || '.' || g.segment3 || '.' ||
- g.segment4 || '.' || g.segment5 || '.' || g.segment6 || '.' ||
- g.segment7 || '.' || g.segment8 segments,
- b.amount,
- replace(b.JUSTIFICATION, ',', ',') JUSTIFICATION
- from ap_expense_report_headers_all a,
- ap_expense_report_lines_all b,
- hr_employees c,
- per_assignments_f d,
- hr_organization_units e,
- gl_code_combinations g
- where a.REPORT_HEADER_ID = b.REPORT_HEADER_ID
- and c.employee_id = d.PERSON_ID
- and a.employee_id = c.employee_id
- and d.ORGANIZATION_ID = e.organization_id
- and g.code_combination_id = b.code_combination_id
- and (sysdate between d.EFFECTIVE_START_DATE and d.EFFECTIVE_END_DATE)
- --and a.invoice_num = 'W105736'
- --and a.invoice_num = 'W26370'
- and a.expense_status_code = 'PENDMGR'
- and (a.WORKFLOW_APPROVED_FLAG <> 'W' or a.WORKFLOW_APPROVED_FLAG is null)
- and to_date(to_char(a.creation_date, 'YYYYMMDD'), 'YYYYMMDD') between
- gp_start_date and gp_end_date
- and a.org_id = gp_org_id
- order by c.last_name, a.invoice_num;
复制代码 |
|