Advertisement
psi_mmobile

Untitled

Jul 5th, 2022
1,593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 1.28 KB | None | 0 0
  1. SELECT ccp.cal_closing_period_id, ccp.oc_calendar_id,
  2. date_to_milliseconds(toutcdate(ccp.from_date, NVL(oc.timezone, 'Europe/Brussels'))) from_date,
  3. date_to_milliseconds(toutcdate(ccp.TO_DATE, NVL(oc.timezone, 'Europe/Brussels'))) TO_DATE,
  4. wc.work_code_id, NVL(ccp.name, wc.short_code || ' - ' || wc.work_code_name) name, ccp.color ccp_color,
  5. wc.color wc_color, ccp.cal_closing_period_status_id, p.person_id, ccp.planning_comment, ccp.ccp_absence_certificate_status_id,
  6. ccp.lm_name, ccp.wbs_id
  7.  
  8. FROM cal_closing_period ccp, person p, gu_person gp, gui_users gu, work_code wc, operation_center oc
  9. WHERE (gu.gui_user_id = :gui_user_id OR gu.profiled_person_id = :user_person_id)
  10. AND (:person_id IS NULL AND gp.gui_user_id IS NOT NULL OR NVL(:person_id, :user_person_id) IS NOT NULL)
  11. AND gu.gui_user_id = gp.gui_user_id
  12. AND oc.operation_center_id = gu.operation_center_id
  13. AND p.person_id = gp.person_id
  14. AND p.person_id = NVL(:person_id, p.person_id)
  15. AND gp.caw_limited IS NULL
  16. AND ccp.work_code_id = wc.work_code_id
  17. AND p.person_status_id = 0
  18. AND p.oc_calendar_id = ccp.oc_calendar_id
  19. AND ccp.from_date <= touserdate(date_from_milliseconds(:TO_DATE), NVL(oc.timezone, 'Europe/Brussels'))
  20. AND ccp.TO_DATE >= touserdate(date_from_milliseconds(:from_date), NVL(oc.timezone, 'Europe/Brussels'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement