Consultar aplicaciones de Notas de Credito

Posted: noviembre 4, 2009 in AR, SQL & PLSQL
Etiquetas: , , ,

la siguiente consulta ayuda a encontrar las aplicaciones de notas de credito
para un cliente en particular

SELECT cta.trx_number nota_credito
, ara.apply_date  fecha_applicacion
, nvl(ARA.amount_applied_from, ara.amount_applied) importe_aplicado
, trx.trx_number  factura
, trx.trx_date    fecha_factura
, hca.account_number cliente
from ar_receivable_applications_all ara
, ra_customer_trx_all            cta
, ra_customer_trx_all            trx
, ra_cust_trx_types_all          ctt
, hz_cust_accounts               hca
where hca.cust_account_id          = trx.bill_to_customer_id
and ara.customer_trx_id          = cta.customer_trx_id
and ara.applied_customer_trx_id  = trx.customer_trx_id
and ctt.org_id                   = trx.org_id
and ctt.type                     = ‘INV’
and trx.cust_trx_type_id         =  ctt.cust_trx_type_id
and ara.display                  = ‘Y’
and ara.status                   = ‘APP’
and ara.application_type         = ‘CM’
and cta.org_id                   = trx.org_id
and cta.org_id                   = &operating_unit
and hca.account_number           = ‘&customer_number’

Advertisement

Deja un comentario

Fill in your details below or click an icon to log in:

Logo de WordPress.com

You are commenting using your WordPress.com account. Log Out / Cambiar )

Twitter picture

You are commenting using your Twitter account. Log Out / Cambiar )

Facebook photo

You are commenting using your Facebook account. Log Out / Cambiar )

Connecting to %s