SELECT hp.party_name customer_name, rt.NAME payment_terms,
sum(lgd.amount)
FROM ra_customer_trx_all rct,
ra_cust_trx_types_all rctt,
hz_cust_accounts_all hca,
ra_customer_trx_lines_all rctl,
ra_customer_trx_lines_all tax_rctl,
ra_customer_trx_lines_all fr_rctl,
ra_terms rt,
hz_parties hp,
ra_cust_trx_line_gl_dist_all lgd,
ra_customer_trx_lines ctl_line,
ar_lookups al_class,
ar_lookups al_type,
ra_rules rr
WHERE rctt.cust_trx_type_id = rct.cust_trx_type_id
AND rct.sold_to_customer_id = hca.cust_account_id
AND rct.customer_trx_id = rctl.customer_trx_id
AND tax_rctl.customer_trx_id(+) = rct.customer_trx_id
AND tax_rctl.line_type(+) = 'TAX'
AND fr_rctl.customer_trx_id(+) = rct.customer_trx_id
AND fr_rctl.line_type(+) = 'FREIGHT'
AND hca.account_number = 12345
AND rct.trx_date between to_date('01-JAN-2015','DD-MON-YYYY')and to_date('30-JUN-2015','DD-MON-YYYY')
AND rct.term_id = rt.term_id
AND hp.party_id = hca.party_id
AND lgd.customer_trx_line_id = rctl.customer_trx_line_id (+)
--AND rct.customer_trx_id = 7451947
AND rctl.link_to_cust_trx_line_id =ctl_line.customer_trx_line_id(+)
AND al_class.lookup_type = 'AUTOGL_TYPE'
AND al_class.lookup_code = lgd.account_class
AND al_type.lookup_type (+)= 'STD_LINE_TYPE'
AND al_type.lookup_code (+) = rctl.line_type
AND rctl.accounting_rule_id = rr.rule_id (+)
AND lgd.account_class = 'REV'
group by hp.party_name, rt.NAME
I will recommend anyone looking for Business loan to Le_Meridian they helped me with Four Million USD loan to startup my Quilting business and it's was fast When obtaining a loan from them it was surprising at how easy they were to work with. They can finance up to the amount of $500,000.000.00 (Five Hundred Million Dollars) in any region of the world as long as there 1.9% ROI can be guaranteed on the projects.The process was fast and secure. It was definitely a positive experience.Avoid scammers on here and contact Le_Meridian Funding Service On. lfdsloans@lemeridianfds.com / lfdsloans@outlook.com. WhatsApp...+ 19893943740. if you looking for business loan.
ReplyDelete