JE Croatian Supplier Invoice Tax

Description
Categories: BI Publisher
Columns: Period Name, Period Num, Period Year, Doc Sequence Value, Tax Date, Accounting Date, Invoice Date, Invoice Num, Vendor Name, Tax Rate ...
Application: European Localizations
Source: Croatian Supplier Invoice Tax Report
Short Name: JEHRVITR_XMLP
DB package: JG_ZZ_SUMMARY_AP_PKG
SELECT GLP.period_name                      period_name
       ,GLP.period_num		         period_num
       ,GLP.period_year			    period_year
      ,JG_INFO_V22                           doc_sequence_value
      ,TO_CHAR(jg_info_d1,'DD-Mon-RRRR')    tax_date
      ,TO_CHAR(jg_info_d3,'DD-Mon-RRRR')    accounting_date
      ,TO_CHAR(jg_info_d2,'DD-Mon-RRRR')    invoice_date
      ,jg_info_v1                           invoice_num
      ,jg_info_v2                           vendor_name
      ,jg_info_n3                           tax_rate
      ,jg_info_v3                           name
      ,jg_info_n5                           invoice_id
      ,jg_info_v4                           invoice_type
      ,jg_info_v5                           currency
      ,jg_info_v6                           tax_code_desc
      ,SUM(jg_info_n2)                      taxable_amount
      ,SUM(jg_info_n4)                      tax
      ,SUM(jg_info_n6)                      rec_tax
      ,SUM(jg_info_n7)                      non_rec_tax
      ,SUM(jg_info_n8)                      functional_amount
      ,SUM(jg_info_n10)                     Transaction_amount
      ,SUM(jg_info_n13)                     Taxable_entered_amount
      ,jg_info_n9                           acct_flexfield
      ,jg_info_v7                           tax_code_vat_trx_type
      ,jg_info_v8                           merchant_number
      ,jg_info_v10                          doc_seq_name
      ,jg_info_v11                          tax_reg_num
      ,jg_info_v13                          tax_code_vat_trx_type_meaning
      ,jg_info_v12                          tax_code_vat_trx_type_desc
      ,jg_info_v14                          tax_code
      /* UT TESTING ,jg_info_n11 . No value is getting populated into this field */
      ,decode(jg_info_v15, 'OFFSET','XOFFSET','VAT')  tax_code_type_code1
      ,JG_ZZ_SUMMARY_AP_PKG.CF_Tax_Code_Type_Code(decode(jg_info_v15, 'OFFSET','XOFFSET','VAT')) Tax_Code_Type_Cod_Is_Offset
      ,decode(jg_info_v15, 'OFFSET','XOFFSET','VAT') tax_code_type_code2
      ,jg_info_n14                          non_rec_unpaid_amt
      ,jg_info_v17                          offset_flag
      ,jg_info_v18                          offset_tax_rate_code
      ,SUM(DECODE(jg_info_v17,'Y', jg_info_n13 , DECODE