Wednesday, February 24, 2016

Jobs with Approval Assignments

/* Formatted on 2016/02/24 11:37 (Formatter Plus v4.8.0) */
SELECT   hou.NAME op_unit,
         DECODE (pj.business_group_id,
                 81, 'US',
                 141, 'DK',
                 142, 'DE',
                 pj.business_group_id
                ) business_group,
         pj.job_id, pjt.NAME job_name, pcga.control_group_name,
         pcf.control_function_name, pcf.description, pcf.document_type_code,
         pcf.document_subtype, ppca.*                     ---ppca.* --- pcga.*
    FROM apps.po_position_controls_all ppca,
         apps.per_jobs_tl pjt,
         apps.po_control_groups_all pcga,
         apps.po_control_functions pcf,
         apps.hr_all_organization_units hou,
         apps.per_jobs pj
   WHERE ppca.job_id = pjt.job_id                                  ---1=1 ----
     AND pjt.job_id = pj.job_id
     AND ppca.control_group_id = pcga.control_group_id
     AND ppca.org_id = pcga.org_id
     AND ppca.control_function_id = pcf.control_function_id
     AND ppca.org_id = hou.organization_id
---and ppca.org_id = 202 and pj.business_group_id <> 142
     AND ppca.org_id = 202                 --- and pj.business_group_id <> 141
---and pjt.name = 'Senior Director.Executive/Senior-Level Officials and Managers' ---'Coordinator.Administrative Support Workers'
---and ppca.creation_date > trunc(sysdate)
     AND pjt.LANGUAGE = 'US'
     AND document_subtype IN ('INTERNAL', 'PURCHASE', 'STANDARD')
     AND pcf.control_function_name = 'Approve Purchase Requisitions'
---and pcf.control_function_name = 'Approve Standard Purchase Orders'
---and pjt.name = 'Specialist.Professionals'
---and pjt.name = 'Analyst.Professionals'
---order by hou.name, pjt.name, pcf.document_type_code, pcf.document_subtype
     AND pjt.NAME LIKE
                'Vice President.Executive/Senior-Level Officials and Managers'
ORDER BY hou.NAME,
         pcf.control_function_name,
         pjt.NAME,
         pcf.document_type_code,
         pcf.document_subtype;

No comments: