<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>
<LOVS>
<!-- loader xml for Enginatics Blitz Report lov: Blitz Upload Mode -->
 <LOVS_ROW>
  <GUID>E811F942597A2075E0530100007FF4F2</GUID>
  <LOV_NAME>Blitz Upload Mode</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select xxen_upload.action_create id, xxen_upload.action_meaning(xxen_upload.action_create) value, null description from dual union all
select xxen_upload.action_create || &apos;,&apos; || xxen_upload.action_update id, xxen_upload.action_meaning(xxen_upload.action_create)||&apos;, &apos;||xxen_upload.action_meaning(xxen_upload.action_update) value, null description from dual
</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: HR Operating Unit -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEB979D2E0530100007F1FF2</GUID>
  <LOV_NAME>HR Operating Unit</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
hou.name value,
null description
from
hr_operating_units hou
where
sysdate between hou.date_from and nvl(hou.date_to,sysdate) and
(:$flex$.ledger is null or hou.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hou.organization_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
order by
hou.name</LOV_QUERY>
  <VERSION_COMMENTS>Fixed where clause duplication</VERSION_COMMENTS>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>وحدة التشغيل مقيدة بالتحكم في الوصول متعدد المنظمات (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Bedieneinheit eingeschränkt durch Multi Org Access Control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Unidad operativa restringida por el control de acceso multiorgánico (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Unité opérationnelle restreinte par un contrôle d&apos;accès multi-organismes (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Unità operativa limitata dal controllo di accesso multiorgano (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>多機関アクセス制御(MOAC)で制限された操作ユニット</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>다중 조직 액세스 제어 (MOAC)에 의해 제한되는 운영 단위</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Unidade operacional restrita por controle de acesso multi org (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Операционное устройство, ограниченное мультиорганизованным контролем доступа (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Styrenhet begränsad av multi-org access control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Çoklu kuruluş erişim kontrolü (MOAC) tarafından kısıtlanan işletim birimi</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>Operating unit restricted by multi org access control (MOAC)</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>受多机构访问控制（MOAC）限制的操作单元。</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: Yes -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEA679D2E0530100007F1FF2</GUID>
  <LOV_NAME>Yes</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
</LOVS>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: AR Refund Upload -->
 <REPORTS_ROW>
  <GUID>D6C04E11BB5E4870BFFBBCC439D8F69D</GUID><ENABLED>Y</ENABLED>
  <SQL_TEXT>select
null action_,
null status_,
null message_,
null modified_columns_,
haouv.name operating_unit,
cast(null as varchar2(30)) refund,
&apos;Credit Memo&apos; refund_source,
rcta.trx_number credit_memo_number,
cast(null as varchar2(30)) receipt_number,
hp.party_name customer_name,
abs(apsa.amount_due_remaining) open_balance,
abs(apsa.amount_due_remaining) refund_amount,
cast(null as date) apply_date,
cast(null as date) apply_gl_date,
cast(null as varchar2(100)) payment_method,
cast(null as varchar2(80)) pay_group,
cast(null as varchar2(240)) payment_reason_comments,
cast(null as varchar2(240)) comments,
rownum upload_row
from
ar_payment_schedules_all apsa,
ra_customer_trx_all rcta,
hr_all_organization_units_vl haouv,
hz_cust_accounts hca,
hz_parties hp
where
1=1 and
apsa.class=&apos;CM&apos; and
apsa.status=&apos;OP&apos; and
apsa.amount_due_remaining&lt;&gt;0 and
apsa.customer_trx_id=rcta.customer_trx_id and
apsa.org_id=haouv.organization_id and
apsa.customer_id=hca.cust_account_id and
hca.party_id=hp.party_id and
apsa.org_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11) and
not exists (
select
null
from
ar_payment_schedules_all inv
where
inv.customer_id=apsa.customer_id and
inv.org_id=apsa.org_id and
inv.class=&apos;INV&apos; and
inv.status=&apos;OP&apos; and
inv.amount_due_remaining&lt;&gt;0 and
(nvl(:include_with_open_invoices,&apos;N&apos;)&lt;&gt;&apos;Y&apos; or :open_invoice_due_within_days is not null and inv.due_date&lt;trunc(sysdate)+:open_invoice_due_within_days)
)
union all
select
null action_,
null status_,
null message_,
null modified_columns_,
haouv.name operating_unit,
cast(null as varchar2(30)) refund,
&apos;Unapplied Receipt&apos; refund_source,
cast(null as varchar2(20)) credit_memo_number,
acra.receipt_number,
hp.party_name customer_name,
(select sum(ara.amount_applied) from ar_receivable_applications_all ara where ara.cash_receipt_id=acra.cash_receipt_id and ara.status in (&apos;UNAPP&apos;,&apos;ACC&apos;) and ara.amount_applied&gt;0) open_balance,
(select sum(ara.amount_applied) from ar_receivable_applications_all ara where ara.cash_receipt_id=acra.cash_receipt_id and ara.status in (&apos;UNAPP&apos;,&apos;ACC&apos;) and ara.amount_applied&gt;0) refund_amount,
cast(null as date) apply_date,
cast(null as date) apply_gl_date,
cast(null as varchar2(100)) payment_method,
cast(null as varchar2(80)) pay_group,
cast(null as varchar2(240)) payment_reason_comments,
cast(null as varchar2(240)) comments,
rownum upload_row
from
ar_cash_receipts_all acra,
hr_all_organization_units_vl haouv,
hz_cust_accounts hca,
hz_parties hp
where
1=1 and
acra.status=&apos;UNAPP&apos; and
acra.org_id=haouv.organization_id and
acra.pay_from_customer=hca.cust_account_id and
hca.party_id=hp.party_id and
acra.org_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11) and
exists (
select
null
from
ar_receivable_applications_all ara
where
ara.cash_receipt_id=acra.cash_receipt_id and
ara.status in (&apos;UNAPP&apos;,&apos;ACC&apos;) and
ara.amount_applied&gt;0
)</SQL_TEXT>
  <TYPE>U</TYPE>
  <UPLOAD_TYPE>A</UPLOAD_TYPE>
  <UPLOAD_OBJECT>xxen_ar_upload.upload_refund</UPLOAD_OBJECT>
  <UPLOAD_EXCEL_VALIDATION>(select
case
when :$column$.refund_source is null or :$column$.operating_unit is null then null
when :$column$.refund_source=&apos;Credit Memo&apos; and :$column$.credit_memo_number is null then &apos;Credit Memo Number is required when Refund Source is Credit Memo.&apos;
when :$column$.refund_source=&apos;Unapplied Receipt&apos; and :$column$.receipt_number is null then &apos;Receipt Number is required when Refund Source is Unapplied Receipt.&apos;
when :$column$.refund_amount is null then null
when :$column$.refund_amount&lt;=0 then &apos;Refund Amount must be greater than zero.&apos;
when :$column$.refund_source=&apos;Credit Memo&apos; and :$column$.refund_amount&gt;nvl((select abs(apsa.amount_due_remaining) from ar_payment_schedules_all apsa, ra_customer_trx_all rcta, hr_all_organization_units_vl haouv where rcta.trx_number=:$column$.credit_memo_number and haouv.name=:$column$.operating_unit and apsa.org_id=haouv.organization_id and apsa.customer_trx_id=rcta.customer_trx_id and apsa.class=&apos;CM&apos; and apsa.status=&apos;OP&apos; and rownum=1),:$column$.refund_amount+1) then &apos;Refund Amount exceeds the open credit memo balance.&apos;
when :$column$.refund_source=&apos;Unapplied Receipt&apos; and :$column$.refund_amount&gt;nvl((select sum(ara.amount_applied) from ar_receivable_applications_all ara, ar_cash_receipts_all acra, hr_all_organization_units_vl haouv where acra.receipt_number=:$column$.receipt_number and haouv.name=:$column$.operating_unit and acra.org_id=haouv.organization_id and ara.cash_receipt_id=acra.cash_receipt_id and ara.status in (&apos;UNAPP&apos;,&apos;ACC&apos;) and ara.amount_applied&gt;0),:$column$.refund_amount+1) then &apos;Refund Amount exceeds the unapplied receipt amount.&apos;
end
from dual)</UPLOAD_EXCEL_VALIDATION>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>AR Refund Upload</REPORT_NAME>
    <DESCRIPTION>Bulk-refund customer credit balances in AR. Each row refunds either an open credit memo or the unapplied/on-account portion of a customer cash receipt by applying it against the operating unit&apos;s Credit Memo Refund Receivables Activity, via AR_CM_APPLICATION_PUB.Activity_application or AR_RECEIPT_API_PUB.Activity_application.

WHEN TO USE EACH REFUND SOURCE
- Credit Memo - the customer has an open credit memo (e.g. overpayment recorded as a CM) and wants the money back.
- Unapplied Receipt - the customer paid more than they owed, or paid against the account with no specific invoice. The receipt has an unapplied/on-account balance to return.

WORKFLOW (review and select)
The template downloads (Create, Update mode) pre-populated with every eligible credit memo and unapplied receipt for the parameters, showing Customer Name and Open Balance. Review the list, then:
1. Set Refund = Yes on the rows to refund; leave blank to skip. Blank rows are not processed.
2. Refund Amount defaults to the source open balance - override with a smaller positive amount for a partial refund (validated &gt; 0 and &lt;= balance, in Excel and at upload).
3. Apply Date / Apply GL Date default to today; the GL Date must be in an open AR period.
4. Optionally set Payment Method, Pay Group, Payment Reason Comments, Comments - these flow to the AP Payment Request invoice.
To add a row manually: pick Refund Source, then the Credit Memo Number or Receipt Number (the LOV adapts to the source).

APPROVAL LIMITS
The AR API runs with p_chk_approval_limit_flag=&apos;Y&apos; - the user&apos;s AR approval limit applies. Rows over the limit error with the API&apos;s own message. Limits are never bypassed.

END-TO-END FLOW
1. AR (this upload): a new ar_receivable_applications_all row is created (application_type=&apos;CM&apos; or &apos;CASH&apos;, status=&apos;ACTIVITY&apos;).
2. AR -&gt; AP business event (automatic): AP creates a Payment Request invoice (source=&apos;Receivables&apos;, invoice_type_lookup_code=&apos;PAYMENT REQUEST&apos;) payable to the customer&apos;s TCA party.
3. AP Invoice Validation (standard AP concurrent).
4. AP Payment Process Request issues the disbursement.

This upload performs step 1 only. Steps 2-4 are standard Oracle AP processing - a second human control point before any money leaves.

PER-OU SETUP
Each OU that processes refunds needs a Credit Memo Refund-type Receivables Activity (AR Setup -&gt; Receipts -&gt; Receivable Activities). The same activity is used for both CM and receipt refunds. If none, the upload errors: &quot;No Credit Memo Refund activity is defined for this operating unit.&quot;

CANDIDATE IDENTIFICATION
- Credit Memo Number LOV: open credit memos in the OU whose customer account has no open invoices (standard refund-candidate rule). Set &quot;Include accounts with open invoices&quot; = Yes to override the safety filter (e.g. when open invoices are disputed).
- Receipt Number LOV: unapplied/on-account customer receipts in the OU with positive unapplied amount.
- Download in Create, Update mode to see existing candidates as rows.

FILTER PARAMETERS
- Operating Unit - filters both branches.
- Customer Name - LOV of customers that have an eligible refund in the OU (respects the open-invoice rules below).
- GL Date From / To, Credit Memo Number (multi-value), Batch Name (multi-value LOV on AR transaction batches) - Credit Memo branch only. The Receipt branch always shows all unapplied/on-account receipts in the chosen OU.
- Include accounts with open invoices - default blank (= safety filter on for CMs). Does not apply to receipts.
- Open Invoice Due Within Days - applies only when Include accounts with open invoices = Yes (otherwise ignored). Enter any number N: a credit memo is hidden only when the customer has an open invoice due within N days; invoices due later are ignored so the CM can still be refunded. Blank = due dates not considered.

MODE
Create, Update by default so the eligible candidates pre-populate. Only rows with Refund = Yes are processed; the result XLSM lists the refunded rows.</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Enginatics</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>R12 only</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
   <CATEGORY_ASSIGNMENTS_ROW>
    <CATEGORY>Upload</CATEGORY>
   </CATEGORY_ASSIGNMENTS_ROW>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:include_with_open_invoices</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:open_invoice_due_within_days</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>:p_upload_mode like &apos;%&apos; || xxen_upload.action_update</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Blitz Upload Mode</LOV_NAME>
    <LOV_GUID>E811F942597A2075E0530100007FF4F2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select xxen_upload.action_create id, xxen_upload.action_meaning(xxen_upload.action_create) value, null description from dual union all
select xxen_upload.action_create || &apos;,&apos; || xxen_upload.action_update id, xxen_upload.action_meaning(xxen_upload.action_create)||&apos;, &apos;||xxen_upload.action_meaning(xxen_upload.action_update) value, null description from dual
</LOV_QUERY_DSP>
    <DEFAULT_VALUE>C,U</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Upload Mode</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>haouv.name=:operating_unit</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>HR Operating Unit</LOV_NAME>
    <LOV_GUID>8E2FF36EDEB979D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
hou.name value,
null description
from
hr_operating_units hou
where
sysdate between hou.date_from and nvl(hou.date_to,sysdate) and
(:$flex$.ledger is null or hou.set_of_books_id in (select gl.ledger_id from gl_ledgers gl where xxen_util.contains(:$flex$.ledger,gl.name)=&apos;Y&apos;)) and
hou.organization_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
order by
hou.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>apsa.gl_date&gt;=:gl_date_from</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>GL Date From</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>apsa.gl_date&lt;:gl_date_to+1</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>GL Date To</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>rcta.trx_number=:credit_memo_number</SQL_TEXT>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Credit Memo Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>hp.party_name=:customer_name</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
hp.party_name value,
hca.account_number description
from
ar_payment_schedules_all apsa,
ra_customer_trx_all rcta,
hr_all_organization_units_vl haouv,
hz_cust_accounts hca,
hz_parties hp
where
apsa.class=&apos;CM&apos; and
apsa.status=&apos;OP&apos; and
apsa.amount_due_remaining&lt;&gt;0 and
apsa.customer_trx_id=rcta.customer_trx_id and
apsa.org_id=haouv.organization_id and
(:$flex$.operating_unit is null or haouv.name=:$flex$.operating_unit) and
apsa.customer_id=hca.cust_account_id and
hca.party_id=hp.party_id and
apsa.org_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11) and
not exists (select null from ar_payment_schedules_all inv where inv.customer_id=apsa.customer_id and inv.org_id=apsa.org_id and inv.class=&apos;INV&apos; and inv.status=&apos;OP&apos; and inv.amount_due_remaining&lt;&gt;0 and (nvl(:$flex$.Include_accounts_with_open_invoices,&apos;N&apos;)&lt;&gt;&apos;Y&apos; or :$flex$.open_invoice_due_within_days is not null and inv.due_date&lt;trunc(sysdate)+:$flex$.open_invoice_due_within_days))
union
select distinct
hp.party_name value,
hca.account_number description
from
ar_cash_receipts_all acra,
hr_all_organization_units_vl haouv,
hz_cust_accounts hca,
hz_parties hp
where
acra.status=&apos;UNAPP&apos; and
acra.org_id=haouv.organization_id and
(:$flex$.operating_unit is null or haouv.name=:$flex$.operating_unit) and
acra.pay_from_customer=hca.cust_account_id and
hca.party_id=hp.party_id and
acra.org_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11) and
exists (select null from ar_receivable_applications_all ara where ara.cash_receipt_id=acra.cash_receipt_id and ara.status in (&apos;UNAPP&apos;,&apos;ACC&apos;) and ara.amount_applied&gt;0)
order by
value</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Customer Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>rcta.batch_id=:batch_id</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV custom</PARAMETER_TYPE_DSP>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
rb.batch_id id,
rb.name value,
to_char(rb.batch_date,&apos;DD-MON-YYYY&apos;)||&apos; - &apos;||haouv.name description
from
ra_batches rb,
hr_all_organization_units_vl haouv
where
rb.org_id=haouv.organization_id and
(:$flex$.operating_unit is null or haouv.name=:$flex$.operating_unit) and
rb.org_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
order by
rb.name desc</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Batch Name</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>:include_with_open_invoices</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Include accounts with open invoices</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</DISPLAY_SEQUENCE>
    <ANCHOR>:open_invoice_due_within_days</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Open Invoice Due Within Days</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>1</COLUMN_NUMBER>
    <COLUMN_NAME>ACTION_</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Char</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>2</COLUMN_NUMBER>
    <COLUMN_NAME>STATUS_</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Char</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>3</COLUMN_NUMBER>
    <COLUMN_NAME>MESSAGE_</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Char</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>4</COLUMN_NUMBER>
    <COLUMN_NAME>MODIFIED_COLUMNS_</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Char</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <HIDDEN>Y</HIDDEN>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>5</COLUMN_NUMBER>
    <COLUMN_NAME>OPERATING_UNIT</COLUMN_NAME>
    <COLUMN_TYPE_DSP>LOV custom</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>240</DATA_LENGTH>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
hou.organization_id id,
hou.name value,
null description
from
hr_operating_units hou
where
sysdate between hou.date_from and nvl(hou.date_to,sysdate) and
hou.organization_id in (select aspa.org_id from ar_system_parameters_all aspa) and
hou.organization_id in (select mgoat.organization_id from mo_glob_org_access_tmp mgoat union select fnd_global.org_id from dual where fnd_release.major_version=11)
order by
hou.name</LOV_QUERY_DSP>
    <REQUIRED>Y</REQUIRED>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>6</COLUMN_NUMBER>
    <COLUMN_NAME>REFUND</COLUMN_NAME>
    <COLUMN_TYPE_DSP>LOV</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>30</DATA_LENGTH>
    <LOV_NAME>Yes</LOV_NAME>
    <LOV_GUID>8E2FF36EDEA679D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;Y&apos; id, xxen_util.meaning(&apos;Y&apos;,&apos;YES_NO&apos;,0) value, null description from dual</LOV_QUERY_DSP>
    <COMMENTS>Set to Yes to refund this row; leave blank to skip it. The download pre-populates all eligible credit memos and unapplied receipts - tick Refund = Yes only on the ones you want to refund. Blank rows are not processed.</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>7</COLUMN_NUMBER>
    <COLUMN_NAME>REFUND_SOURCE</COLUMN_NAME>
    <COLUMN_TYPE_DSP>LOV custom</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>17</DATA_LENGTH>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select &apos;CM&apos; id, &apos;Credit Memo&apos; value, null description from dual union all
select &apos;RECEIPT&apos; id, &apos;Unapplied Receipt&apos; value, null description from dual</LOV_QUERY_DSP>
    <DEFAULT_VALUE>Credit Memo</DEFAULT_VALUE>
    <COMMENTS>Pick Credit Memo to refund an open credit memo, or Unapplied Receipt to refund the unapplied/on-account portion of a customer receipt. Only one of Credit Memo Number / Receipt Number is needed per row (the one matching the source).</COMMENTS>
    <REQUIRED>Y</REQUIRED>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>8</COLUMN_NUMBER>
    <COLUMN_NAME>CREDIT_MEMO_NUMBER</COLUMN_NAME>
    <COLUMN_TYPE_DSP>LOV custom</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>20</DATA_LENGTH>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
rcta.customer_trx_id id,
rcta.trx_number value,
hp.party_name description
from
ar_payment_schedules_all apsa,
ra_customer_trx_all rcta,
hr_all_organization_units_vl haouv,
hz_cust_accounts hca,
hz_parties hp
where
:$column$.refund_source=&apos;Credit Memo&apos; and
apsa.class=&apos;CM&apos; and
apsa.status=&apos;OP&apos; and
apsa.amount_due_remaining&lt;&gt;0 and
apsa.customer_trx_id=rcta.customer_trx_id and
apsa.org_id=haouv.organization_id and
haouv.name=:$column$.operating_unit and
apsa.customer_id=hca.cust_account_id and
hca.party_id=hp.party_id and
not exists (
select
null
from
ar_payment_schedules_all inv
where
inv.customer_id=apsa.customer_id and
inv.org_id=apsa.org_id and
inv.class=&apos;INV&apos; and
inv.status=&apos;OP&apos; and
inv.amount_due_remaining&lt;&gt;0 and
(nvl(:$flex$.Include_accounts_with_open_invoices,&apos;N&apos;)&lt;&gt;&apos;Y&apos; or :$flex$.open_invoice_due_within_days is not null and inv.due_date&lt;trunc(sysdate)+:$flex$.open_invoice_due_within_days)
)
order by
rcta.trx_number</LOV_QUERY_DSP>
    <COMMENTS>Required when Refund Source is Credit Memo. Lists open credit memos in the operating unit.</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>9</COLUMN_NUMBER>
    <COLUMN_NAME>RECEIPT_NUMBER</COLUMN_NAME>
    <COLUMN_TYPE_DSP>LOV custom</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>30</DATA_LENGTH>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
acra.cash_receipt_id id,
acra.receipt_number value,
hp.party_name description
from
ar_cash_receipts_all acra,
hr_all_organization_units_vl haouv,
hz_cust_accounts hca,
hz_parties hp
where
:$column$.refund_source=&apos;Unapplied Receipt&apos; and
acra.status=&apos;UNAPP&apos; and
acra.org_id=haouv.organization_id and
haouv.name=:$column$.operating_unit and
acra.pay_from_customer=hca.cust_account_id and
hca.party_id=hp.party_id and
exists (
select
null
from
ar_receivable_applications_all ara
where
ara.cash_receipt_id=acra.cash_receipt_id and
ara.status in (&apos;UNAPP&apos;,&apos;ACC&apos;) and
ara.amount_applied&gt;0
)
order by
acra.receipt_number</LOV_QUERY_DSP>
    <COMMENTS>Required when Refund Source is Unapplied Receipt. Lists unapplied/on-account customer receipts in the operating unit.</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>10</COLUMN_NUMBER>
    <COLUMN_NAME>CUSTOMER_NAME</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Char</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>360</DATA_LENGTH>
    <COMMENTS>Read-only reference - the customer the credit memo or receipt belongs to, shown so you can review each row before selecting Refund.</COMMENTS>
    <READ_ONLY>Y</READ_ONLY>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>11</COLUMN_NUMBER>
    <COLUMN_NAME>OPEN_BALANCE</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Number</COLUMN_TYPE_DSP>
    <DATA_TYPE>number</DATA_TYPE>
    <DEFAULT_VALUE>select
case :$column$.refund_source
when &apos;Credit Memo&apos; then (
select
abs(apsa.amount_due_remaining)
from
ar_payment_schedules_all apsa,
ra_customer_trx_all rcta,
hr_all_organization_units_vl haouv
where
rcta.trx_number=:$column$.credit_memo_number and
haouv.name=:$column$.operating_unit and
apsa.org_id=haouv.organization_id and
apsa.customer_trx_id=rcta.customer_trx_id and
apsa.class=&apos;CM&apos; and
apsa.status=&apos;OP&apos;
)
when &apos;Unapplied Receipt&apos; then (
select
sum(ara.amount_applied)
from
ar_receivable_applications_all ara,
ar_cash_receipts_all acra,
hr_all_organization_units_vl haouv
where
acra.receipt_number=:$column$.receipt_number and
haouv.name=:$column$.operating_unit and
acra.org_id=haouv.organization_id and
ara.cash_receipt_id=acra.cash_receipt_id and
ara.status in (&apos;UNAPP&apos;,&apos;ACC&apos;) and
ara.amount_applied&gt;0
)
end
from dual</DEFAULT_VALUE>
    <COMMENTS>Read-only reference. Shows the credit memo&apos;s open remaining balance or the receipt&apos;s unapplied/on-account amount, so you can see what is available to refund alongside the Refund Amount you enter.</COMMENTS>
    <READ_ONLY>Y</READ_ONLY>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>12</COLUMN_NUMBER>
    <COLUMN_NAME>REFUND_AMOUNT</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Number</COLUMN_TYPE_DSP>
    <DATA_TYPE>number</DATA_TYPE>
    <DEFAULT_VALUE>select
case :$column$.refund_source
when &apos;Credit Memo&apos; then (
select
abs(apsa.amount_due_remaining)
from
ar_payment_schedules_all apsa,
ra_customer_trx_all rcta,
hr_all_organization_units_vl haouv
where
rcta.trx_number=:$column$.credit_memo_number and
haouv.name=:$column$.operating_unit and
apsa.org_id=haouv.organization_id and
apsa.customer_trx_id=rcta.customer_trx_id and
apsa.class=&apos;CM&apos; and
apsa.status=&apos;OP&apos;
)
when &apos;Unapplied Receipt&apos; then (
select
sum(ara.amount_applied)
from
ar_receivable_applications_all ara,
ar_cash_receipts_all acra,
hr_all_organization_units_vl haouv
where
acra.receipt_number=:$column$.receipt_number and
haouv.name=:$column$.operating_unit and
acra.org_id=haouv.organization_id and
ara.cash_receipt_id=acra.cash_receipt_id and
ara.status in (&apos;UNAPP&apos;,&apos;ACC&apos;) and
ara.amount_applied&gt;0
)
end
from dual</DEFAULT_VALUE>
    <COMMENTS>Defaults to the source&apos;s open balance (credit memo) or unapplied amount (receipt) when a source is picked. Enter a smaller positive amount for a partial refund - it cannot exceed the source balance and must be greater than zero (validated in Excel and at upload time).</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>13</COLUMN_NUMBER>
    <COLUMN_NAME>APPLY_DATE</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Date</COLUMN_TYPE_DSP>
    <DATA_TYPE>date</DATA_TYPE>
    <DEFAULT_VALUE>trunc(sysdate)</DEFAULT_VALUE>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>14</COLUMN_NUMBER>
    <COLUMN_NAME>APPLY_GL_DATE</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Date</COLUMN_TYPE_DSP>
    <DATA_TYPE>date</DATA_TYPE>
    <DEFAULT_VALUE>trunc(sysdate)</DEFAULT_VALUE>
    <COMMENTS>Must fall within an open AR accounting period.</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>15</COLUMN_NUMBER>
    <COLUMN_NAME>PAYMENT_METHOD</COLUMN_NAME>
    <COLUMN_TYPE_DSP>LOV custom</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>100</DATA_LENGTH>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
ipmv.payment_method_code id,
ipmv.payment_method_name value,
null description
from
iby_payment_methods_vl ipmv
where
nvl(ipmv.inactive_date,sysdate+1)&gt;sysdate
order by
ipmv.payment_method_name</LOV_QUERY_DSP>
    <COMMENTS>Optional. Payment method for the downstream AP Payment Request invoice.</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>16</COLUMN_NUMBER>
    <COLUMN_NAME>PAY_GROUP</COLUMN_NAME>
    <COLUMN_TYPE_DSP>LOV custom</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>80</DATA_LENGTH>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
flvv.lookup_code id,
flvv.meaning value,
flvv.description
from
fnd_lookup_values_vl flvv
where
flvv.lookup_type=&apos;PAY GROUP&apos;
and flvv.security_group_id=0
and flvv.enabled_flag=&apos;Y&apos;
and trunc(sysdate) between nvl(flvv.start_date_active,trunc(sysdate)) and nvl(flvv.end_date_active,trunc(sysdate))
order by
flvv.meaning</LOV_QUERY_DSP>
    <COMMENTS>Optional. Pay group for the downstream AP Payment Request invoice.</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>17</COLUMN_NUMBER>
    <COLUMN_NAME>PAYMENT_REASON_COMMENTS</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Char</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>240</DATA_LENGTH>
    <COMMENTS>Optional free-text note flowed to the AP Payment Request invoice.</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>18</COLUMN_NUMBER>
    <COLUMN_NAME>COMMENTS</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Char</COLUMN_TYPE_DSP>
    <DATA_TYPE>varchar2</DATA_TYPE>
    <DATA_LENGTH>240</DATA_LENGTH>
    <COMMENTS>Optional comment recorded on the AR application.</COMMENTS>
   </UPLOAD_COLUMNS_ROW>
   <UPLOAD_COLUMNS_ROW>
    <COLUMN_NUMBER>19</COLUMN_NUMBER>
    <COLUMN_NAME>UPLOAD_ROW</COLUMN_NAME>
    <COLUMN_TYPE_DSP>Number</COLUMN_TYPE_DSP>
    <DATA_TYPE>number</DATA_TYPE>
    <HIDDEN>Y</HIDDEN>
   </UPLOAD_COLUMNS_ROW>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>1</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>status_</PARAMETER_NAME>
    <IN_OUT>out</IN_OUT>
    <PARAMETER_TYPE>Char</PARAMETER_TYPE>
    <COLUMN_NAME>STATUS_CODE_</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>2</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>message_</PARAMETER_NAME>
    <IN_OUT>out</IN_OUT>
    <PARAMETER_TYPE>Char</PARAMETER_TYPE>
    <COLUMN_NAME>MESSAGE_</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>3</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_org_id</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Number</PARAMETER_TYPE>
    <COLUMN_NAME>OPERATING_UNIT</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>4</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_refund</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Char</PARAMETER_TYPE>
    <COLUMN_NAME>REFUND</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>5</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_refund_source</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Char</PARAMETER_TYPE>
    <COLUMN_NAME>REFUND_SOURCE</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>6</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_customer_trx_id</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Number</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>CREDIT_MEMO_NUMBER</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>7</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_cash_receipt_id</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Number</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>RECEIPT_NUMBER</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>8</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_refund_amount</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Number</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>REFUND_AMOUNT</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>9</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_apply_date</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Date</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>APPLY_DATE</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_apply_gl_date</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Date</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>APPLY_GL_DATE</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>11</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_payment_method_code</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Char</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>PAYMENT_METHOD</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>12</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_pay_group</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Char</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>PAY_GROUP</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>13</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_payment_reason_comments</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Char</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>PAYMENT_REASON_COMMENTS</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>14</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_comments</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Char</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>COMMENTS</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
   <UPLOAD_PARAMETERS_ROW>
    <SOURCE>U</SOURCE>
    <DISPLAY_SEQUENCE>15</DISPLAY_SEQUENCE>
    <PARAMETER_NAME>p_upload_row</PARAMETER_NAME>
    <IN_OUT>in</IN_OUT>
    <PARAMETER_TYPE>Number</PARAMETER_TYPE>
    <DEFAULTED>Y</DEFAULTED>
    <COLUMN_NAME>UPLOAD_ROW</COLUMN_NAME>
   </UPLOAD_PARAMETERS_ROW>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
   <UPLOAD_SQLS_ROW>
    <SQL_TYPE>Error SQL</SQL_TYPE>
   </UPLOAD_SQLS_ROW>
   <UPLOAD_SQLS_ROW>
    <SQL_TYPE>Order By</SQL_TYPE>
    <SQL_TEXT>upload_row,
operating_unit,
refund_source,
credit_memo_number,
receipt_number</SQL_TEXT>
   </UPLOAD_SQLS_ROW>
   <UPLOAD_SQLS_ROW>
    <SQL_TYPE>Success SQL</SQL_TYPE>
    <SQL_TEXT>select
null action_,
xu.status_,
xu.message_,
xu.modified_columns_,
xu.operating_unit,
xu.refund,
xu.refund_source,
xu.credit_memo_number,
xu.receipt_number,
xu.customer_name,
xu.open_balance,
araa.amount_applied refund_amount,
trunc(araa.apply_date) apply_date,
trunc(araa.gl_date) apply_gl_date,
xu.payment_method,
xu.pay_group,
xu.payment_reason_comments,
araa.comments,
xu.upload_row
from
xxen_ar_refund_upload_5128_u xu,
hr_all_organization_units_vl haouv,
ra_customer_trx_all rcta,
ar_receivable_applications_all araa,
ar_receivables_trx_all arta
where
xu.status_code_=xxen_upload.status_success and
xu.refund_source=&apos;Credit Memo&apos; and
xu.operating_unit=haouv.name and
haouv.organization_id=rcta.org_id and
rcta.trx_number=xu.credit_memo_number and
rcta.customer_trx_id=araa.customer_trx_id and
araa.application_type=&apos;CM&apos; and
araa.status=&apos;ACTIVITY&apos; and
araa.display=&apos;Y&apos; and
araa.request_id=coalesce(
(select fcr.parent_request_id from fnd_concurrent_requests fcr where fcr.request_id=fnd_global.conc_request_id),
(select xrr.upload_request_id from xxen_report_runs xrr where xrr.run_id=to_number(regexp_substr(sys_context(&apos;userenv&apos;,&apos;action&apos;),&apos;^\d+&apos;))) --webservice result render has no concurrent request; the engine stamps the run id into the session action
) and
araa.receivables_trx_id=arta.receivables_trx_id and
arta.type=&apos;CM_REFUND&apos;
union all
select
null action_,
xu.status_,
xu.message_,
xu.modified_columns_,
xu.operating_unit,
xu.refund,
xu.refund_source,
xu.credit_memo_number,
xu.receipt_number,
xu.customer_name,
xu.open_balance,
araa.amount_applied refund_amount,
trunc(araa.apply_date) apply_date,
trunc(araa.gl_date) apply_gl_date,
xu.payment_method,
xu.pay_group,
xu.payment_reason_comments,
araa.comments,
xu.upload_row
from
xxen_ar_refund_upload_5128_u xu,
hr_all_organization_units_vl haouv,
ar_cash_receipts_all acra,
ar_receivable_applications_all araa,
ar_receivables_trx_all arta
where
xu.status_code_=xxen_upload.status_success and
xu.refund_source=&apos;Unapplied Receipt&apos; and
xu.operating_unit=haouv.name and
haouv.organization_id=acra.org_id and
acra.receipt_number=xu.receipt_number and
acra.cash_receipt_id=araa.cash_receipt_id and
araa.application_type=&apos;CASH&apos; and
araa.status=&apos;ACTIVITY&apos; and
araa.display=&apos;Y&apos; and
araa.request_id=coalesce(
(select fcr.parent_request_id from fnd_concurrent_requests fcr where fcr.request_id=fnd_global.conc_request_id),
(select xrr.upload_request_id from xxen_report_runs xrr where xrr.run_id=to_number(regexp_substr(sys_context(&apos;userenv&apos;,&apos;action&apos;),&apos;^\d+&apos;)))
) and
araa.receivables_trx_id=arta.receivables_trx_id and
arta.type=&apos;CM_REFUND&apos;</SQL_TEXT>
   </UPLOAD_SQLS_ROW>
  </UPLOAD_SQLS>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
