SELECT glp.start_date,
gjh.je_header_id,
gjh.doc_sequence_value voucher_no,
gjh.je_source,
gjh.je_category,
entity_code,
gjh.period_name,
gjh.status,
gjh.actual_flag,
gjh.default_effective_date,
gjl.je_line_num,
gjl.code_combination_id,
gjl.description voucher_desc,
xal.accounted_dr debit,
xal.accounted_cr credit,
gcc.segment1
|| '-'
|| gcc.segment2
|| '-'
|| gcc.segment3
|| '-'
|| gcc.segment4
|| '-'
|| gcc.segment5
|| '-'
|| gcc.segment6
|| '-'
|| gcc.segment7
account_code,
TO_CHAR (aca.check_number) trx_num,
aca.check_date trx_date
FROM gl.gl_je_headers gjh,
gl.gl_je_lines gjl,
gl.gl_code_combinations gcc,
gl.gl_periods glp,
gl.gl_import_references imp,
xla.xla_ae_lines xal,
xla.xla_ae_headers xah,
xla.xla_events xe,
xla.xla_transaction_entities xte,
ap.ap_checks_all aca
WHERE 1 = 1
AND gjh.je_header_id = gjl.je_header_id
AND gjl.status || '' = 'P'
AND gjl.code_combination_id = gcc.code_combination_id
AND gjh.period_name = glp.period_name
AND glp.period_set_name = :p_period_set_name
AND glp.adjustment_period_flag <> 'Y'
|| gcc.segment6
|| '-'
|| gcc.segment7
account_code,
TO_CHAR (acr.receipt_number) trx_num,
acr.receipt_date trx_date
FROM gl.gl_je_headers gjh,
gl.gl_je_lines gjl,
gl.gl_code_combinations gcc,
gl.gl_periods glp,
gl.gl_import_references imp,
xla.xla_ae_lines xal,
xla.xla_ae_headers xah,
xla.xla_events xe,
xla.xla_transaction_entities xte,
ar_cash_receipts_all acr
WHERE 1 = 1
AND gjh.je_header_id = gjl.je_header_id
AND gjl.status || '' = 'P'
AND gjl.code_combination_id = gcc.code_combination_id
AND gjh.period_name = glp.period_name
AND glp.period_set_name = :p_period_set_name
AND glp.adjustment_period_flag <> 'Y'
AND gjh.je_source = 'Receivables'
AND gjl.je_header_id = imp.je_header_id
AND gjl.je_line_num = imp.je_line_num
AND imp.gl_sl_link_id = xal.gl_sl_link_id
AND imp.gl_sl_link_table = xal.gl_sl_link_table
AND xal.application_id = xah.application_id
AND xal.ae_header_id = xah.ae_header_id
AND xah.application_id = xe.application_id
AND xah.event_id = xe.event_id
AND xe.application_id = xte.application_id
AND xte.application_id = 222
AND xe.entity_id = xte.entity_id
AND xte.entity_code = 'RECEIPTS'
AND xte.source_id_int_1 = acr.cash_receipt_id
AND gjh.default_effective_date BETWEEN :p_period_from_start_date
AND :p_period_to_end_date
AND (gjh.actual_flag = :p_actual_flag OR :p_actual_flag IS NULL)
gjh.status,
gjh.actual_flag,
gjh.default_effective_date,
gjl.je_line_num,
gjl.code_combination_id,
gjl.description voucher_desc,
xal.accounted_dr debit,
xal.accounted_cr credit,
gcc.segment1
|| '-'
|| gcc.segment2
|| '-'
|| gcc.segment3
|| '-'
|| gcc.segment4
|| '-'
|| gcc.segment5
|| '-'
|| gcc.segment6
|| '-'
|| gcc.segment7
account_code,
TO_CHAR (aaa.adjustment_number) trx_num,
aaa.apply_date trx_date
FROM gl.gl_je_headers gjh,
gl.gl_je_lines gjl,
gl.gl_code_combinations gcc,
gl.gl_periods glp,
gl.gl_import_references imp,
xla.xla_ae_lines xal,
xla.xla_ae_headers xah,
xla.xla_events xe,
xla.xla_transaction_entities xte,
ar_adjustments_all aaa
WHERE 1 = 1
AND gjh.je_header_id = gjl.je_header_id
AND gjl.status || '' = 'P'
AND gjl.code_combination_id = gcc.code_combination_id
AND gjh.period_name = glp.period_name
AND glp.period_set_name = :p_period_set_name
AND glp.adjustment_period_flag <> 'Y'
AND gjh.je_source = 'Receivables'
AND gjl.je_header_id = imp.je_header_id
AND gjl.je_line_num = imp.je_line_num
AND imp.gl_sl_link_id = xal.gl_sl_link_id
AND imp.gl_sl_link_table = xal.gl_sl_link_table
AND xal.application_id = xah.application_id
AND xal.ae_header_id = xah.ae_header_id
AND xah.application_id = xe.application_id
AND xah.event_id = xe.event_id
AND xe.application_id = xte.application_id
Link between Order Management and Account Receivables (OM Link AR)
SELECT ooha.order_number
, oola.line_number so_line_number
, oola.ordered_item
, oola.ordered_quantity * oola.unit_selling_price so_extended_price
, rcta.trx_number invoice_number
, rcta.trx_date
, rctla.line_number inv_line_number
, rctla.unit_selling_price inv_unit_selling_price
FROM oe_order_headers_all ooha
, oe_order_lines_all oola
, ra_customer_trx_all rcta
, ra_customer_trx_lines_all rctla
WHERE ooha.header_id = oola.header_id
AND rcta.customer_trx_id = rctla.customer_trx_id
AND rctla.interface_line_attribute6 = TO_CHAR (oola.line_id)
AND rctla.interface_line_attribute1 = TO_CHAR (ooha.order_number)
AND order_number = :p_order_number
, wdi.sequence_number bol_number
, wds.departure_net_weight ship_weight
, wds.actual_departure_date ship_date
, ooh.cust_po_number
, SUBSTR (hp.party_name, 1, 30) || ' ' ||
SUBSTR (hl_ship.address1, 1, 36) || ' ' ||
SUBSTR (hl_ship.address2, 1, 36) || ' ' ||
SUBSTR (hl_ship.city, 1, 30) || ' ' ||
SUBSTR (hl_ship.province , 1 , 2 ) || ' ' ||
SUBSTR (hl_ship.postal_code , 1 , 8 ) ship_to_address
FROM apps.hr_locations hl
, org_organization_definitions ood
, apps.oe_order_headers_all ooh
, oe_order_lines_all ool
, apps.hz_locations hl_ship
, apps.hz_parties hp
, apps.hz_party_sites hps
, apps.hz_cust_acct_sites_all hcas
, apps.hz_cust_site_uses_all hcsu
, apps.hz_party_sites hps_bill
, apps.hz_cust_acct_sites_all hcas_bill
, apps.hz_cust_site_uses_all hcsu_bill
, apps.wsh_delivery_details wdd
, apps.wsh_new_deliveries wnd
, apps.wsh_delivery_assignments wda
, apps.wsh_trips wt
, apps.wsh_delivery_legs wdl
, apps.wsh_trip_stops wds
, apps.wsh_document_instances wdi
, apps.hz_parties hp_carrier
, ra_customer_trx_all rct
WHERE 1 = 1
AND
ooh.header_id = ool.header_id
AND
ood.organization_id = ool.ship_from_org_id
AND
ooh.ship_from_org_id = hl.inventory_organization_id
AND
hl_ship.location_id = hps.location_id
AND
hp.party_id = hps.party_id
AND
hps.party_site_id = hcas.party_site_id
AND
hps_bill.party_site_id = hcas_bill.party_site_id
AND
hps_bill.party_id = hp.party_id
AND
hcas.cust_acct_site_id = hcsu.cust_acct_site_id
AND
hcsu.site_use_id = ooh.ship_to_org_id
AND
hcas_bill.cust_acct_site_id = hcsu_bill.cust_acct_site_id
AND
hcsu_bill.site_use_id = ooh.invoice_to_org_id
AND
ooh.header_id = wdd.source_header_id(+)
AND
wda.delivery_detail_id(+) = wdd.delivery_detail_id
AND
wda.delivery_id = wnd.delivery_id(+)
AND
ool.line_id = wdd.source_line_id
AND
wt.trip_id(+) = wds.trip_id
AND
wds.stop_id(+) = wdl.pick_up_stop_id
AND
wdl.delivery_id(+) = wnd.delivery_id
AND
hp_carrier.party_id(+) = wt.carrier_id
AND
wdi.entity_id(+) = wdl.delivery_leg_id
AND
wdi.entity_name(+) = 'WSH_DELIVERY_LEGS'
AND TO_CHAR (ooh.order_number) = rct.ct_reference(+)
AND TO_CHAR (ooh.order_number) = rct.interface_header_attribute1(+)
AND
interface_header_context(+) = 'ORDER ENTRY'
AND
ooh.order_number = :order_number
ORDER BY ool.flow_status_code
, ooh.order_number
, ool.line_number
SELECT trx.trx_number,
trx.cust_trx_type_id,
trx.bill_to_customer_id,
trx_dist.amount ar_inv_dist_amount,
trx_dist.code_combination_id ar_inv_dist_ccid,
gcc.segment1
|| '.'
|| gcc.segment2
|| '.'
|| gcc.segment3
|| '.'
|| gcc.segment4
|| '.'
|| gcc.segment5
|| '.'
|| gcc.segment6
|| '.'
|| gcc.segment7
|| '.'
|| gcc.segment8
ar_inv_dist_code_combination,
gjh.name gl_je_header_name,
gjh.description gl_je_header_desc,
gjl.je_line_num,
gjl.code_combination_id gl_je_line_ccid
FROM ar.ra_customer_trx_all trx,
ar.ra_cust_trx_line_gl_dist_all trx_dist,
gl.gl_code_combinations gcc,
gl.gl_ledgers gl,
xla.xla_transaction_entities xte,
xla.xla_ae_headers xah,
xla.xla_ae_lines xal,
xla.xla_distribution_links xdl,
gl.gl_import_references gir,
gl.gl_je_headers gjh,
gl.gl_je_lines gjl
WHERE 1 = 1
-- AND trx.org_id = :P_ORG_ID
-- AND trx.batch_source_id = :P_BATCH_SOURCE_ID
AND trx.customer_trx_id = :P_CUSTOMER_TRX_ID
AND trx.customer_trx_id = trx_dist.customer_trx_id
AND gcc.code_combination_id = trx_dist.code_combination_id
-- AND gl.short_name = :P_LEDGER_SHORT_NAME
AND gl.chart_of_accounts_id = gcc.chart_of_accounts_id
AND xte.ledger_id = gl.ledger_id
AND xte.entity_code = 'TRANSACTIONS'
AND xte.application_id = 222
AND xte.source_id_int_1 = trx.customer_trx_id
AND xah.entity_id = xte.entity_id
AND xal.ae_header_id = xah.ae_header_id
AND xal.accounting_class_code = 'REVENUE'
AND xdl.ae_header_id = xah.ae_header_id
AND xdl.ae_line_num = xal.ae_line_num
AND xdl.source_distribution_id_num_1 = trx_dist.cust_trx_line_gl_dist_id
AND xdl.application_id = 222
AND gir.gl_sl_link_id = xal.gl_sl_link_id
AND gjh.je_header_id = gir.je_header_id
AND gjl.je_header_id = gjh.je_header_id
AND gjl.je_line_num = gir.je_line_num;
AR Receipt Queries
Query for Total On Account Receipt Amount
SELECT NVL (SUM (ps.amount_due_remaining), 0) total_onacct_receipts
FROM hz_cust_accounts_all cust_acct,
ar_payment_schedules_all ps,
ar_receivable_applications_all arr,
hz_cust_acct_sites_all acct_site,
hz_party_sites party_site,
hz_locations loc,
hz_cust_site_uses_all site_uses,
ar_cash_receipts_all acr,
ar_cash_receipt_history_all crh,
gl_code_combinations cc
WHERE
TRUNC (ps.gl_date) <= :p_as_of_date
AND ps.customer_id = cust_acct.cust_account_id
hcpa.overall_credit_limit,
apsa.amount_due_remaining,
acra.amount
FROM hz_parties hp,
hz_cust_accounts hca,
hz_customer_profiles hcp,
hz_cust_profile_amts hcpa,
ra_customer_trx_all rcta--, ra_customer_trx_lines_all rctla
,
ar_cash_receipts_all acra,
ar_receivable_applications_all araa,
ar_payment_schedules_all apsa
WHERE 1 = 1
AND hp.party_id = hca.party_id
AND hca.cust_account_id = hcp.cust_account_id
AND hcp.site_use_id IS NULL
AND hcpa.cust_account_profile_id = hcp.cust_account_profile_id
AND hcpa.currency_code = 'USD'
AND rcta.sold_to_customer_id = hca.cust_account_id
AND rcta.org_id = 204
--and rcta.customer_trx_id = rctla.customer_trx_id
AND rcta.customer_trx_id = apsa.customer_trx_id
AND araa.applied_customer_trx_id = apsa.customer_trx_id
AND acra.cash_receipt_id = araa.cash_receipt_id
AND rcta.trx_number = '11792'
AND acra.cash_receipt_id =
(SELECT MAX (cash_receipt_id)
FROM ar_receivable_applications_all araa_2
WHERE araa_2.applied_customer_trx_id = apsa.customer_trx_id)
;
3)to list all the invoices whicha r pending to b paid for more than 60 days from sysdate
cust no,cust name,invoice no,date of invoice,amount,
period of invoice pending for 30-60 days,period of invoice pending for 60-120 days,
period of invoice pending for more than 120 days
SELECT hca.account_number,
hp.party_name,
rcta.trx_number,
rcta.trx_date,
SUM (rctla.extended_amount),
CASE
WHEN TRUNC (SYSDATE - rcta.trx_date) BETWEEN 30 AND 60
THEN
rcta.trx_number
END
"Pending for 30 - 60 days",
CASE
WHEN TRUNC (SYSDATE - rcta.trx_date) BETWEEN 60 AND 120
THEN
rcta.trx_number
END
"Pending for 60 - 120 days",
CASE
WHEN TRUNC (SYSDATE - rcta.trx_date) > 120 THEN rcta.trx_number
END
"Pending for more than 120 days"
FROM hz_parties hp,
hz_cust_accounts hca,
ra_customer_trx_all rcta,
ra_customer_trx_lines_all rctla
WHERE hp.party_id = hca.party_id
AND rcta.org_id = 204
AND hca.cust_account_id = rcta.sold_to_customer_id
AND rcta.customer_trx_id = rctla.customer_trx_id
AND hca.account_number = 3896
GROUP BY hca.account_number, hp.party_name, rcta.trx_number, rcta.trx_date;
4)to list all the invoices paid during past 6 months
cust no,cust name,invoice no,receipt no,date of invoive,date of payment,amount
SELECT hca.account_number,
hp.party_name,
rcta.trx_number,
acra.receipt_number,
rcta.trx_date,
acra.creation_date,
acra.amount
FROM hz_parties hp,
hz_cust_accounts hca,
ra_customer_trx_all rcta--, ra_customer_trx_lines_all rctla
,
ar_cash_receipts_all acra,
ar_payment_schedules_all apsa,
ar_receivable_applications_all araa,
ar_lookups al
WHERE 1 = 1
AND hp.party_id = hca.party_id
AND rcta.sold_to_customer_id = hca.cust_account_id
AND rcta.org_id = 204
--and rcta.customer_trx_id = rctla.customer_trx_id
AND rcta.customer_trx_id = apsa.customer_trx_id
AND araa.applied_customer_trx_id = apsa.customer_trx_id
AND acra.cash_receipt_id = araa.cash_receipt_id
AND acra.status = al.lookup_code
AND al.lookup_type = 'PAYMENT_TYPE'
AND rcta.trx_number = '11792'
AND TRUNC (MONTHS_BETWEEN (SYSDATE, araa.creation_date)) <= 6;
AR to HZ Table Link
apps.hz_cust_site_uses_all hcsu_bill,
apps.wsh_delivery_details wdd,
apps.wsh_new_deliveries wnd,
apps.wsh_delivery_assignments wda,
apps.wsh_trips wt,
apps.wsh_delivery_legs wdl,
apps.wsh_trip_stops wds,
apps.wsh_document_instances wdi,
apps.hz_parties hp_carrier,
ra_customer_trx_all rct
WHERE 1 = 1
AND ooh.header_id = ool.header_id
AND ood.organization_id = ool.ship_from_org_id
AND ooh.ship_from_org_id = hl.inventory_organization_id
AND hl_ship.location_id = hps.location_id
AND hp.party_id = hps.party_id
AND hps.party_site_id = hcas.party_site_id
AND hps_bill.party_site_id = hcas_bill.party_site_id
AND hps_bill.party_id = hp.party_id
AND hcas.cust_acct_site_id = hcsu.cust_acct_site_id
AND hcsu.site_use_id = ooh.ship_to_org_id
AND hcas_bill.cust_acct_site_id = hcsu_bill.cust_acct_site_id
AND hcsu_bill.site_use_id = ooh.invoice_to_org_id
AND ooh.header_id = wdd.source_header_id(+)
AND wda.delivery_detail_id(+) = wdd.delivery_detail_id
AND wda.delivery_id = wnd.delivery_id(+)
AND ool.line_id = wdd.source_line_id
AND wt.trip_id(+) = wds.trip_id
AND wds.stop_id(+) = wdl.pick_up_stop_id
AND wdl.delivery_id(+) = wnd.delivery_id
AND hp_carrier.party_id(+) = wt.carrier_id
AND wdi.entity_id(+) = wdl.delivery_leg_id
AND wdi.entity_name(+) = 'WSH_DELIVERY_LEGS'
AND TO_CHAR (ooh.order_number) = rct.ct_reference(+)
AND TO_CHAR (ooh.order_number) = rct.interface_header_attribute1(+)
AND interface_header_context(+) = 'ORDER ENTRY'
AND ooh.order_number = :order_number
ORDER BY ool.flow_status_code, ooh.order_number, ool.line_number;
ooh.ordered_date,
ooh.transactional_curr_code curr,
os2.name sdt,
ooh.source_document_id sdi,
os1.name os,
ooh.orig_sys_document_ref osdr,
ooh.sold_to_org_id sold_to,
ooh.invoice_to_org_id invoice_to,
ooh.cust_po_number cust_po,
ooh.payment_type_code pay_type,
ooh.flow_status_code hdr_flow_status,
ooh.open_flag,
ooh.booked_flag,
ooh.cancelled_flag,
NVL (ooh.upgraded_flag, 'N') upgraded_flag
FROM oe_order_headers_all ooh,
oe_transaction_types_tl ott,
oe_order_sources os1,
oe_order_sources os2
WHERE 1 = 1
AND ooh.order_number = &order_number
AND ooh.order_type_id = ott.transaction_type_id
AND ooh.order_source_id = os1.order_source_id(+)
AND ooh.source_document_type_id = os2.order_source_id(+)
AND ott.language = (SELECT fl.language_code
FROM fnd_languages fl
WHERE fl.installed_flag = 'B');
and ooh.hold_source_id=ohs.hold_source_id(+)
and ohs.hold_id=ohd.hold_id(+)
and trunc(ool.schedule_ship_date)= to_date('30-APR-14','DD-MON-YY')
and oeh.PAYMENT_TERM_ID in ( 1021 ,1143);
/*List of Standing Orders along with Credit Card Details on the first open line*/
SELECT OOHA.HEADER_ID,oola.line_number,oola.line_id,op.line_id,
OOHA.ORDER_NUMBER,
(SELECT hca.account_number
FROM hz_cust_accounts hca
WHERE hca.cust_account_id=ooha.sold_to_org_id
) CustomerNumber,
OOHA.FLOW_STATUS_CODE "OrderStatus",
OOHA.PAYMENT_TYPE_CODE,
ooha.credit_card_number,
OOLA.ORDERED_ITEM,
OOLA.ORDERED_QUANTITY,
OOLA.SHIPPED_QUANTITY,
oola.invoiced_quantity,
OOLA.TAX_VALUE,
(OOLA.UNIT_SELLING_PRICE * OOLA.ORDERED_QUANTITY) ITEMTOTALAMOUNT,
OOLA.FLOW_STATUS_CODE "LineStatus",
IFTE.TRXN_EXTENSION_ID ,
ic.ccnumber,
ic.chname,
ic.card_owner_id,
ic.masked_cc_number,
ic.card_issuer_code,
ic.expirydate,
ic.inactive_date
FROM OE_ORDER_HEADERS_ALL OOHA,
OE_ORDER_LINES_ALL OOLA,
OE_PAYMENTS OP,
IBY_FNDCPT_TX_EXTENSIONS IFTE,
IBY_PMT_INSTR_USES_ALL IPUA,
IBY_CREDITCARD IC
WHERE OOHA.HEADER_ID=OOLA.HEADER_ID
--AND OOHA.PAYMENT_TYPE_CODE LIKE 'CREDIT_CARD'
AND OP.line_ID(+)
=OOla.line_ID
AND OP.TRXN_EXTENSION_ID=IFTE.TRXN_EXTENSION_ID(+)
--AND IFTE.TRXN_EXTENSION_ID=ITSA.INITIATOR_EXTENSION_ID
AND IFTE.INSTR_ASSIGNMENT_ID=IPUA.INSTRUMENT_PAYMENT_USE_ID(+)
AND IPUA.INSTRUMENT_ID
=IC.INSTRID(+)
AND ooha.flow_status_code != 'CLOSED'
and ooha.PAYMENT_TERM_ID in ( 1021 ,1143)
and ooha.order_type_id=1010
and oola.line_id = (select min(l.line_id) from oe_order_lines_all l where
l.header_id=ooha.header_id
and l.flow_status_code not in ('CLOSED','CANCELLED'));
/List of Standing Orders for which credit card details are populated at header
level/
/**List of Standng order lines for with credit card details are shown******/
SELECT OOHA.HEADER_ID,OOHA.ORDER_NUMBER, OOHA.FLOW_STATUS_CODE
"OrderStatus",oola.line_number,oola.flow_status_code, oola.schedule_ship_date,
(SELECT hca.account_number
FROM hz_cust_accounts hca
WHERE hca.cust_account_id=ooha.sold_to_org_id
) CustomerNumber,
OOHA.PAYMENT_TYPE_CODE,
ooha.credit_card_number,
OOLA.ORDERED_ITEM,
OOLA.ORDERED_QUANTITY,
OOLA.SHIPPED_QUANTITY,
oola.invoiced_quantity,
ic.ccnumber,
ic.chname,
ic.card_owner_id,
ic.masked_cc_number,
ic.card_issuer_code,
ic.expirydate,
ic.inactive_date
FROM OE_ORDER_HEADERS_ALL OOHA,
OE_ORDER_LINES_ALL OOLA,
OE_PAYMENTS OP,
IBY_FNDCPT_TX_EXTENSIONS IFTE,
IBY_PMT_INSTR_USES_ALL IPUA,
IBY_CREDITCARD IC
WHERE OOHA.HEADER_ID=OOLA.HEADER_ID
AND OP.line_ID(+)
=OOla.line_ID
AND OP.TRXN_EXTENSION_ID=IFTE.TRXN_EXTENSION_ID(+)
AND IFTE.INSTR_ASSIGNMENT_ID=IPUA.INSTRUMENT_PAYMENT_USE_ID(+)
AND IPUA.INSTRUMENT_ID
=IC.INSTRID(+)
AND ooha.flow_status_code not in ('CLOSED' ,'CANCELLED')
and ooha.PAYMENT_TERM_ID in ( 1021 ,1143)
and ooha.order_type_id=1010
--and trunc(oola.schedule_ship_date)>trunc(sysdate)
--and trunc(oola.schedule_ship_date)= to_date('02-MAY-14','DD-MON-YY')
and oola.line_id = (select min(l.line_id) from oe_order_lines_all l where
l.header_id=ooha.header_id
and l.flow_status_code not in ('CLOSED','CANCELLED'))
order by oola.schedule_ship_date asc;
/**********query which we run daily to knows orders on
hold***************/
SELECT ooh.header_id,oeh.header_id, ott.name
Order_type,oeh.order_number,oeh.payment_type_code,rt.name
payment_term,ool.line_number,
ool.ordered_item,ool.schedule_ship_date,ool.flow_status_code line_status,
ohd.name,ooh.order_hold_id,ooh.creation_date,ooh.released_flag
,ic.ccnumber,
ic.chname,
ic.card_owner_id,
ic.masked_cc_number,
ic.card_issuer_code,
ic.expirydate,
ic.inactive_date
FROM oe_order_headers_all oeh, oe_order_lines_all ool,oe_transaction_types_tl ott,
ra_terms_tl rt,
oe_order_holds_all ooh,
oe_hold_sources_all ohs,
oe_hold_definitions ohd,
OE_PAYMENTS OP,
IBY_FNDCPT_TX_EXTENSIONS IFTE,
IBY_PMT_INSTR_USES_ALL IPUA,
IBY_CREDITCARD IC
WHERE 1=1
and oeh.header_id=ool.header_id
AND oeh.flow_status_code != 'CLOSED'
and ool.flow_status_code!='CANCELLED'
and oeh.order_type_id=ott.transaction_type_id
and ott.language='US'
and oeh.payment_term_id=rt.term_id
and rt.language='US'
and ool.header_id=ooh.header_id(+)
and ool.line_id=nvl(ooh.line_id(+),ool.line_id)
-- and ool.line_id=ooh.line_id(+)
and ooh.hold_source_id=ohs.hold_source_id(+)
and ohs.hold_id=ohd.hold_id(+)
AND OP.line_ID(+)
=Ool.line_ID
AND OP.TRXN_EXTENSION_ID=IFTE.TRXN_EXTENSION_ID(+)
--and op.payment_level_code(+)='ORDER'
--AND IFTE.TRXN_EXTENSION_ID=ITSA.INITIATOR_EXTENSION_ID
AND IFTE.INSTR_ASSIGNMENT_ID=IPUA.INSTRUMENT_PAYMENT_USE_ID(+)
AND IPUA.INSTRUMENT_ID
=IC.INSTRID(+)
and trunc(ool.schedule_ship_date)= to_date('08-MAY-14','DD-MON-YY')
and oeh.PAYMENT_TERM_ID in ( 1021 ,1143);
Transaction Interface
Tables
RA_INTERFACE_LINES_ALL
RA_INTERFACE_SALESCREDITS
Transaction Sales credit information
_ALL
RA_INTERFACE_DISTRIBUTIONS
Transaction Distribution information
_ALL
RA_INTERFACE_ERRORS_ALL
Receipts tables
AR_CASH_RECEIPTS_ALL
AR_RECEIVABLE_APPLICATIONS
stores Receipt Application details
_ALL
This table is updated when an activity occurs against
AR_PAYMENT_SCHEDULES_ALL an invoice, debit memo, chargeback, credit memo,
on-account credit, bills receivable
This table stores all of the activity that is contained
for the life cycle of a receipt.
Each row represents one step.
AR_CASH_RECEIPT_HISTORY_A
The status field for that row tells you which step
LL
the receipt has reached.
Possible statuses are Approved, Confirmed,
Remitted, Cleared, and Reversed.
Customer Tables
HZ_PARTIES
HZ_CUST_ACCOUNTS
HZ_PARTY_SITES
HZ_CUST_ACCT_SITES_ALL
HZ_CUST_SITE_USES_ALL
HZ_LOCATIONS
Setup tables
RA_CUST_TRX_TYPES_ALL
AR_RECEIPT_CLASSES
AR_RECEIPT_METHODS
AR to GL link in R12
SELECT ooha.order_number,
oola.line_number,
wdd.source_header_type_name,
wnd.name,
rcta.trx_number,
xlate.transaction_number,
b.name batch_name,
b.description batch_description,
h.je_category,
h.je_source,
h.period_name je_period_name,
h.name journal_name,
h.status journal_status,
h.description je_description
FROM -- Create Sales Order -oe_order_headers_all ooha,
oe_order_lines_all oola,
-- Book the Sales Order -wsh_delivery_details wdd,
wsh_delivery_assignments wda,
wsh_new_deliveries wnd,
3] AR_RECEIPT_API_PUB.UNAPPLY
Use this procedure to unapply a cash receipt application against a specified installment of a
debit item or payment schedule ID.
4] AR_RECEIPT_API_PUB.CREATE_AND_APPLY
Use this procedure to create a cash receipt and apply it to a specified installment of a debit
item.
5] AR_RECEIPT_API_PUB.REVERSE
Use this procedure to reverse cash and miscellaneous receipts.
6] AR_RECEIPT_API_PUB.APPLY_ON_ACCOUNT
Use this procedure to apply a cash receipt on account.
7] AR_RECEIPT_API_PUB.UNAPPLY_ON_ACCOUNT
Use this procedure to unapply an on-account application of a specified cash receipt.
8] AR_RECEIPT_API_PUB.ACTIVITY_APPLICATION
Use this procedure to create an activity application on a cash receipt, including Short Term
Debit (STD) and Receipt Write-off applications.
9] AR_RECEIPT_API_PUB. ACTIVITY_UNAPPLICATION
Use this procedure to create a reversal of an activity application on a cash receipt including
Short Term Debt and Receipt write-off.
10] AR_RECEIPT_API_PUB.CREATE_MISC
Use this procedure to create a miscellaneous receipt.
11] AR_RECEIPT_API_PUB.APPLY_OPEN_RECEIPT
Use this procedure to apply a cash receipt to another open receipt. Open receipts include
unapplied cash, on-account cash, and claim investigation applications.
12] AR_RECEIPT_API_PUB.UNAPPLY_OPEN_RECEIPT
Use this procedure to reverse a payment netting application on a cash receipt.
PRINTING_OPTION
PURCHASE_ORDER
PURCHASE_ORDER_DATE
PURCHASE_ORDER_REVISION
REASON_CODE
RECEIPT_METHOD_ID
RELATED_CUSTOMER_TRX_ID
SET_OF_BOOKS_ID
TERM_ID
TERRITORY_ID
TRX_DATE
TRX_NUMBER
Optional Attributes:
ACCOUNTING_RULE_DURATION
ACCOUNTING_RULE_ID
ATTRIBUTE1-15
ATTRIBUTE_CATEGORY
INTERFACE_LINE_ATTRIBUTE1-15
INTERFACE_LINE_CONTEXT
INVENTORY_ITEM_ID
REFERENCE_LINE_ID
RULE_START_DATE
SALES_ORDER
SALES_ORDER_DATE
SALES_ORDER_LINE
SALES_ORDER_REVISION
SALES_ORDER_SOURCE
TAX_CODE
TAX_RATE
The following Ship-To fields were mandatory grouping attributes in release 11i, but are optional
in release 12ORIG_SYSTEM_SHIP_CUSTOMER_ID
ORIG_SYSTEM_SHIP_ADDRESS_ID
ORIG_SYSTEM_SHIP_CONTACT_IDThis is because ship to information is now stored at the line
level in R12. Therefore a single invoice could have different ship to information for each line.
Autoinvoice program matches all the mandatory parameters and group the transactions into
invoices. If all the mandatory parameters are matched for two or more similar transactions, they
will fall in a same invoice. If we define any optional attribute, Autoinvoice program matches
optional attributes in addition to the mandatory attributes to group the transactions.
For Example: SALES_ORDER is the optional attribute assigned to a grouping rule, there
Autoinvoice program matches all mandatory attributes + Sales Order for the transactions. For
any two or more transactions, if all the mandatory attributes and Sales Order(optional attribute)
are matching, only one invoice will be created for those transactions.
If your Grouping rule doesn't include Sales Order and Ship To fields in Optional attributes,
similar sales orders with different ship-to addresses but same bill to will be grouped into one
invoice and AR transaction form will not show any value in Ship-To address as it can not
determine which ship-to value to be picked from multiple sales orders.
Steps to create a Grouping Rule:
Responsibility: Receivables Manager
Navigation: Setup -> Transactions -> Auto Invoice -> Grouping Rules
Select Line Ordering Rules if you are using any. Optional grouping characteristics are optional.
If we are not giving any optional Grouping Characteristics, Autoinvoice will only matches
mandatory characteristics. We can assign Optional characteristics for Invoices, Credit Memos
and Debit Memos.
If we want to assign optional attributes for all invoices, credit memos and debit memos, First
assign optional characteristics for invoice class and the place the cursor on Class Invoices ad
use Down Arrow to define attributes for other classes(Credit Memo and Debit Memo) as well.
Posted by Elangovan Ragavan at 16:51 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query, FUNCTIONAL
That means for a BFB enabled customer, we can not override the Default Payment
Term with BFB enabled Payment Term.
If you try to override the default payment term with Non-BFB Payment Term, it will
work.
For example:
1.Customer - BFB Enabled
Default Payment Term - 30 NET
Override Payment Term - CREDIT (BFB Enabled)
Payment Term on AR Transaction - 30 NET
2. Customer - BFB Enabled
Default Payment Term - 30 NET
Override Payment Term - IMMEDIATE ( NON-BFB Payment Term)
Payment Term on AR Transaction - IMMEDIATE Note: Receivables uses the
following hierarchy to determine the default payment terms, stopping when one is
found:
customer Bill-To site level customer address level
customer level
Transaction Type
Posted by Elangovan Ragavan at 09:54 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query, FUNCTIONAL
How to Debug the error 'Please complete your tax accounting flexfield'
This post explains the process to debug the error 'Please complete your tax accounting flexfield'
which appears in Auto Invoicing process.This approach helps you when the Receivables Auto
Accounting rules derive the Tax account segments from E Business Tax setups and you have
not much idea on EB Tax setups.
Step 1: Get the Customer details from Auto Invoice Import program output or
from Sales Order.
Notice that the Account segment which is missing in the error has source as 'Taxes'.
It means this segment gets derived from EB Tax.Generally Receivables uses Tax
accounts which can be defined at any of the 3 levels shown below.
1. Tax
2. Tax Jurisdiction
3. Tax Rate
Refer to Metalink Note ID 885225.1 for detailed explanation.
Step 3: Create a manual AR invoice for same customer in test instances to
know the Tax account details.
Responsibility: Any Receivables responsibility
Navigation: Transactions > Transactions
Enter a manual invoice and open Invoice Distributions Window.
Note the distribution amount. Close this window and click on Tax button to open Tax
window.
Based on the Distribution amount noted from Invoice Distributions window, find out
the tax details in Tax window.
Step 4: Check whether the tax accounts are defined and/or active currently in
EB Tax.
(i) Check at Tax Jurisdiction level:
Responsibility: Tax Manager or any Tax responsibility which has access to setups.
Navigation: Tax Configuration > Tax Jurisdictions
Query the form with Tax Jurisdiction code noted from step 3.
Click on Tax Accounts button which is on top right. Check whether Tax accounts are
defined and/or active.
(ii) Check at Tax Rate level:
Navigation: Tax Configuration > Tax Rates
Query the form with required details noted from step 3.
Click on Tax Accounts button and check whether Tax accounts are defined and/or
active.
(iii) Check at Tax level:
Navigation: Tax Configuration > Taxes
Click on Tax Accounts button which is on top right. Check whether Tax accounts are
defined and/or active.
Make sure the tax accounts are defined and are active, then re run Auto Invoice
program to process errored records.
Posted by Elangovan Ragavan at 09:26 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
, rila.*
, '---> ERRORS'
, riea.interface_line_id
, riea.MESSAGE_TEXT
, riea.invalid_value
FROM ar.ra_interface_lines_all rila
, ar.ar_receipt_methods arm
, gl.gl_ledgers gl
, apps.hz_cust_accounts hca
, apps.hz_parties hp
, ar.ra_interface_errors_all riea
WHERE rila.receipt_method_id = arm.receipt_method_id(+)
AND rila.set_of_books_id = gl.ledger_id(+)
AND rila.orig_system_bill_customer_id = hca.cust_account_id
AND hp.party_id = hca.party_id
AND rila.interface_line_id = riea.interface_line_id(+)
AND 1 = 1;
Posted by Elangovan Ragavan at 09:58 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
, ar.ra_cust_trx_types_all rctta
, apps.hz_cust_accounts hca
, apps.hz_parties hp
, ar.hz_party_sites hps
, apps.hz_cust_acct_sites_all hcasa
, apps.hz_cust_site_uses_all hcsua
, ar.hz_locations hl
, applsys.fnd_user fu1
, applsys.fnd_user fu2
, ar.ra_batch_sources_all rbsa
, gl.gl_code_combinations gcc
WHERE rcta.bill_to_customer_id = hca.cust_account_id
AND hp.party_id = hca.party_id
AND hp.party_id = hps.party_id
AND hcasa.party_site_id = hps.party_site_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hcasa.cust_acct_site_id = hcsua.cust_acct_site_id
AND rcta.created_by = fu1.user_id
AND rcta.last_updated_by = fu2.user_id
AND hcsua.site_use_id = rcta.bill_to_site_use_id
AND hps.location_id = hl.location_id
AND rcta.batch_source_id = rbsa.batch_source_id(+)
AND rcta.customer_trx_id = rctla.customer_trx_id
AND rctla.customer_trx_line_id = rctlgda.customer_trx_line_id
AND rctlgda.code_combination_id = gcc.code_combination_id
AND rcta.cust_trx_type_id = rctta.cust_trx_type_id
AND RCTA.BATCH_ID = RBA.BATCH_ID
--
SELECT rcta.trx_number
, rcta.complete_flag complete
, rcta.request_id
, fu1.description created_by
, '## SOURCE ##'
, rbsa.name source_name
, rbsa.description
, '## STATS ##'
, fu2.description updated_by
, '## ACCOUNT ##'
, hp.party_name
, hca.account_number act_no
, hps.party_site_number site_num
, rcta.org_id
hp.party_name
, hca.account_number act_no
, hca.cust_account_id
, hca.party_id
, DECODE(hca.status, 'I', 'Inactive', 'A', 'Active', 'Other') hdr
, '##'
, hca.creation_date hdr_creation_date
, fu_header.description hdr_created_by
, hca.last_update_date hdr_updated
, fu_hdr_upd.description hdr_updated_by
, '###'
, hcsua.org_id
, hps.party_site_number site_num
, hcsua.cust_acct_site_id
, hcsua.location
, hcsua.site_use_code
, hcsua.primary_flag
, DECODE(hcasa.status, 'I', 'Inactive', 'A', 'Active', 'Other') site
, '####'
, hcsua.creation_date site_creation_date
, fu_site.description site_created_by
, hcsua.last_update_date site_updated
, fu_site_upd.description site_updated_by
, '#####'
, hl.address1
, hl.address2
, hl.address3
, hl.address4
, hl.city
, hl.state
, hl.postal_code
FROM apps.hz_parties hp
, ar.hz_party_sites hps
, ar.hz_locations hl
, apps.hz_cust_accounts hca
, apps.hz_cust_acct_sites_all hcasa
, apps.hz_cust_site_uses_all hcsua
, applsys.fnd_user fu_header
, applsys.fnd_user fu_hdr_upd
, applsys.fnd_user fu_site
, applsys.fnd_user fu_site_upd
WHERE hp.party_id = hca.party_id
AND hp.party_id = hps.party_id
AND hcasa.party_site_id = hps.party_site_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hcasa.cust_acct_site_id = hcsua.cust_acct_site_id
AND hca.created_by = fu_header.user_id
AND hca.last_updated_by = fu_hdr_upd.user_id
AND hcsua.created_by = fu_site.user_id
AND hcsua.last_updated_by = fu_site_upd.user_id
AND hps.location_id = hl.location_id
AND hl.location_id = 123
--
--
--
--
--
--
--
ORDER BY hcsua.org_id
, hp.party_name;
, hp.party_number
, hps.party_site_number site_num
, DECODE(hcasa.status, 'I', 'Inactive', 'A', 'Active', 'Other') status
, hp.party_name
, hcsua.location
, hcsua.site_use_code
, hcasa.creation_date site_created_date
, fu.description created_by
, hcasa.last_update_date site_update_date
, fu2.description updated_by
, rcrm.cust_receipt_method_id
, rcrm.customer_id
, rcrm.receipt_method_id
, rcrm.primary_flag
, rcrm.start_date
, rcrm.end_date
, rcrm.site_use_id
, rcrm.creation_date
FROM apps.hz_parties hp
, ar.hz_party_sites hps
, apps.hz_cust_accounts hca
, apps.hz_cust_acct_sites_all hcasa
, apps.hz_cust_site_uses_all hcsua
, applsys.fnd_user fu
, applsys.fnd_user fu2
, apps.ar_receipt_methods arm
, apps.ra_cust_receipt_methods rcrm
WHERE hp.party_id = hca.party_id
AND hp.party_id = hps.party_id
AND hcasa.party_site_id = hps.party_site_id
AND hca.cust_account_id = hcasa.cust_account_id
AND hcasa.cust_acct_site_id = hcsua.cust_acct_site_id
AND hcsua.created_by = fu.user_id
AND hcsua.last_updated_by = fu2.user_id
AND arm.receipt_method_id = rcrm.receipt_method_id
AND rcrm.customer_id = hca.cust_account_id
AND rcrm.site_use_id = hcsua.site_use_id
AND hcasa.status <> 'I'
AND hca.cust_account_id = 123
-AND hca.account_number = '123'
AND rcrm.end_date IS NULL
AND 1 = 1
ORDER BY hp.party_name;
Posted by Elangovan Ragavan at 08:51 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
ca.account_number custno
ca.attribute_category
DECODE (cs.status, 'I', 'Inactive',
pa.party_name name
cu.site_use_code site_use
'A', 'Active',
'Other') status
, hps.party_site_number site_num
, cu.location site_location
, hl.address1
, hl.city
, hl.postal_code
, hl.country
FROM ar.hz_cust_site_uses_all cu
, ar.hz_cust_accounts ca
, ar.hz_cust_acct_sites_all cs
, ar.hz_parties pa
, ar.hz_party_sites hps
, ar.hz_locations hl
WHERE ca.cust_account_id = cs.cust_account_id
AND cu.cust_acct_site_id = cs.cust_acct_site_id
AND ca.party_id = pa.party_id
AND pa.party_id = hps.party_id
AND cs.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND ca.account_number = 123
AND cu.site_use_code = 'BILL_TO'
AND ca.customer_type = 'R'
Posted by Elangovan Ragavan at 08:50 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
TUESDAY, 10 DECEMBER 2013
To be in the position where you need to handle and process a payment in Receivables, you
need to have a buyer/payer (most times this is a customer but there are exceptions). Customer
records are stored in the HZ_CUST_ACCOUNTS and HZ_PARTIES tables. Each customer
needs to have a site (a location/address of business) for which information is stored in
HZ_CUST_ACCT_SITES_ALL and HZ_PARTY_SITES_ALL.
When a customer purchases goods or services from your company, an invoice is generated for
the customer. These invoice transactions are recorded in RA_CUSTOMER_TRX_ALL (invoice
headers) and RA_CUSTOMER_TRX_LINES_ALL (invoice lines).
When the customer makes a payment, this generates new transactions. These are recorded in
AR_CASH_RECEIPTS_ALL and AR_CASH_RECEIPT_HISTORY. If there is adjustment to an
invoice, this is recorded in AR_ADJUSTMENTS.
Sometimes payments are received in batches, where a single payment is for multiple invoices.
These batch payments have records in AR_BATCHES.
The AR_PAYMENT_SCHEDULE table holds one record per payment. Therefore, for payments
that pay an invoice in full, there will only be one record related to that invoice. However, if
payments for an invoice are broken up into a payment plan, or if a partial payment is received
for an invoice, additional records will be generated in this table for each payment.
I mentioned above that most times payments are from customers, but there are exceptions. An
example of an exception is payment from a bank for interest earned. The payment is not from
a customer and its not for goods/services provided. These types of payments are recorded in
AR_MISC_CASH_DISTRIBUTIONS.
These transactions affect accounting which will eventually make their way to the GL (when the
Receivables Transfer to GL program is run). The accounting transactions are generated in
RA_CUST_TRX_LINE_GL_DIST and AR_RECEIVABLE_APPLICATIONS.
1. What is TCA? Tables?
A) Trading Community Architecture. It is a centralized repository of business entities such as
Partners, Customers, and Organizations etc. It is a new framework developed in Oracle 11i.
HZ_PARTIES: The HZ_PARTIES table stores basic information about parties that can be shared
with any relationship that the party might establish with another party. Although a record in
the HZ_PARTIES table represents a unique party, multiple parties can have the same name.
The parties can be one of four types:
Organization for example, Oracle CorporationPerson for example, Jane DoeGroup for
example, World Wide Web ConsortiumRelationship for example, Jane Doe at Oracle
Corporation.
HZ_LOCATIONS: The HZ_LOCATIONS table stores information about a delivery or postal
address such as building number, street address, postal code, and directions to a location.
This table provides physical location information about parties (organizations and people) and
customer accounts.
HZ_PARTY_SITES: The HZ_PARTY_SITES table links a party (see HZ_PARTIES) and a location
(see HZ_LOCATIONS) and stores location-specific party information. One party can optionally
have one or more party sites. One location can optionally be used by one or more parties.
This party site can then be used for multiple customer accounts within the same party.
HZ_CUST_ACCT_SITES_ALL
HZ_CUST_SITE_USES_ALL
HZ_CUST_CONTACT_POINTS etc.
2. What are Base Tables or Interface Tables for Customer Conversions, Autolockbox, Auto
Invoice?
A) Customer Conversion:
Interface Tables : RA_CUSTOMERS_INTERFACE_ALL, RA_CUSTOMER_PROFILES_INT_ALL,
RA_CONTACT_PHONES_INT_ALL,
RA_CUSTOMER_BANKS_INT_ALL,
RA_CUST_PAY_METHOD_INT_ALL
Base Tables : RA_CUSTOMERS, RA_ADDRESSES, RA_SITE_USES_ALL,
RA_CUSTOMER_PROFILES_ALL, RA_PHONES etc
B) Auto Invoice:
Interface Tables : RA_INTERFACE_LINES_ALL, RA_INTERFACE_DISTRIBUTIONS_ALL
RA_INTERFACE_SALESCREDITS_ALL, RA_INTERFACE_ERRORS_ALL
Base Tables : RA_CUSTOMER_TRX_ALL, RA_CUSTOMER_TRX_LINES_ALL,
RA_CUST_TRX_LINE_GL_DIST_ALL, RA_CUST_TRX_LINE_SALESREPS_ALL,
RA_CUST_TRX_TYPES_ALL
C) AutoLockBox:
Interface Tables : AR_PAYMENTS_INTERFACE_ALL (POPULATED BY IMPORT PROCESS)
Interim tables : AR_INTERIM_CASH_RECEIPTS_ALL (All Populated by Submit Validation)
: AR_INTERIM_CASH_RCPT_LINES_ALL,
AR_INTERIM_POSTING
Base Tables : AR_CASH_RECEIPTS_ALL, AR_RECEIVABLE_APPLICATIONS_ALL,
AR_PAYMENT_SCHEDULES_ALL ( All Populated by post quick cash)
3. What are the tables in which Invoices/transactions information is stored?
A) RA_CUSTOMER_TRX_ALL, The RA_CUSTOMER_TRX_ALL table stores invoice, debit memo,
commitment, bills receivable, and credit memo header information. Each row in this table
includes general invoice information such as customer, transaction type, and printing
instructions.
RA_CUSTOMER_TRX_LINES_ALL, The RA_CUSTOMER_TRX_LINES_ALL table stores information
about invoice, debit memo, credit memo, bills receivable, and commitment lines (LINE,
AR TO GL LINK IN R12
AR TO GL LINK IN R12( THROUGH XLA) or ( WITH XLA )
/* Formatted on 11/29/2013 4:46:26 PM (QP5 v5.114.809.3010) */
SELECT ooha.order_number,
ooha.org_id,
hca.account_name,
hp.party_name "Customer Name",
hcasab.orig_system_reference BILL_TO_ORIG_REF,
hpsb.status BILL_TO_STATUS,
'ADDRESS1 - '
|| bill_loc.address1
|| ','
|| CHR (10)
|| 'ADDRESS2 - '
|| bill_loc.address2
|| ','
|| CHR (10)
|| 'ADDRESS3 - '
|| bill_loc.address3
|| ','
|| CHR (10)
|| 'CITY - '
|| bill_loc.city
|| ','
|| CHR (10)
|| 'POSTAL CD- '
|| bill_loc.postal_code
|| ','
|| CHR (10)
|| 'COUNTRY - '
|| bill_loc.country
BILL_TO_ADDRESS,
hcasas.orig_system_reference SHIP_TO_ORIG_REF,
hpss.status SHIP_TO_STATUS,
'ADDRESS1 - '
|| ship_loc.address1
|| ','
|| CHR (10)
|| 'ADDRESS2 - '
|| ship_loc.address2
|| ','
|| CHR (10)
|| 'ADDRESS3 - '
|| ship_loc.address3
|| ','
|| CHR (10)
|| 'CITY - '
|| ship_loc.city
|| ','
|| CHR (10)
|| 'POSTAL CD- '
|| ship_loc.postal_code
|| ','
|| CHR (10)
|| 'COUNTRY - '
|| ship_loc.country
SHIP_TO_ADDRESS,
oola.inventory_item_id,
oola.ordered_item,
msib.description item_description,
wnd.name delivery_number,
rct.trx_number "AR Invoice Number",
acr.receipt_number "AR Receipt Number",
gjh.ledger_id,
gjh.name
FROM oe_order_headers_all ooha,
oe_order_lines_all oola,
hz_parties hp,
hz_cust_accounts hca,
hz_party_sites hpss,
hz_party_sites hpsb,
hz_locations bill_loc,
hz_locations ship_loc,
hz_cust_acct_sites_all hcasab,
hz_cust_acct_sites_all hcasas,
hz_cust_site_uses_all hzsuab,
hz_cust_site_uses_all hzsuas,
mtl_system_items_b msib,
wsh_delivery_details wdd,
wsh_new_deliveries wnd,
wsh_delivery_assignments wda,
ra_customer_trx_all rct,
ra_customer_trx_lines_all rctl,
ra_cust_trx_line_gl_dist_all rctld,
ar_cash_receipts_all acr,
xla.xla_transaction_entities xte,
xla_events xe,
xla_ae_headers xah,
xla_ae_lines xal,
xla_distribution_links xdl,
gl_import_references gir,
gl_je_batches gjb,
gl_je_headers gjh,
gl_je_lines gjl
WHERE
ooha.order_number = :SalesOrderNumber--Right click :RequitionNumber from
Toad Enable Prompt For Substitution Variables
AND ooha.org_id = 204
AND hca.cust_account_id = ooha.sold_to_org_id
AND hp.party_id = hca.party_id
AND hpss.party_id = hca.party_id
AND hpsb.party_id = hca.party_id
AND bill_loc.location_id = hpss.location_id
AND ship_loc.location_id = hpsb.location_id
AND hcasas.cust_account_id = hca.cust_account_id
AND hcasab.cust_account_id = hca.cust_account_id
AND hcasas.party_site_id = hpss.party_site_id
AND hcasab.party_site_id = hpsb.party_site_id
AND hzsuas.cust_acct_site_id = hcasas.cust_acct_site_id
AND hzsuab.cust_acct_site_id = hcasab.cust_acct_site_id
AND hzsuas.site_use_id = ooha.ship_to_org_id
AND hzsuab.site_use_id = ooha.invoice_to_org_id
AND wda.delivery_id = wnd.delivery_id(+)
AND wdd.delivery_detail_id = wda.delivery_detail_id
AND wdd.source_header_id = ooha.header_id
AND wdd.source_line_id = oola.line_id
AND wdd.organization_id = msib.organization_id(+)
AND wdd.inventory_item_id = msib.inventory_item_id(+)
AND rct.interface_header_attribute1 = TO_CHAR (ooha.order_number)
AND rct.org_id = ooha.org_id
AND rctl.customer_trx_id = rct.customer_trx_id
AND rctl.sales_order = TO_CHAR (ooha.order_number)
AND rctld.customer_trx_id = rct.customer_trx_id
AR TO GL LINK IN R12
AR TO GL LINK IN R12( THROUGH XLA) or ( WITH XLA )
/* Formatted on 11/29/2013 4:46:26 PM (QP5 v5.114.809.3010) */
SELECT ooha.order_number,
ooha.org_id,
hca.account_name,
hp.party_name "Customer Name",
hcasab.orig_system_reference BILL_TO_ORIG_REF,
hpsb.status BILL_TO_STATUS,
'ADDRESS1 - '
|| bill_loc.address1
|| ','
|| CHR (10)
|| 'ADDRESS2 - '
|| bill_loc.address2
|| ','
|| CHR (10)
|| 'ADDRESS3 - '
|| bill_loc.address3
|| ','
|| CHR (10)
|| 'CITY - '
|| bill_loc.city
|| ','
|| CHR (10)
|| 'POSTAL CD- '
|| bill_loc.postal_code
|| ','
|| CHR (10)
|| 'COUNTRY - '
|| bill_loc.country
BILL_TO_ADDRESS,
hcasas.orig_system_reference SHIP_TO_ORIG_REF,
hpss.status SHIP_TO_STATUS,
'ADDRESS1 - '
|| ship_loc.address1
|| ','
|| CHR (10)
|| 'ADDRESS2 - '
|| ship_loc.address2
|| ','
|| CHR (10)
|| 'ADDRESS3 - '
|| ship_loc.address3
|| ','
|| CHR (10)
|| 'CITY - '
|| ship_loc.city
|| ','
|| CHR (10)
|| 'POSTAL CD- '
|| ship_loc.postal_code
|| ','
|| CHR (10)
|| 'COUNTRY - '
|| ship_loc.country
SHIP_TO_ADDRESS,
oola.inventory_item_id,
oola.ordered_item,
msib.description item_description,
wnd.name delivery_number,
rct.trx_number "AR Invoice Number",
acr.receipt_number "AR Receipt Number",
gjh.ledger_id,
gjh.name
FROM oe_order_headers_all ooha,
oe_order_lines_all oola,
hz_parties hp,
hz_cust_accounts hca,
hz_party_sites hpss,
hz_party_sites hpsb,
hz_locations bill_loc,
hz_locations ship_loc,
hz_cust_acct_sites_all hcasab,
hz_cust_acct_sites_all hcasas,
hz_cust_site_uses_all hzsuab,
hz_cust_site_uses_all hzsuas,
mtl_system_items_b msib,
wsh_delivery_details wdd,
wsh_new_deliveries wnd,
wsh_delivery_assignments wda,
ra_customer_trx_all rct,
ra_customer_trx_lines_all rctl,
ra_cust_trx_line_gl_dist_all rctld,
ar_cash_receipts_all acr,
xla.xla_transaction_entities xte,
xla_events xe,
xla_ae_headers xah,
xla_ae_lines xal,
xla_distribution_links xdl,
gl_import_references gir,
gl_je_batches gjb,
gl_je_headers gjh,
gl_je_lines gjl
WHERE
ooha.order_number = :SalesOrderNumber--Right click :RequitionNumber from
Toad Enable Prompt For Substitution Variables
AND ooha.org_id = 204
AND hca.cust_account_id = ooha.sold_to_org_id
AND hp.party_id = hca.party_id
AND hpss.party_id = hca.party_id
AND hpsb.party_id = hca.party_id
AND bill_loc.location_id = hpss.location_id
AND ship_loc.location_id = hpsb.location_id
AND hcasas.cust_account_id = hca.cust_account_id
AND hcasab.cust_account_id = hca.cust_account_id
AND hcasas.party_site_id = hpss.party_site_id
AND hcasab.party_site_id = hpsb.party_site_id
AND hzsuas.cust_acct_site_id = hcasas.cust_acct_site_id
AND hzsuab.cust_acct_site_id = hcasab.cust_acct_site_id
AND hzsuas.site_use_id = ooha.ship_to_org_id
AND hzsuab.site_use_id = ooha.invoice_to_org_id
AND wda.delivery_id = wnd.delivery_id(+)
AND wdd.delivery_detail_id = wda.delivery_detail_id
AND wdd.source_header_id = ooha.header_id
AND wdd.source_line_id = oola.line_id
AND wdd.organization_id = msib.organization_id(+)
AND wdd.inventory_item_id = msib.inventory_item_id(+)
AND rct.interface_header_attribute1 = TO_CHAR (ooha.order_number)
AND rct.org_id = ooha.org_id
AND rctl.customer_trx_id = rct.customer_trx_id
AND rctl.sales_order = TO_CHAR (ooha.order_number)
AND rctld.customer_trx_id = rct.customer_trx_id
AR to GL Query
Provide Set of book id, Period name, AR invoice/Transaction to the following query. It will give
all GL Batch Name, GL Header and Line details along with the Posted status at the line level.
Query:
SELECT gjl.reference_4 AR_Transaction,
gjb.je_batch_id,
gjb.name batch_name,
gjh.je_header_id,
gjh.name Journal_Header_Name,
DECODE (gjh.ACTUAL_FLAG,
'A', 'Actual',
'B', 'Budget',
'E', 'Encumbrance')
Balance_Type,
gjl.subledger_doc_sequence_value Doc_Seq_Value,
gjl.effective_date GL_Date,
gjl.code_combination_id,
gjl.accounted_dr,
gjl.accounted_cr,
gjl.description Description,
DECODE (gjl.status, 'P', 'Posted', 'U', 'Unposted',
gjl.status)
Journal_Line_Status
FROM gl_je_headers gjh, gl_je_lines gjl, gl_je_batches gjb
WHERE
gjh.je_source = 'Receivables'
AND gjh.je_header_id = gjl.je_header_id
AND gjh.JE_BATCH_ID = gjb.JE_BATCH_ID
AND gjh.JE_HEADER_ID = gjl.JE_HEADER_ID
AND gjh.period_name = gjb.default_period_name
AND gjh.set_of_books_id = &sob_id
AND gjh.period_name = '&Period_Name'
AND gjl.reference_4 = '&AR_trx_number';
Posted by Elangovan Ragavan at 18:09 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query, gl
Oracle R12 Internal Requisition and Internal Sales Order Process Flow.
In this blog I will explain the Process flow and Setup required to create Oracle Order
Management Internal Sales order (ISO) from Internal requisition (IR)
What is internal sales order
A request within your company for goods or services. An internal sales order originates
from an employee or from another process as a requisition, such as inventory or
manufacturing, and becomes an internal sales order when the information is transferred
from Purchasing to Order Management. Also known as internal requisition or purchase
requisition.
Oracle Purchasing uses Order Import to transfer requisitions for internally sourced
products to Order Management. Once imported, the internal sales orders are processed
similar to regular sales orders.
Note: You can create requisitions (with same number) in two different operating units.
You can partially or fully cancel the line quantities on internal sales orders.
You can make the following attribute changes after an internal sales order has been generated:
Update Scheduled Shipment Date
6# Set the Internal Order Setup at Customer Ship To Site in Oracle Order Management.
8# Define Purchasing Option Setup for Internal Sales Order and define
Internal requisition Order Type
Internal requisition Order Source.
in Oracle Purchasing Module
Select MAIN_TAB.*
from
(select AR_TAB.account_number ,
AR_TAB.party_name,
AR_TAB.customer_trx_id,
AR_TAB.Trans_Type,
AR_TAB.trans_type_name,
AR_TAB.cust_trx_type_id,
AR_TAB.invoice_currency_code,
AR_TAB.location_code,
AR_TAB.trx_num,
AR_TAB.Trans_Date,
AR_TAB.gl_date,
AR_TAB.Due_Date,
AR_TAB.Fcy_Amt,
AR_TAB.Inr_Amt,
AR_TAB.exchange_rate,
AR_TAB.amount_due_remaining_FCY,
AR_TAB.Amount_Remaining_INR,
nvl(AR_TAB.ar_acctd_amt_due,0) ar_acctd_amt_due,
(nvl(AR_TAB.INR_AMT,0) - nvl(AR_TAB.ar_acctd_amt_due,0)) outstanding_amount_inr,
(nvl(AR_TAB.Fcy_Amt,0)-nvl(AR_TAB.ar_fcy_amt_due,0)) Outstanding_amount_fcy,
(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) <=0 then (AR_TAB.INR_AMT AR_TAB.ar_acctd_amt_due)
else 0 end ) Current_bal
,(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) between 1 and 30 then
(nvl(AR_TAB.INR_AMT,0) - nvl(AR_TAB.ar_acctd_amt_due,0))
else 0 end ) One_30_Days_Past_Due ---1-30
,(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) between 31 and 60 then
(nvl(AR_TAB.INR_AMT,0) - nvl(AR_TAB.ar_acctd_amt_due,0))
else 0 end ) ThirtyOne_60_Days_Past_Due ---31-60
,(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) between 61 and 90 then
(nvl(AR_TAB.INR_AMT,0) - nvl(AR_TAB.ar_acctd_amt_due,0))
else 0 end ) One_90_Days_Past_Due,
(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) between 91 and 120 then
(nvl(AR_TAB.INR_AMT,0) - nvl(AR_TAB.ar_acctd_amt_due,0))
else 0 end ) One_120_Days_Past_Due,
(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) between 121 and 150 then
(nvl(AR_TAB.INR_AMT,0) - nvl(AR_TAB.ar_acctd_amt_due,0))
else 0 end ) One_150_Days_Past_Due,
(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) between 151 and 180 then
(nvl(AR_TAB.INR_AMT,0) - nvl(AR_TAB.ar_acctd_amt_due,0))
else 0 end ) One_180_Days_Past_Due,
(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) > 180 then (nvl(AR_TAB.INR_AMT,0) -
nvl(AR_TAB.ar_acctd_amt_due,0))
else 0 end ) more_than_180_Days_Past_Due
from
(SELECT
hca.account_number account_number,
hp.PARTY_NAME party_name,
cta.CUSTOMER_TRX_ID customer_trx_id
--,acl.name collector_name
,decode(ps.class,'INV', 'Invoice', 'DM', 'Debit Memo','CM','Credit Memo') Trans_Type
,rctt.name trans_type_name,
rctt.CUST_TRX_TYPE_ID cust_trx_type_id
,cta.INVOICE_CURRENCY_CODE invoice_currency_code,
hou.LOCATION_CODE location_code,
ps.trx_number trx_num
,ps.trx_date Trans_Date,
ps.GL_DATE gl_date,
ps.due_date Due_Date,
ps.AMOUNT_DUE_ORIGINAL Fcy_Amt,
round((ps.AMOUNT_DUE_ORIGINAL * nvl(ps.EXCHANGE_RATE,1)),2) Inr_Amt ,
ps.EXCHANGE_RATE exchange_rate,
ps.AMOUNT_DUE_REMAINING amount_due_remaining_FCY
,ps.acctd_amount_due_remaining Amount_Remaining_INR,
(select round(sum(nvl(a.AMOUNT_APPLIED* nvl(ps.EXCHANGE_RATE,1) ,0)),2)
from ar_receivable_applications_all a
where a.APPLIED_PAYMENT_SCHEDULE_ID = ps.PAYMENT_SCHEDULE_ID
-- a.APPLIED_CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
and a.DISPLAY='Y'
and trunc(a.GL_DATE) between :p_from_date and :p_to_date
group by a.APPLIED_PAYMENT_SCHEDULE_ID) ar_acctd_amt_due,
(select round(sum(nvl(a.AMOUNT_APPLIED,0)),2) from ar_receivable_applications_all a where
a.APPLIED_PAYMENT_SCHEDULE_ID=ps.PAYMENT_SCHEDULE_ID
and a.DISPLAY='Y' and trunc(a.GL_DATE) between :p_from_date and :p_to_date
group by a.APPLIED_PAYMENT_SCHEDULE_ID) ar_fcy_amt_due
/*,(case when (trunc(sysdate) - trunc(ps.GL_DATE)) <=0 then ps.acctd_amount_due_remaining
else 0 end ) Current_bal
,(case when (trunc(sysdate) - trunc(ps.GL_DATE)) between 1 and 30 then
ps.acctd_amount_due_remaining
else 0 end ) One_30_Days_Past_Due ---1-30
,(case when (trunc(sysdate) - trunc(ps.GL_DATE)) between 31 and 60 then
ps.acctd_amount_due_remaining
else 0 end ) ThirtyOne_60_Days_Past_Due ---31-60
,(case when (trunc(sysdate) - trunc(ps.GL_DATE)) between 61 and 90 then
ps.acctd_amount_due_remaining
else 0 end ) One_90_Days_Past_Due,
(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) between 151 and 180 then (nvl(abs(AR_TAB.INR_AMT),0) - nvl(abs(AR_TAB.ar_acctd_amt_due),0))
else 0 end ) One_180_Days_Past_Due,
(case when (:p_to_date - trunc(AR_TAB.DUE_DATE)) > 180 then (nvl(abs(AR_TAB.INR_AMT),0) - nvl(abs(AR_TAB.ar_acctd_amt_due),0))
else 0 end ) more_than_180_Days_Past_Due
from
(SELECT
hca.account_number account_number,
hp.PARTY_NAME party_name,
cta.CUSTOMER_TRX_ID customer_trx_id
--,acl.name collector_name
,decode(ps.class,'INV', 'Invoice', 'DM', 'Debit Memo','CM','Credit Memo') Trans_Type
,rctt.name trans_type_name,
rctt.CUST_TRX_TYPE_ID cust_trx_type_id
,cta.INVOICE_CURRENCY_CODE invoice_currency_code,
hou.LOCATION_CODE location_code,
ps.trx_number trx_num
,ps.trx_date Trans_Date,
ps.GL_DATE gl_date,
ps.due_date Due_Date,
ps.AMOUNT_DUE_ORIGINAL Fcy_Amt,
round((ps.AMOUNT_DUE_ORIGINAL * nvl(ps.EXCHANGE_RATE,1)),2) Inr_Amt ,
ps.EXCHANGE_RATE exchange_rate,
ps.AMOUNT_DUE_REMAINING amount_due_remaining_FCY
,ps.acctd_amount_due_remaining Amount_Remaining_INR,
(select round(sum(nvl(a.AMOUNT_APPLIED*nvl(ps.EXCHANGE_RATE,1),0)),2)
from ar_receivable_applications_all a
where a.PAYMENT_SCHEDULE_ID = ps.PAYMENT_SCHEDULE_ID
-- a.APPLIED_CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
and a.DISPLAY='Y'
and trunc(a.GL_DATE) between :p_from_date and :p_to_date
group by a.PAYMENT_SCHEDULE_ID) ar_acctd_amt_due,
(select round(sum(nvl(abs(a.AMOUNT_APPLIED),0)),2)
from ar_receivable_applications_all a
where a.PAYMENT_SCHEDULE_ID = ps.PAYMENT_SCHEDULE_ID
-- a.APPLIED_CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
and a.DISPLAY='Y'
and trunc(a.GL_DATE) between :p_from_date and :p_to_date
group by a.PAYMENT_SCHEDULE_ID) ar_fcy_amt_due
/*,(case when (trunc(sysdate) - trunc(ps.GL_DATE)) <=0 then ps.acctd_amount_due_remaining
else 0 end ) Current_bal
,(case when (trunc(sysdate) - trunc(ps.GL_DATE)) between 1 and 30 then
ps.acctd_amount_due_remaining
AND rctt.ORG_ID=cta.ORG_ID
AND ps.AMOUNT_ADJUSTED is null -- added on 10jul2012
--AND cta.TRX_NUMBER='511120003'
--AND trunc(ps.DUE_DATE) between nvl(:p_from_date,trunc(ps.DUE_DATE)) and
nvl(:p_to_date,trunc(ps.DUE_DATE))
--AND trunc(ps.GL_DATE) between nvl(:p_from_date,trunc(ps.GL_DATE)) and
nvl(:p_to_date,trunc(ps.GL_DATE)
AND trunc(ps.GL_DATE) between nvl(:p_from_date,trunc(ps.GL_DATE)) and
nvl(:p_to_date,trunc(ps.GL_DATE))) AR_TAB
--AND AR_TAB.Amount_Remaining_INR <>0
where (nvl(abs(AR_TAB.INR_AMT),0) - nvl(abs(AR_TAB.ar_acctd_amt_due),0)) <> 0)
MAIN_TAB
order by MAIN_TAB.PARTY_NAME asc;
Posted by Elangovan Ragavan at 10:38 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query, REPORT_QUERY
TUESDAY, 14 MAY 2013
AR to GL Link r12
SELECT
>>SQL1:je_category=
INV/CM/DM/CB
SL
Fields
gle.NAMEledger_name,
gle.currency_codeledger_currency_code,
gcc.concatenated_segmentssla_gl_account,
gcc1.concatenated_segmentsgl_account,
gps.period_nameperiod_name,
party.party_nameparty_name,
party.party_numberparty_number,
cust.account_nameaccount_name,
cust.account_numbercustomer_number,
rct.trx_number,
rct.trx_date,
ctt.NAMEtrx_type,
DECODE(ctt.TYPE,
'INV','Invoices',
'CM','CreditMemos',
'DM','DebitMemos',
'CB','ChargeBacks',
NULL)
trx_class,
rct.complete_flag,
rct.invoice_currency_code,
rctgd.amountdist_AMT,
rctgd.acctd_amountdist_ACCTD_AMOUNT,
rctgd.gl_datear_gl_date,
Rctgd.Gl_Posted_DateAr_Gl_Posted_Date,
rctgd.account_classar_line_account_class,
ael.entered_drsla_line_entered_dr,
ael.entered_crsla_line_entered_cr,
NVL(ael.accounted_dr,0)NVL(ael.accounted_cr,0)
sla_line_accounted_net,
ael.accounted_drsla_line_accounted_dr,
ael.accounted_crsla_line_accounted_cr,
xdl.unrounded_entered_drsla_dist_entered_dr,
xdl.unrounded_entered_crsla_dist_entered_cr,
xdl.unrounded_accounted_drsla_dist_accounted_dr,
xdl.unrounded_accounted_crsla_dist_accounted_cr,
NVL(xdl.unrounded_accounted_dr,0)
NVL(xdl.unrounded_accounted_cr,0)
sla_dist_accounted_net,
DECODE(rctgd.posting_control_id,3,'N','Y')
gl_transfer_statusGLFields
Amounts
,
jl.entered_drgl_entered_dr,
jl.entered_crgl_entered_cr,
jl.accounted_drgl_accounted_dr,
jl.accounted_crgl_accounted_cr,
NVL(jl.entered_dr,0)NVL(jl.entered_cr,0)
gl_net_entered_amt,
NVL(jl.accounted_dr,0)NVL(jl.accounted_cr,0)
gl_net_accounted_amtJournal
Info.
,
jb.NAMEje_batch_name,
jb.descriptionje_batch_description,
jh.NAMEje_name,
jh.descriptionje_description,
jh.posted_dateje_posted_date,
DECODE(
jh.status,
'P',
'Posted',
'U',
'Unposted',
'F',
'Error7Showinginvalidjournalentrylinesornojournal
entrylines',
'K',
'Error10Showingunbalancedintercompanyjournalentry',
'Z',
'Error7Showinginvalidjournalentrylinesornojournal
entrylines',
'Unknown'
)
je_status,
DECODE(jh.actual_flag,
'A',
'Actual',
'B',
'Budget',
'E',
'Encumbrance')
je_typeReconcileStatusand
Amounts..
,
DECODE(
rctgd.posting_control_id,
3,
'NotTransferredToSLA',
DECODE(aeh.gl_transfer_status_code,
'Y','TransferredtoGL',
'NotTransferredtoGL')
)
reconcile_status,
xdl.accounting_line_code,
xdl.event_class_code,
xdl.event_type_code,
aeh.accounting_date,
aeh.gl_transfer_date,
hou.NAMEoperating_unit,
PrimaryKeys
rct.customer_trx_id,
rctgd.cust_trx_line_gl_dist_id,
ctt.cust_trx_type_id,
gle.ledger_id,
gcc.code_combination_idsla_code_combination_id,
gcc1.code_combination_idgl_code_combination_id,
party.party_id,
cust.cust_account_id,
aeh.ae_header_id,
ael.ae_line_num,
jl.je_line_num,
jh.je_header_id,
jb.je_batch_id,
jes.je_source_name,
xdl.event_id,
jec.je_category_name,
gps.start_date,
gps.end_date,
hou.organization_idorg_id,
PrimaryKeys
gcc1.code_combination_id,
aeh.application_id,
xdl.temp_line_num,
xdl.ref_ae_header_id,
gps.set_of_books_id,
hou.organization_id,
GCC.SEGMENT2GCC#50353#ACCOUNT,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT2,
'MAS_GL_COA_ACCOUNT')
GCC#50353#ACCOUNT#DESCR,
GCC.SEGMENT1GCC#50353#COMPANY,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT1,
'MAS_GL_COA_COMPANY')
GCC#50353#COMPANY#DESCR,
GCC.SEGMENT6GCC#50353#DEPARTMENT,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT6,
'MAS_GL_COA_DEPARTMENT')
GCC#50353#DEPARTMENT#DESCR,
GCC.SEGMENT8GCC#50353#FUTURE,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT8,
'MAS_GL_COA_FUTURE')
GCC#50353#FUTURE#DESCR,
GCC.SEGMENT7GCC#50353#IC,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT7,
'MAS_GL_COA_COMPANY')
GCC#50353#IC#DESCR,
GCC.SEGMENT4GCC#50353#LOB,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT4,
'MAS_GL_COA_LOB')
GCC#50353#LOB#DESCR,
GCC.SEGMENT5GCC#50353#LOCATIONS,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT5,
'MAS_GL_COA_LOCATION')
GCC#50353#LOCATIONS#DESCR,
GCC.SEGMENT3GCC#50353#QUALIFIER,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT3,
'MAS_GL_COA_ACCT_QUAL')
GCC#50353#QUALIFIER#DESCR
FROMra_customer_trxrct,
ra_cust_trx_line_gl_distrctgd,
ra_cust_trx_typesctt,
gl_ledgersgle,
gl_code_combinations_kfvgcc,
gl_code_combinations_kfvgcc1,
hz_partiesparty,
hz_cust_accountscust,
xla_ae_headersaeh,
xla_ae_linesael,
xla_distribution_linksxdl,
gl_import_referencesjir,
gl_je_batchesjb,
gl_je_headersjh,
gl_je_linesjl,
gl_je_sourcesjes,
gl_je_categoriesjec,
gl_period_statusesgps,
hr_operating_unitshou
WHERErct.customer_trx_id=rctgd.customer_trx_id
ANDrct.cust_trx_type_id=ctt.cust_trx_type_id
ANDrct.org_id=ctt.org_id
ANDrct.set_of_books_id=gle.ledger_id
ANDrctgd.code_combination_id=gcc.code_combination_id
ANDgcc.code_combination_id(+)=ael.code_combination_id
ANDgcc1.code_combination_id(+)=jl.code_combination_id
ANDrct.bill_to_customer_id=cust.cust_account_id
ANDcust.party_id=party.party_id
ANDrctgd.account_set_flag='N'xla
tables
ANDrctgd.cust_trx_line_gl_dist_id=
xdl.source_distribution_id_num_1(+)
ANDxdl.source_distribution_type(+)=
'RA_CUST_TRX_LINE_GL_DIST_ALL'
ANDxdl.ae_header_id=aeh.ae_header_id(+)
ANDxdl.ae_header_id=ael.ae_header_id(+)
ANDxdl.ae_line_num=ael.ae_line_num(+)
ANDjir.gl_sl_link_id(+)=ael.gl_sl_link_id
ANDjir.gl_sl_link_table(+)=ael.gl_sl_link_table
GlJoins
ANDjb.je_batch_id(+)=jir.je_batch_id
ANDjh.je_header_id(+)=jir.je_header_id
ANDjl.je_line_num(+)=jir.je_line_num
ANDjl.je_header_id(+)=jir.je_header_id
ANDjes.je_source_name(+)=jh.je_source
ANDjec.je_category_name(+)=jh.je_category
ANDjh.je_source(+)='Receivables'
ANDjh.je_category(+)='DebitMemos'
ANDctt.TYPE='DM'
ANDrct.complete_flag='Y'
ANDctt.post_to_gl='Y'
ANDgl_security_pkg.validate_access(gle.ledger_id)='TRUE'
ANDgle.object_type_code='L'
ANDgps.ledger_id=gle.ledger_id
ANDgps.application_id=222
ANDgps.adjustment_period_flag='N'
ANDrctgd.gl_dateBETWEENgps.start_dateANDgps.end_date
ANDhou.organization_id=rct.org_id;
AR to GL link
SELECTgle.NAMEledger_name,
gle.currency_codeledger_currency_code,
gcc.concatenated_segmentssla_gl_account,
gcc1.concatenated_segmentsgl_account,
gps.period_nameperiod_name,
party.party_nameparty_name,
party.party_numberparty_number,
cust.account_nameaccount_name,
cust.account_numbercustomer_number,
rct.trx_number,
rct.trx_date,
ctt.NAMEtrx_type,
DECODE(ctt.TYPE,
'INV','Invoices',
'CM','CreditMemos',
'DM','DebitMemos',
'CB','ChargeBacks',
NULL)
trx_class,
rct.complete_flag,
rct.invoice_currency_code,
rctgd.amountdist_AMT,
rctgd.acctd_amountdist_ACCTD_AMOUNT,
rctgd.gl_datear_gl_date,
rctgd.gl_posted_datear_gl_posted_date,
rctgd.account_classar_line_account_class,
ael.entered_drsla_line_entered_dr,
ael.entered_crsla_line_entered_cr,
NVL(ael.accounted_dr,0)NVL(ael.accounted_cr,0)
sla_line_accounted_net,
ael.accounted_drsla_line_accounted_dr,
ael.accounted_crsla_line_accounted_cr,
xdl.unrounded_entered_drsla_dist_entered_dr,
xdl.unrounded_entered_crsla_dist_entered_cr,
xdl.unrounded_accounted_drsla_dist_accounted_dr,
xdl.unrounded_accounted_crsla_dist_accounted_cr,
NVL(xdl.unrounded_accounted_dr,0)
NVL(xdl.unrounded_accounted_cr,0)
sla_dist_accounted_net,
DECODE(rctgd.posting_control_id,3,'N','Y')
gl_transfer_status
,
jl.entered_drgl_entered_dr,
jl.entered_crgl_entered_cr,
jl.accounted_drgl_accounted_dr,
jl.accounted_crgl_accounted_cr,
NVL(jl.entered_dr,0)NVL(jl.entered_cr,0)
gl_net_entered_amt,
NVL(jl.accounted_dr,0)NVL(jl.accounted_cr,0)
gl_net_accounted_amt
,
jb.NAMEje_batch_name,
jb.descriptionje_batch_description,
jh.NAMEje_name,
jh.descriptionje_description,
jh.posted_dateje_posted_date,
DECODE(
jh.status,
'P',
'Posted',
'U',
'Unposted',
'F',
'Error7Showinginvalidjournalentrylinesornojournal
entrylines',
'K',
'Error10Showingunbalancedintercompanyjournalentry',
'Z',
'Error7Showinginvalidjournalentrylinesornojournal
entrylines',
'Unknown'
)
je_status,
DECODE(jh.actual_flag,
'A',
'Actual',
'B',
'Budget',
'E',
'Encumbrance')
je_type
,
DECODE(
rctgd.posting_control_id,
3,
'NotTransferredToSLA',
DECODE(aeh.gl_transfer_status_code,
'Y','TransferredtoGL',
'NotTransferredtoGL')
)
reconcile_status,
xdl.accounting_line_code,
xdl.event_class_code,
xdl.event_type_code,
aeh.accounting_date,
aeh.gl_transfer_date,
hou.NAMEoperating_unit,
primaryKeys
rct.customer_trx_id,
rctgd.cust_trx_line_gl_dist_id,
ctt.cust_trx_type_id,
gle.ledger_id,
gcc.code_combination_idsla_code_combination_id,
gcc1.code_combination_idgl_code_combination_id,
party.party_id,
cust.cust_account_id,
aeh.ae_header_id,
ael.ae_line_num,
jl.je_line_num,
jh.je_header_id,
jb.je_batch_id,
jes.je_source_name,
xdl.event_id,
jec.je_category_name,
gps.start_date,
gps.end_date,
hou.organization_idorg_id,
PrimaryKeys
gcc.code_combination_id,
aeh.application_id,
xdl.temp_line_num,
xdl.ref_ae_header_id,
gps.set_of_books_id,
hou.organization_id,
GCC.SEGMENT2GCC#50353#ACCOUNT,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT2,
'MAS_GL_COA_ACCOUNT')
GCC#50353#ACCOUNT#DESCR,
GCC.SEGMENT1GCC#50353#COMPANY,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT1,
'MAS_GL_COA_COMPANY')
GCC#50353#COMPANY#DESCR,
GCC.SEGMENT6GCC#50353#DEPARTMENT,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT6,
'MAS_GL_COA_DEPARTMENT')
GCC#50353#DEPARTMENT#DESCR,
GCC.SEGMENT8GCC#50353#FUTURE,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT8,
'MAS_GL_COA_FUTURE')
GCC#50353#FUTURE#DESCR,
GCC.SEGMENT7GCC#50353#IC,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT7,
'MAS_GL_COA_COMPANY')
GCC#50353#IC#DESCR,
GCC.SEGMENT4GCC#50353#LOB,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT4,
'MAS_GL_COA_LOB')
GCC#50353#LOB#DESCR,
GCC.SEGMENT5GCC#50353#LOCATIONS,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT5,
'MAS_GL_COA_LOCATION')
GCC#50353#LOCATIONS#DESCR,
GCC.SEGMENT3GCC#50353#QUALIFIER,
xxeis.eis_rs_fin_utility.decode_vset(GCC.SEGMENT3,
'MAS_GL_COA_ACCT_QUAL')
GCC#50353#QUALIFIER#DESCR,
GCC1.SEGMENT2GCC1#50353#ACCOUNT,
xxeis.eis_rs_fin_utility.decode_vset(GCC1.SEGMENT2,
'MAS_GL_COA_ACCOUNT')
GCC1#50353#ACCOUNT#DESCR,
GCC1.SEGMENT1GCC1#50353#COMPANY,
xxeis.eis_rs_fin_utility.decode_vset(GCC1.SEGMENT1,
'MAS_GL_COA_COMPANY')
GCC1#50353#COMPANY#DESCR,
GCC1.SEGMENT6GCC1#50353#DEPARTMENT,
xxeis.eis_rs_fin_utility.decode_vset(GCC1.SEGMENT6,
'MAS_GL_COA_DEPARTMENT')
GCC1#50353#DEPARTMENT#DESCR,
GCC1.SEGMENT8GCC1#50353#FUTURE,
xxeis.eis_rs_fin_utility.decode_vset(GCC1.SEGMENT8,
'MAS_GL_COA_FUTURE')
GCC1#50353#FUTURE#DESCR,
GCC1.SEGMENT7GCC1#50353#IC,
xxeis.eis_rs_fin_utility.decode_vset(GCC1.SEGMENT7,
'MAS_GL_COA_COMPANY')
GCC1#50353#IC#DESCR,
GCC1.SEGMENT4GCC1#50353#LOB,
xxeis.eis_rs_fin_utility.decode_vset(GCC1.SEGMENT4,
'MAS_GL_COA_LOB')
GCC1#50353#LOB#DESCR,
GCC1.SEGMENT5GCC1#50353#LOCATIONS,
xxeis.eis_rs_fin_utility.decode_vset(GCC1.SEGMENT5,
'MAS_GL_COA_LOCATION')
GCC1#50353#LOCATIONS#DESCR,
GCC1.SEGMENT3GCC1#50353#QUALIFIER,
xxeis.eis_rs_fin_utility.decode_vset(GCC1.SEGMENT3,
'MAS_GL_COA_ACCT_QUAL')
GCC1#50353#QUALIFIER#DESCR
FROMra_customer_trxrct,
ra_cust_trx_line_gl_distrctgd,
ra_cust_trx_typesctt,
gl_ledgersgle,
gl_code_combinations_kfvgcc,
gl_code_combinations_kfvgcc1,
hz_partiesparty,
hz_cust_accountscust,
xla_ae_headersaeh,
xla_ae_linesael,
xla_distribution_linksxdl,
gl_import_referencesjir,
gl_je_batchesjb,
gl_je_headersjh,
gl_je_linesjl,
gl_je_sourcesjes,
gl_je_categoriesjec,
gl_period_statusesgps,
hr_operating_unitshou
WHERErct.customer_trx_id=rctgd.customer_trx_id
ANDrct.cust_trx_type_id=ctt.cust_trx_type_id
ANDrct.org_id=ctt.org_id
ANDrct.set_of_books_id=gle.ledger_id
ANDrctgd.code_combination_id=gcc.code_combination_id
ANDgcc.code_combination_id(+)=ael.code_combination_id
ANDgcc1.code_combination_id(+)=jl.code_combination_id
ANDrct.bill_to_customer_id=cust.cust_account_id
ANDcust.party_id=party.party_id
ANDrctgd.account_set_flag='N'
xlatables
ANDrctgd.cust_trx_line_gl_dist_id=
xdl.source_distribution_id_num_1(+)
ANDxdl.source_distribution_type(+)=
'RA_CUST_TRX_LINE_GL_DIST_ALL'
ANDxdl.ae_header_id=aeh.ae_header_id(+)
ANDxdl.ae_header_id=ael.ae_header_id(+)
ANDxdl.ae_line_num=ael.ae_line_num(+)
ANDjir.gl_sl_link_id(+)=ael.gl_sl_link_id
ANDjir.gl_sl_link_table(+)=ael.gl_sl_link_table
GlJoins
ANDjb.je_batch_id(+)=jir.je_batch_id
ANDjh.je_header_id(+)=jir.je_header_id
ANDjl.je_line_num(+)=jir.je_line_num
ANDjl.je_header_id(+)=jir.je_header_id
ANDjes.je_source_name(+)=jh.je_source
ANDjec.je_category_name(+)=jh.je_category
ANDjh.je_source(+)='Receivables'
ANDjh.je_category(+)='CreditMemos'
ANDctt.TYPE='CM'
ANDrct.complete_flag='Y'
ANDctt.post_to_gl='Y'
ANDgl_security_pkg.validate_access(gle.ledger_id)='TRUE'
ANDgle.object_type_code='L'
ANDgps.ledger_id=gle.ledger_id
ANDgps.application_id=222
ANDgps.adjustment_period_flag='N'
ANDrctgd.gl_dateBETWEENgps.start_dateANDgps.end_date
ANDhou.organization_id=rct.org_id;
hz_org_contacts org_cont,
hz_cust_accounts role_acct,
hz_contact_restrictions cont_res,
hz_person_language per_lang,
hz_cust_acct_sites_all hcasa
WHERE
acct_role.party_id = rel.party_id
AND acct_role.role_type = 'CONTACT'
AND org_cont.party_relationship_id = rel.relationship_id
AND rel.subject_id = party.party_id
AND rel_party.party_id = rel.party_id
AND cont_point.owner_table_id(+) = rel_party.party_id
AND cont_point.contact_point_type(+) = 'EMAIL'
AND cont_point.primary_flag(+) = 'Y'
AND acct_role.cust_account_id = role_acct.cust_account_id
AND role_acct.party_id = rel.object_id
AND party.party_id = per_lang.party_id(+)
AND per_lang.native_language(+) = 'Y'
AND party.party_id = cont_res.subject_id(+)
AND cont_res.subject_table(+) = 'HZ_PARTIES'
AND role_acct.cust_account_id = hcasa.cust_account_id
AND hcasa.cust_acct_site_id = acct_role.cust_acct_site_id
-- AND acct_role.cust_account_id
= p_customer_id --3177
-- AND acct_role.cust_acct_site_id
= p_address_id
-- AND hcasa.org_id
= 90
Posted by Elangovan Ragavan at 12:32 No comments:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
(SELECT ACR.RECEIPT_DATE
FROM AR_CASH_RECEIPTS_ALL ACR
WHERE ACR.DOC_SEQUENCE_ID = XAH.DOC_SEQUENCE_ID
AND ACR.DOC_SEQUENCE_VALUE = XAH.DOC_SEQUENCE_VALUE)
RECEIPT_DATE,
(SELECT ACR.DOC_SEQUENCE_VALUE
FROM AR_CASH_RECEIPTS_ALL ACR
WHERE ACR.DOC_SEQUENCE_ID = XAH.DOC_SEQUENCE_ID
AND ACR.DOC_SEQUENCE_VALUE = XAH.DOC_SEQUENCE_VALUE)
VOUCHER_NUMBER,
(SELECT ACR.CREATION_DATE
FROM AR_CASH_RECEIPTS_ALL ACR
WHERE ACR.DOC_SEQUENCE_ID = XAH.DOC_SEQUENCE_ID
AND ACR.DOC_SEQUENCE_VALUE = XAH.DOC_SEQUENCE_VALUE)
VOUCHER_DATE,
DECODE (XAL.ACCOUNTED_CR, NULL, XAL.ACCOUNTED_DR, 0) RECEIPT,
DECODE (XAL.ACCOUNTED_DR, NULL, XAL.ACCOUNTED_CR, 0) PAYMENT
FROM GL_JE_BATCHES GJB,
GL_JE_HEADERS GJH,
GL_JE_LINES GJL,
GL_CODE_COMBINATIONS GCC,
GL_IMPORT_REFERENCES GIR,
XLA_AE_LINES XAL,
XLA_AE_HEADERS XAH,
XLA.XLA_TRANSACTION_ENTITIES XTE
WHERE
GJB.JE_BATCH_ID = GJH.JE_BATCH_ID
AND GJH.JE_HEADER_ID = GJL.JE_HEADER_ID
AND GJL.CODE_COMBINATION_ID = GCC.CODE_COMBINATION_ID
AND GJL.JE_HEADER_ID = GIR.JE_HEADER_ID
AND GJL.JE_LINE_NUM = GIR.JE_LINE_NUM
AND GIR.GL_SL_LINK_ID = XAL.GL_SL_LINK_ID
AND GIR.GL_SL_LINK_TABLE = XAL.GL_SL_LINK_TABLE
AND XAL.AE_HEADER_ID = XAH.AE_HEADER_ID
AND XTE.APPLICATION_ID = XAH.APPLICATION_ID
AND XTE.ENTITY_ID = XAH.ENTITY_ID
AND GJL.STATUS = 'P'
AND GCC.SEGMENT5 = NVL (:P_ACC_NUM, GCC.SEGMENT5)
AND TRUNC (GJH.DEFAULT_EFFECTIVE_DATE) BETWEEN NVL (
:P_FROM_DATE,
TRUNC(GJH.DEFAULT_EFFECTIVE_DATE)
)
AND NVL (
:P_TO_DATE,
TRUNC(GJH.DEFAULT_EFFECTIVE_DATE)
)
AND GJH.JE_SOURCE = 'Receivables'
UNION ALL
---------------- Manual ----------------------SELECT GJH.DESCRIPTION JV_HEADER_DESCRIPTION,
GJH.NAME JV_NAME,
GJH.JE_CATEGORY,
GJH.JE_SOURCE,
GJH.PERIOD_NAME,
NVL (GJL.ACCOUNTED_DR, 0) ACCOUNTED_DR,
NVL (GJL.ACCOUNTED_CR, 0) ACCOUNTED_CR,
gjl.description jv_line_description,
'' EVENT_TYPE_CODE,
'' SLA_DESCRIPTION,
NULL AE_LINE_NUM,
GJH.DEFAULT_EFFECTIVE_DATE GL_DATE,
'' VENDOR_NAME,
'' CHECK_NUMBER,
NULL CHECK_DATE,
NULL VOUCHER_NUMBER,
NULL VOUCHER_DATE,
NVL (GJL.ACCOUNTED_DR, 0) RECEIPT,
NVL (GJL.ACCOUNTED_CR, 0) PAYMENT
FROM GL_JE_BATCHES GJB,
GL_JE_HEADERS GJH,
GL_JE_LINES GJL,
GL_CODE_COMBINATIONS GCC
WHERE
GJB.JE_BATCH_ID = GJH.JE_BATCH_ID
AND GJH.JE_HEADER_ID = GJL.JE_HEADER_ID
AND GJL.CODE_COMBINATION_ID = GCC.CODE_COMBINATION_ID
AND GJL.STATUS = 'P'
AND GCC.SEGMENT5 = NVL (:P_ACC_NUM, GCC.SEGMENT5)
AND TRUNC (GJH.DEFAULT_EFFECTIVE_DATE) BETWEEN NVL (
:P_FROM_DATE,
TRUNC(GJH.DEFAULT_EFFECTIVE_DATE)
)
AND NVL (
:P_TO_DATE,
TRUNC(GJH.DEFAULT_EFFECTIVE_DATE)
)
AND GJH.JE_SOURCE = 'Manual'
UNION ALL
-----ALL OTHER SOURCES OTHER THAN ABOVE---------SELECT GJH.DESCRIPTION JV_HEADER_DESCRIPTION,
GJH.NAME JV_NAME,
GJH.JE_CATEGORY,
GJH.JE_SOURCE,
GJH.PERIOD_NAME,
NVL (XAL.ACCOUNTED_CR, 0) GL_CR,
NVL (XAL.ACCOUNTED_DR, 0) GL_DR,
GJL.DESCRIPTION JV_LINE_DESCRIPTION,
XAH.EVENT_TYPE_CODE,
XAH.DESCRIPTION SLA_DESCRIPTION,
XAL.AE_LINE_NUM,
XAL.ACCOUNTING_DATE GL_DATE,
'' VENDOR_NAME,
'' CHECK_NUMBER,
NULL CHECK_DATE,
NULL VOUCHER_NUMBER,
NULL VOUCHER_DATE,
DECODE (XAL.ACCOUNTED_CR, NULL, XAL.ACCOUNTED_DR, 0) RECEIPT,
DECODE (XAL.ACCOUNTED_DR, NULL, XAL.ACCOUNTED_CR, 0) PAYMENT
FROM XLA_AE_HEADERS XAH,
XLA_AE_LINES XAL,
GL_JE_LINES GJL,
GL_IMPORT_REFERENCES GIR,
GL_JE_HEADERS GJH,
GL_CODE_COMBINATIONS GCC
WHERE
XAH.AE_HEADER_ID = XAL.AE_HEADER_ID
AND GJL.JE_LINE_NUM = GIR.JE_LINE_NUM
AND GJL.JE_HEADER_ID = GIR.JE_HEADER_ID
AND GIR.GL_SL_LINK_TABLE = XAL.GL_SL_LINK_TABLE
AND GIR.GL_SL_LINK_ID = XAL.GL_SL_LINK_ID
AND GJL.JE_HEADER_ID = GJH.JE_HEADER_ID
AND GJL.CODE_COMBINATION_ID = GCC.CODE_COMBINATION_ID
AND GCC.SEGMENT5 = NVL (:P_ACC_NUM, GCC.SEGMENT5)
AND TRUNC (GJH.DEFAULT_EFFECTIVE_DATE) BETWEEN NVL (
:P_FROM_DATE,
TRUNC(GJH.DEFAULT_EFFECTIVE_DATE)
)
AND NVL (
:P_TO_DATE,
TRUNC(GJH.DEFAULT_EFFECTIVE_DATE)
)
AND GJH.STATUS = 'P'
AND GJH.JE_SOURCE NOT IN
('Receivables', 'Payables', 'Cash Management')
Posted by Elangovan Ragavan at 12:14 No comments:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
FRIDAY, 19 APRIL 2013
hz_cust_accounts_all hca,
ap_bank_accounts_all cba,
ap_bank_branches bb,
ar_receipt_methods rec_method,
ar_receipt_classes rc
WHERE
1=1
AND acr.confirmed_flag = 'Y'
AND acr.pay_from_customer = hca.cust_account_id(+)
AND hp.party_id(+) = hca.party_id
AND acr.remittance_bank_account_id = cba.bank_account_id(+)
AND bb.bank_branch_id(+) = cba.bank_branch_id
AND acr.receipt_method_id = rec_method.receipt_method_id
AND rec_method.receipt_class_id = rc.receipt_class_id
AND cba.Bank_Account_Id =
NVL (:l_bank_account_id, cba.Bank_Account_Id)
AND acr.receipt_number >= NVL (:p_start_rec_no, acr.receipt_number)
AND acr.receipt_number <= NVL (:p_end_rec_no, acr.receipt_number)
AND TRUNC (acr.receipt_date) >= :p_start_rec_date
AND TRUNC (acr.receipt_date) <= :p_end_rec_date
AND acr.org_id = fnd_profile.VALUE ('ORG_ID')
Posted by Elangovan Ragavan at 10:35 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
THURSDAY, 18 APRIL 2013
Freight Account When you have freight line, system will pick this account
Revenue Account When an AR transaction is created, your revenue is booked againt
the transaction in this account (This will be Credited)
Clearing Account
Unbilled Receivable Account
Unearned Revenue Account This is used when you had booked your revenue in
advance.
ACCOUNTING RULES N > Receivables > Setup > Accounting Rules
This is used to distribute your revenue in different periods. This is used for recognizing
your revenue.
AUTO ACCOIUNTING
N > Receivables > Setup > Transactions > AutoAccounting
This is used to control your accounting code combination to br derived based on
transaction type, sales person, memo line, Customer Site
It is mandetory to setup AuAccounting for Receivables and Revenue
PAYMENT TERM
N > Receivables > Setup > Transactions > Payment Term
TRANSACTION SOURCE
N > Receivables > Setup > Transactions > Sources
This is the source from which transactions are coming into the Oracel Receivables
SYSTEM OPTIPONS N > Receivables > Setup > System > System Options
Day per posting cycle???
Allow payment of unrelated transactions??
Sptil Amount?
MEMO LINE
N > Receivables > Setup > Transactions > Memo Lines
LINE TRANSACTION FLEXFIELD
N > Receivables > Setup > Financial > Flexfield > Descriptive > Segment
Query for Application Receivables
Title Line Transaction Flexfiled
LINE ODERDERING RULES N > Receivables > Setup > Transactions > AutoIndoice > Line Ordering Rules
GROUPING RULES N > Receivables > Setup > Transactions > AutoIndoice > Grouping Rules
OPEN THE PERIOD N > Receivables > Control > Accounting > Open/Close Periods
TRANSACTIONS
N > Receivables > Transactions > Transactions
COPY TRANSACTION
N > Receivables > Transactions > Transactions
Query the existing transaction, goto Actions > Copy To
CREATING CM
Option 1
N > Receivables > Transactions > Transactions
Select the Invoice Class as CM
Option 2
N > Receivables > Transactions > Credit Transactions
APPLYING CM TO INVOICE
N > Receivables > Transactions > Transactions
Create a CM. Complete it. Goto Actions > Applications
and select the Invoice against with you want to apply CM.
PROFILE CLASSES
N > Receivables > Customers > Profile Classes
CUSTOMER
N > Receivables > Customers > Customers
Posted by Elangovan Ragavan at 12:11 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
Transactions Work Bench: Profile Class: To create profile class first we setup these three.
I. Payment Terms
II. Collector
III. Statement Cycle
Payment Terms: Nav: - Setup Transactions Payment Terms
Table Name: RA_TERMS_LINES
Then Click on Discounts Enter Discounts
Table Name: RA_TERMS_LINES_DISCOUNTS
Collectors: Nav: Setup Collections Collectors
Table Name: AR_COLLECTORS
Statement Cycle: Nav: Setup Print Statement Cycle
Guarantee
Bills Receivable
1. With out Transaction Type and Transaction Source we cannot create a Transaction.
2. The Definition of customer used in more than 80 Modules.
Transaction Type: Nav: Setup Transactions Transaction Type
Table Name: RA_CUST_TRX_TYPES
Transaction Status: Open Did not make a payment
Close After Receiving Payment
Pending Waiting for some approval
Void Cancel Invoice
Transaction Source: Nav: Setup Transactions Sources
Table Name: RA_BATCH_SOURCES
Transaction: Nav: Transactions Transactions
Table Name: RA_CUST_TRX_LINE_GL_DIST_V
After Complete: View Transactions: Nav: Collections Customer Accounts
Tax Codes: Nav: Setup Tax Codes
Table Name: AR_VAT_TAX_VL
ACCOUNTING HIERARCHY: Auto Accounting is a powerful flexible tool, which create GL Accounting Flex Field.
Customer Bill to site
Customer Header
Transaction Type
Auto Accounting
FREIGHT CARRIERS: These are two types.
Header Level
Line Level
1.
1.
1.
Enter Invoice
Nav: Transactions Transactions
Receipt Work Bench: -
SELECT CUSTOMER_NAME,
NVL (SUM (Amount), 0) charges_Amount,
--TDS_Individuals_Customers_Name
CASE
WHEN TDS_Individuals_Customers_Name LIKE 'TDS Re%'
THEN
( select amount from RA_CUST_TRX_LINE_GL_DIST_ALL where
code_combination_id=x.code_combination_id and CUSTOMER_TRX_ID =
x.CUSTOMER_TRX_ID)
ELSE
0
END
AS TDS_Individuals_Customers_Name,
TDS_Amount AS TDS_Amount
FROM (
SELECT
RACTA.CUSTOMER_TRX_ID ,gcc.code_combination_id,
arc.CUSTOMER_NAME,
(RACTLA.UNIT_SELLING_PRICE * RACTLA.QUANTITY_ORDERED)
AS Amount,
glcdv.account AS TDS_Individuals_Customers_Name,
NVL (jaitdsc.amount, 0) AS TDS_Amount
FROM RA_CUSTOMER_TRX_ALL RACTA,
ra_customer_trx_lines_all RACTLA,
RA_CUST_TRX_LINE_GL_DIST_ALL RACTLGLDA,
GL_CODE_COMBINATIONS GCC,
ar_customers arc,
hr_operating_units hou,
JAI_AR_TDS_CERTIFICATES jaitdsc,
xxcapl_gl_code_desc_v glcdv
WHERE 1 = 1
AND RACTA.CUSTOMER_TRX_ID = RACTLA.CUSTOMER_TRX_ID
AND RACTLA.CUSTOMER_TRX_LINE_ID =
RACTLGLDA.CUSTOMER_TRX_LINE_ID
AND RACTLGLDA.CODE_COMBINATION_ID =
GCC.CODE_COMBINATION_ID
AND RACTA.BILL_TO_CUSTOMER_ID = arc.CUSTOMER_ID
AND RACTLGLDA.account_class = 'REV'
AND RACTLA.line_type = 'LINE'
AND hou.organization_id = RACTA.org_id
AND jaitdsc.CUSTOMER_ID(+) = arc.CUSTOMER_ID
AND glcdv.code_combination_id = gcc.code_combination_id
and RACTA.COMPLETE_FLAG='Y'
--AND RACTA.CUSTOMER_TRX_ID =
-- 112005
AND RACTA.org_id = NVL (:P_ORG_ID, RACTA.org_id)
AND TRUNC (RACTA.trx_date) >= :p_from_date
AND TRUNC (RACTA.trx_date) <= :p_to_date
AND RACTA.bill_to_customer_id =
NVL (:p_customer_id,
RACTA.bill_to_customer_id)
)X
SELECT hp.party_name
, hp.party_number
, hca.account_number
, hca.cust_account_id
, hp.party_id
, hps.party_site_id
, hps.location_id
, hl.address1
, hl.address2
, hl.address3
, hl.city
, hl.state
, hl.country
, hl.postal_code
, hcsu.site_use_code
, hcsu.site_use_id
, hcsa.bill_to_flag
FROM hz_parties hp
, hz_party_sites hps
, hz_locations hl
, hz_cust_accounts_all hca
, hz_cust_acct_sites_all hcsa
, hz_cust_site_uses_all hcsu
WHERE hp.party_id = hps.party_id
AND hps.location_id = hl.location_id
AND hp.party_id = hca.party_id
AND hcsa.party_site_id = hps.party_site_id
AND hcsu.cust_acct_site_id = hcsa.cust_acct_site_id
AND hca.cust_account_id = hcsa.cust_account_id
AND hca.account_number = '';
Posted by Elangovan Ragavan at 12:58 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
wnd.WAYBILL waybill,
wnd.GROSS_WEIGHT gross_weight,
wnd.WEIGHT_UOM_CODE uom,
wnd.status_code,
we.message
from wsh_new_deliveries wnd,
wsh_picking_batches wpb,
wsh_exceptions we,
fnd_lookup_values_vl lv,
hz_cust_accounts cust_acct,
hz_parties party
where wnd.delivery_id = 12814
and wpb.batch_id = wnd.batch_id
and we.delivery_id(+) = wnd.delivery_id
and we.exception_name(+) = 'WSH_BATCH_MESSAGE'
and lv.lookup_code(+) = wpb.ship_method_code
and lv.lookup_type(+) = 'SHIP_METHOD'
and lv.view_application_id(+) = 3
and cust_acct.cust_account_id (+)=wnd.customer_id
and party.party_id(+) = cust_acct.party_id
Posted by Elangovan Ragavan at 12:57 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
TUESDAY, 26 MARCH 2013
WHERE
1=1
AND arc.cash_receipt_id = ara.cash_receipt_id(+)
AND arc.TYPE = 'CASH'
AND ara.display = 'Y'
AND ara.application_type = 'CASH'
AND NVL (ara.confirmed_flag, 'Y') = 'Y'
AND NVL (arc.confirmed_flag, 'Y') = 'Y'
AND acrh.cash_receipt_id = arc.cash_receipt_id
AND acrh.first_posted_record_flag = 'Y'
AND cust.CUST_ACCOUNT_ID(+) = arc.pay_from_customer
AND CUST.PARTY_ID = PARTY.PARTY_ID(+)
AND arc.receipt_method_id = arm.receipt_method_id
AND bat.batch_id(+) = acrh.batch_id
AND gcc.code_combination_id = aCRH.ACCOUNT_CODE_COMBINATION_ID
AND ara.applied_customer_trx_id = trx.customer_trx_id
AND trx.org_id = hou.organization_id
AND arc.receipt_number BETWEEN NVL (:p_in_cr_number,
arc.receipt_number)
AND NVL (:p_in_cr_number_high,
arc.receipt_number)
AND gcc.segment1 BETWEEN NVL (:p_company_from, segment1)
AND NVL (:p_company_to, segment1)
AND party.party_name BETWEEN NVL (:p_in_customer_low,
party.party_name)
AND NVL (:p_in_customer_high,
party.party_name)
AND bat.name BETWEEN NVL (:p_in_batch_low, bat.name)
AND NVL (:p_in_batch_high, bat.name)
-AND arc.deposit_date BETWEEN NVL (:p_in_deposit_date_low,
-arc.deposit_date)
-AND NVL (:p_in_deposit_date_high,
-arc.deposit_date)
AND arc.status BETWEEN NVL (:p_in_status_low, arc.status)
AND NVL (:p_in_status_high, arc.status)
AND ara.gl_date BETWEEN NVL (:p_in_gl_date_low, ara.gl_date)
AND NVL (:p_in_gl_date_high, ara.gl_date)
AND DECODE (NVL (:p_in_currency, arc.currency_code),
'All', arc.currency_code,
NVL (:p_in_currency, arc.currency_code)) =
arc.currency_code
UNION
----- NULL CUSTOMER -----/* Formatted on 3/26/2013 12:30:47 PM (QP5 v5.114.809.3010) */
SELECT gcc.segment1 Company,
bat.NAME batch_name,
arc.deposit_date deposit_date,
NULL customer_name,
NULL customer_number,
arc.receipt_number receipt_number,
arc.receipt_date receipt_date,
arc.STATUS receipt_status,
acrh.amount receipt_amount,
gcc.concatenated_segments applied_gl_account,
acrh.gl_date gl_date,
NULL applied_date,
NULL applied_trx_number,
NULL applied_trx_date
FROM ar_cash_receipts_all arc,
ar_cash_receipt_history_all acrh,
ar_batches_all bat,
gl_code_combinations_kfv gcc,
ar_receipt_methods arm
WHERE
1=1
AND ARC.PAY_FROM_CUSTOMER IS NULL
AND acrh.cash_receipt_id = arc.cash_receipt_id
AND bat.batch_id(+) = acrh.batch_id
-AND arc.receipt_number in('1204298-UNITED TEL','300497-TRIANGLE','1202381UNITED TEL')
AND gcc.code_combination_id = aCRH.ACCOUNT_CODE_COMBINATION_ID
AND arc.receipt_method_id = arm.receipt_method_id
AND arc.receipt_number BETWEEN NVL (:p_in_cr_number,
arc.receipt_number)
AND NVL (:p_in_cr_number_high,
arc.receipt_number)
AND gcc.segment1 BETWEEN NVL (:p_company_from, segment1)
AND NVL (:p_company_to, segment1)
-AND party.party_name BETWEEN NVL (:p_in_customer_low,
-party.party_name)
-AND NVL (:p_in_customer_high,
-party.party_name)
AND bat.name BETWEEN NVL (:p_in_batch_low, bat.name)
AND NVL (:p_in_batch_high, bat.name)
-AND arc.deposit_date BETWEEN NVL (:p_in_deposit_date_low,
-arc.deposit_date)
-AND NVL (:p_in_deposit_date_high,
-arc.deposit_date)
AND arc.status BETWEEN NVL (:p_in_status_low, arc.status)
AND NVL (:p_in_status_high, arc.status)
AND acrh.gl_date BETWEEN NVL (:p_in_gl_date_low, acrh.gl_date)
AND NVL (:p_in_gl_date_high, acrh.gl_date)
AND DECODE (NVL (:p_in_currency, arc.currency_code),
'All', arc.currency_code,
NVL (:p_in_currency, arc.currency_code)) =
arc.currency_code
=====================================================================
SELECT bat.NAME batch_name,
arc.receipt_number receipt_number,
acrh.gl_date gl_date,
arc.deposit_date deposit_date,
arc.STATUS receipt_status,
acrh.amount receipt_amount,
--
arC.amount,
gcc.concatenated_segments applied_gl_account,
arc.receipt_date receipt_date
FROM ar_cash_receipts_all arc,
ar_cash_receipt_history_all acrh,
ar_batches_all bat,
gl_code_combinations_kfv gcc,
ar_receipt_methods arm
WHERE
1=1
and ARC.PAY_FROM_CUSTOMER is NULL
AND acrh.cash_receipt_id = arc.cash_receipt_id
AND bat.batch_id(+) = acrh.batch_id
AND gcc.code_combination_id = aCRH.ACCOUNT_CODE_COMBINATION_ID
AND arc.receipt_method_id = arm.receipt_method_id
AND acrh.gl_date BETWEEN NVL (:p_in_gl_date_low, acrh.gl_date)
AND NVL (:p_in_gl_date_high, acrh.gl_date)
AND gcc.segment1 BETWEEN NVL (:p_company_from, segment1)
AND NVL (:p_company_to, segment1)
AR_PAYMENT_SCHEDULES_ALL aps,
ar_receivable_applications_all ara,
AR_CASH_RECEIPTS_ALL acr
where rct.bill_to_customer_id = hca.cust_account_id
AND hca.party_id = hp.party_id
and rct.customer_trx_id = aps.customer_trx_id(+)
and rct.customer_trx_id = ara.applied_customer_trx_id(+)
and ara.CASH_RECEIPT_ID = acr.CASH_RECEIPT_ID(+)
and rct.CUSTOMER_TRX_ID = rctl.CUSTOMER_TRX_ID
AND taxline.link_to_cust_trx_line_id(+) = rctl.customer_trx_line_id
AND TRUNC (rct.CREATION_DATE) BETWEEN '01-APR-2011' AND '13-AUG-2011'
and rct.SET_OF_BOOKS_ID = 5
--and rct.ORG_ID = 90
Posted by Elangovan Ragavan at 19:22 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
MONDAY, 16 JULY 2012
Query to fetch the detail info about a particular customers open invoices
SELECT hp.party_name
,hc.cust_account_id
,hc.account_number
customer_number
,amount_due_remaining
amount_due_remaining
,aps.amount_due_original amount_due_original
,ra.trx_number
FROM ra_customer_trx_all
ra,
ra_customer_trx_lines_all rl,
ar_payment_schedules_all aps,
ra_cust_trx_types_all rt,
hz_cust_accounts
hc,
hz_parties
hp,
hz_cust_acct_sites_all hcasa_bill,
hz_cust_site_uses_all hcsua_bill,
hz_party_sites
hps_bill,
ra_cust_trx_line_gl_dist_all rct
WHERE ra.customer_trx_id
= rl.customer_trx_id
AND ra.customer_trx_id
= aps.customer_trx_id
AND ra.org_id
= aps.org_id
AND rct.customer_trx_id
= aps.customer_trx_id
AND rct.customer_trx_id
= ra.customer_trx_id
AND rct.customer_trx_id
= rl.customer_trx_id
AND rct.customer_trx_line_id = rl.customer_trx_line_id
AND ra.complete_flag
= 'Y'
AND rl.line_type
IN ('FREIGHT', 'LINE')
AND ra.cust_trx_type_id
= rt.cust_trx_type_id
AND ra.bill_to_customer_id
= hc.cust_account_id
AND hc.status
= 'A'
AND hp.party_id
= hc.party_id
AND hcasa_bill.cust_account_id = ra.bill_to_customer_id
AND hcasa_bill.cust_acct_site_id = hcsua_bill.cust_acct_site_id
AND hcsua_bill.site_use_code = 'BILL_TO'
AND hcsua_bill.site_use_id
= ra.bill_to_site_use_id
AND hps_bill.party_site_id
= hcasa_bill.party_site_id
AND hcasa_bill.status
= 'A'
AND hcsua_bill.status
= 'A'
AND aps.amount_due_remaining <> 0
AND aps.status
= 'OP'
AND hc.cust_account_id
=?;
Posted by Elangovan Ragavan at 16:59 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
TUESDAY, 24 JANUARY 2012
AR Salce Invoice
Sales invoice
SELECT hou.NAME operating_unit_name,
rct.trx_number sales_invoice_number,
ooh.order_number,
rc.customer_name,
rsa.NAME sales_person_name,
msi.segment1 item_number,
mln.lot_number,
msi.primary_unit_of_measure primary_uom,
ool.ordered_quantity primary_quantity,
msi.secondary_uom_code secondary_uom,
ool.ordered_quantity2 secondary_quantity,
msi.organization_id inventory_org_id,
ool.org_id,
rctl.extended_amount amount
FROM oe_order_headers_all ooh,
oe_order_lines_all ool,
hr_operating_units hou,
ra_customer_trx_all rct,
ra_customer_trx_lines_all rctl,
ra_customers rc,
ra_salesreps_all rsa,
mtl_system_items_b msi,
mtl_lot_numbers mln
WHERE ooh.header_id = ool.header_id
AND hou.organization_id = ool.org_id
AND ool.reference_customer_trx_line_id = rctl.customer_trx_line_id
AND rct.sold_to_customer_id = rc.customer_id
AND ooh.salesrep_id = rsa.salesrep_id
AND mln.inventory_item_id = msi.inventory_item_id
AND mln.organization_id = msi.organization_id
Receipt
SELECT ACR.RECEIPT_NUMBER
,ARM.NAME RECEIPT_METHOD
,ACR.RECEIPT_DATE
,ACRH.GL_DATE
,ABB.BANK_NAME
,ABA.BANK_ACCOUNT_NUM
,HP.PARTY_NAME CUSTOMER_NAME
FROM AR_RECEIPT_METHODS ARM
,AR_CASH_RECEIPTS_ALL ACR
,AR_CASH_RECEIPT_HISTORY_ALL ACRH
,AP_BANK_ACCOUNTS ABA
,AP_BANK_BRANCHES ABB
,HZ_PARTIES HP
,HZ_CUST_ACCOUNTS HCA
WHERE ARM.RECEIPT_METHOD_ID=ACR.RECEIPT_METHOD_ID
AND ACR.CASH_RECEIPT_ID=ACRH.CASH_RECEIPT_ID
AND ACR.REMITTANCE_BANK_ACCOUNT_ID=ABA.BANK_ACCOUNT_ID(+)
AND ABA.BANK_ACCOUNT_ID=ABB.BANK_BRANCH_ID(+)
AND ACR.PAY_FROM_CUSTOMER=HCA.CUST_ACCOUNT_ID
AND HCA.PARTY_ID=HP.PARTY_ID
AR INVOICE
select rcta.trx_number invoice_num,
--sales_order_reference,
rct.gl_date,
rctl.inventory_item_id,
rct.amount,
rcta.trx_date invoice_date,
rctl.taxable_amount tax_amount
-- revenue_account_id,
--receivables_account_id,
from ra_customer_trx_lines_all rctl,
ra_cust_trx_line_gl_dist_all rct,
ra_customer_trx_all rcta
where rctcl.customer_trx_line_id=rct.customer_trx_line_id
and rctl.customer_trx_id=rcta.customer_trx_id
and rcta.customer_trx_id=rct.customer_trx_id
Posted by Elangovan Ragavan at 19:53 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
AR INVOICE QUERY
exec mo_global.init('AR');
/* Formatted on 2011/12/26 23:23 (Formatter Plus v4.8.8) */
SELECT rct.org_id, hou.NAME ou_name, rct.customer_trx_id, rct.trx_number,
rct.old_trx_number, TRUNC (rct.trx_date) trx_date, ctl.line_number,
ctl.customer_trx_line_id, lgd.amount, lgd.account_class,
lgd.acctd_amount, al_class.meaning, lgd.al_class_meaning, gcc.concatenated_segments,
ffv.description acct_desc, rctt.TYPE, rctt.NAME trx_type_name,
rctt.description, rctt.post_to_gl, rctt.accounting_affect_flag,
lgd.gl_date, rct.complete_flag, rctt.status, gcc.segment3 account_no,
ffv.description account_des, rctt.end_date
FROM ra_cust_trx_line_gl_dist_v lgd,
gl_code_combinations_kfv gcc,
fnd_flex_values_vl ffv,
ra_customer_trx_all rct,
apps.ra_cust_trx_types_all rctt,
hr_operating_units hou,
ra_customer_trx_lines_all ctl,
ra_customer_trx_lines_all ctl_line,
ar_lookups al_class
WHERE lgd.code_combination_id = gcc.code_combination_id
AND ffv.flex_value = gcc.segment3
AND rct.customer_trx_id = lgd.customer_trx_id
AND rctt.cust_trx_type_id(+) = rct.cust_trx_type_id
AND hou.organization_id(+) = rct.org_id
AND lgd.customer_trx_line_id = ctl.customer_trx_line_id(+)
AND ctl.link_to_cust_trx_line_id = ctl_line.customer_trx_line_id(+)
AND al_class.lookup_type = 'AUTOGL_TYPE'
AND al_class.lookup_code = lgd.account_class
AND TRUNC (rct.trx_date) BETWEEN :p_from_date AND :p_to_date
--AND rct.customer_trx_id = 1082
order by rct.org_id, hou.NAME , rct.customer_trx_ID
-------------------------- NEXT -----------------------------/* Formatted on 12/26/2011 9:20:35 PM (QP5 v5.115.810.9015) */
SELECT rct.org_id,
hou.NAME ou_name,
rct.customer_trx_id,
rct.trx_number,
rct.old_trx_number,
TRUNC (rct.trx_date) trx_date,
ctl.line_number,
ctl.customer_trx_line_id,
lgd.amount,
lgd.ACCOUNT_CLASS,
lgd.acctd_amount,
-lgdv.AL_CLASS_MEANING,
gcc.concatenated_segments,
ffv.description acct_desc,
-rctt.TYPE,
-rctt.NAME trx_type_name,
-rctt.description,
rctt.post_to_gl,
rctt.accounting_affect_flag,
lgd.GL_DATE,
rct.COMPLETE_FLAG,
rctt.status,
gcc.SEGMENT3 ACCOUNT_NO,
ffv.DESCRIPTION ACCOUNT_DES,
rctt.end_date,
AL_CLASS.MEANING,
AL_TYPE.MEANING
FROM ra_cust_trx_line_gl_dist_all lgd,
ra_customer_trx_lines_all ctl,
ra_customer_trx_all rct,
hr_operating_units hou,
gl_code_combinations_kfv gcc,
apps.ra_cust_trx_types_all rctt,
fnd_flex_values_vl ffv,
RA_CUSTOMER_TRX_LINES CTL_LINE,
AR_LOOKUPS AL_CLASS,
AR_LOOKUPS AL_TYPE,
RA_RULES RR
WHERE
lgd.customer_trx_line_id = ctl.customer_trx_line_id(+)
AND rct.customer_trx_id(+) = ctl.customer_trx_id
AND hou.organization_id(+) = rct.org_id
AND gcc.code_combination_id = lgd.code_combination_id
AND rctt.cust_trx_type_id(+) = rct.cust_trx_type_id
AND CTL.LINK_TO_CUST_TRX_LINE_ID = CTL_LINE.CUSTOMER_TRX_LINE_ID(+)
AND AL_CLASS.LOOKUP_TYPE = 'AUTOGL_TYPE'
AND AL_CLASS.LOOKUP_CODE = LGD.ACCOUNT_CLASS
AND AL_TYPE.LOOKUP_TYPE(+) = 'STD_LINE_TYPE'
AND AL_TYPE.LOOKUP_CODE(+) = CTL.LINE_TYPE
AND CTL.ACCOUNTING_RULE_ID = RR.RULE_ID(+)
AND ffv.flex_value = gcc.segment3
AND TRUNC (rct.trx_date) BETWEEN :p_from_date AND :p_to_date
ORDER BY rct.org_id, hou.NAME,rct.trx_number
Posted by Elangovan Ragavan at 23:04 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
WEDNESDAY, 2 NOVEMBER 2011
rct.trx_number,
rct.trx_date,
rct.TERM_DUE_DATE,
hp.PARTY_NUMBER Customer_Number,
hp.party_name Customer_Name,
aps.AMOUNT_APPLIED,
aps.AMOUNT_DUE_ORIGINAL,
aps.AMOUNT_DUE_REMAINING,
acr.receipt_number,
acr.receipt_date,
ara.cash_receipt_id,
aps.PAYMENT_SCHEDULE_ID,
ara.PAYMENT_SCHEDULE_ID,
taxline.PRECEDENCE_1,
taxline.PRECEDENCE_2,
taxline.PRECEDENCE_3,
taxline.PRECEDENCE_4,
taxline.PRECEDENCE_5,
taxline.tax_amount T_AMOUNT
From ra_customer_trx_all rct,
ra_customer_trx_lines_all rctl,
JAI_AR_TRX_TAX_LINES taxline,
-- ja_in_ra_cust_trx_tax_lines taxline,
hz_cust_accounts hca,
hz_parties hp,
AR_PAYMENT_SCHEDULES_ALL aps,
ar_receivable_applications_all ara,
AR_CASH_RECEIPTS_ALL acr
where rct.bill_to_customer_id = hca.cust_account_id
AND hca.party_id = hp.party_id
and rct.customer_trx_id = aps.customer_trx_id(+)
and rct.customer_trx_id = ara.applied_customer_trx_id(+)
and ara.CASH_RECEIPT_ID = acr.CASH_RECEIPT_ID(+)
and rct.CUSTOMER_TRX_ID = rctl.CUSTOMER_TRX_ID
AND taxline.link_to_cust_trx_line_id(+) = rctl.customer_trx_line_id
AND TRUNC (rct.CREATION_DATE) BETWEEN '01-APR-2011' AND '13-AUG-2011'
-- and rct.SET_OF_BOOKS_ID = 5
--and rct.ORG_ID = 90
Posted by Elangovan Ragavan at 14:54 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
MONDAY, 31 OCTOBER 2011
R12 Customer
/* Formatted on 18-08-2011 20:52:09 (QP5 v5.115.810.9015) */
SELECT hp.party_name,
hp.party_number,
hca.account_number,
hca.cust_account_id,
hp.party_id,
hps.party_site_id,
hps.location_id,
hl.address1,
hl.address2,
hl.address3,
hl.city,
hl.state,
hl.country,
hl.postal_code,
hcsu.site_use_code,
hcsu.site_use_id,
hcsa.bill_to_flag
FROM hz_parties hp,
hz_party_sites hps,
hz_locations hl,
hz_cust_accounts_all hca,
hz_cust_acct_sites_all hcsa,
hz_cust_site_uses_all hcsu
WHERE
Qhp.party_id = hps.party_id
AND hps.location_id = hl.location_id
AND hp.party_id = hca.party_id
AND hcsa.party_site_id = hps.party_site_id
AND hcsu.cust_acct_site_id = hcsa.cust_acct_site_id
AND hca.cust_account_id = hcsa.cust_account_id
Posted by Elangovan Ragavan at 16:13 1 comment:
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: AR_Query
TUESDAY, 25 OCTOBER 2011
AR Invoice Tax
/* Formatted on 09-08-2011 16:32:56 (QP5 v5.115.810.9015) */
SELECT DISTINCT
(SELECT name
FROM hr_operating_units
WHERE organization_id = rctl.org_id AND set_of_books_id = 5)
Operating_unit,
jai.customer_trx_id T_TAX_HEADER_ID,
jai.CUSTOMER_TRX_ID,
jai.trx_number T_TRX_NUMBER,
jline.line_number T_LINE_NUMBER,
taxline.tax_line_no T_TAX_LINE_NO,
tax.tax_name T_TAX_NAME,
tax.TAX_TYPE ,
taxline.PRECEDENCE_1,
taxline.PRECEDENCE_2,
taxline.PRECEDENCE_3,
taxline.PRECEDENCE_4,
taxline.PRECEDENCE_5,
taxline.tax_amount T_AMOUNT
FROM ra_customer_trx_lines_all rctl,
ra_cust_trx_line_gl_dist_all rct,
ra_customer_trx_all rcta,
ja_in_ra_customer_trx jai,
ja_in_ra_customer_trx_lines jline,
ja_in_ra_cust_trx_tax_lines taxline,
ja_in_tax_codes tax
WHERE
rctl.customer_trx_line_id = rct.customer_trx_line_id
AND rct.customer_trx_id = rcta.customer_trx_id
AND rcta.customer_trx_id = jai.customer_trx_id(+)
AND jai.customer_trx_id = jline.customer_trx_id
AND taxline.link_to_cust_trx_line_id = rctl.customer_trx_line_id
AND taxline.tax_id = tax.tax_id
AND TRUNC (rcta.TRX_DATE) BETWEEN '01-AUG-2011' AND '13-AUG-2011'
--AND rctl.LINE_TYPE = 'TAX'
AND rcta.SET_OF_BOOKS_ID = 5