SELECT
pla.lease_num lease_num,
pla.name lease_name,
LOOK.MEANING LEASE_TYPE,
trunc(ppsa.schedule_date) schedule_date,
SUM(ppia.actual_amount) cash
FROM
pn_leases_all pla,
pn_payment_terms_all pt,
pn_payment_items_all ppia,
pn_payment_schedules_all ppsa,
FND_LOOKUPS LOOK
WHERE
pla.lease_id = pt.lease_id
AND pt.payment_term_id = ppia.payment_term_id
AND ppia.payment_schedule_id = ppsa.payment_schedule_id
and LOOK.LOOKUP_TYPE = 'PN_LEASE_TYPE'
AND LOOK.LOOKUP_CODE = pla.LEASE_TYPE_CODE
--and pla.org_id=123
and pla.lease_num= 'ABC_123'
--pla.lease_num BETWEEN :p_low_lease_num AND :p_high_lease_num--
GROUP BY
pla.lease_num,
pla.name,
ppsa.schedule_date,
LOOK.MEANING
order by ppsa.schedule_date, pla.lease_num;
No comments:
Post a Comment
comments are welcome