--OM Advanced Pricing Modifier Qualifiers Setup
SELECT qsh.name,
qsh.description,
qsh.comments,
qsh.active_flag,
qsh.automatic_flag,
qsh.start_date_active,
qsh.end_date_active,
qms.operand,
qms.arithmetic_operator,
qms.start_date_active,
qms.modifier_level,
qms.list_line_type,
qms.product_attr_value item_code
FROM qp_secu_list_headers_vl qsh,
qp_qualifiers_v qqv,
ar_customers arc,
qp_modifier_summary_v qms
WHERE qqv.list_header_id = qsh.list_header_id
AND qualifier_attr_value = TO_CHAR (arc.customer_id)
AND arc.customer_name = NVL (:p_customer, arc.customer_name)
AND qms.product_attr_value = NVL (:p_item_code, qms.product_attr_value)
AND qqv.list_line_id = qms.list_line_id
AND qqv.list_header_id = qms.list_header_id
--AND qsh.end_date_active is NULL
AND qsh.active_flag = 'Y';