
create or replace view ke014t3.bcd_ict_ar_master_minor_view as
select SUBSTR(AR_CODE,1,1) START_l, ar_code, upper(ar_name) AR_NAME, AR_ANALYSIS_6 from id_ar_master where
AR_ANALYSIS_6 not in ('INTCOM','STAFF-1','STAFF-2','SUBS') and AR_STATUS not in ('B')
order by ar_code

SELECT DISTINCT AR_ANALYSIS_6 FROM ke014t3.bcd_ict_ar_master_minor_view

create or replace view ke014t3.bcd_ict_cust_rct_details as
SELECT art_code, ART_NUMBER RCT_NO, ART_DOC_DATE RCT_DATE, ART_CURRENCY ALOC_CCY, ART_FOREIGN_AMOUNT RCT_ALOC_AMT, ART_DESCRIPTION RCT_DES, B.RH_OTHER_REFERENCE OTH_REF,
RH_CASH_BANK_CODE, RH_FOREIGN_AMOUNT RCT_FULL_AMT, RH_CURRENCY RCT_CCY, RH_CHEQUE_NUMBER CHQ, RH_CREATED_BY, RH_CREATED_ON
FROM ke014t3.ID_AR_TRANS A,ke014t3.ID_RECEIPT_HEADER B
WHERE
RH_DOC_NUMBER=ART_NUMBER
and ART_BASE_TYPE='RCT'
and RH_STATUS='P'
order by ART_DOC_DATE desc

select * from id_ar_trans where art_number='BRV200200001'

create or replace view ke014t3.bcd_ict_rct_details as
select 
RH_DOC_DATE, RH_DOC_NUMBER,RH_NOTES,RH_CASH_BANK_CODE, RH_CURRENCY, RH_EXCHANGE_RATE, RH_FOREIGN_AMOUNT,RH_OTHER_REFERENCE,
RH_CHEQUE_NUMBER, RH_NARRATION, RH_CREATED_BY, RH_CREATED_ON
from
ke014t3.id_receipt_header where RH_STATUS='P' and RH_DOC_DATE>'31-DEC-2018' order by rh_doc_number

