<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: GL Ledger (inv org related) -->
 <LOVS_ROW>
  <GUID>8E2FF36EDF3A79D2E0530100007F1FF2</GUID>
  <LOV_NAME>GL Ledger (inv org related)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
gl.ledger_id in (select ood.set_of_books_id from org_organization_definitions ood where nvl(ood.disable_date,sysdate)&gt;=sysdate) and
(:$flex$.chart_of_accounts is null or xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;) and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
fifsv.id_flex_structure_name,
gl.name</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>جميع دفاتر الأستاذ المتعلقة بجميع منظمات المخزون النشطة</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Alle Ledger, die sich auf alle aktiven Inventarorganisationen beziehen</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Todos los libros de contabilidad relacionados con todas las organizaciones de inventario activas</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Tous les grands livres relatifs à tous les organismes d&apos;inventaire actifs</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Tutti i libri contabili relativi a tutte le organizzazioni di inventario attive</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>すべてのアクティブな在庫組織に関連するすべての台帳</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>모든 활성 재고 조직과 관련된 모든 원장</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Todos os livros contábeis relacionados a todas as organizações de inventário ativas</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Все бухгалтерские книги, относящиеся ко всем организациям, занимающимся активным инвентаризацией.</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Alla huvudböcker relaterade till alla aktiva lagerorganisationer</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Tüm aktif envanter organizasyonlarıyla ilgili tüm defterler</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>All ledgers related to all active inventory organizations</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>与所有现行清单组织有关的所有分类账</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: INV Category Set -->
 <LOVS_ROW>
  <GUID>8E2FF36EDECA79D2E0530100007F1FF2</GUID>
  <LOV_NAME>INV Category Set</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: INV Item (master, costing enabled only) -->
 <LOVS_ROW>
  <GUID>91D022B15B12FFB9E053BB6B63587F0B</GUID>
  <LOV_NAME>INV Item (master, costing enabled only)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <FILTER_BEFORE_DISPLAY>Y</FILTER_BEFORE_DISPLAY>
  <LOV_QUERY>select
msiv.concatenated_segments value,
msiv.description
from
mtl_system_items_vl msiv
where
msiv.organization_id=(
select
max(mp.master_organization_id) master_organization_id
from
mtl_parameters mp
where
mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) or
fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) is null and
mp.organization_id in (select oav.organization_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id)
) and
msiv.costing_enabled_flag=&apos;Y&apos;
order by
msiv.concatenated_segments</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>All costing enabled items from item master org</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: INV Operating Unit -->
 <LOVS_ROW>
  <GUID>9B9627743E84607DE053BB6B635805FB</GUID>
  <LOV_NAME>INV Operating Unit</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
haouv.name value,
&apos;Operating Unit&apos; description
from
hr_all_organization_units_vl haouv
where
haouv.organization_id in 
(
select
to_number(hoi.org_information3)
from
mtl_parameters mp,
hr_organization_information hoi,
hr_all_organization_units haou
where
mp.organization_id&lt;&gt;mp.master_organization_id and
mp.organization_id=hoi.organization_id and
hoi.org_information_context=&apos;Accounting Information&apos; and 
hoi.organization_id=haou.organization_id and
nvl(haou.date_to,sysdate)&gt;=sysdate
)
order by 1</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>جميع وحدات التشغيل المرتبطة بمؤسسة مخزون غير رئيسية نشطة</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Alle Betriebseinheiten, die mit einer aktiven Nicht-Master-Inventarisierungsorganisation verbunden sind</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Todas las unidades operativas relacionadas con una organización de inventario no maestra activa</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Toutes les unités opérationnelles liées à un organisme d&apos;inventaire non maître actif</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Tutte le unità operative legate a un&apos;organizzazione di inventario non master attiva</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>アクティブな非マスターインベントリ組織に関連するすべてのオペレーティング・ユニット</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>활성 비 마스터 재고 조직과 관련된 모든 운영 단위</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Todas as unidades operacionais relacionadas a uma organização ativa de inventário não-mestre</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Все операционные единицы, относящиеся к действующей организации, не являющейся ведущим поставщиком инвентарных запасов.</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Alla operativa enheter relaterade till en aktiv organisation som inte är huvudlager</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Etkin bir ana envanter organizasyonu ile ilgili tüm işletim birimleri</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>All operating units related to an active non master inventory organization</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>与在用的非总清单组织有关的所有业务单位：</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: INV Organization Code (excluding master) -->
 <LOVS_ROW>
  <GUID>91D3167A33531204E053BB6B63585EE3</GUID>
  <LOV_NAME>INV Organization Code (excluding master)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select
