SELECT SUBSTRB (hp.party_name, 1, 50) bill_to_customer, ooha.order_number sales_order_number, rcta.trx_number transaction_number, rcta.trx_date transaction_date, ottt.NAME sales_order_type, apsa.amount_line_items_original original_line_amount, apsa.freight_original original_freight, apsa.amount_due_original original_amount_due, rctta.NAME transaction_type_name, hcsua.LOCATION ship_to_site, rtt.NAME payment_term_name, rcta.creation_date creation_date, hca.account_number customer_number FROM ra_customer_trx_all rcta, hz_cust_accounts hca, hz_parties hp, oe_order_headers_all ooha, oe_transaction_types_tl ottt, ar_payment_schedules_all apsa, ra_cust_trx_types_all rctta, hz_cust_site_uses_all hcsua, ar_receipt_methods rmi, oe_transaction_types_all otta, ra_terms_tl rtt WHERE rcta.cust_trx_type_id = rctta.cust_trx_type_id AND TO_CHAR (ooha.order_number) = rcta.interface_header_attribute1 AND rcta.term_id = rtt.term_id AND rcta.cust_trx_type_id = apsa.cust_trx_type_id AND hp.party_id = hca.party_id AND ooha.order_type_id = ottt.transaction_type_id AND rctta.cust_trx_type_id = otta.cust_trx_type_id AND ooha.order_type_id = otta.transaction_type_id AND rcta.ship_to_site_use_id = hcsua.site_use_id AND rcta.receipt_method_id = rmi.receipt_method_id