JE Spanish B2G Electronic Invoices XML File Output

Description
Categories: BI Publisher
Columns: Trx Id, Trx Type, Trx Cur Code, Exchange Rate, Exchange Date, Trx Date, Trx Number, Trx Doc Type, Trx Class, Trx Lang ...
Application: European Localizations
Source: Spanish B2G Electronic Invoices XML File Output
Short Name: JEESEIFO_XMLP
DB package: JE_ES_B2G_ELECTRONIC_FILE
SELECT trx_id,
                           trx_type,       
                           trx_cur_code,
                           exchange_rate,
                           exchange_date,
                           trx_date,
                           trx_number,
                           trx_doc_type,
                           trx_class,
                           trx_lang,
                           func_cur_code ,
                           batch_name,
                           seq_name,
                           period_set
                    FROM  (SELECT trx.customer_trx_id trx_id,
                                  trx_types.type trx_type,
                                  trx.invoice_currency_code  trx_cur_code,
                                  decode(sob.currency_code,'EUR', trx.exchange_rate,rates.conversion_rate)  exchange_rate,
                                  to_char(trx.exchange_date,'YYYY-MM-DD')  exchange_date,
                                  to_char(trx.trx_date,'YYYY-MM-DD')      trx_date,
                                  trx.trx_number     trx_number,
                                  NVL(trx.global_attribute17,'FC') trx_doc_type,                     -- trx_doc_type
                                  :p_gen_option||trx.global_attribute1 trx_class,         -- trx_type (original,corrective,consolidated)
                                  LOWER(NVL(trx.global_attribute18,'ES'))   trx_lang ,                                -- language                                      
                                  sob.currency_code  func_cur_code,
                                  batch.name batch_name,
                                  seqs.name seq_name,
                                  sob.period_set_name period_set
                            FROM  ra_customer_trx  trx,
                                  ra_cust_trx_types trx_types,
                                  gl_sets_of_books sob,
                                  gl_daily_rates rates,
                                  ra_batches batch,
                                  fnd_document_sequences seqs 
                           WHERE  trx.legal_entity_id     = :P_LEGAL_ENTITY_ID
                             AND  trx.bill_to_customer_id = :P_CUST_ACCOUNT_ID
                             AND  trx.bill_to_site_use_id = :P_BILL_TO_SITE_USE_ID
                             AND  trx.cust_trx_type_id    = trx_types.cust_trx_type_id