


CREATE VIEW id_booking_view_schneider_2019 
AS
SELECT
TBK_TMP_CUST_NAME Traveller_Name,
(select tbpm_name from id_tb_provider_master where tbpm_provider=tbrd_provider and rownum=1) Hotel_Name,
(tbrd_city||'-'||TBRD_FLEX_V_1||' CID: '||TBRD_FROM_DATE||' COD: '||TBRD_TO_DATE||' Units: '||TBRD_NO_OF_UNITS) Service_Description,
TBT_DOC_NUMBER Invoice_No,
tbt_doc_date Invoice_Date,


TBT_OTHER_REFERENCE LPO,
TBK_DATE Booking_Date,
TBK_CUSTOMER Customer_Code,
TBT_CREATED_ON Created_On





TBRD_INVOICE_VALUE Invoice_Amount,
TBRD_COST_L_AMOUNT Local_amount,
(TBRD_INVOICE_VALUE-TBRD_COST_L_AMOUNT) Markup,
decode(tbk_booking_Type,'IB','L','I') Domestic_Intl,

FROM
ID_TB_TRANS,
ID_TB_BOOKING_HEADER,
id_tb_provider_master,
id_tb_booking_rate_details
where
TBRD_REFERENCE=TBK_REFERENCE
and TBT_BOOK_NUMBER = TBK_BOOKING_NUMBER
and TBPM_PROVIDER = TBT_PROVIDER
AND TBK_CUSTOMER in ('B0093','B0105','B0104')
and TBT_DOC_TYPE = 'TIN'
and tbt_status='P'
and TBRD_SYS_TYPE='SV'
and tbrd_status<>'V'
and tbt_created_on between '01-JAN-2019' and sysdate
/

select * from id_tb_booking_header


from id_tb_booking_rate_details where TBRD_SYS_TYPE='SV'

select *
from id_tb_booking_rate_details where TBRD_SYS_TYPE='SV'

select * from id_tb_service_master

select * from id_tb_provider_master
