jueves, noviembre 12

Consultar aplicaciones NC a Facturas

la siguiente consulta es basica para consultar las aplicaciones
de las notas de credito a facturas
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’

0 comentarios:

Publicar un comentario