119: END IF;
120:
121: IF x_payment_term_id IS NULL THEN
122: SELECT tl.term_id into x_payment_term_id
123: FROM ra_terms t_su,
124: ra_terms t_cp1,
125: ra_terms t_cp2,
126: ra_terms tl,
127: hz_customer_profiles cp1,
120:
121: IF x_payment_term_id IS NULL THEN
122: SELECT tl.term_id into x_payment_term_id
123: FROM ra_terms t_su,
124: ra_terms t_cp1,
125: ra_terms t_cp2,
126: ra_terms tl,
127: hz_customer_profiles cp1,
128: hz_customer_profiles cp2,
121: IF x_payment_term_id IS NULL THEN
122: SELECT tl.term_id into x_payment_term_id
123: FROM ra_terms t_su,
124: ra_terms t_cp1,
125: ra_terms t_cp2,
126: ra_terms tl,
127: hz_customer_profiles cp1,
128: hz_customer_profiles cp2,
129: hz_cust_site_uses_all su
122: SELECT tl.term_id into x_payment_term_id
123: FROM ra_terms t_su,
124: ra_terms t_cp1,
125: ra_terms t_cp2,
126: ra_terms tl,
127: hz_customer_profiles cp1,
128: hz_customer_profiles cp2,
129: hz_cust_site_uses_all su
130: WHERE p_bill_to_customer_account_id = cp1.cust_account_id(+)