JE Spanish Inter-EU Invoices Journal

Description
Categories: BI Publisher
Columns: Seq Name, Accounting Date, Doc Sequence Value, Invoice Num, Invoice Date, Vendor Name, Invoice Currency Code, Func Currency Code, Vat Num, Vat Name ...
Application: European Localizations
Source: Spanish Inter-EU Invoices Journal Report
Short Name: JEESRVAR_XMLP
DB package: jg_zz_journal_ap_pkg
   SELECT  jg_info_v1        SEQ_NAME
          ,TO_CHAR(jg_info_d2,'DD-Mon-RRRR')        ACCOUNTING_DATE
          ,jg_info_n2       DOC_SEQUENCE_VALUE /* jg_info_v25. Bug#8278481*/
          ,jg_info_v7        INVOICE_NUM
          ,TO_CHAR(jg_info_d1,'DD-Mon-RRRR')        INVOICE_DATE
          ,jg_info_v2        VENDOR_NAME
          ,jg_info_v8        INVOICE_CURRENCY_CODE
          ,jg_info_v20       FUNC_CURRENCY_CODE
          ,jg_info_v3        VAT_NUM
          ,jg_info_v4        VAT_NAME
          ,SUM(ROUND(decode(jg_info_v20, jg_info_v8,jg_info_n20,jg_info_n13), 2))  TAXABLE_REC_AMT
		  ,SUM(ROUND(decode(jg_info_v20, jg_info_v8,jg_info_n21,jg_info_n14), 2))  TAXABLE_NREC_AMT
          ,SUM(ROUND(decode(jg_info_v20, jg_info_v8,decode(jg_info_v29,'Y',nvl(jg_info_n22,0)+nvl(jg_info_n23,0),jg_info_n22),
		  decode(jg_info_v29,'Y',nvl(jg_info_n15,0)+nvl(jg_info_n16,0),jg_info_n15)) , 2))  TAX_REC_AMT
          ,SUM(ROUND(decode(jg_info_v29,'Y',0,decode(jg_info_v20, jg_info_v8,jg_info_n23,jg_info_n16)), 2))  TAX_NREC_AMT
		  /* Bug 16395602 
          ,SUM(ROUND(DECODE(jg_info_v21,'', DECODE(jg_info_v20, jg_info_v8, DECODE(nvl(jg_info_v9,'N'),'N',jg_info_n3,0), 
           DECODE(nvl(jg_info_v9,'N'),'N',jg_info_n4,0)), NVL(jg_info_n7,0) + DECODE(nvl(jg_info_v9,'N'),'N',nvl(jg_info_n4,0),0))
           + decode(jg_info_v20, jg_info_v8, jg_info_n5, jg_info_n6), 2))  TOTAL_AMT
		   */
		  ,SUM(ROUND(DECODE(jg_info_v20, jg_info_v8, nvl(jg_info_n20,0)+nvl(jg_info_n21,0),