select
EXTRACT(MONTH FROM TICKET_DATE) MONTH,
COUNT(TICKET_NUMBER) Count,
ROUND(sum(ticket_net_receivable * ticket_ex_rate),2) RECEIVABLE,
ROUND(sum(ticket_net_payable*ticket_ex_rate),2) PAYABLE,
ROUND(sum(ticket_total_commission*ticket_ex_rate),2) COMMISSION,
ROUND(SUM(TICKET_TOTAL_DISCOUNT*TICKET_EX_RATE),2) DISCOUNTS,
ROUND(SUM(SERVICE_FEE * TICKET_EX_RATE),2) SERVICE_FEE,
(sum(ADM_PAYABLES_1*ticket_ex_rate)+sum(ADM_PAYABLES_2*ticket_ex_rate)+sum(ADM_PAYABLES_3*ticket_ex_rate)) ADM_PAYABLES
from
ticket_view_t3
where
STOCK_airline='BSP'
and ticket_date between '01-JAN-2018' and '31-DEC-2018'
AND TICKET_STATUS='S'
GROUP BY EXTRACT(MONTH FROM TICKET_DATE)
ORDER BY EXTRACT(MONTH FROM TICKET_DATE)


select
pre_glt_doc_date DOC_Date,
PRE_GLT_DOC_NUMBER DOC_Number,
Pre_glt_code GL_Code,
ticket_number TKT_No,
gl_description GL_Account,
PRE_GLT_LOCAL_AMOUNT KES_Value
from
ticket_view_t3,
id_pre_gl_view_all,
id_gl_master
where 
ticket_date between '01-JAN-2018' and '31-DEC-2018'
and
TICKET_DAYEND_REFERENCE=pre_glt_doc_number
and
pre_glt_code=gl_account
and stock_airline='BSP'
order by pre_glt_doc_number, pre_glt_doc_date, ticket_number

