
--CREATE OR REPLACE VIEW KE014T3.BCD_ICT_AR_MASTER_STAFF_VIEW AS
select SUBSTR(AR_CODE,1,1) START_l, ar_code, upper(a.ar_name) AR_NAME, AR_ANALYSIS_6,
--decode(ar_analysis_2,'CK','CHRISTOPHER','IRO','IMELDA','KEN','KENNEDY','CMM','JUMA','NOT ASSIGNED') 
'MH' Credit_Controller,
AR_CREDIT_DAYS, AR_FINAL_LIMIT,
usd_tot_os, kes_tot_os,TOTAL_OS_IN_KES
from
KE014T3.id_ar_master a,ke014t3.bcd_ict_ar_ageing_of_os_staff b, ke014t3.bcd_ict_ar_balance_as_on_staff c
where
TOTAL_OS_IN_KES<>0
AND ar_code=art_code
and a.ar_code=cust_code
and AR_ANALYSIS_6 in ('STAFF-1','STAFF-2') and AR_STATUS not in ('B')
order by ar_code




--select * from ke014t3.bcd_ict_ar_balance_as_on_staff
--select * from KE014T3.BCD_ICT_AR_MASTER_STAFF_VIEW 
