0% found this document useful (0 votes)
104 views

Oracle Apps Dunning Configuration

This document contains an SQL query that is selecting various data fields from different tables to populate fields for an invoice or dunning letter. It is selecting customer information like name, address and account details like total amount due, individual invoice details, and collector contact information. It includes tables for locations, parties, resources and other tables related to accounts receivable, payments and transactions.

Uploaded by

Avinash1375
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

Oracle Apps Dunning Configuration

This document contains an SQL query that is selecting various data fields from different tables to populate fields for an invoice or dunning letter. It is selecting customer information like name, address and account details like total amount due, individual invoice details, and collector contact information. It includes tables for locations, parties, resources and other tables related to accounts receivable, payments and transactions.

Uploaded by

Avinash1375
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

select (select to_char(correspondence_date,'MM/DD/YYYY') from iex_dunnings where

dunning_id=:DUNNING_ID) currsysdate,

decode((per.person_first_name || per.person_last_name), null,


ARPT_SQL_FUNC_UTIL.get_lookup_meaning('RESPONSIBILITY', 'APS'), per.person_first_name)
first_name,

per.person_last_name last_name,

org.party_name org_name,

loc.address1 address1,

loc.address2 address2,

loc.city city,

loc.state state,

loc.postal_code postal_code,

per.person_first_name first_name1,

(select sum(aps.acctd_amount_due_remaining)

from

iex_delinquencies_all dd,

ar_payment_schedules_all aps

where

dd.payment_schedule_id = aps.payment_schedule_id and

dd.status = 'DELINQUENT' and

aps.amount_due_remaining <> 0 and


dd.party_cust_id = org.party_id and

dd.cust_account_id = :ACCOUNT_ID) total_due_remaining,

(SELECT ACCOUNT_NUMBER FROM HZ_CUST_ACCOUNTS WHERE CUST_ACCOUNT_ID = :ACCOUNT_ID )


CUST_NO,

rs.source_name collector_name,

rs.source_job_title collector_title,

rs.source_phone collector_phone,

CURSOR

(select

ct.trx_number invoice_number,

ar.amount_due_remaining amount_due_remaining,

ct.invoice_currency_code invoice_currency_code,

ar.acctd_amount_due_remaining acctd_amount_due_remaining,

gl.currency_code functional_currency,

to_char(ar.due_date, 'YYYY-MM-DD') due_date,

CT.PURCHASE_ORDER CUST_PO,

((SELECT CORRESPONDENCE_DATE FROM IEX_DUNNINGS WHERE DUNNING_ID=:DUNNING_ID)-


AR.DUE_DATE) NO_DAYS

from

iex_delinquencies_all d,

ar_payment_schedules_all ar,

ra_customer_trx_all ct,

ar_system_parameters_all ars,

gl_sets_of_books gl

where

d.party_cust_id = org.party_id

and d.cust_account_id = :ACCOUNT_ID

and d.payment_schedule_id = ar.payment_schedule_id

and d.status = 'DELINQUENT'


and ar.customer_trx_id = ct.customer_trx_id

and ar.amount_due_remaining <> 0

and ars.set_of_books_id=gl.set_of_books_id

and ars.org_id = ar.org_id

) as payment_history,

loc.location_id,per.party_id,rs.RESOURCE_ID

from

HZ_LOCATIONS loc

,hz_parties org

,hz_parties per

,jtf_rs_resource_extns rs

where

loc.location_id = :LOCATION_ID

and org.party_id= :PARTY_ID

and per.party_id = nvl(:CONTACT_ID, org.party_id)

and rs.RESOURCE_ID = :RESOURCE_ID

You might also like