CREATE OR REPLACE VIEW
XX_GET_AVAILABLE_RECEIPTS_VIEW AS
SELECT (CASE
WHEN C.REMIT_BANK_CURRENCY <> C.CURRENCY_CODE THEN
(C.AMOUNT * NVL(C.EXCHANGE_RATE, 1))
ELSE
C.AMOUNT
END) AMOUNT,
C.REMIT_BANK_CURRENCY,
CBA.BANK_ACCOUNT_ID,
C.STATE_DSP,
C.ORG_ID,
C.REMIT_BANK_ACCOUNT_NAME
BANK_ACCOUNT_NAME,
C.GL_DATE EFFECTIVE_DATE,
L.LEDGER_ID
FROM AR_CASH_RECEIPTS_V C,
XX_LOGO_TL L, -- Its Custom Table only for Convert Org to Ledger
CE_BANK_ACCOUNTS CBA
WHERE C.STATE_DSP = 'Remitted'
AND L.ORG_ID = C.ORG_ID
AND CBA.BANK_ACCOUNT_NUM = C.REMIT_BANK_ACCOUNT_NUM
AND C.PAYMENT_METHOD_DSP LIKE '%CDC%' -- I have Hard Code Only For Current Dated Cheque