select ticket_date Sale_Date,  to_number(EXTRACT(month FROM ticket_date)) Ticketed_Month, to_char(ticket_number) Ticket_No, to_char(TICKET_DOC_NUMBER1) Invoice, to_char(REPORING_AIRLINE) Flown_Airline_Code, to_char(AIRLINE_NAME) Flown_Airline_Name, TICKET_ROUTING Routing, TICKET_LOCAL_INTER Flown_Region, TICKET_PAX_NAME Pax,  TICKET_BOOKING_CLERK TC,
(select upper( EXEC_NAME)  from ID_EXECUTIVE_MASTER where TICKET_BOOKING_CLERK=EXEC_CODE) BCD_TC_Name,
 to_char(TICKET_FLEX_V_2) PNR,approved_by Safaricom_Booker,PROJECT_NUMBER PR_Number
,TICKET_currency CCY, TICKET_NET_RECEIVABLE Receivable_Amt, decode(TICKET_DOC_NUMBER1,'','NOTINVOICED','INVOICED') Invoice_Status, TICKET_EX_RATE EX_Rate,round(TICKET_NET_RECEIVABLE*TICKET_EX_RATE,2) Local_value
from ticket_view_t3 where TICKET_CUSTOMER_1='P0056' and
Ticket_date between '01-JAN-2019' and '30-JUN-2019'
order by REPORING_AIRLINE, ticket_date
