
CREATE OR REPLACE VIEW KE014T3_SUPPORT.BCD_ICT_TBRD_BOOKING_DTL_03_19
(branch, tbk_booking_number, tbk_date, tbk_customer, tbk_next_process_number, tbk_flex_2, tbk_flex_3, tbk_flex_4, tbrd_provider, tbrd_supplier, tbrd_service, tbrd_city, tbrd_from_date, tbrd_to_date, tbrd_provider_currency, tbrd_provider_rate, tbrd_provider_ex_rate, tbrd_markup_method, tbrd_markup_value, tbrd_discount_value, tbrd_quantity, tbrd_no_of_units, tbrd_invoice_value, tbrd_currency, tbrd_ex_rate, tbrd_invoice_f_amount, tbrd_invoice_l_amount, tbrd_cost_f_amount, tbrd_cost_l_amount, tbrd_created_by, tbrd_invoice, tbrd_system, tbrd_drcr, tbrd_meal_plan, tbrd_room_type)
AS
select 'HO' Branch,
TBK_BOOKING_NUMBER, TBK_DATE, TBK_CUSTOMER,TBK_NEXT_PROCESS_NUMBER, TBK_FLEX_2,TBK_FLEX_3,TBK_FLEX_4,TBRD_provider, tbrd_supplier, tbrd_service,tbrd_city,tbrd_from_date, tbrd_to_date, tbrd_provider_currency, tbrd_provider_rate,
TBRD_PROVIDER_EX_RATE, TBRD_MARKUP_METHOD, TBRD_MARKUP_VALUE, TBRD_DISCOUNT_VALUE, TBRD_QUANTITY,TBRD_NO_OF_UNITS,TBRD_INVOICE_VALUE,
TBRD_CURRENCY,TBRD_EX_RATE, TBRD_INVOICE_F_AMOUNT, TBRD_INVOICE_L_AMOUNT, TBRD_COST_F_AMOUNT,TBRD_COST_L_AMOUNT,TBRD_CREATED_BY,
TBRD_INVOICE,TBRD_SYSTEM,TBRD_DRCR,TBRD_MEAL_PLAN,TBRD_ROOM_TYPE
from
ke014t3_support.id_tb_booking_rate_details,
ke014t3_support.id_tb_booking_header
where
tbk_reference=tbrd_reference
and tbk_customer in ('S0171','S0175','S0177','S0171A','S0171B','S0171C')
and tbrd_status<>'V'
and tbrd_service<>'REV'
and tbrd_provision_f_amount=0
union all
select
'SAFCOM' Branch,TBK_BOOKING_NUMBER, TBK_DATE, TBK_CUSTOMER,TBK_NEXT_PROCESS_NUMBER, TBK_FLEX_2,TBK_FLEX_3,TBK_FLEX_4,TBRD_provider, tbrd_supplier, tbrd_service,tbrd_city,tbrd_from_date, tbrd_to_date, tbrd_provider_currency, tbrd_provider_rate,
TBRD_PROVIDER_EX_RATE, TBRD_MARKUP_METHOD, TBRD_MARKUP_VALUE, TBRD_DISCOUNT_VALUE, TBRD_QUANTITY,TBRD_NO_OF_UNITS,TBRD_INVOICE_VALUE,
TBRD_CURRENCY,TBRD_EX_RATE, TBRD_INVOICE_F_AMOUNT, TBRD_INVOICE_L_AMOUNT, TBRD_COST_F_AMOUNT,TBRD_COST_L_AMOUNT,TBRD_CREATED_BY,
TBRD_INVOICE,TBRD_SYSTEM,TBRD_DRCR,TBRD_MEAL_PLAN,TBRD_ROOM_TYPE
from
ke074t3_support.id_tb_booking_rate_details,
ke074t3_support.id_tb_booking_header
where
tbk_reference=tbrd_reference
and tbk_customer in ('S0171','S0175','S0177','S0171A','S0171B','S0171C')
and tbrd_status<>'V'
and tbrd_service<>'REV'
and tbrd_provision_f_amount=0

/
