Thursday, 7 February 2019

AR Receipts Report

SELECT
 ACRA.RECEIPT_DATE
,ACRA.PAY_FROM_CUSTOMER
,ACRA.MISC_PAYMENT_SOURCE
,ACRA.TYPE
,ACRA.RECEIPT_NUMBER
,case when ACRA.TYPE != 'MISC' then (select hp.party_name from hz_parties hp, HZ_CUST_ACCOUNTS hca where hca.cust_account_id = ACRA.PAY_FROM_CUSTOMER and hca.party_id = hp.party_id)
 else ACRA.MISC_PAYMENT_SOURCE
 end CUSTOMER_NAME
,substr(arm.name,instr(ARM.name,'-')+1,length(arm.name)) receipt_method
,ACRA.AMOUNT
,(select IBY_AMOUNT_IN_WORDS.Get_Amount_In_Words(ACRA.AMOUNT,'AED',2) from dual) AMT_Words
,ACRA.COMMENTS Remark
,ARM.printed_name
,ACRA.created_by
,sysdate PRINTING_DATE
FROM
AR_RECEIPT_METHODS                 ARM
,AR_CASH_RECEIPTS_ALL               ACRA
WHERE 1=1
AND ARM.RECEIPT_METHOD_ID               =               ACRA.RECEIPT_METHOD_ID
and acra.org_id =:p_bu_id

1 comment: