Delinquent Customer with Strategy Assigned
Delinquent Customer with Strategy Assigned
from
(
select distinct hcpf.cust_account_id,hca.account_number,hcpf.PROFILE_CLASS_Id,
(select name from fusion.HZ_CUST_PROFILE_CLASSES where PROFILE_CLASS_ID =
hcpf.PROFILE_CLASS_ID) Profile_Class_NAME
, iestv.STRATEGY_TEMP_ID,
iestv.STRATEGY_NAME,ies.status_code,iestv.category_type_meaning from
fusion.iex_strategies ies, fusion.HZ_CUSTOMER_PROFILES_F
hcpf,fusion.iex_strategy_templates_vl iestv,
fusion.hz_cust_accounts hca,
hr_operating_units hou
where ies.CUST_ACCOUNT_ID = hcpf.cust_account_id
and ies.strategy_template_id = iestv.STRATEGY_TEMP_ID
and hca.cust_account_id = ies.CUST_ACCOUNT_ID
AND hou.organization_id = ies.org_id
and iestv.category_type_meaning = 'Delinquent'
and iestv.STRATEGY_NAME is not null
and ies.status_code in ('OPEN','ONHOLD')
AND (
(
organization_id IN (:P_BUNIT)
AND coalesce (:P_BUNIT, NULL) IS NOT NULL
)
OR coalesce (:P_BUNIT, NULL) IS NULL
)
)