959:
960: CURSOR l_std_terms_csr (
961: cp_cust_id IN NUMBER,
962: cp_site_use_id IN NUMBER) IS
963: SELECT c.standard_terms standard_terms
964: FROM hz_customer_profiles c
965: WHERE c.cust_account_id = cp_cust_id
966: AND c.site_use_id = cp_site_use_id
967: UNION
964: FROM hz_customer_profiles c
965: WHERE c.cust_account_id = cp_cust_id
966: AND c.site_use_id = cp_site_use_id
967: UNION
968: SELECT c1.standard_terms standard_terms
969: FROM hz_customer_profiles c1
970: WHERE c1.cust_account_id = cp_cust_id
971: AND c1.site_use_id IS NULL
972: AND NOT EXISTS (