<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: JE Spanish B2G Electronic Invoices XML File Output -->
 <REPORTS_ROW>
  <GUID>82288223F0F03869E053B46B63588994</GUID>
  <SQL_TEXT>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,&apos;EUR&apos;, trx.exchange_rate,rates.conversion_rate)  exchange_rate,
                                  to_char(trx.exchange_date,&apos;YYYY-MM-DD&apos;)  exchange_date,
                                  to_char(trx.trx_date,&apos;YYYY-MM-DD&apos;)      trx_date,
                                  trx.trx_number     trx_number,
                                  NVL(trx.global_attribute17,&apos;FC&apos;) trx_doc_type,                     -- trx_doc_type
                                  :p_gen_option||trx.global_attribute1 trx_class,         -- trx_type (original,corrective,consolidated)
                                  LOWER(NVL(trx.global_attribute18,&apos;ES&apos;))   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
                             AND  trx_types.type in (&apos;INV&apos;,&apos;CM&apos;)
                             AND  trx.org_id = trx_types.org_id
                             AND  trx.complete_flag       = &apos;Y&apos;
                             AND  trx.customer_trx_id     =  NVL(:p_trx_id,trx.customer_trx_id)
                             AND  trx.invoice_currency_code = :P_TRX_CUR
                             AND  trx.trx_date between :P_TRX_DATE_FROM  and :P_TRX_DATE_TO
                             AND  ((:p_gen_option=&apos;O&apos; and (trx.global_attribute16 is null OR trx.global_attribute16 = &apos;TBR&apos;))
                                    OR (:p_gen_option = &apos;C&apos; and trx.global_attribute16 = &apos;ACC&apos;))
                             AND  ((trx_types.type    =&apos;INV&apos;) 
                                    OR (trx_types.type=&apos;CM&apos; AND (trx.previous_customer_trx_id is not null 
                                                                 OR (( (select count(distinct ara.applied_customer_trx_id) 
                                                                          from ar_Receivable_applications ara
                                                                         where ara.customer_trx_id = trx.customer_trx_id) = 1 )
                                                                           AND not exists (select 1 from ar_payment_schedules 
                                                                                            where customer_trx_id = trx.customer_trx_id
                                                                                              and amount_due_remaining &lt;&gt; 0)))
                                                             AND trx.global_attribute19 is not null and trx.global_attribute20 is not null))
                             AND  exists (select 1 
                                            from ra_customer_trx_lines_all trx_lines
                                           where trx_lines.customer_trx_id = trx.customer_trx_id    
                                             and trx_lines.line_type = &apos;TAX&apos; )
                             AND  trx.set_of_books_id = sob.set_of_books_id
                             AND  rates.from_currency(+) = trx.invoice_currency_code
                             AND  rates.to_currency(+) =&apos;EUR&apos;
                             AND  rates.conversion_type(+) = trx.exchange_rate_type
                             AND  rates.conversion_date(+) = trx.trx_date
                             AND  trx.batch_id = batch.batch_id(+)
                             AND  trx.doc_sequence_id = seqs.doc_sequence_id(+)
                        ORDER BY  trx.trx_number)
                WHERE ROWNUM &lt;= :p_max_no_of_invs    
</SQL_TEXT>
  <XDO_APPLICATION_SHORT_NAME>JE</XDO_APPLICATION_SHORT_NAME>
  <XDO_DATA_SOURCE_CODE>JEESEIFO_XMLP</XDO_DATA_SOURCE_CODE>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <REPORT_NAME>JE أعمال لحكومات - الفواتير الإلكترونية في أسبانيا - مخرجات ملف XML</REPORT_NAME>
    <DESCRIPTION>Application: المحليات الأوروبية
Source: أعمال لحكومات - الفواتير الإلكترونية في أسبانيا - مخرجات ملف XML
Short Name: JEESEIFO_XMLP
DB package: JE_ES_B2G_ELECTRONIC_FILE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <REPORT_NAME>JE B2G Elektronische Rechnungen - XML-Dateiausgabe</REPORT_NAME>
    <DESCRIPTION>Application: Europäische Lokalisierungen
Source: Spanien: B2G Elektronische Rechnungen - XML-Dateiausgabe
Short Name: JEESEIFO_XMLP
DB package: JE_ES_B2G_ELECTRONIC_FILE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <REPORT_NAME>JE Espagne - B-to-G - Factures électroniques - Sortie dans fichier XML</REPORT_NAME>
    <DESCRIPTION>Application: European Localizations
Source: Espagne - B-to-G - Factures électroniques - Sortie dans fichier XML
Short Name: JEESEIFO_XMLP
DB package: JE_ES_B2G_ELECTRONIC_FILE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>JE Spanish B2G Electronic Invoices XML File Output</REPORT_NAME>
    <DESCRIPTION>Application: European Localizations
Source: Spanish B2G Electronic Invoices XML File Output
Short Name: JEESEIFO_XMLP
DB package: JE_ES_B2G_ELECTRONIC_FILE</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>BI Publisher</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>:p_bill_to_site_use_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_cust_account_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_gen_option</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_issuer_type</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_legal_entity_id</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_max_no_of_invs</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_no_of_invs_per_file</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_trx_cur</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_trx_date_from</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_trx_date_to</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_trx_id</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
  </PARAMETER_DEPENDENCIES>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
  <UPLOAD_DEPENDENCIES>
  </UPLOAD_DEPENDENCIES>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
