Accounts receivable Summary

Source: Internet
Author: User
Select Customer_name,
Customer_number,
Extended_amount,
Description,
Price,
Quantity,
Salename,
Startdate,
Enddate
From ( Select HPT. party_name customer_name,
HCA. account_number customer_number,
Decode (CTL. gross_extended_amount,
Null ,
CTL. extended_amount,
CTL. gross_extended_amount) As Extended_amount,
CTL. description,
Decode (CTL. gross_unit_selling_price,
Null ,
CTL. unit_selling_price,
CTL. gross_unit_selling_price) As Price,
Arpt_ SQL _func_util.get_salesrep_name_number (Ct. primary_salesrep_id,
' Name ' ,
Ct.org _ id) As Salename,
Nvl (CTL. quantity_credited, CTL. quantity_invoiced) As Quantity,
To_char (: startdate, ' YYYY-MM-DD ' ) As Startdate,
To_char (: enddate, ' YYYY-MM-DD ' ) As Enddate
From ra_customer_trx_all CT,
ra_customer_trx_lines_all CTL,
hz_parties HPT,
hz_cust_accounts HCA,
export CTT,
mtl_units_of_measure UOM
Where Ct. customer_trx_id = CTL. customer_trx_id
And Ct.org _ id = Ctl.org _ id
And Ct. bill_to_customer_id = HCA. cust_account_id
And HCA. party_id = HPT. party_id
And CTT. cust_trx_type_id = Ct. cust_trx_type_id
And CTL. line_type ! =   ' Tax '
And CTT. Type In ( ' Inv ' , ' Cm ' )
And CTT. cust_trx_type_id ! =
Cux_ar_utl_pkg.get_return_commitment_type
And CTT. Name ! =   ' Sh-open account for internal sales '
And CTL. uom_code = UOM. uom_code ( + )
And To_char (Ct. trx_date, ' Yyyy-mm-dd ' ) Between
To_char (: startdate, ' YYYY-MM-DD ' ) And
To_char (: enddate, ' YYYY-MM-DD ' )
And HCA. account_number = Nvl (: customernum, HCA. account_number ))

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.