ood.organization_code value,
ood.organization_name description
from
org_organization_definitions ood
where
ood.organization_id not in (select mp.organization_id from mtl_parameters mp where mp.organization_id=mp.master_organization_id) and
(:$flex$.operating_unit is null or ood.operating_unit in (select haouv.organization_id from hr_all_organization_units_vl haouv where xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos;)) and
(:$flex$.ledger is null or ood.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
nvl(ood.disable_date,sysdate)&gt;=sysdate
order by
ood.organization_code</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>AR</LANGUAGE>
    <DESCRIPTION>جميع رموز تنظيم المخزون النشط باستثناء المؤسسات الرئيسية</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>D</LANGUAGE>
    <DESCRIPTION>Alle aktiven Inventar-Organisationscodes mit Ausnahme von Master-Organisationen</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>E</LANGUAGE>
    <DESCRIPTION>Todos los códigos de organización de inventario activos, excluyendo las organizaciones maestras</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>F</LANGUAGE>
    <DESCRIPTION>Tous les codes d&apos;organisation de l&apos;inventaire actif, à l&apos;exclusion des organisations maîtresses</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>I</LANGUAGE>
    <DESCRIPTION>Tutti i codici di organizzazione dell&apos;inventario attivi, escluse le organizzazioni master</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>JA</LANGUAGE>
    <DESCRIPTION>マスター組織を除くすべてのアクティブなインベントリ組織コード</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>KO</LANGUAGE>
    <DESCRIPTION>마스터 조직을 제외한 모든 활성 재고 조직 코드</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>PTB</LANGUAGE>
    <DESCRIPTION>Todos os códigos ativos de organização de inventário, excluindo organizações mestre</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>RU</LANGUAGE>
    <DESCRIPTION>Все действующие инвентаризационные коды организаций, за исключением основных организаций</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>S</LANGUAGE>
    <DESCRIPTION>Alla aktiva organisationskoder för inventarier exklusive huvudorganisationer</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>TR</LANGUAGE>
    <DESCRIPTION>Ana organizasyonlar hariç tüm aktif envanter organizasyon kodları</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <DESCRIPTION>All active inventory organization codes excluding master organizations</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>ZHS</LANGUAGE>
    <DESCRIPTION>所有现行清单组织代码，不包括主组织</DESCRIPTION>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: WIP Class Code (org dependent) -->
 <LOVS_ROW>
  <GUID>E7CCB27F39561272E0530100007F62B4</GUID>
  <LOV_NAME>WIP Class Code (org dependent)</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <LOV_QUERY>select distinct
wac.class_code value,
wac.description
from
mtl_parameters mp,
wip_accounting_classes wac
where
(:$flex$.organization_code is null or xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos;) and
mp.organization_id=wac.organization_id
order by
wac.class_code</LOV_QUERY>
  <LOV_TRANSLATIONS>
   <LOV_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
   </LOV_TRANSLATIONS_ROW>
  </LOV_TRANSLATIONS>
 </LOVS_ROW>
<!-- loader xml for Enginatics Blitz Report lov: WIP Job -->
 <LOVS_ROW>
  <GUID>8E2FF36EDEC379D2E0530100007F1FF2</GUID>
  <LOV_NAME>WIP Job</LOV_NAME>
  <VALIDATE_FROM_LIST>Y</VALIDATE_FROM_LIST>
  <FILTER_BEFORE_DISPLAY>Y</FILTER_BEFORE_DISPLAY>
  <LOV_QUERY>select
we.wip_entity_name value,
xxen_util.meaning(we.entity_type,&apos;WIP_ENTITY&apos;,700)||&apos; (&apos;||ood.organization_code||&apos;)&apos;||nvl2(we.description,&apos;: &apos;||we.description,null) description
from
wip_entities we,
org_organization_definitions ood
where
(:$flex$.ledger is null or ood.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
(
:$flex$.organization_code is null and ood.organization_id in (select oav.organization_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id) or
xxen_util.contains(:$flex$.organization_code,ood.organization_code)=&apos;Y&apos;
) and
we.organization_id=ood.organization_id and
nvl(ood.disable_date,sysdate)&gt;=sysdate and
we.entity_type in (1,3,5,8) --(Discrete job, Closed discrete job, Lot based job, Closed lot based job)
order by
we.creation_date desc</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: CAC WIP Jobs With Complete Status Which Are Ready for Close -->
 <REPORTS_ROW>
  <GUID>B9E8FC1CED8511DCE053BB6B6358E005</GUID>
  <SQL_TEXT>select  nvl(gl.short_name, gl.name) Ledger,
        haou2.name Operating_Unit,
        mp.organization_code Org_Code,
        -- Revision for version 1.6
        -- &apos;p_date_completed&apos; For_Completion_Date,
        wac.class_code WIP_Class,
        ml1.meaning Class_Type,
        we.wip_entity_name WIP_Job,
        ml2.meaning Job_Status,
        -- Revision for version 1.14
        wdj.date_released Date_Released,
        wdj.date_completed Date_Completed,
        wdj.last_update_date Last_Update_Date,
        wdj.completion_subinventory Completion_Subinventory,
        msiv.concatenated_segments  Assembly_Number,
        msiv.description Assembly_Description,
        -- Revision for version 1.14
        fcl.meaning Item_Type,
        misv.inventory_item_status_code Item_Status,
        ml3.meaning Make_Buy_Code,
        -- End revision for version 1.14
&amp;category_columns
        -- Revision for version 1.10
        muomv.uom_code UOM_Code,
        nvl(wdj.start_quantity, 0) Start_Quantity,
        nvl(wdj.quantity_completed, 0) Quantity_Completed,
        nvl(wdj.quantity_scrapped, 0) Quantity_Scrapped,
        nvl(wdj.quantity_completed, 0) + nvl(wdj.quantity_scrapped, 0) Total_Quantity,
        -- Check for completion quantities
        -- Revision for version 1.10, check if WIP scrap is financially recorded
        case 
          when (wdj.quantity_completed + decode(:p_include_scrap,&apos;N&apos;,0, wdj.quantity_scrapped)) = 0
                then (select fl.meaning from fnd_lookups fl where fl.lookup_type = &apos;YES_NO_ALL&apos; and fl.lookup_code = &apos;N&apos;)     -- No completion quantities
          when (wdj.start_quantity - (wdj.quantity_completed + decode(:p_include_scrap,&apos;N&apos;,0, wdj.quantity_scrapped))) = 0
                then (select fl.meaning from fnd_lookups fl where fl.lookup_type = &apos;YES_NO_ALL&apos; and fl.lookup_code = &apos;A&apos;)     -- All quantities completed
          when (wdj.start_quantity - (wdj.quantity_completed + decode(:p_include_scrap,&apos;N&apos;,0, wdj.quantity_scrapped))) &gt; 0
                then (select ml.meaning from mfg_lookups ml where ml.lookup_type = &apos;SYS_RANGE&apos; and ml.lookup_code = 2)        -- Partial quantities completed
         else  (select fl.meaning from fnd_lookups fl where fl.lookup_type = &apos;YES_NO_ALL&apos; and fl.lookup_code = &apos;A&apos;)            -- All quantities completed
        end Quantities_Completed,
         -- Revision for version 1.10, check for WIP with material quantities not issued
        (select max(fl.meaning)
         from   wip_requirement_operations wro,
                mtl_system_items_b msi,
                wip_parameters wp,
                fnd_lookups fl
         where  wro.wip_entity_id        = wdj.wip_entity_id 
         and    wro.organization_id      = wdj.organization_id
         and    msi.organization_id      = wro.organization_id
         and    msi.inventory_item_id    = wro.inventory_item_id
         -- Only want to check valued items, not expense items
         and    msi.inventory_asset_flag = &apos;Y&apos;
         and    wp.organization_id       = wdj.organization_id
         and    fl.lookup_type           = &apos;YES_NO&apos;
         and    fl.lookup_code           = &apos;Y&apos;
         -- Revision for version 1.12
         and    2=2                      -- Include WIP bulk supply types
         -- Revision for version 1.13
         and    wro.wip_supply_type &lt;&gt; 6 -- Phantom
         -- Calculate the quantity required based on the completion quantities
         -- Use the completion quantities with scrap quantities unless scrap is not financially recorded
         -- Basis of 2 indicates the component is issued per lot not per assembly and the component yield factor is ignored
         having round(sum(decode(wro.basis_type,
                                 null, nvl(wro.quantity_per_assembly, 0) * 1 / nvl(wro.component_yield_factor, 1) *
                                          (nvl(wdj.quantity_completed, 0) + decode(:p_include_scrap,&apos;N&apos;,0,nvl(wdj.quantity_scrapped, 0))),
                                 1,    nvl(wro.quantity_per_assembly, wdj.start_quantity) * 1 / nvl(wro.component_yield_factor, 1) *
                                          (nvl(wdj.quantity_completed, 0) + decode(:p_include_scrap,&apos;N&apos;,0,nvl(wdj.quantity_scrapped, 0))),
                                 2,    nvl(wro.required_quantity,1),
                                       nvl(wro.quantity_per_assembly, 0) * 1 / nvl(wro.component_yield_factor, 1) *
                                          (nvl(wdj.quantity_completed, 0) + decode(:p_include_scrap,&apos;N&apos;,0,nvl(wdj.quantity_scrapped, 0)))
                                )
                         )
                   ,3) - round(sum(nvl(wro.quantity_issued, 0)),3) &gt; 0
        ) Open_Material_Quantities,  -- Quantity_Left_in_WIP
        -- End of revision for version 1.10
        -- Check for WIP Operation Resources with no earned OSP
        -- Revision for version 1.3
        -- nvl((select &apos;Yes&apos;
        (select max(fl.meaning)
         from   wip_operation_resources wor,
                fnd_lookups fl
         where  wor.wip_entity_id = wdj.wip_entity_id 
         and    wor.organization_id = wdj.organization_id
         and    wor.autocharge_type in ( 3, 4 ) -- 3 = &apos;PO receipt&apos; and 4 =  &apos;PO move&apos; 
         and    nvl(wor.applied_resource_units,0) = 0
         and    fl.lookup_type           = &apos;YES_NO&apos;
         and    fl.lookup_code           = &apos;Y&apos;
        ) No_Earned_OSP,
        gl.currency_code Currency_Code,
        round(
        sum(nvl(wpb.pl_material_in,0)-
            nvl(wpb.tl_material_out,0)-
            nvl(wpb.pl_material_out,0)-
            nvl(wpb.tl_material_var,0)-
            nvl(wpb.pl_material_var,0) +
        -- Material Overhead Balance 
            nvl(wpb.pl_material_overhead_in,0)-
            nvl(wpb.tl_material_overhead_out,0)-
            nvl(wpb.pl_material_overhead_out,0)-
            nvl(wpb.tl_material_overhead_var,0)-
            nvl(wpb.pl_material_overhead_var,0) +
        -- Resource Balance
            nvl(wpb.tl_resource_in,0)+
            nvl(wpb.pl_resource_in,0)-
            nvl(wpb.tl_resource_out,0)-
            nvl(wpb.pl_resource_out,0)-
            nvl(wpb.tl_resource_var,0)-
            nvl(wpb.pl_resource_var,0)+
        -- Outside Processing Balance
            nvl(wpb.tl_outside_processing_in,0)+
            nvl(wpb.pl_outside_processing_in,0)-
            nvl(wpb.tl_outside_processing_out,0)-
            nvl(wpb.pl_outside_processing_out,0)-
            nvl(wpb.tl_outside_processing_var,0)-
            nvl(wpb.pl_outside_processing_var,0) +
        -- Overhead Balance
            nvl(wpb.tl_overhead_in,0)+
            nvl(wpb.pl_overhead_in,0)-
            nvl(wpb.tl_overhead_out,0)-
            nvl(wpb.pl_overhead_out,0)-
            nvl(wpb.tl_overhead_var,0)-
            nvl(wpb.pl_overhead_var,0) +
        -- Estimated Scrap Balances
            nvl(wpb.tl_scrap_in,0)-
            nvl(wpb.tl_scrap_out,0)-
            nvl(wpb.tl_scrap_var,0)
        ),2) WIP_Value,
        -- Revision for version 1.15
        round(
                sum(nvl(wpb.pl_material_in,0)+
                    nvl(wpb.pl_material_overhead_in,0)+
                    nvl(wpb.tl_resource_in,0)+
                    nvl(wpb.pl_resource_in,0)+
                    nvl(wpb.tl_outside_processing_in,0)+
                    nvl(wpb.pl_outside_processing_in,0)+
                    nvl(wpb.tl_overhead_in,0)+
                    nvl(wpb.pl_overhead_in,0)+
                    nvl(wpb.tl_scrap_in,0)
                   )
              ) WIP_Costs_In,
        -- WIP variance percentage = WIP Net Value / WIP Costs In
        -- WIP Net Value
        round(
                sum(nvl(wpb.pl_material_in,0)-
                    nvl(wpb.tl_material_out,0)-
                    nvl(wpb.pl_material_out,0)-
                    nvl(wpb.tl_material_var,0)-
                    nvl(wpb.pl_material_var,0) +
                -- Material Overhead Balance 
                    nvl(wpb.pl_material_overhead_in,0)-
                    nvl(wpb.tl_material_overhead_out,0)-
                    nvl(wpb.pl_material_overhead_out,0)-
                    nvl(wpb.tl_material_overhead_var,0)-
                    nvl(wpb.pl_material_overhead_var,0) +
                -- Resource Balance
                    nvl(wpb.tl_resource_in,0)+
                    nvl(wpb.pl_resource_in,0)-
                    nvl(wpb.tl_resource_out,0)-
                    nvl(wpb.pl_resource_out,0)-
                    nvl(wpb.tl_resource_var,0)-
                    nvl(wpb.pl_resource_var,0)+
                -- Outside Processing Balance
                    nvl(wpb.tl_outside_processing_in,0)+
                    nvl(wpb.pl_outside_processing_in,0)-
                    nvl(wpb.tl_outside_processing_out,0)-
                    nvl(wpb.pl_outside_processing_out,0)-
                    nvl(wpb.tl_outside_processing_var,0)-
                    nvl(wpb.pl_outside_processing_var,0) +
                -- Overhead Balance
                    nvl(wpb.tl_overhead_in,0)+
                    nvl(wpb.pl_overhead_in,0)-
                    nvl(wpb.tl_overhead_out,0)-
                    nvl(wpb.pl_overhead_out,0)-
                    nvl(wpb.tl_overhead_var,0)-
                    nvl(wpb.pl_overhead_var,0) +
                -- Estimated Scrap Balances
                    nvl(wpb.tl_scrap_in,0)-
                    nvl(wpb.tl_scrap_out,0)-
                    nvl(wpb.tl_scrap_var,0)
                   ) /
        decode(
                sum(nvl(wpb.pl_material_in,0)+
                    nvl(wpb.pl_material_overhead_in,0)+
                    nvl(wpb.tl_resource_in,0)+
                    nvl(wpb.pl_resource_in,0)+
                    nvl(wpb.tl_outside_processing_in,0)+
                    nvl(wpb.pl_outside_processing_in,0)+
                    nvl(wpb.tl_overhead_in,0)+
                    nvl(wpb.pl_overhead_in,0)+
                    nvl(wpb.tl_scrap_in,0)
                   ), 0, 1,
                sum(nvl(wpb.pl_material_in,0)+
                    nvl(wpb.pl_material_overhead_in,0)+
                    nvl(wpb.tl_resource_in,0)+
                    nvl(wpb.pl_resource_in,0)+
                    nvl(wpb.tl_outside_processing_in,0)+
                    nvl(wpb.pl_outside_processing_in,0)+
                    nvl(wpb.tl_overhead_in,0)+
                    nvl(wpb.pl_overhead_in,0)+
                    nvl(wpb.tl_scrap_in,0)
                   )
              )
           ,3) * 100 WIP_Variance_Percent,
        -- End revision for version 1.15
        -- Check for Unprocessed Material
        -- Revision for version 1.3
        -- nvl((select &apos;Yes&apos; 
        (select max(fl.meaning)
         from   mtl_material_transactions_temp mmtt,
                fnd_lookups fl
         where  mmtt.organization_id       = wdj.organization_id
         and    mmtt.transaction_source_type_id = 5
         and    mmtt.transaction_source_id = wdj.wip_entity_id
         and    fl.lookup_type             = &apos;YES_NO&apos;
         and    fl.lookup_code             = &apos;Y&apos;
        ) Unprocessed_Material,
        -- Check for Uncosted Material
        -- Revision for version 1.3
        -- nvl((select &apos;Yes&apos; 
        (select max(fl.meaning)
         from   mtl_material_transactions mmt1,
                fnd_lookups fl
         where  mmt1.transaction_source_id = wdj.wip_entity_id 
         and    mmt1.organization_id       = wdj.organization_id
         and    mmt1.transaction_source_type_id = 5
         and    mmt1.costed_flag is not null
         and    fl.lookup_type             = &apos;YES_NO&apos;
         and    fl.lookup_code             = &apos;Y&apos;
        ) Uncosted_Material,
        -- Check for Pending WIP Costing
        -- Revision for version 1.3
        -- nvl((select &apos;Yes&apos; 
        (select max(fl.meaning)
         from   wip_cost_txn_interface wcti,
                fnd_lookups fl
         where  wcti.wip_entity_id         = wdj.wip_entity_id 
         and    wcti.organization_id       = wdj.organization_id
         and    fl.lookup_type             = &apos;YES_NO&apos;
         and    fl.lookup_code             = &apos;Y&apos;
        ) Pending_WIP_Costing,
        -- Check for Pending Receiving
        -- Revision for version 1.3
        -- nvl((select &apos;Yes&apos; 
        (select max(fl.meaning)
         from   rcv_transactions_interface rti,
                fnd_lookups fl
         where  rti.wip_entity_id          = wdj.wip_entity_id 
         and    rti.to_organization_id     = wdj.organization_id
         and    fl.lookup_type             = &apos;YES_NO&apos;
         and    fl.lookup_code             = &apos;Y&apos;
        ) Pending_Receiving,
        -- Revision for version 1.3
        -- Check for Pending Purchase Requisitions
        (select max(fl.meaning)
         from   po_requisitions_interface pri,
                wip_operation_resources wor,
                fnd_lookups fl
         where  pri.wip_entity_id          = wdj.wip_entity_id 
         and    pri.destination_organization_id = wdj.organization_id
         and    wor.wip_entity_id          = wdj.wip_entity_id 
         and    wor.organization_id        = wdj.organization_id
         and    wor.autocharge_type in ( 3, 4 ) -- 3 = &apos;PO receipt&apos; and 4 =  &apos;PO move&apos; 
         -- Only for jobs with no applied resource units, to avoid
         -- selecting duplicate purchase requisition interface entries
         and    nvl(wor.applied_resource_units,0) = 0
         and    fl.lookup_type             = &apos;YES_NO&apos;
         and    fl.lookup_code             = &apos;Y&apos;
        ) Pending_Requisitions,
        -- Check for Pending Material
        -- Revision for version 1.3
        -- nvl((select &apos;Yes&apos; 
        (select max(fl.meaning)
         from   mtl_transactions_interface mti,
                -- Revision for version 1.16
                -- wip_discrete_jobs wdj,
                fnd_lookups fl
         where  mti.transaction_source_id  = wdj.wip_entity_id 
         and    mti.organization_id        = wdj.organization_id
         and    mti.transaction_source_type_id = 5
         and    fl.lookup_type             = &apos;YES_NO&apos;
         and    fl.lookup_code             = &apos;Y&apos;
        ) Pending_Material,
        -- Check for Pending Shop Floor Move
        -- Revision for version 1.3
        -- nvl((select &apos;Yes&apos; 
        (select max(fl.meaning)
         from   wip_move_txn_interface wmti,
                -- Revision for version 1.16
                -- wip_discrete_jobs wdj,
                fnd_lookups fl
         where  wmti.wip_entity_id         = wdj.wip_entity_id 
         and    wmti.organization_id       = wdj.organization_id
         and    fl.lookup_type             = &apos;YES_NO&apos;
         and    fl.lookup_code             = &apos;Y&apos;
        ) Pending_Shop_Floor_Move,
        -- Check for WSM Split Merge Transactions
         -- Uncosted WSM starting jobs
         -- Uncosted WSM resulting jobs
        (select max(fl.meaning)
         from   wsm_split_merge_transactions wsmt,
                wsm_sm_starting_jobs wssj, 
                wsm_sm_resulting_jobs wsrj,
                fnd_lookups fl
         where  ((wssj.wip_entity_id = wdj.wip_entity_id and wssj.organization_id = wdj.organization_id and wsmt.transaction_id = wssj.transaction_id)
                  or
                 (wsrj.wip_entity_id = wdj.wip_entity_id and wsrj.organization_id = wdj.organization_id and wsmt.transaction_id = wsrj.transaction_id) 
                )
         and    wsmt.costed &lt;&gt; 4
         and    fl.lookup_type             = &apos;YES_NO&apos;
         and    fl.lookup_code             = &apos;Y&apos;
        ) Uncosted_Split_Merge_Txn, 
        -- Check for WSM Split Merge Transactions
         -- Pending WSM Jobs Interface - starting_jobs
         -- Pending WSM Jobs Interface - resulting_jobs
        (select max(fl.meaning)
         from   wsm_split_merge_txn_interface wsmti,
                wsm_starting_jobs_interface wsji, 
                wsm_resulting_jobs_interface wrji,
                fnd_lookups fl
         where  ((      wsji.wip_entity_id   = wdj.wip_entity_id
                  and   wsji.organization_id = wdj.organization_id
                  and   wsmti.header_id      = wsji.header_id
                 )
                  or
                 (      wrji.wip_entity_name = we.wip_entity_name 
                  and   wrji.organization_id = we.organization_id
                  and   wsmti.header_id      = wrji.header_id
                 )
                )
         and    wsmti.process_status &lt;&gt; 4
         and    fl.lookup_type               = &apos;YES_NO&apos;
         and    fl.lookup_code               = &apos;Y&apos;
        ) Unprocessed_WSM_Txn_Interface,
        -- Check for Pending WSM Lots Interface - resulting_lots
        -- Revision for version 1.3
        -- nvl((select &apos;Yes&apos; 
        (select max(fl.meaning)
         from   wsm_resulting_lots_interface wrli, 
                wsm_lot_split_merges_interface wlsmi,
                fnd_lookups fl
         where  wrli.wip_entity_id        = wdj.wip_entity_id
         and    wrli.organization_id      = wdj.organization_id
         and    wlsmi.header_id           = wrli.header_id
         and    wlsmi.wip_flag            = 1
         and    wlsmi.process_status     &lt;&gt; 4
         and    fl.lookup_type            = &apos;YES_NO&apos;
         and    fl.lookup_code            = &apos;Y&apos;
        ) Pending_Resulting_Lots,
        --Check for WSM_Lot_Job_Interface
        (select max(fl.meaning)
         from   wsm_lot_job_interface wlji,
                fnd_lookups fl
         where  wlji.wip_entity_id       = wdj.wip_entity_id
         and    wlji.organization_id     = wdj.organization_id
         and    wlji.process_status     &lt;&gt; 4
         and    fl.lookup_type           = &apos;YES_NO&apos;
         and    fl.lookup_code           = &apos;Y&apos;
        ) Pending_WSM_Job_Lots
from    wip_discrete_jobs wdj, 
        wip_entities we, 
        mtl_parameters mp, 
        -- Revision for version 1.10
        wip_parameters wp,
        wip_period_balances wpb,
        wip_accounting_classes wac,
        mtl_system_items_vl msiv,
        -- Revision for version 1.10
        mtl_units_of_measure_vl muomv,
        mfg_lookups ml1, -- Class Type
        mfg_lookups ml2, -- Job Status
        -- Revision for version 1.14
        mfg_lookups ml3, -- Planning Make Buy
        fnd_common_lookups fcl,
        mtl_item_status_vl misv,
        -- End revision for version 1.14
        hr_organization_information hoi,
        hr_all_organization_units_vl haou,
        hr_all_organization_units_vl haou2,
        gl_ledgers gl,
        (-- Revision for version 1.4
         -- Add a group by, need one row per WIP Entity ID
         -- to avoid cross-joining
         -- Revision for version 1.1 
         -- Interface select statements for WIP Jobs
         -- Check for Unprocessed Material
         select wip_interface_errs.wip_entity_id
         from   (
                 select wcti.wip_entity_id wip_entity_id
                 from   wip_cost_txn_interface wcti
                 union all
                 -- Check for Pending Receiving
                 select rti.wip_entity_id
                 from   rcv_transactions_interface rti
                 where  rti.wip_entity_id is not null
                 union all
                 -- Check for Pending Material
                 select mti.transaction_source_id
                 from   mtl_transactions_interface mti
                 where  mti.transaction_source_type_id = 5
                 union all
                 -- Check for Pending Shop Floor Move
                 select wmti.wip_entity_id
                 from   wip_move_txn_interface wmti
                 union all
                 -- Check for WSM Split Merge Transactions
                 select  WSM.wip_entity_id
                 from        
                        -- Uncosted WSM starting jobs
                        (select wssj.wip_entity_id wip_entity_id
                         from   wsm_sm_starting_jobs wssj, 
                                wsm_split_merge_transactions wsmt
                         where  wsmt.transaction_id = wssj.transaction_id
                         and    wsmt.costed &lt;&gt; 4
                         union all
                         -- Uncosted WSM resulting jobs
                         select wsrj.wip_entity_id wip_entity_id
                         from   wsm_sm_resulting_jobs wsrj, 
                                wsm_split_merge_transactions wsmt
                         where  wsmt.transaction_id   = wsrj.transaction_id
                         and    wsmt.costed          &lt;&gt; 4 
                        ) WSM
                 union all
                 -- Check for WSM Split Merge Interface Transactions
                 select  WSMI.wip_entity_id
                 from        
                        -- Pending WSM Jobs Interface - starting_jobs
                        (select wsji.wip_entity_id wip_entity_id
                         from   wsm_starting_jobs_interface wsji, 
                                wsm_split_merge_txn_interface wsmti
                         where  wsmti.header_id = wsji.header_id
                         and    wsmti.process_status &lt;&gt; 4
                        union all
                        -- Pending WSM Jobs Interface - resulting_jobs
                         select we.wip_entity_id wip_entity_id
                         from   wip_entities we, 
                                wsm_resulting_jobs_interface wrji, 
                                wsm_split_merge_txn_interface wsmti
                         where  wrji.wip_entity_name = we.wip_entity_name
                         and    wrji.organization_id = we.organization_id
                         and    wsmti.header_id = wrji.header_id
                         and    wsmti.process_status &lt;&gt; 4
                        ) WSMI
                 union all
                 -- Check for Pending WSM Lots Interface - resulting_lots
                 select wrli.wip_entity_id
                 from   wsm_resulting_lots_interface wrli, 
                        wsm_lot_split_merges_interface wlsmi
                 where  wlsmi.header_id = wrli.header_id
                 and    wlsmi.wip_flag = 1
                 and    wlsmi.process_status &lt;&gt; 4
                 union all
                 --Check for WSM_Lot_Job_Interface
                 select wlji.wip_entity_id
                 from   wsm_lot_job_interface wlji
                 where  wlji.process_status &lt;&gt; 4
                 -- Revision for version 1.3
                 union all
                 -- Check for Pending Purchase Requisitions
                 select pri.wip_entity_id
                 from   po_requisitions_interface pri,
                        wip_operation_resources wor,
                        wip_discrete_jobs wdj
                 where  pri.wip_entity_id = wor.wip_entity_id  
                 and    pri.destination_organization_id = wor.organization_id
                 and    wor.autocharge_type in ( 3, 4 ) -- 3 = &apos;PO receipt&apos; and 4 =  &apos;PO move&apos; 
                 -- Only for jobs with no applied resource units, to avoid
                 -- selecting duplicate purchase requisition interface entries
                 and    nvl(wor.applied_resource_units,0) = 0
                 and    wdj.wip_entity_id = wor.wip_entity_id
                 and    wdj.date_closed is null
                 -- End revision for version 1.3
                ) wip_interface_errs
                 group by wip_interface_errs.wip_entity_id
        ) wip_interfaces
-- WIP Joins
where   wdj.date_completed is not null -- wdj.status_type = 4
and     wdj.date_closed is null
and     wdj.status_type                  = 4 -- Complete
and     we.wip_entity_id                 = wdj.wip_entity_id
and     mp.organization_id               = wdj.organization_id
-- Revision for version 1.10
and     wp.organization_id               = wdj.organization_id
and     wpb.wip_entity_id                = wdj.wip_entity_id
and     wpb.organization_id              = wdj.organization_id
and     wac.class_code                   = wdj.class_code
and     wac.organization_id              = wdj.organization_id
and     wac.class_type in (1,3,5) 
-- ================================
-- 1 Standard Discrete 
-- 2 Repetitive Assembly 
-- 3 Asset Non-standard 
-- 4 Expense Non-standard 
-- 5 Standard Lot Based 
-- 6 Maintenance 
-- 7 Expense Non-standard Lot Based
-- ================================
-- WIP Joins to WIP Interfaces
and     wip_interfaces.wip_entity_id (+) = wdj.wip_entity_id
-- Item Master Joins
and     msiv.organization_id             = wdj.organization_id
and     msiv.inventory_item_id           = wdj.primary_item_id
-- Revision for version 1.14
and     msiv.inventory_item_status_code  = misv.inventory_item_status_code
-- Revision for version 1.10
and     msiv.primary_uom_code            = muomv.uom_code
-- Lookup Joins
and     ml1.lookup_type                  = &apos;WIP_CLASS_TYPE&apos;
and     ml1.lookup_code                  = wac.class_type
and     ml2.lookup_type                  = &apos;WIP_JOB_STATUS&apos;
and     ml2.lookup_code                  = wdj.status_type
-- Revision for version 1.14
and     ml3.lookup_type                 = &apos;MTL_PLANNING_MAKE_BUY&apos;
and     ml3.lookup_code                 = msiv.planning_make_buy_code
and     fcl.lookup_type (+)             = &apos;ITEM_TYPE&apos;
and     fcl.lookup_code (+)             = msiv.item_type
-- End revision for version 1.14
-- ===========================================
-- Organization joins to the HR org model
-- ===========================================
and     hoi.org_information_context      = &apos;Accounting Information&apos;
and     hoi.organization_id              = mp.organization_id
and     hoi.organization_id              = haou.organization_id   -- this gets the organization name
and     haou2.organization_id            = to_number(hoi.org_information3) -- this gets the operating unit id
and     gl.ledger_id                     = to_number(hoi.org_information1) -- get the ledger_id
-- Revision for version 1.16
and     mp.organization_id in (select oav.organization_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id)
and     1=1                              -- p_assembly_number, p_wip_job, p_wip_class_code, p_org_code, p_operating_unit, p_ledger
-- Same joins as the view
-- Quantities Completed
and     (wdj.start_quantity - (wdj.quantity_completed + decode(:p_include_scrap,&apos;N&apos;,0, wdj.quantity_scrapped))) &lt;= 0
-- Unprocessed Material
and not exists 
        (select 1
         from   mtl_material_transactions_temp mmtt
         where  mmtt.organization_id            = wdj.organization_id
         and    mmtt.transaction_source_type_id = 5
         and    mmtt.transaction_source_id      = wdj.wip_entity_id)
-- Uncosted Material
and not exists 
        (select 1
         from   mtl_material_transactions mmt1
         where  mmt1.transaction_source_id      = wdj.wip_entity_id 
         and    mmt1.organization_id            = wdj.organization_id
         and    mmt1.transaction_source_type_id = 5
         and    mmt1.costed_flag is not null)
-- Uncosted WSM starting_jobs
and not exists
        (select 1
         from   wsm_sm_starting_jobs wssj, 
                wsm_split_merge_transactions wsmt
         where  wssj.wip_entity_id              = wdj.wip_entity_id 
         and    wssj.organization_id            = wdj.organization_id
         and    wsmt.transaction_id             = wssj.transaction_id
         and    wsmt.costed                    &lt;&gt; 4)
-- Uncosted WSM resulting_jobs
and not exists
        (select 1
         from   wsm_sm_resulting_jobs wsrj, 
                wsm_split_merge_transactions wsmt
         where  wsrj.wip_entity_id              = wdj.wip_entity_id 
         and    wsrj.organization_id            = wdj.organization_id
         and    wsmt.transaction_id             = wsrj.transaction_id
         and    wsmt.costed                    &lt;&gt; 4)
-- Pending WIP Costing
and not exists
        (select 1
         from   wip_cost_txn_interface wcti
         where  wcti.wip_entity_id              = wdj.wip_entity_id 
         and    wcti.organization_id            = wdj.organization_id )
-- Pending WSM Jobs Interface - starting_jobs
and not exists
        (select 1
         from   wsm_starting_jobs_interface wsji, 
                wsm_split_merge_txn_interface wsmti
         where  wsji.wip_entity_id              = wdj.wip_entity_id 
         and    wsji.organization_id            = wdj.organization_id
         and    wsmti.header_id                 = wsji.header_id
         and    wsmti.process_status           &lt;&gt; 4)
-- Pending WSM Jobs Interface - resulting_jobs
and not exists
        (select 1
         from   wsm_resulting_jobs_interface wrji, 
                wsm_split_merge_txn_interface wsmti
         where  we.wip_entity_id                = wdj.wip_entity_id
         and    wrji.wip_entity_name            = we.wip_entity_name 
         and    wrji.organization_id            = we.organization_id
         and    wsmti.header_id                 = wrji.header_id
         and    wsmti.process_status           &lt;&gt; 4)
-- Pending WSM Lots Interface - resulting_lots
and not exists
        (select 1
         from   wsm_resulting_lots_interface wrli, 
                wsm_lot_split_merges_interface wlsmi
         where  wrli.wip_entity_id              = wdj.wip_entity_id
         and    wrli.organization_id            = wdj.organization_id
         and    wlsmi.header_id                 = wrli.header_id
         and    wlsmi.wip_flag                  = 1
         and    wlsmi.process_status           &lt;&gt; 4)
-- WSM_Lot_Job_Interface
and not exists
        (select 1
         from   wsm_lot_job_interface wlji
         where  wlji.wip_entity_id              = wdj.wip_entity_id
         and    wlji.organization_id            = wdj.organization_id
         and    wlji.process_status            &lt;&gt; 4)
-- Pending Receiving
and not exists
        (select 1
         from   rcv_transactions_interface rti
         where  rti.wip_entity_id               = wdj.wip_entity_id 
         and    rti.to_organization_id          = wdj.organization_id )
-- Pending Material
and not exists
        (select 1
         from   mtl_transactions_interface mti
         where  mti.transaction_source_id       = wdj.wip_entity_id 
         and    mti.organization_id             = wdj.organization_id
         and    mti.transaction_source_type_id  = 5
         and    process_flag &lt;&gt; 9)
-- Pending Shop Floor Move
and not exists 
        (select 1
         from   wip_move_txn_interface wmti
         where  wmti.wip_entity_id              = wdj.wip_entity_id 
         and    wmti.organization_id            = wdj.organization_id)
-- WIP Operation Resources with no earned OSP
and not exists 
        (select 1
         from   wip_operation_resources wor
         where  wor.wip_entity_id               = wdj.wip_entity_id
         and    wor.organization_id             = wdj.organization_id
         and    wor.autocharge_type in ( 3, 4 )
         and    nvl(wor.applied_resource_units,0) = 0)
-- WIP with material quantities not issued
and not exists 
        (select 1
         from   wip_requirement_operations wro,
                mtl_system_items_b msi,
                wip_parameters wp
         where  wro.wip_entity_id        = wdj.wip_entity_id 
         and    wro.organization_id      = wdj.organization_id
         and    msi.organization_id      = wro.organization_id
         and    msi.inventory_item_id    = wro.inventory_item_id
         -- Only want to check valued items, not expense items
         and    msi.inventory_asset_flag = &apos;Y&apos;
         and    wp.organization_id       = wdj.organization_id
         -- Revision for version 1.12
         and    2=2                      -- Include WIP bulk supply types
         -- Revision for version 1.13
         and    wro.wip_supply_type     &lt;&gt; 6 -- Phantom
         -- Calculate the quantity required based on the completion quantities
         -- Use the completion quantities with scrap quantities unless scrap is not financially recorded
         -- Basis of 2 indicates the component is issued per lot not per assembly and the component yield factor is ignored
         and    round(decode(wro.basis_type,
                                null, nvl(wro.quantity_per_assembly, 0) * 1 / nvl(wro.component_yield_factor, 1) *
                                         (nvl(wdj.quantity_completed, 0) + decode(:p_include_scrap,&apos;N&apos;,0,nvl(wdj.quantity_scrapped, 0))),
                                1,    nvl(wro.quantity_per_assembly, wdj.start_quantity) * 1 / nvl(wro.component_yield_factor, 1) *
                                         (nvl(wdj.quantity_completed, 0) + decode(:p_include_scrap,&apos;N&apos;,0,nvl(wdj.quantity_scrapped, 0))),
                                2,    nvl(wro.required_quantity,1),
                                      nvl(wro.quantity_per_assembly, 0) * 1 / nvl(wro.component_yield_factor, 1) *
                                         (nvl(wdj.quantity_completed, 0) + decode(:p_include_scrap,&apos;N&apos;,0,nvl(wdj.quantity_scrapped, 0)))
                            )
                   ,3) - round(nvl(wro.quantity_issued, 0),3) &gt; 0 -- Quantity_Left_in_WIP
        )
group by
        nvl(gl.short_name, gl.name),
        haou2.name,
        mp.organization_code,
        -- Revision for version 1.6
        -- &apos;p_date_completed&apos;,
        we.wip_entity_name,
        wac.class_code,
        ml1.meaning, -- Class Type
        we.wip_entity_name,
        we.organization_id,
        ml2.meaning, -- Job Status
        -- Revision for version 1.14
        wdj.date_released,
        -- Revision for version 1.2
        -- decode(wdj.attribute15, null, &apos;No&apos;, &apos;Yes&apos;),
        wdj.date_completed,
        wdj.last_update_date,
        wdj.completion_subinventory,
        msiv.concatenated_segments,
        msiv.description,
        -- Revision for version 1.14
        fcl.meaning, -- Item Type
        misv.inventory_item_status_code, -- Item Status
        ml3.meaning, -- Make Buy Code
        -- End revision for version 1.14
        wdj.start_quantity,
        wdj.quantity_completed,
        wdj.quantity_scrapped,
        wp.mandatory_scrap_flag,
        -- Revision for version 1.10
        muomv.uom_code,
        gl.currency_code,
        -- Needed for inline queries
        msiv.inventory_item_id,
        msiv.organization_id,
        wdj.organization_id,
        wdj.wip_entity_id,
        -- Revision for version 1.1
        wip_interfaces.wip_entity_id
-- ===========================================
-- Check for variance tolerances
-- ===========================================
having  abs(sum(nvl(wpb.pl_material_in,0)-
            nvl(wpb.tl_material_out,0)-
            nvl(wpb.pl_material_out,0)-
            nvl(wpb.tl_material_var,0)-
            nvl(wpb.pl_material_var,0) +
        -- Material Overhead Balance 
            nvl(wpb.pl_material_overhead_in,0)-
            nvl(wpb.tl_material_overhead_out,0)-
            nvl(wpb.pl_material_overhead_out,0)-
            nvl(wpb.tl_material_overhead_var,0)-
            nvl(wpb.pl_material_overhead_var,0) +
        -- Resource Balance
            nvl(wpb.tl_resource_in,0)+
            nvl(wpb.pl_resource_in,0)-
            nvl(wpb.tl_resource_out,0)-
            nvl(wpb.pl_resource_out,0)-
            nvl(wpb.tl_resource_var,0)-
            nvl(wpb.pl_resource_var,0)+
        -- Outside Processing Balance
            nvl(wpb.tl_outside_processing_in,0)+
            nvl(wpb.pl_outside_processing_in,0)-
            nvl(wpb.tl_outside_processing_out,0)-
            nvl(wpb.pl_outside_processing_out,0)-
            nvl(wpb.tl_outside_processing_var,0)-
            nvl(wpb.pl_outside_processing_var,0) +
        -- Overhead Balance
            nvl(wpb.tl_overhead_in,0)+
            nvl(wpb.pl_overhead_in,0)-
            nvl(wpb.tl_overhead_out,0)-
            nvl(wpb.pl_overhead_out,0)-
            nvl(wpb.tl_overhead_var,0)-
            nvl(wpb.pl_overhead_var,0) +
        -- Estimated Scrap Balances
            nvl(wpb.tl_scrap_in,0)-
            nvl(wpb.tl_scrap_out,0)-
            -- Revision for version 1.6
            nvl(wpb.tl_scrap_var,0))) &lt;  :p_wip_var_threshold
-- Revision for version 1.15
and     -- Revision for version 1.15
        -- WIP variance percentage = WIP Net Value / WIP Costs In
        -- WIP Net Value
        abs(round(
                sum(nvl(wpb.pl_material_in,0)-
                    nvl(wpb.tl_material_out,0)-
                    nvl(wpb.pl_material_out,0)-
                    nvl(wpb.tl_material_var,0)-
                    nvl(wpb.pl_material_var,0) +
                -- Material Overhead Balance 
                    nvl(wpb.pl_material_overhead_in,0)-
                    nvl(wpb.tl_material_overhead_out,0)-
                    nvl(wpb.pl_material_overhead_out,0)-
                    nvl(wpb.tl_material_overhead_var,0)-
                    nvl(wpb.pl_material_overhead_var,0) +
                -- Resource Balance
                    nvl(wpb.tl_resource_in,0)+
                    nvl(wpb.pl_resource_in,0)-
                    nvl(wpb.tl_resource_out,0)-
                    nvl(wpb.pl_resource_out,0)-
                    nvl(wpb.tl_resource_var,0)-
                    nvl(wpb.pl_resource_var,0)+
                -- Outside Processing Balance
                    nvl(wpb.tl_outside_processing_in,0)+
                    nvl(wpb.pl_outside_processing_in,0)-
                    nvl(wpb.tl_outside_processing_out,0)-
                    nvl(wpb.pl_outside_processing_out,0)-
                    nvl(wpb.tl_outside_processing_var,0)-
                    nvl(wpb.pl_outside_processing_var,0) +
                -- Overhead Balance
                    nvl(wpb.tl_overhead_in,0)+
                    nvl(wpb.pl_overhead_in,0)-
                    nvl(wpb.tl_overhead_out,0)-
                    nvl(wpb.pl_overhead_out,0)-
                    nvl(wpb.tl_overhead_var,0)-
                    nvl(wpb.pl_overhead_var,0) +
                -- Estimated Scrap Balances
                    nvl(wpb.tl_scrap_in,0)-
                    nvl(wpb.tl_scrap_out,0)-
                    nvl(wpb.tl_scrap_var,0)
                   ) /
        -- WIP Costs In
        decode(
                sum(nvl(wpb.pl_material_in,0)+
                    nvl(wpb.pl_material_overhead_in,0)+
                    nvl(wpb.tl_resource_in,0)+
                    nvl(wpb.pl_resource_in,0)+
                    nvl(wpb.tl_outside_processing_in,0)+
                    nvl(wpb.pl_outside_processing_in,0)+
                    nvl(wpb.tl_overhead_in,0)+
                    nvl(wpb.pl_overhead_in,0)+
                    nvl(wpb.tl_scrap_in,0)
                   ), 0, 1,
                sum(nvl(wpb.pl_material_in,0)+
                    nvl(wpb.pl_material_overhead_in,0)+
                    nvl(wpb.tl_resource_in,0)+
                    nvl(wpb.pl_resource_in,0)+
                    nvl(wpb.tl_outside_processing_in,0)+
                    nvl(wpb.pl_outside_processing_in,0)+
                    nvl(wpb.tl_overhead_in,0)+
                    nvl(wpb.pl_overhead_in,0)+
                    nvl(wpb.tl_scrap_in,0)
                   )
              )
           ,3)) * 100 &lt;  :p_wip_var_percent</SQL_TEXT>
  <ENABLED>Y</ENABLED>
  <NUMBER_FORMAT>#,##0.00000;[Red](#,##0.00000)</NUMBER_FORMAT>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>CAC WIP Jobs With Complete Status Which Are Ready for Close</REPORT_NAME>
    <DESCRIPTION>Report WIP jobs which have a status of &quot;Complete&quot;, do not exceed variance tolerances, have completed or exceeded the WIP start quantity, with no open material requirements, no unearned OSP (outside processing) charges and no stuck transactions in interfaces.  When you include scrap quantities, any scrapped assemblies are counted with the completed units.  Note that for material requirements, expense items are ignored.

Parameters:
==========
Variance Amount Threshold:  maximum absolute WIP variance or current job balance that is allowed for jobs you wish to close (required).
Variance Percent Threshold: maximum absolute WIP variance percentage that is allowed for jobs you wish to close.  Based on WIP Job Balance / WIP Costs In. (required).
Include Scrap Quantities:  include scrapped assemblies in completion and component material requirements (required).
Include Bulk Supply Items:  include bulk WIP supply types in the component requirements (required).
Category Set 1:  any item category you wish, typically the Cost or Product Line category set (optional).
Category Set 2:  any item category you wish, typically the Inventory category set (optional).
Organization Code:  enter the specific inventory organization(s) you wish to report (optional).
Class Code:  enter the WIP class code to report (optional).
WIP Job:  enter the WIP Job to report (optional).
Assembly Number:  enter the specific assembly number(s) you wish to report (optional).
Operating Unit:  enter the specific operating unit(s) you wish to report (optional).
Ledger:  enter the specific ledger(s) you wish to report (optional).

/* +=============================================================================+
-- |  Copyright 2017 - 2024 Douglas Volz Consulting, Inc.
-- |  All rights reserved.
-- |  Permission to use this code is granted provided the original author is
-- |  acknowledged.  No warranties, express or otherwise is included in this permission.
-- +=============================================================================+
-- |
-- |  Original Author: Douglas A. Volz
-- | 
-- |  Version Modified on Modified  by  Description
-- |  ======= =========== ============= =========================================
-- |  1.0     16 MAR 2017 Douglas Volz  Initial Coding
-- |  1.1     19 MAR 2017 Douglas Volz  Added interface conditions for eligibility
-- |                                    and check for no applied OSP
-- |  1.3     27 MAR 2017 Douglas Volz  Fix &quot;return more than one row&quot; error for
-- |                                    correlated sub-query on OSP and add in check for purchase requisitions
-- |  1.4     27 APR 2017 Douglas Volz  Fix for cross-joining results
-- |  1.6     25 Oct 2017 Douglas Volz  Remove p_date_completed parameter, not needed
-- |  1.7     25 Jul 2018 Douglas Volz  Removed all categories except Inventory
-- |  1.8     25 Jul 2018 Douglas Volz  Removed all category values
-- |  1.9     11 Dec 2020 Douglas Volz  Now for Standard, Lot Based Standard and Non-
-- |                                    Standard Asset Jobs.  Added another category.
-- |  1.10    26 Jan 2021 Douglas Volz  Check for unissued materials and WIP scrap controls
-- |  1.11    11 Feb 2021 Douglas Volz  Added parameter to include scrap for requirements
-- |  1.12    05 Mar 2021 Douglas Volz  Added parameter to include bulk items for requirements.
-- |  1.13    12 Mar 2021 Douglas Volz  Add logic to ignore Phantom WIP Supply Types as
-- |                                    these requirements are never issued.
-- |  1.14    15 Apr 2021 Douglas Volz  Added Date Released
-- |  1.15    10 Jul 2022 Douglas Volz  Added WIP Variance Percentage parameter.
-- |  1.16    21 Jan 2024 Douglas Volz  Bug fix for Pending Material and Pending Shop Floor
-- |                                    Move.  Remove tabs and add inventory access controls.
-- +=============================================================================+*/






</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>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>&amp;category_columns</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>1=1</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_include_scrap</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_wip_var_percent</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:p_wip_var_threshold</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>:p_wip_var_threshold</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>500</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Variance Amount Threshold</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>:p_wip_var_percent</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>20</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Variance Percent Threshold</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>:p_include_scrap</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>Y</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Include Scrap Quantities</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>2=2</ANCHOR>
    <SQL_TEXT>wro.wip_supply_type &lt;&gt; 4</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <MATCHING_VALUE>N</MATCHING_VALUE>
    <DEFAULT_VALUE>N</DEFAULT_VALUE>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Include Bulk Supply Items</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>coalesce(xxen_util.previous_parameter_value(:parameter_id),(select mdsv.category_set_name from mtl_default_sets_view mdsv where mdsv.functional_area_id=11))</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 1</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>coalesce(xxen_util.previous_parameter_value(:parameter_id),(select mdsv.category_set_name from mtl_default_sets_view mdsv where mdsv.functional_area_id=5))</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 2</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>7</SORT_ORDER>
    <DISPLAY_SEQUENCE>70</DISPLAY_SEQUENCE>
    <ANCHOR>&amp;category_columns</ANCHOR>
    <SQL_TEXT>select xxen_util.item_category_columns(p_category_set_name=&gt;&apos;&lt;parameter_value&gt;&apos;) sql_text from dual</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Category Set</LOV_NAME>
    <LOV_GUID>8E2FF36EDECA79D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
mcsv.category_set_name value,
mcsv.description
from
mtl_category_sets_vl mcsv
where
:$flex$.organization_code is null or
mcsv.category_set_id in (select mic.category_set_id from mtl_parameters mp, mtl_item_categories mic where xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos; and mp.organization_id=mic.organization_id)
order by
mcsv.category_set_name</LOV_QUERY_DSP>
    <DEFAULT_VALUE>xxen_util.previous_parameter_value(:parameter_id)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Category Set 3</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>8</SORT_ORDER>
    <DISPLAY_SEQUENCE>80</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>mp.organization_code = :p_org_code</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Organization Code (excluding master)</LOV_NAME>
    <LOV_GUID>91D3167A33531204E053BB6B63585EE3</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
ood.organization_code value,
ood.organization_name description
from
org_organization_definitions ood
where
ood.organization_id not in (select mp.organization_id from mtl_parameters mp where mp.organization_id=mp.master_organization_id) and
(:$flex$.operating_unit is null or ood.operating_unit in (select haouv.organization_id from hr_all_organization_units_vl haouv where xxen_util.contains(:$flex$.operating_unit,haouv.name)=&apos;Y&apos;)) and
(:$flex$.ledger is null or ood.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
nvl(ood.disable_date,sysdate)&gt;=sysdate
order by
ood.organization_code</LOV_QUERY_DSP>
    <DEFAULT_VALUE>select mp.organization_code from mtl_parameters mp where mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;)</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>9</SORT_ORDER>
    <DISPLAY_SEQUENCE>90</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>wdj.class_code = :p_class_code</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>WIP Class Code (org dependent)</LOV_NAME>
    <LOV_GUID>E7CCB27F39561272E0530100007F62B4</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select distinct
wac.class_code value,
wac.description
from
mtl_parameters mp,
wip_accounting_classes wac
where
(:$flex$.organization_code is null or xxen_util.contains(:$flex$.organization_code,mp.organization_code)=&apos;Y&apos;) and
mp.organization_id=wac.organization_id
order by
wac.class_code</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Class Code</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>10</SORT_ORDER>
    <DISPLAY_SEQUENCE>100</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>we.wip_entity_name = :p_wip_job</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>WIP Job</LOV_NAME>
    <LOV_GUID>8E2FF36EDEC379D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
we.wip_entity_name value,
xxen_util.meaning(we.entity_type,&apos;WIP_ENTITY&apos;,700)||&apos; (&apos;||ood.organization_code||&apos;)&apos;||nvl2(we.description,&apos;: &apos;||we.description,null) description
from
wip_entities we,
org_organization_definitions ood
where
(:$flex$.ledger is null or ood.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
(
:$flex$.organization_code is null and ood.organization_id in (select oav.organization_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id) or
xxen_util.contains(:$flex$.organization_code,ood.organization_code)=&apos;Y&apos;
) and
we.organization_id=ood.organization_id and
nvl(ood.disable_date,sysdate)&gt;=sysdate and
we.entity_type in (1,3,5,8) --(Discrete job, Closed discrete job, Lot based job, Closed lot based job)
order by
we.creation_date desc</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>WIP Job</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>11</SORT_ORDER>
    <DISPLAY_SEQUENCE>110</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>msiv.concatenated_segments = :p_item_number</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Item (master, costing enabled only)</LOV_NAME>
    <LOV_GUID>91D022B15B12FFB9E053BB6B63587F0B</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <FILTER_BEFORE_DISPLAY_DSP>Y</FILTER_BEFORE_DISPLAY_DSP>
    <LOV_QUERY_DSP>select
msiv.concatenated_segments value,
msiv.description
from
mtl_system_items_vl msiv
where
msiv.organization_id=(
select
max(mp.master_organization_id) master_organization_id
from
mtl_parameters mp
where
mp.organization_id=fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) or
fnd_profile.value(&apos;MFG_ORGANIZATION_ID&apos;) is null and
mp.organization_id in (select oav.organization_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id)
) and
msiv.costing_enabled_flag=&apos;Y&apos;
order by
msiv.concatenated_segments</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Assembly Number</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>12</SORT_ORDER>
    <DISPLAY_SEQUENCE>120</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>haou2.name = :p_operating_unit</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>INV Operating Unit</LOV_NAME>
    <LOV_GUID>9B9627743E84607DE053BB6B635805FB</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
haouv.name value,
&apos;Operating Unit&apos; description
from
hr_all_organization_units_vl haouv
where
haouv.organization_id in 
(
select
to_number(hoi.org_information3)
from
mtl_parameters mp,
hr_organization_information hoi,
hr_all_organization_units haou
where
mp.organization_id&lt;&gt;mp.master_organization_id and
mp.organization_id=hoi.organization_id and
hoi.org_information_context=&apos;Accounting Information&apos; and 
hoi.organization_id=haou.organization_id and
nvl(haou.date_to,sysdate)&gt;=sysdate
)
order by 1</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>13</SORT_ORDER>
    <DISPLAY_SEQUENCE>130</DISPLAY_SEQUENCE>
    <ANCHOR>1=1</ANCHOR>
    <SQL_TEXT>gl.name = :p_ledger</SQL_TEXT>
    <PARAMETER_TYPE_DSP>LOV</PARAMETER_TYPE_DSP>
    <LOV_NAME>GL Ledger (inv org related)</LOV_NAME>
    <LOV_GUID>8E2FF36EDF3A79D2E0530100007F1FF2</LOV_GUID>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
gl.name value,
fifsv.id_flex_structure_name||&apos;: &apos;||gl.description description
from
gl_ledgers gl,
fnd_id_flex_structures_vl fifsv
where
gl.ledger_id in (select ood.set_of_books_id from org_organization_definitions ood where nvl(ood.disable_date,sysdate)&gt;=sysdate) and
(:$flex$.chart_of_accounts is null or xxen_util.contains(:$flex$.chart_of_accounts,fifsv.id_flex_structure_name)=&apos;Y&apos;) and
gl.chart_of_accounts_id=fifsv.id_flex_num and
fifsv.id_flex_code=&apos;GL#&apos; and
fifsv.application_id=101
order by
fifsv.id_flex_structure_name,
gl.name</LOV_QUERY_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Ledger</PARAMETER_NAME>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Organization Code</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.ledger</FLEX_BIND>
    <PARAMETER_NAME>Ledger</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>WIP Job</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.operating_unit</FLEX_BIND>
    <PARAMETER_NAME>Operating Unit</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Organization Code</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Category Set 1</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Category Set 2</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>Class Code</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
   <PARAMETER_DEPENDENCIES_ROW>
    <FLEX_BIND>:$flex$.organization_code</FLEX_BIND>
    <PARAMETER_NAME>Organization Code</PARAMETER_NAME>
    <DEPENDENT_PARAMETER_NAME>WIP Job</DEPENDENT_PARAMETER_NAME>
   </PARAMETER_DEPENDENCIES_ROW>
  </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>
