oracle receivable - refund
im trying to run this query as below but im not getting the correct refuncd to the correspondent location, it is linked to the customer id anot the location
and im not sure how to link it
select distinct
decode(:p_currency_code,NULL,(PS.Exchange_rate*SCE.Amount_applied),SCE.Amount_applied) Amount_applied,
SCE.GL_DATE, CUST.account_number , application_type , HZ.category_code,
decode(PS.CLASS,'PMT','Receipt','CM','Credit Memo') Type_rfnd,
SCE.GL_DATE ref_date
,PS.TRX_NUMBER "Receipt/CM number"
,loc.address1||lang.description
,addr.cust_acct_site_id
,PS.CUSTOMER_SITE_USE_ID