INSERT INTO id_tb_provider_master values ('1','DXB_SARit','The Sarit','20032','abraham street','thotalanga','CMB','sri lanka','964656544','','naran@kjk.com','','S','A','','','','','SP','26-JUN-2019','','','namel','','DXB-987','','','','','H','CMB','YY')

delete from id_tb_provider_master where tbpm_provider='DXB_SARit'



select * from ke074t3.id_ap_trans where apt_type='TACN'

select substr(b.AIRT_0,8,16), AIR_REFERENCE from ID_AIR_AMADEUS a, id_air_t b
where a.air_key=b.airt_key
and  substr(b.AIRT_0,8,16)='4795345015'

select * from id_tb_booking_header where tbk_booking_number='IB18020553'

select * from id_tb_service_voucher_header, id_tb_service_voucher_details
where tbsvh_sv_number=tbsvd_sv_number
and TBSVD_BOOKING_NUMBER='IB18020553'

select * from ke074t3.id_tb_ar_details where SUB_ARD_DOC_TYPE='TADN'

select * from id_tb_service_voucher_details where TBSVD_BOOKING_NUMBER='IB18020553'

select count(SUB_AR_DOC_NUMBER) from id_tb_ar_header where SUB_AR_DATE>'31-DEC-2018' and SUB_AR_CODE='P0056' 
group by extract(month from sub_ar_date)
order by extract(month from sub_ar_date)

select * from id_tb_ar_details where SUB_AR_DATE>'31-DEC-2018' and SUB_AR_CODE='P0056' 

select * from id_tb_service_voucher_header where tbsvh_sv_number='SV19050061'

-- ===================================================================================================================================================================================================================================================================================
update id_tb_service_voucher_header set TBSVH_VOUCHER_DESCRIPTION=replace(TBSVH_VOUCHER_DESCRIPTION,'including  tax and service charges')
where tbsvh_sv_number in (select tbsvh_sv_number from
ke014t3.id_tb_booking_header a,ke014t3.ID_TB_SERVICE_VOUCHER_DETAILS B, ke014t3.id_tb_service_voucher_header c
where TBK_BOOKING_NUMBER=TBSVD_BOOKING_NUMBER
and tbk_status<>'F'
and tbk_customer='P0056'
and TBSVD_SV_SERIAL=TBSVH_SERIAL
and extract(month from a.tbk_date)=(extract(month from sysdate))-1
and extract(year from a.tbk_date)=(extract(year from sysdate))
and TBSVH_STATUS in('P','T'))

update id_tb_service_voucher_header set TBSVH_VOUCHER_DESCRIPTION=replace(TBSVH_VOUCHER_DESCRIPTION,' including tax and service charge')
where tbsvh_sv_number in (select tbsvh_sv_number from
ke014t3.id_tb_booking_header a,ke014t3.ID_TB_SERVICE_VOUCHER_DETAILS B, ke014t3.id_tb_service_voucher_header c
where TBK_BOOKING_NUMBER=TBSVD_BOOKING_NUMBER
and tbk_status<>'F'
and tbk_customer='P0056'
and TBSVD_SV_SERIAL=TBSVH_SERIAL
and extract(month from a.tbk_date)=(extract(month from sysdate))-1
and extract(year from a.tbk_date)=(extract(year from sysdate))
and TBSVH_STATUS in('P','T'))

select TBSVH_VOUCHER_DESCRIPTION from
ke014t3.id_tb_booking_header a,ke014t3.ID_TB_SERVICE_VOUCHER_DETAILS B, ke014t3.id_tb_service_voucher_header c
where TBK_BOOKING_NUMBER=TBSVD_BOOKING_NUMBER
and tbk_status<>'F'
and tbk_customer='P0056'
and TBSVD_SV_SERIAL=TBSVH_SERIAL
and extract(month from a.tbk_date)=(extract(month from sysdate))-1
and extract(year from a.tbk_date)=(extract(year from sysdate))
and TBSVH_STATUS in('P','T')

