SELECT *
FROM (
SELECT dtl.party_id party_id
,dtl.party_number party_number
,dtl.party_name party_name
,dtl.party_site_id party_site_id
,dtl.party_site_name party_site_name
,dtl.trx_id trx_id
,dtl.trx_number trx_number
,to_char(dtl.trx_date, 'DD-MON-YYYY') trx_date
,dtl.trx_amount trx_amount
,dtl.trx_line_amt trx_line_amount
,dtl.tax_regime_id tax_regime_id
,dtl.tax_regime_code tax_regime_code
,dtl.tax_regime_code tax_regime_name
,dtl.tax_type_id tax_type_id
,dtl.tax_type_name tax_type_name
,dtl.tax_rate_id tax_rate_id
,dtl.tax_rate_code tax_rate_code
,dtl.tax_amt_trx_curr tax_amt_trx_curr
,to_char(ext.date1, 'DD-MON-YYYY') suppl_process_date
,ext.attribute1 suppl_process_status
,DECODE(ext.attribute1
,'Y'
,'Raised Supplementary Invoices'
,'Unraised Supplementary Invoices')
suppl_process_status_dsp
,ext.attribute2 suppl_invoice_type
,DECODE(ext.attribute2
,'INV'
,'Invoice'
,'CM'
,'Credit Memo'
,'DM'
,'Debit Memo'
,'Wrong Invoice Type')
suppl_invoice_type_dsp
,ext.numeric1 suppl_trx_id
,ext.attribute3 suppl_trx_number
,to_char(ext.date2, 'DD-MON-YYYY') suppl_trx_date
,ext.numeric2 suppl_trx_type_id
,ext.attribute4 suppl_trx_type_name
FROM jai_rep_trx_detail_t dtl
,jai_rep_trx_jx_ext_t ext
,jai_rep_context_t hdr
WHERE dtl.detail_tax_line_id = ext.detail_tax_line_id
AND dtl.rep_context_id = hdr.rep_context_id
AND hdr.request_id = :P_CONC_REQUEST_ID
) d |