JG EMEA VAT: Summary AR Extract

Description
Categories: BI Publisher
Columns: Reporting Code, Invoice Id, Invoice Number, Export Number, Invoice Date, Trx Line Class Code, Vat Code, Vat Desc, Vat Type, Posted Flag ...
Application: Regional Localizations
Source: EMEA VAT: Summary AR Extract
Short Name: JGZZSUMMARYAR_XMLP
DB package: JG_ZZ_SUMMARY_AR_PKG
	SELECT  
			JZVTD.reporting_code REPORTING_CODE
			,JZVTD.trx_id INVOICE_ID
			,DECODE(JZVTD.trx_line_class ,'ADJUSTMENT',JZVTD.applied_to_trx_number , JZVTD.trx_number) INVOICE_NUMBER
			,NULL EXPORT_NUMBER
			,TO_CHAR(JZVTD.trx_date,'DD-Mon-RRRR') INVOICE_DATE
			,JZVTD.trx_line_class TRX_LINE_CLASS_CODE
			,JZVTD.tax_rate_code_vat_trx_type_mng VAT_CODE
			,JZVTD.tax_rate_vat_trx_type_desc VAT_DESC
			,JZVTD.tax_rate_vat_trx_type_code VAT_TYPE
			,JZVTD.posted_flag POSTED_FLAG
			,SUM(NVL( JZVTD.tax_amt_funcl_curr,JZVTD.tax_amt) + NVL( JZVTD.taxable_amt_funcl_curr,JZVTD.TAXABLE_AMT)
				) TRX_AMOUNT
			,SUM(NVL(JZVTD.tax_amt_funcl_curr,0) + NVL(JZVTD.taxable_amt_funcl_curr,0)
				) FUNC_AMOUNT
			,SUM(DECODE(JZVTD.reporting_code,'IL_VAT_EXEMPT', 0 
										  ,'VAT-EXEMPT',0
										  ,'VAT-0',0
										  ,(DECODE(JZVTD.TAX_RATE,0,0, NVL(JZVTD.taxable_amt_funcl_curr,JZVTD.taxable_amt)))
						)
				) TAXABLE_AMOUNT 
			,SUM(DECODE(JZVTD.reporting_code,'IL_VAT_EXEMPT', 0 
										  ,'VAT-EXEMPT',0
										  ,'VAT-0',0
										  ,(DECODE(JZVTD.TAX_RATE,0,0, NVL( JZVTD.tax_amt_funcl_curr,JZVTD.tax_amt)))
						)
				) TAX_AMOUNT
			,SUM((DECODE(JZVTD.reporting_code,'IL_VAT_EXEMPT',NVL(JZVTD.taxable_amt_funcl_curr,JZVTD