select a.set_of_books_id,org_id,
a.cust_trx_type_id,a.name, description,type,
a.credit_memo_type_id ,
a.post_to_gl,a.accounting_affect_flag,
a.credit_memo_type_id as Open_receivables,
status,default_printing_option,default_status,
(select distinct name from ra_cust_trx_types_all where cust_trx_type_id = a.credit_memo_type_id) as credit_memo_type,
( select name from ra_terms where term_id = a.default_term),
a.gl_id_rev,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_rev) as revenue,
gl_id_freight,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_freight) as freight,
gl_id_rec,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_rec) as receivables,
gl_id_clearing,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_clearing) as clearing,
gl_id_unbilled,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_unbilled) as Unbilled,
gl_id_tax,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_tax) as tax,
gl_id_unearned,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_unearned) as unearned,
allow_freight_flag,allow_overapplication_flag,creation_sign,tax_calculation_flag,natural_application_only_flag
---,exclude_from_late_charges,
---adj_post_to_gl
from ra_cust_trx_types_all a;
a.cust_trx_type_id,a.name, description,type,
a.credit_memo_type_id ,
a.post_to_gl,a.accounting_affect_flag,
a.credit_memo_type_id as Open_receivables,
status,default_printing_option,default_status,
(select distinct name from ra_cust_trx_types_all where cust_trx_type_id = a.credit_memo_type_id) as credit_memo_type,
( select name from ra_terms where term_id = a.default_term),
a.gl_id_rev,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_rev) as revenue,
gl_id_freight,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_freight) as freight,
gl_id_rec,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_rec) as receivables,
gl_id_clearing,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_clearing) as clearing,
gl_id_unbilled,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_unbilled) as Unbilled,
gl_id_tax,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_tax) as tax,
gl_id_unearned,
( select concatenated_segments from gl_code_combinations_kfv where code_combination_id = a.gl_id_unearned) as unearned,
allow_freight_flag,allow_overapplication_flag,creation_sign,tax_calculation_flag,natural_application_only_flag
---,exclude_from_late_charges,
---adj_post_to_gl
from ra_cust_trx_types_all a;