SELECT haou.name operating_unit,
flv1.meaning || ' ' || flv2.meaning document_type,
pdtav.type_name name,
xtv1.template_name document_types_layout,
xtv2.template_name contract_terms_layout,
DECODE (pdtav.can_preparer_approve_flag, 'Y', 'Yes', 'N', 'No')
can_preparer_approve,
INITCAP (pdtav.security_level_code) security_level,
pdtav.document_type_code,
pdtav.document_subtype
FROM hr_all_organization_units haou,
po_document_types_all_vl pdtav,
fnd_lookup_values flv1,
fnd_lookup_values flv2,
xdo_templates_vl xtv1,
xdo_templates_vl xtv2
WHERE 1 = 1
AND haou.organization_id = pdtav.org_id
AND pdtav.document_type_code = flv1.lookup_code(+)
AND pdtav.document_subtype = flv2.lookup_code(+)
AND flv1.lookup_type(+) = 'DOCUMENT TYPE'
AND flv2.lookup_type(+) =
DECODE (pdtav.document_type_code,
'REQUISITION', 'REQUISITION TYPE',
'RFQ', 'RFQ SUBTYPE',
'QUOTATION', 'QUOTATION SUBTYPE',
'DOCUMENT SUBTYPE')
AND flv1.language(+) = USERENV ('lang')
AND flv2.language(+) = USERENV ('lang')
AND flv1.view_application_id(+) = 201
AND flv2.view_application_id(+) = 201
AND flv1.security_group_id(+) = 0
AND flv2.security_group_id(+) = 0
AND pdtav.document_template_code = xtv1.template_code(+)
AND pdtav.contract_template_code = xtv2.template_code(+)
ORDER BY haou.name
,pdtav.document_type_code
,pdtav.type_name
Keep posting.
ReplyDeleteOptumflex.com
ReplyDelete