Ar aging report
Hello
i have issue with my selection code , the issue that the selection include outstanding amount of customer depending on parameter to_date , but if we have due date is less than apply date these transactions not included in the selection and this is the SQL code
-----------------------------------------------------------------------------------------------------------------
select
party_name,
ACCOUNT_NUMBER ,
PROFILE_CLASS,
sum(amt_due_remaining) from (
select
hp.party_name,
hc.ACCOUNT_NUMBER,
case when hcpc.name like 'DEFAULT' then 'IMMEDIATE' else hcpc.name end PROFILE_CLASS,
aps.due_date,
hps_bill.PARTY_SITE_NUMBER,
aps.gl_date ,
to_date(:p_as_of_date)-aps.due_date total_days,