SELECT c.customer_number,c.customer_name,g.party_site_number,d.location,a.overall_credit_limit,
d.site_use_id,sum(e.amount_due_remaining) credit_balance
FROM HZ_CUST_PROFILE_AMTS a, HZ_CUST_ACCOUNTS b, ar_customers c,
hz_cust_site_uses_all d,ar_payment_schedules_all e,
hz_cust_acct_sites_all f,hz_party_sites g
WHERE overall_credit_limit IS NOT NULL
and a.cust_account_id = b.cust_account_id
and b.account_number = c.customer_number
and a.site_use_id = d.site_use_id
and c.customer_id = e.customer_id
and d.site_use_id = e.customer_site_use_id
-- and c.customer_number = :customer_number
and d.cust_acct_site_id = f.cust_acct_site_id
and g.party_site_id = f.party_site_id
and e.org_id = :org_id
GROUP BY c.customer_name,
c.customer_number,
d.site_use_id,
d.location,
a.overall_credit_limit,
g.party_site_number
ORDER BY CUSTOMER_NAME
d.site_use_id,sum(e.amount_due_remaining) credit_balance
FROM HZ_CUST_PROFILE_AMTS a, HZ_CUST_ACCOUNTS b, ar_customers c,
hz_cust_site_uses_all d,ar_payment_schedules_all e,
hz_cust_acct_sites_all f,hz_party_sites g
WHERE overall_credit_limit IS NOT NULL
and a.cust_account_id = b.cust_account_id
and b.account_number = c.customer_number
and a.site_use_id = d.site_use_id
and c.customer_id = e.customer_id
and d.site_use_id = e.customer_site_use_id
-- and c.customer_number = :customer_number
and d.cust_acct_site_id = f.cust_acct_site_id
and g.party_site_id = f.party_site_id
and e.org_id = :org_id
GROUP BY c.customer_name,
c.customer_number,
d.site_use_id,
d.location,
a.overall_credit_limit,
g.party_site_number
ORDER BY CUSTOMER_NAME
This blog is always wonderful..the insights are too brilliant and useful .Thanks for this good site.
ReplyDeletePIC Scheme Singapore
If the customer credit limit is not defined at site level and defined at customer account level. This query won't work.
ReplyDeleteHow Can we derive it ?
I did the same but getting wrong credit limit compared to what I see in forms.
ReplyDeleteHere is Mr Benjamin contact Email details, 247officedept@gmail.com. / Or Whatsapp +1 989-394-3740 that helped me with loan of 90,000.00 Euros to startup my business and I'm very grateful,It was really hard on me here trying to make a way as a single mother things hasn't be easy with me but with the help of Mr Benjamin put smile on my face as i watch my business growing stronger and expanding as well.I know you may surprise why me putting things like this here but i really have to express my gratitude so anyone seeking for financial help or going through hardship with there business or want to startup business project can see to this and have hope of getting out of the hardship..Thank You.
ReplyDelete